02.05.2011, 00:05
Whats a good way to set a cars color (function built into samp)
ChangeVehicleColor(vehicleid,color1,color2);
ChangeVehicleColor(vehicleid, 3, 3);
COMMAND:ccolor(playerid, params[])
{
new color1,color2;
if(sscanf(params, "ii", color1, color2)) return SendClientMessage(playerid, COLOR_RED, "Usage: /ccolor [color1] [color2]");
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, Grey, "You are not in a vehicle.");
ChangeVehicleColor(GetPlayerVehicleID(playerid),color1,color2);
SendClientMessage(playerid,orange,"You have changed your vehicle's color.");
return 1;
}
if(strcmp(cmd, "/ccolor", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new color1, color2;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xF60000AA, "USAGE: /ccolor >color1< >color2<");
color1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0xF60000AA, "USAGE: /ccolor >color1< >color2<");
color2 = strval(tmp);
ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
}
else
{
SendClientMessage(playerid,0xF60000AA,"You're not in any Vehicle!");
}
return 1;
}