12.03.2014, 13:40
pawn Код:
public OnPlayerConnect(playerid)
{
new str[128];
format(str, 128, "AdmMsg: PlayerID: [%d] - Player Name: [%s] has connected!", playerid, GetPlayerName(playerid));
MessageToAdmins(-1, str);
return 1;
}
stock MessageToAdmins(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++) // Loops through all players
{
if(IsPlayerConnected(i) == 1) // Checks if the player is connected
{
if(PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i, color, string);//if player is connected and he's admin level higher then 1 he will get this message
}
}
}
return 1;
}