22.01.2013, 21:50
I've been coming at this thing every angle and can't figure out what is wrong so I came to the pros. When I try the /paintjob command outside of a car it works fine and sends me an error message. When I get into a car and type /paintjob with no params it sends me "CMD: Car color changed." when it should be sending me "USAGE: /paintjob [c1] [c2]" and also when I type the command with only one param EX: "/paintjob 12" it sends me the success message when it should be sending me usage and when I try it with two params it sends me usage.
PS: Sorry it got really messy from trying to fix all the errors.
pawn Код:
CMD:paintjob(playerid, params[])
{
new c1, c2;
new vehid = GetPlayerVehicleID(playerid);
if !IsPlayerInAnyVehicle(playerid) *then
SendClientMessage(playerid, COLOR_RED, "ERROR: You must be in a vehicle to use this command.");
else
if (!sscanf(params, "ii", c1, c2))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /paintjob [c1] [c2]");
{
if (c1 < 0 || c1 > 125 || c2 < 0 || c2 > 125) SendClientMessage(playerid, COLOR_RED, "ERROR: Color IDs range from 0 to 125.");
return 1;
}
}
else
{
ChangeVehicleColor(vehid, c1, c2);
SendClientMessage(playerid, COLOR_GREEN, "CMD: Car color changed.");
}
return 1;
}