Player ID Problem?
#1

When I try to do /setvip command it says Invalid player id

pawn Код:
COMMAND:setvip(playerid, params[])
{
    if(pInfo[playerid][Adminlevel] >= 4)
    {
            new Target;
            new Level;
            if(!sscanf(params, "ui", Target,Level))
            {
                if(Level > 3) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Maximum level is 3!");
                if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: Invalid player ID");
                if(pInfo[Target][Adminlevel] >= pInfo[playerid][Adminlevel]) return SendClientMessage(playerid,COLOR_RED,"{F81414}[ERROR]: {FFFFFF}This command is not available in this server! Type {F81414}/help {FFFFFF}for a list of commands.");
                pInfo[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 have been promoted to  VIP Level %i, thanks to %s!", pname, Level);
                SendClientMessage(Target, COLOR_RED, TargetString);
                SendClientMessage(playerid,COLOR_GREEN,MyString);
            }
            else SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /setvip <playerid> <vip-level>");
        }
    else SendClientMessage(playerid, COLOR_RED, "[ERROR]: You have to be an Admin level 4 or higher to perform this command!");
    return 1;
}
Help?
Reply


Messages In This Thread
Player ID Problem? - by Affan - 07.06.2013, 14:46
Re: Player ID Problem? - by Facerafter - 07.06.2013, 14:53
Re: Player ID Problem? - by Affan - 07.06.2013, 15:01
Re: Player ID Problem? - by Facerafter - 07.06.2013, 15:05
Re: Player ID Problem? - by Red_Dragon. - 07.06.2013, 15:09
Re: Player ID Problem? - by Affan - 07.06.2013, 15:33

Forum Jump:


Users browsing this thread: 3 Guest(s)