09.11.2014, 15:30
Hello i have this command to change the vehicle color its work fine but i want if the player didnt type the color2 it will just change the color1 how can i do that
PHP код:
CMD:vc(playerid,params[])
{
new color1, color2;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,Red,"UnKnwon Command! Type /cmds");
if(sscanf(params, "dd",color1,color2)) return SendClientMessage(playerid,Red,"Change vehicle color: /vc <color1> <color2>");
if(IsPlayerInAnyVehicle(playerid))
{
ChangeVehicleColor(GetPlayerVehicleID(playerid),color1,color2);
}
else
{
SendClientMessage(playerid,Red,"You are not in vehicle");
}
return 1;
}