15.09.2011, 19:12
PHP код:
new hp; // top
if(strcmp(cmd, "/aod", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(AdminDuty[playerid] == 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Admin %s is now off duty.", sendername,playerid);
SendClientMessageToAll(COLOR_DBLUE,string);
AdminDuty[playerid] = 0;
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,0);
SetPlayerToTeamColor(playerid);
KillTimer(hp);
}
else
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Admin %s is now on duty.",sendername,playerid);
SendClientMessageToAll(0xFAAFBEFF,string);
AdminDuty[playerid] = 1;
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
hp = SetTimer("Infinity", 500, 1); // <-----------------
SetPlayerColor(playerid,0xFAAFBEFF);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
SetPlayerMarkerForPlayer( i,playerid,0xFAAFBEFF );
}
}
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Your not an admin !");
}
return 1;
}
forward Infinity(playerid);
public Infinity(playerid)
{
SetPlayerHealth(playerid, 10000);
SetPlayerArmour(playerid, 10000);
}