Admin Commands
#1

Hello friends, I have a little problem and I do not know what to do.

Errors:
pawn Код:
Commands.pwn (47): error 029: invalid expression, assumed zero
Commands.pwn (47): warning 215: expression has no effect
Commands.pwn (47): error 001: The expected token: ";", but found "]"
Commands.pwn (47): error 029: invalid expression, assumed zero
Commands.pwn (47): fatal error 107: too many error messages on one line
Line:

Reply
#2

As far as I know, PAWN doesn't support pointers by default. Also, you're missing a closing bracket after "(playerid)", so it should be GetAdminRankName(GetPlayerAdminLevel(playerid)).
Reply
#3

PHP код:
format(string,sizeof(string), "lol: %s lol: %P\n",GetAdminRankName(GetPlayerAdminLevel(playerid)),i); // how it should be 
Reply
#4

And how to fix that showed the dialog admins online?
Reply
#5

It works, but I want to show only the administrators. how to do?

do not want players to appear in / admins




How do unless admin to hide in / admins
Reply
#6

What variable do you use for admin levels?
Reply
#7

pawn Код:
CheckAdminLevel(playerid)
{
    for(new i; i < admin_Total; i++)
    {
        if(!strcmp(gPlayerName[playerid], admin_Data[i][admin_Name]))
        {
            admin_Level[playerid] = admin_Data[i][admin_Rank];
            break;
        }
    }
}
or

pawn Код:
stock GetPlayerAdminLevel(playerid)
{
    if(!IsPlayerConnected(playerid))
        return 0;

    return admin_Level[playerid];
}
Reply
#8

Bump..
Reply
#9

pawn Код:
CMD:admins(playerid, params[])
{
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
      if(IsPlayerConnected(i))
      {
         if(admin_level[playerid] >= 1)
         {
            new string[128];
            format(string,sizeof(string), "lol: %s lol: %P\n",GetAdminRankName(GetPlayerAdminLevel(playerid)),i);
            Dialog_Show(playerid, DIALOG_STYLE_MSGBOX, "lol", string, "Closed", "");
         }
      }
   }
   return 1;
}
Reply
#10

Quote:
Originally Posted by ReD_HunTeR
Посмотреть сообщение
pawn Код:
CMD:admins(playerid, params[])
{
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
      if(IsPlayerConnected(i))
      {
         if(admin_level[playerid] >= 1)
         {
            new string[128];
            format(string,sizeof(string), "lol: %s lol: %P\n",GetAdminRankName(GetPlayerAdminLevel(playerid)),i);
            Dialog_Show(playerid, DIALOG_STYLE_MSGBOX, "lol", string, "Closed", "");
         }
      }
   }
   return 1;
}
Really thanks + REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)