|
if(strcmp(cmd, "/adm", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] == 1) { GetPlayerName(playerid, sMsg, MAX_PLAYER_NAME); format( sMsg, sizeof( sMsg ), "* %s is now connected to a moderator.", sMsg ); SendClientMessageToAll( TEAM_BLUE_COLOR, sMsg ); SetPlayerColor(playerid,TEAM_BLUE_COLOR); LigarAdmin[playerid] = 1; SetPlayerArmour(playerid, 10000000); } else if(PlayerInfo[playerid][pAdmin] >= 5) { GetPlayerName(playerid, sMsg, MAX_PLAYER_NAME); format( sMsg, sizeof( sMsg ), "* %s is now connected as an administrator.", sMsg ); SendClientMessageToAll( COLOR_YELLOW, sMsg ); SetPlayerColor(playerid,COLOR_YELLOW); LigarAdmin[playerid] = 0; SetPlayerArmour(playerid, 1000000); SetPlayerHealth(playerid, 1000000); } else { SendClientMessage(playerid, COLOR_GREY, " You are not an administrator!."); return 1; } } return 1; } |
Forward AdminInv(playerid);
new AdminInvTimer;
on Gamemode init:
AdminInvTimer = SetTimer("AdminInv", 1000, 1);
public AdminInv(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
SetPlayerArmour(i, 10000);
SetPlayerHealth(i, 10000);
}
}
}
)Test it, and let me know.(reply)