/admins
#1

Can anyone look at my /admins command. This will show all admins online.

Код:
  if(strcmp(cmd, "/admins", true) == 0)
	{
	 for(new i=0, m=GetMaxPlayers; i<m; i++)
	 {
		if((PlayerInfo[i][AdminLevel] > 0) && !IsPlayerConnected(i))
		SendClientMessage(playerid, 0xFFA500FF, "Server: There is no admins oline!");
		if((PlayerInfo[i][AdminLevel] > 0) && IsPlayerConnected(i))
	 {
 		new str[128];
		format(str, 128, "%s(%d) [Level: %d]", Name(i), i, PlayerInfo[i][AdminLevel]);
		SendClientMessage(playerid, 0xFFA500FF, "Server: Currently online admins:");
		SendClientMessage(playerid, 0xFFA500FF, str);
	  }
	 }
  }
 	return 0;
  }
and I got error:

Quote:

I:\Mini-Quests\filterscripts\Admin2.pwn(30 : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Error is on line:

Quote:

for(new i=0, m=GetMaxPlayers; i<m; i++)

Reply
#2

replace for(new i=0, m=GetMaxPlayers; i<m; i++)


with

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
Reply
#3

Thanks man!
Reply
#4

Should be
GetMaxPlayers();
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)