22.01.2016, 02:04
IsPlayerConnected doesnt need 1-2 check, as it return true or false.
EDIT: woops fixed
EDIT v2: Yes, you cannot use [i] on IsPlayerAdmin since thats an in-built SA:MP function and it responds to IsPlayerAdmin(playerid) or in your case IsPlayerAdmin(i)
Look more here
https://sampwiki.blast.hk/wiki/IsPlayerAdmin
PHP код:
forward MessageToAdmins(color,const string[]);
public MessageToAdmins(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) {
if(PlayerInfo[i][Level] >= 1 || IsPlayerAdmin(i)) {
SendClientMessage(i, color, string);
}
}
}
return 1;
}
EDIT v2: Yes, you cannot use [i] on IsPlayerAdmin since thats an in-built SA:MP function and it responds to IsPlayerAdmin(playerid) or in your case IsPlayerAdmin(i)
Look more here
https://sampwiki.blast.hk/wiki/IsPlayerAdmin