23.03.2011, 21:57
Hey guys, i have done all this completly alone by my mind and now don't work.. Compile without errors/warnings but ingame i type /spawncar 560 3 3 and it don't spawn teh car, it jus show me again the usage form...
here's the code:
here's the code:
pawn Код:
COMMAND:spawncar(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 105)
{
new id, carid, carcolor1, carcolor2;
if(!sscanf(params, "uiiii", id, carid, carcolor1, carcolor2))
{
if(carid >= 400 && carid <= 611)
{
if(carcolor1 >= 0 && carid <= 252)
{
if(carcolor2 >= 0 && carid <= 252)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CreateVehicle(carid, X, Y, Z+(2), 10, carcolor1, carcolor2, 100);
SendClientMessage(playerid, 0xFF00CC, "Vehicle Spawned");
return 1;
}
else return SendClientMessage(playerid, 0xFF00CC, "Only color id's between 0 and 252 are avaliable.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Only color id's between 0 and 252 are avaliable.");
}
else return SendClientMessage(playerid, 0xFF00CC, "Only id's between 400 and 611 are avaliable.");
}
else return SendClientMessage(playerid, 0xFF00CC, "USAGE: /spawncar [VehicleId] [Color 1][Color 2]");
}
else return SendClientMessage(playerid, 0xFF00CC, "You are not allowed to use this command.");
}