if (strcmp("/cc", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
ChangeVehicleColor(//what ever needs to go here);
SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: Your vehicles car color has now been changed.");
}
else SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to change your car color.");
return 1;
}
COMMAND:ccolor(playerid, params[])
{
new color1,color2,vid = GetPlayerVehicleID(playerid),pstate = GetPlayerState(playerid);
if(sscanf(params, "ii", color1, color2)) return SendClientMessage(playerid, COLOR_RED, "Usage: /ccolor [color1] [color2]");
if(pstate == PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to change your car color.");
ChangeVehicleColor(vid,color1,color2);
SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: Your vehicles car color has now been changed.");
return 1;
}
Try This http://forum.sa-mp.com/search.php
|
Dcmd: http://hood.pastebin.com/j5DTwc1m
Strok: http://hood.pastebin.com/spD2pRCM Or use what Tee said |
if (strcmp("/cc", cmdtext, true, 3) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new params[2];
new totalparams;
for(new cell;cell<strlen(cmdtext);cell++)
{
if(cmdtext[cell]==' ')
{
params[totalparams]=cell+1;
totalparams++;
if(totalparams==sizeof(params))break;
}
}
if(totalparams!=sizeof(params))return SendClientMessage(playerid,COLOR_NAVY,"USAGE: /cc [Color1] [Color2]");
ChangeVehicleColor(GetPlayerVehicleID(playerid),strval(cmdtext[params[0]]),strval(cmdtext[params[1]]));
SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: Your vehicles car color has now been changed.");
}
else SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to change your car color.");
return 1;
}