More command help [/changecolor]
#1

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.
Reply
#2

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

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

So can someone help me please.
Reply
#4

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;
}
Reply
#5

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

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

Or use what Tee said
Reply
#7

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;
    }
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)