IRCCMD:admins problem
#1

Hi all,i make this code:

pawn Код:
IRCCMD:admins(botid, channel[], user[], host[])
{
    new str[100],name[24];
    for(new i=0;i<MAX_PLAYERS;i++)
    {
      if(IsPlayerConnected(i) &&  if(PlayerInfo[i][AdminLevel] > 1)
        {
            GetPlayerName(i,name,sizeof name);
            format(str,sizeof str,"0,3Admin %s (ID:%d) (Level %d)",name,i,AdminLevel[i]);
            IRC_GroupSay(gGroupID, channel,str);
        }
    }
    return 1;
}
For show the !admins online.

Variable: if(PlayerInfo[playerid][AdminLevel] > 1)

I've this errors:


Код:
C:\Documents and Settings\l\Desktop\SFWAR.pwn(2994) : error 029: invalid expression, assumed zero
C:\Documents and Settings\l\Desktop\SFWAR.pwn(2994) : error 017: undefined symbol "playerid"
C:\Documents and Settings\l\Desktop\SFWAR.pwn(2994 -- 2996) : error 001: expected token: "}", but found ";"
C:\Documents and Settings\l\Desktop\SFWAR.pwn(2994 -- 2996) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
What's wrong?
Reply
#2

You can't get this working, because, you havent defined playerid, or anything
Never worked with IRCCMD so I dunno, try to change botid to playerid.

new playerid[MAX_PLAYERS];

EDIT: change this line:

pawn Код:
format(str,sizeof str,"0,3Admin %s (ID:%d) (Level %d)",name,i,AdminLevel[i]);
to:
pawn Код:
format(str,sizeof(str),"0,3Admin %s (ID:%d) (Level %d)",name,i,AdminLevel[i]);
Reply
#3

Still many errors.
Reply
#4

this line
pawn Код:
if(IsPlayerConnected(i) &&  if(PlayerInfo[i][AdminLevel] > 1)
should be
pawn Код:
if(IsPlayerConnected(i) &&  PlayerInfo[i][AdminLevel] > 1)
I don't know if this line is correct
pawn Код:
format(str,sizeof str,"0,3Admin %s (ID:%d) (Level %d)",name,i,AdminLevel[i]);
maybe it should be
pawn Код:
format(str,sizeof str,"0,3Admin %s (ID:%d) (Level %d)",name,i,PlayerInfo[i][AdminLevel]);
Reply
#5

Lol it's working,thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)