command(mycars, playerid, params[])
{
new string[256], string1[256];
print("new string[256], string1[256];");
if(Player[playerid][CarKey1] != 0)format(string1, sizeof(string1), "Vehicle Slot 1: %s(ID %d) - Plate: %s.", GetVehicleName(OwnedCar(Player[playerid][CarKey1])), OwnedCar(Player[playerid][CarKey1]), Vehicles[OwnedCar(Player[playerid][CarKey1])][VehiclePlate]);
print("if(Player[playerid][CarKey1] != 0)format(string1, sizeof(string1), \"Vehicle Slot 1: %s(ID %d) - Plate: %s.\", GetVehicleName(OwnedCar(Player[playerid][CarKey1])), OwnedCar(Player[playerid][CarKey1]), Vehicles[OwnedCar(Player[playerid][CarKey1])][VehiclePlate]);");
if(Player[playerid][CarKey1] == 0)format(string1, sizeof(string1), "Vehicle Slot 1: Not used.");
print("else if(Player[playerid][CarKey1] == 0)format(string1, sizeof(string1), \"Vehicle Slot 1: Not used.\");");
format(string, sizeof(string), "%s\n", string1);
print("format(string, sizeof(string), \"%s\n\", string1);");
ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "Your Owned Vehicles", string, "OK", "");
print("ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, \"Your Owned Vehicles\", string, OK,\"\");");
return 1;
}
[04:13:18] [debug] Run time error 4: "Array index out of bounds" [04:13:18] [debug] Accessing element at negative index -400 [04:13:18] [debug] AMX backtrace: [04:13:18] [debug] #0 000cc5cc in ?? () from new.amx [04:13:18] [debug] #1 00029ae0 in public cmd_mycars () from new.amx [04:13:18] [debug] #2 native CallLocalFunction () [00472260] from samp-server.exe [04:13:18] [debug] #3 000065e0 in public OnPlayerCommandText () from new.amx
GetVehicleName(OwnedCar(Player[playerid][CarKey1])), OwnedCar(Player[playerid][CarKey1]), Vehicles[OwnedCar(Player[playerid][CarKey1])][VehiclePlate]
What parts is it you need to see? Because I don't know what one's that you wanna see.
Please tell me the one's and I will show them . |
#define OwnedCar(%0) ivCreated[%0]
new ivCreated[MAX_VEHICLES];
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"
};
stock GetVehicleName(vehicleid)
{
new String[28];
format(String,sizeof(String),"%s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
return String;
}