change vehicle colour
#5

First of all get off your high horse and realise I made a small mistake when editing SOMEONE ELSES code (Vincent's), and secondly szSuccess would be a better string name as 'string' 'polluted' the namespace.
It is not 'such a fail' - I made a small mistake in not changing the name of the string parameter in format(). You sir are a failure.

pawn Code:
CMD:vcolor(playerid, params[])
{
    if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, 0xFF0000FF, "You are not driving a vehicle.");
    new color[2];
    if(sscanf(params, "iI(-1)", color[0], color[1]))
    {
        return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /colorcar [color1] <color2>");
    }
    if(color[1] == -1) color[1] = color[0]; // If color2 was left out, set it the same as color 1
    new szSuccess[44];
    format(szSuccess, sizeof(szSuccess), "Vehicle colors changed to: {FFFFFF}%i and %i.", color[0], color[1]);
    SendClientMessage(playerid, 0x00FF00FF, szSuccess);
    ChangeVehicleColor(GetPlayerVehicleID(playerid), color[0], color[1]);
    return 1;
}
Reply


Messages In This Thread
change vehicle colour - by TheDiscussionCafe - 28.04.2012, 14:41
Re: change vehicle colour - by ReneG - 28.04.2012, 15:23
Re: change vehicle colour - by MP2 - 28.04.2012, 15:26
Re: change vehicle colour - by Joshb93 - 28.04.2012, 15:31
Re: change vehicle colour - by MP2 - 28.04.2012, 15:37
Re: change vehicle colour - by TheDiscussionCafe - 28.04.2012, 15:58
Re: change vehicle colour - by TheDiscussionCafe - 28.04.2012, 16:56
Re: change vehicle colour - by Rudy_ - 28.04.2012, 17:11
Re: change vehicle colour - by Rudy_ - 28.04.2012, 17:45
Re: change vehicle colour - by TheDiscussionCafe - 28.04.2012, 18:01

Forum Jump:


Users browsing this thread: 1 Guest(s)