Hey Leute,
hab ne frage bin ein relativer anfänger in sachen Pawno und wollte fragen wie ich das machen kann das mit nem Dialog (STYLE = Input) das man da die ID eingibt und dann auf Bestätigen klickt und dann Spawnt neben einem ein Auto!
hab das gefunden:
//On Top:
new fahrzeug[2][MAX_PLAYERS],
autonamen[][]= {
"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perenniel", "Sentinel", "Dumper", "Feuertruck 1",
"Müllauto", "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Krankenwagen",
"Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Eiswagen", "BF Injection",
"Hunter", "Premier", "Enforcer", "Sicherheitsauto", "Banshee", "Predator", "Bus", "Rhino", "Barracks",
"Hotknife", "Article Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit",
"Romero", "Packer", "Monster Truck", "Admiral", "Squallo", "Seasparrow", "Pizzaboy", "Tram",
"Article Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbad", "Yankee", "Caddy", "Soliar",
"Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
"Oceanic", "Sanchez", "Sparrow", "Patriot", "Quad", "Kuestenwache", "Dinghy", "Hermes", "Sabre",
"Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito", "Camper", "Marquis", "Baggage",
"Dozer", "Maverick", "SAN News Maverick", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax",
"Hotring Racer 1", "Sandking", "Balista Compact", "Polizei Maverick", "Boxville", "Benson", "Mesa",
"RC Goblin", "Hotring Racer 2", "Hotring Racer 3", "Bloodring Banger", "Rancher", "Super GT", "Elegant",
"Journey", "Fahrrad", "Mountain Bike", "Beagle", "Cropduster", "Stuntflugzeug", "Benzin Tanker",
"Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV-1000",
"Zement Truck", "Abschlepper", "Fortune", "Cadrona", "FBI Truck", "Willard", "Gabelstabler",
"Traktor", "Maehdrescher", "Feltzer", "Remington", "Slamvan", "Blade", "Brownstreak", "Freight",
"Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Feuertruck 2", "Hustler", "Intruder", "Primo",
"Cargobob", "Tampa", "Sunrise", "Merit", "Utility Van", "Nevada", "Yosemite", "Windsor",
"Monster Truck", "Monster Truck", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance",
"RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat Trailer", "Streak Trailer",
"Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT400", "DFT-30", "Huntley", "Stafford",
"BF-400", "Nachrichten Van", "Tug", "Benzin Anhaenger", "Emperor", "Wayfarer", "Euros", "Hotdog",
"Club", "Freight Box Trailer", "Article Trailer 3", "Andromada", "Dodo", "RC Cam", "Launch",
"Polizeiauto LSPD", "Polizeiauto SFPD", "Polizeiauto LVPD", "Ranger", "Picador", "Wasserwerfer",
"Alpha", "Phoenix", "Glendale Shit", "Sadler Shit", "Baggage Trailer 1", "Baggage Trailer 2",
"Tug Stairs Trailer", "Boxburg", "Farm Trailer", "Utility Trailer"
};
//OnPlayerCommandText
if(strcmp(cmd, "/v", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xAAAAAAA, "Benutze: /v [NAME/ID]");
return 1;
}
new car;
if(IsNumeric(tmp)) {
car = strval(tmp); }
else {
for(new i; i<212; i++) {
if(strfind(autonamen[i],tmp,true)==0) {
car=i+400;
i=212; }}}
if(car < 400 || car > 611) { SendClientMessage(playerid, 0xAAAAAAA, " Das Auto gibt es nicht bzw. Die ID gibt es nicht, Wähle eine Andere."); return 1; }
tmp = strtok(cmdtext, idx);
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 126) { return 1; }
tmp = strtok(cmdtext, idx);
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 126) { return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid,carid,0);
format(string, sizeof(string), " Du hast Auto ID %d gespawnt.", GetPlayerVehicleID(playerid));
SendClientMessage(playerid, 0xAAAAAAA, string);
if(fahrzeug[0][playerid]==-1) {
fahrzeug[0][playerid]=carid; }
else if(fahrzeug[1][playerid]==-1) {
fahrzeug[1][playerid]=carid; }
else {
DestroyVehicle(fahrzeug[0][playerid]);
fahrzeug[0][playerid]=fahrzeug[1][playerid];
fahrzeug[1][playerid]=carid; }}
return 1;}
//Ganz unten vom Script :
stock IsNumeric(string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
Mein problem ist das ich mich nicht so mit Befehlen beschäftigt habe und jetzt will ich anstatt das man /v dann die Id eingeben muss sondern einfach nur /v und dann kommt der Dialog
das mit dem Dialog weis ich ja nur nicht was ich genau in die Response Funktion schreiben soll also wie ich das verändern muss, könnte das bitte wer machen ? Wäre Nett vielen Dank!
Mfg. Ich