Params won't show up!
#6

Still doesn't work, still gives the message that I set my level to 0, even though I only type "/setvip"...

pawn Код:
COMMAND:setvip(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {

            new Target;
            new Level;
            if(sscanf(params, "ui", Target, Level))
            {
                //if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
                if(Level > 3) return SendClientMessage(playerid, COLOR_RED, "SERVER: Maximum level is 3!");
                if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
                if(PlayerInfo[Target][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"ERROR: You cant perform this on Admins that are equal or higher than your level!");
                PlayerInfo[Target][VIPlevel] = Level;
                new tname[MAX_PLAYER_NAME];
                GetPlayerName(Target,tname,sizeof(tname));
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid,pname,sizeof(pname));
                new MyString[128];
                new TargetString[128];
                format(MyString, sizeof(MyString), "You have set %s VIP Level to %i!", tname, Level);
                format(TargetString, sizeof(TargetString), "You are now VIP Level %i, thanks to %s!", Level, pname);
                SendClientMessage(Target, COLOR_RED, TargetString);
                SendClientMessage(playerid,COLOR_GREEN,MyString);
                PlayerPlaySound(Target,1057,0.0,0.0,0.0);
            }
            else
            {
                SendClientMessage(playerid,COLOR_RED,"USAGE: /setvip <playerid> <level>");
            }
           
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "ERROR: You have to be an Admin level 4 or higher to perform this command!");
    }
    return 1;
}
EDIT: Tryin' this from iPLEOMAX! I'mma post later what happened!
EDIT2: Yep, thanks iPLEOMAX, all fixed, you betcha!^_^
Reply


Messages In This Thread
Params won't show up! - by Twisted_Insane - 28.02.2012, 16:55
Re: Params won't show up! - by Babul - 28.02.2012, 16:56
Re: Params won't show up! - by Twisted_Insane - 28.02.2012, 17:16
Re: Params won't show up! - by Babul - 28.02.2012, 17:26
Re: Params won't show up! - by iPLEOMAX - 28.02.2012, 17:32
Re: Params won't show up! - by Twisted_Insane - 28.02.2012, 17:54
Re: Params won't show up! - by Konstantinos - 28.02.2012, 18:01

Forum Jump:


Users browsing this thread: 1 Guest(s)