18.02.2017, 08:17
Just do this
EDIT:much better
PHP код:
CMD:carcolor(playerid, cmd[], cmdtext[])
{
new string[144], vcolor1, vcolor2;
if(!IsPlayerSpawned(playerid))
return SendMessage(100, playerid, COLOR_WHITE, ""#COL_ERROR"[ERROR]: "#COL_WHITE"You must spawn before using this command.");
if(!IsPlayerInAnyVehicle(playerid))
return SendMessage(100, playerid, COLOR_WHITE, ""#COL_ERROR"[ERROR]: "#COL_WHITE"You are not in a vehicle.");
if(sscanf(params, "dd", vcolor1, vcolor2)) return SendClientMesage(playerid, COLOR_WHITE, "USAGE:/carcolor [color1] [color2]");
ChangeVehicleColor(GetPlayerVehicleID(playerid), vcolor1, vcolor2);
format(string, sizeof(string), "Vehicle colors changed to %d, and %d.", vcolor1, vcolor2);
SendMessage(100, playerid, COLOR_REGULAR_PLAYER, string);
return 1;
}