Paint car.
#1

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.

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;
}
PS: Sorry it got really messy from trying to fix all the errors.
Reply
#2

pawn Код:
CMD:paintjob(playerid, params[])
{
    new
        c1, c2;
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You have to be in a vehicle!");
    if(sscanf(params, "ii", c1, c2)) return SendClientMessage(playerid, -1, "Usage: /paintjob [Col1] [Colr2]");
    if(c1 > 128 || c1 < 0) return SendClientMessage(playerid, -1, "0-128 only!");
    ChangeVehicleColor(GetPlayerVehicleID(playerid), c1, c2);
    SendClientMessage(playerid, -1, "Color changed! yay");
    return 1;
}
Reply
#3

There are over 160 colors ****** "samp car colors" not at home so I can't give it 2 u
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)