Hey,
und zwar hänge ich die ganze Zeit an einem Problem, welches mit dem Auslesen der Fahrzeugnamen zusammen hängt.
Wenn ich einen Befehl eingebe, wo dann in einem If Else Konstrukt der Fahrzeugname ausgelesen werden sollte, returnt der Befehl einfach nur "Server: unknown command".
Wird kein Fahrzeugname ausgelesen, funktioniert es.
So wie beim /freecar System -> Kein Fahrzeug abgeschleppt -> geht
Fahrzeug abgeschleppt -> geht nicht.
Das mit /opark und diversen anderen Systemen ähnlich. Ausgenommen beim Erstellen, da klappt es wieso auch immer.
Code
new VehicleNames[][] =
{
"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
"Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
"Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
"Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
"Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
"Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
"Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
"Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
"Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
"Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
"Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
"Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
"Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
"Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
"Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin",
"Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
"Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
"Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
"FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
"Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
"Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
"Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
"Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
"Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
"Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
"Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
"Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
"News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
"Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
"Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
"Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
"Tiller", "Utility Trailer"
};
Alles anzeigen
Code
ocmd:freecar(playerid)
{
new string[128];
if (IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "** Du darfst dich nicht in einem Fahrzeug befinden.");
if (!IsPlayerInRangeOfPoint(playerid, 25.0, COORDS_OPARK)) return SendClientMessage(playerid, COLOR_GREY, "** Du befindest dich nicht in der Nähe der Verwahrstelle.");
for (new j = 0; j < MAX_PLAYER_VEHICLES; j ++)
{
if (Vehicle[PrivateVehicle[playerid][j][vehID]][vehAbgeschleppt] == 1)
{
format(string, sizeof string, "Fahrzeug: %s\nKaution: $%i\n\nDas Fahrzeug wurde am %s von %s abgeschleppt.\nMöchtest du das Fahrzeug jetzt freikaufen?", VehicleNames[GetVehicleModel(PrivateVehicle[playerid][j][vehID]) - 400], Vehicle[PrivateVehicle[playerid][j][vehID]][vehAbgeschlepptPreis], Vehicle[PrivateVehicle[playerid][j][vehID]][vehAbgeschlepptDatum], Vehicle[PrivateVehicle[playerid][j][vehID]][vehAbgeschlepptVon]);
ShowPlayerDialog(playerid, DIALOG_FREECAR, DIALOG_STYLE_MSGBOX, "Ordnungsamt | Verwahrstelle", string, "Freikaufen", "Abbrechen");
return 1;
}
}
SendClientMessage(playerid, COLOR_GREY, "** Es wurde keins deiner Fahrzeuge abgeschleppt.");
return 1;
}
Alles anzeigen
Ähnliches Beispiel beim Auslesen:
Code
format(string, sizeof(string), "Du hast ein Fraktionsfahrzeug (%s) für %d$ abgeschleppt.", VehicleNames[GetVehicleModel(vehicleid) - 400], STANDARD_TOWED);
Brauche dringend Hilfe...