30.01.2014, 16:11
pawn Код:
(strcmp(cmd, "/vehiclespray", true) == 0 )
{
new vehicleseat = GetPlayerVehicleSeat(playerid);
if(PlayerInfo[playerid][pSprayCan] < 1)
{
SendClientMessage(playerid, COLOR_RED, "You don't have any Spray Cans!");
return 1;
}
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle to do that!");
return 1;
}
if(vehicleseat != 0)
{
SendClientMessage(playerid, COLOR_RED, "You must be in the drivers seat to do that!");
return 1;
}
if(vehicleseat == 0)
{
new color1, color2;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /vehiclespray [Color1] [Color2]");
return 1;
}
color1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /vehiclespray [Color1] [Color2]");
return 1;
}
color2 = strval(tmp);
ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
CallRemoteFunction("OnVehicleRespray", "iiii", playerid, vehicleid, color1, color2);
return 1;
}
}