PHP код:
CMD:aod(playerid, params[])
{
if(playerData[playerid][playerLoggedIn])
{
if(playerData[playerid][playerLevel] >= 1)
{
if(!playerData[playerid][playerAdminDuty])
{
new string[128];
SendClientMessage(playerid, COLOR_WHITE, "{OOFFOO}[ADMIN]{FFFFFF} You're now an on duty Administrator.");
playerData[playerid][playerAdminDuty] = true;
playerData[playerid][playerAdminLabel] = Create3DTextLabel("Admin on Duty", 0x00ff00ff, 30.0, 40.0, 50.0, 60.0, -1, 1);
Attach3DTextLabelToPlayer(playerData[playerid][playerAdminLabel], playerid, 0.0, 0.0, 0.4);
//Sends message to everybody
format(string, sizeof(string), "{00FF00}[ADMIN] {FF69A6}%s is now an on duty Administrator. Use /ask!", playerData[playerid][tempAdminName]);
SendClientMessageToAll(COLOR_WHITE, string);
// Give them infinite health.
SetPlayerHealth(playerid, 9999999);
SetPlayerColor(playerid, 0x00ff00);
TextDrawShowForPlayer(playerid, Text:AdminDuty);
}
else
{
// Admin is already on duty, so we'll now put them off duty
SendClientMessage(playerid, COLOR_WHITE, "{00FF00}[ADMIN] {FFFFFF}You're now an off duty Administrator.");
playerData[playerid][playerAdminDuty] = false;
Delete3DTextLabel(playerData[playerid][playerAdminLabel]);
// Give them default health
SetPlayerHealth(playerid, 100);
newPlayerColour(playerid);
TextDrawHideForPlayer(playerid, Text:AdminDuty);
//Sends message to everybody
format(string, sizeof(string), "{00FF00}[ADMIN] {FF69A6}%s is now an off duty Administrator.", playerData[playerid][tempAdminName]);
SendClientMessageToAll(COLOR_WHITE, string);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER]{FFFFFF} You're not an admin.");
}
}
return 1;
}