09.04.2014, 08:38
pawn Код:
CMD:aduty(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "This is an admin only command!");
if(!PlayerInfo[playerid][pAdminDuty])
{
SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on administrative duty! Remember to check /reports!");
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, (Float:0x7F800000));
SetPlayerArmour(playerid, (Float:0x7F800000));
SetPlayerColor(playerid, COLOR_REALRED);
//SetPlayerSkin(playerid, 294); - Commented by Voltage
AdminMode[playerid] = Create3DTextLabel("Administrator on duty!\n{FF1515}Do not Attack!", 0xFFFF00FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(AdminMode[playerid], playerid, 0.0, 0.0, 0.5);
new string[128];
format(string, sizeof(string), "Administrator %s(ID %d) is now on Admin Duty!", GetPlayerNameEx(playerid), playerid);
ABroadCast(COLOR_YELLOW, string, 1);
}
else if(PlayerInfo[playerid][pAdminDuty])
{
PlayerInfo[playerid][pAdminDuty] = 0;
SendClientMessageEx(playerid, COLOR_RED, "You are now off admin duty!");
//SetPlayerName(playerid, PlayerInfo[playerid][pNormalName]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
SetPlayerToTeamColor(playerid);
//SetPlayerSkin(playerid, 299); - Commented by Voltage
Delete3DTextLabel(AdminMode[playerid]);
new string[128];
format(string, sizeof(string), "Administrator %s(ID %d) is now Off Admin Duty! ( Leave the Admin to Roleplay )", GetPlayerNameEx(playerid), playerid);
ABroadCast(COLOR_YELLOW, string, 1);
}
return 1;
}
pawn Код:
//Under OnPlayerSpawn...
if(PlayerInfo[playerid][pAdminDuty]) Attach3DTextLabelToPlayer(AdminMode[playerid], playerid, 0.0, 0.0, 0.5);
pawn Код:
//Under OnPlayerDisconnect...
if(PlayerInfo[playerid][pAdminDuty])
{
Delete3DTextLabel(AdminMode[playerid]);
PlayerInfo[playerid][pAdminDuty] = false;
}
pawn Код:
new AdminMode[MAX_PLAYERS];
pawn Код:
new Text3D:AdminMode[MAX_PLAYERS];