Why this script doesnt work ?
#1

PHP Code:
CMD:vcolor(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 3) return 0;
    new 
color1color2;
    if(
sscanf(params,"ui"color1color2)) return SendClientMessage(playeridCOLOR_RED,"USAGE: /vcolor [COLOR 1] [COLOR 2]");
     
ChangeVehicleColor(GetPlayerVehicleID(playerid),color1,color2);
     
SendClientMessage(playerid,COLOR_BLUE,"Your car was resprayed");
    return 
1;

Reply
#2

Try something like this

pawn Code:
CMD:vcolor(playerid,params[])
{
    new color[2];
    if(PlayerInfo[playerid][pAdmin] < 3)
    {
        if(sscanf(params,"ii",color[0],color[1])) return SendClientMessage(playerid,0xFFFFFFFF,"Use: /vcolor [color1] [color2]");
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,"You need to be in vehicle to use this command!");
        ChangeVehicleColor(GetPlayerVehicleID(playerid),color[0],color[1]);

    }
    return 1;
}
The problem should be here
Code:
if(sscanf(params,"ui", color1, color2))
Change ui to ii
Reply
#3

Works, thank you.
Reply
#4

I suggest you read the specifiers section on the sscanf thread.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)