29.06.2012, 03:03
Here I have some code for my command.
It doesn't seem to work? It just returns 0 all the time displaying \"Unknown Command.\".
If somebody can help, that would be great!
The print("new string[256], string1[256]"); prints and that's the only thing that does print.
Crashdetect is:
Thanks!
It doesn't seem to work? It just returns 0 all the time displaying \"Unknown Command.\".
pawn Код:
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;
}
The print("new string[256], string1[256]"); prints and that's the only thing that does print.
Crashdetect is:
Код:
[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