08.11.2011, 09:51
pawn Код:
COMMAND:addveh(playerid, params[])
{
new model,type,color1,color2;
if(sscanf(params, "uiii", model, type, color1, color2)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /addveh [model] [type] [col1] [col2]");
else
{
if (PlayerInfo[playerid][pPlayerLogged] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
if(model < 400 || model > 611) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 400 or above 611.");
if(type < 0 || type > 4) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 4.");
if(color1 < 0 || color1 > 126) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 126.");
if(color2 < 0 || color2 > 126) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 126.");
if(PlayerInfo[playerid][pAdmin] >= 10)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x,y,z);
new carid = AddStaticVehicleEx(model, x,y,z, 0.0, color1, color2, 3600);
PutPlayerInVehicle(playerid, carid, 0);
CreateDynamicVehicle(playerid,model,Float:x,Float:y,Float:z,color1,color2);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
}
}
return 1;
}
SERVER: Cannot go under 400 or above 611
Can somebody tell me where is mistake?