/admins command
#6

Quote:
Originally Posted by Amit_B
View Post
Hey

To fix these error you need to remove or comment line 476. Its unnecessary because your'e using it below this line.
The warnings comes from the part when you've checked, I guess, the admin level of the players?

GetPlayerPVar() requires 2 parameters as I believe you know, which one of them is the ID of the player and the second is the variable name. At the line with both of the warnings you've used this function twice without adding a variable name. What you need to do is to add the variable name as second parameter.
Thanks for your comment, anyway I already removed line 476 and i did GetPlayerPVar function
pawn Code:
error 017: undefined symbol "varname"
This is the GetPlayerPVar that requires 2 parameters
pawn Code:
GetPVarInt(playerid, varname[]);
pawn Code:
CMD:admins( playerid,params[])
    {
        if ( GetPVarInt( playerid, "Logged" ) == 1 )
        return SendClientMessage( playerid, -1, ""COL_RED"ERROR:{FFFFFF} You have to login to see the admins list.");

        new count=0;
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(GetPVarInt(i) >= 1 && GetPVarInt(i) < 3)
                {
                    new str[128];
                    GetPVarInt(playerid, varname[]);
//                  GetName(i, pName, 24);
                    format(str, sizeof(str), "%s [ID:%d] Level:[%d]",GetName(i),i,GetPVarInt(i));
                    count++;
                    ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Online admins:",str,"Close"," ");

                }
            }
        }
        if(count == 0)
        {
            ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Online admins:","There's no admins online right now.","Close"," ");
        }
        return 1;
    }
Toda.
Reply


Messages In This Thread
/admins command - by Firo - 03.06.2012, 16:14
Re: /admins command - by TheDominator - 03.06.2012, 16:20
Re: /admins command - by Firo - 03.06.2012, 16:22
Re: /admins command - by Firo - 03.06.2012, 17:39
Re: /admins command - by Amit_B - 04.06.2012, 14:39
Re: /admins command - by Firo - 04.06.2012, 14:43
Re: /admins command - by 3ventic - 04.06.2012, 14:50
Re: /admins command - by Amit_B - 04.06.2012, 14:51
Re: /admins command - by Firo - 04.06.2012, 14:58
Re: /admins command - by 3ventic - 04.06.2012, 14:59
Re: /admins command - by Firo - 04.06.2012, 15:00
Re: /admins command - by Firo - 05.06.2012, 09:55

Forum Jump:


Users browsing this thread: 1 Guest(s)