11.03.2013, 16:46
hey all,
i made this command "/v" with parameters "park, respawn, color, get", but now i have a problem at the color.
when i want to set the color of the car, it's like this:
/v color color1 color2.
so i did this:
but when i do for example "/v color 1 1" it says: correct usage: /v color/respawn/get/park.
so i have to skip a certain part of the command for sscanf... but how can i do this?
greets
i made this command "/v" with parameters "park, respawn, color, get", but now i have a problem at the color.
when i want to set the color of the car, it's like this:
/v color color1 color2.
so i did this:
pawn Код:
CMD:v(playerid, params[])
{
if(strcmp(params,"color",true) == 0)
{
if(GetPlayerVehicleID(playerid) != PlayerVeh) return SendClientMessage(playerid, COLOR_RED, "This ain't your current car, use / v get to change your current car.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't in any vehicle.");
if(IsValidVehicleID(GetPlayerVehicleID(playerid)))
{
new col1, col2;
if(sscanf(params, "dd", col1, col2)) return SendClientMessage(playerid, COLOR_YELLOW, "Correct Usage: {FF0000}/v color [color1] [color2]");
ChangeVehicleColor(GetPlayerVehicleID(playerid), col1, col2);
SendClientMessage(playerid, COLOR_GREEN, "You have successfully changed your Vehicle colors");
SaveVehComponents(playerid, PlayerVeh, CurrentSlot(playerid));
}
}
return 1;
}
so i have to skip a certain part of the command for sscanf... but how can i do this?
greets