21.11.2015, 21:33
When i spawn the vehicle it didnt not put me into the vehicle i get this warning
Код:
warning 202: number of arguments does not match definition
PHP код:
}
COMMAND:veh(playerid, params[])
{
new iVehicle, iColors[2], Float:Poz[4];
if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1]))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [model ID] [color 1] [color 2]");
if(!(400 <= iVehicle <= 611))
return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Invalid model specified (model IDs start at 400, and end at 611).");
if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255))
return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Invalid colour specified (IDs start at 0, and end at 255).");
if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
if(!AdminUser(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to create a admin user, /admincreate.");
if(GetPVarInt(playerid, "AdminLogged") == 0) return SendClientMessage(playerid, COLOR_GREY, "You need to login into your admin account, /adminlogin.");
if(GetPVarInt(playerid, "Admin") < 2)
{
GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]); //getting player pos
GetPlayerFacingAngle(playerid, Poz[3]); //getting player angle
CreateVehicle(strval(params), Poz[0]+4, Poz[1], Poz[2], Poz[3], 0, 0, -1); //creating vehicle
PutPlayerInVehicle(playerid, 0); //Puting player in vehicle as dirver
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: You do not have access to this command!");
}
return 1;