SA-MP Forums Archive
More command help [/changecolor] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: More command help [/changecolor] (/showthread.php?tid=213855)



More command help [/changecolor] - Kyle. - 20.01.2011

pawn Код:
if (strcmp("/cc", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            ChangeVehicleColor(//what ever needs to go here);
            SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: Your vehicles car color has now been changed.");
        }
        else SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to change your car color.");
        return 1;
    }
I wanna be able to change the car color, but let them choose what they want. If they are not in a vehicle, I wan't it to say "else SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to change your car color.");" as it already does, just help me with the "ChangeVehicleColor" part

Thanks in advanced,

I'm new to scripting.


Re: More command help [/changecolor] - [UG]Scripter - 20.01.2011

Try This http://forum.sa-mp.com/search.php


Re: More command help [/changecolor] - Kyle. - 20.01.2011

Yea, I did. Didn't find anything I liked.

So can someone help me please.


Re: More command help [/changecolor] - Tee - 20.01.2011

I would recommend you getting ZCMD.
Here is the ZCMD verison of it.:

pawn Код:
COMMAND:ccolor(playerid, params[])
{
    new color1,color2,vid = GetPlayerVehicleID(playerid),pstate = GetPlayerState(playerid);
    if(sscanf(params, "ii", color1, color2)) return SendClientMessage(playerid, COLOR_RED, "Usage: /ccolor [color1] [color2]");
    if(pstate == PLAYER_STATE_ONFOOT) return SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to change your car color.");
    ChangeVehicleColor(vid,color1,color2);
    SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: Your vehicles car color has now been changed.");
    return 1;
}



Re: More command help [/changecolor] - Antonio [G-RP] - 20.01.2011

Quote:
Originally Posted by [UG]Scripter
Посмотреть сообщение
Try this http://************/687vzqw


Re: More command help [/changecolor] - hoodline - 20.01.2011

Dcmd: http://hood.pastebin.com/j5DTwc1m
Strok: http://hood.pastebin.com/spD2pRCM

Or use what Tee said


Re: More command help [/changecolor] - Joe Staff - 20.01.2011

Quote:
Originally Posted by hoodline
Посмотреть сообщение
You can't just assume that the person you're sending scripts to uses strtok or has the IsNumeric Function, because half the time they don't and will just complain when they try to compile.

pawn Код:
if (strcmp("/cc", cmdtext, true, 3) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new params[2];
            new totalparams;
            for(new cell;cell<strlen(cmdtext);cell++)
            {
                if(cmdtext[cell]==' ')
                {
                    params[totalparams]=cell+1;
                    totalparams++;
                    if(totalparams==sizeof(params))break;
                }
            }
            if(totalparams!=sizeof(params))return SendClientMessage(playerid,COLOR_NAVY,"USAGE: /cc [Color1] [Color2]");
            ChangeVehicleColor(GetPlayerVehicleID(playerid),strval(cmdtext[params[0]]),strval(cmdtext[params[1]]));
            SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: Your vehicles car color has now been changed.");
        }
        else SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to change your car color.");
        return 1;
    }