SA-MP Forums Archive
car color change command?[+REP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: car color change command?[+REP] (/showthread.php?tid=527160)



car color change command?[+REP] - [SU]Spartan - 21.07.2014

Hello,
Can someone make for me /cc command?It changes your vehicle command:+rep if u do.


Re: car color change command?[+REP] - LivingLikeYouDo - 21.07.2014

Requires ZCMD and sscanf2 includes.
pawn Код:
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;
}