31.10.2018, 17:38
Code:
new Text3D:PlayerAdminLabel[MAX_PLAYERS];
ReturnAdminLevel(playerid)
{
new
string[64]
;
switch (PlayerInfo[playerid][pAdmin])
{
case 1: string= "Moderator";
case 2: string= "Game Administrator";
case 3: string= "Lead Administrator";
case 4: string= "Server Manager";
default: string= "Undefined";
}
return string;
}
CMD:aduty(playerid, params[])
{
new id;
if(IsAdmin(playerid))
{
if(IsOnAdminDuty(playerid))
{
PlayerInfo[playerid][pAdminDuty] = 0;
SendClientMessage(playerid, COLOR_YELLOW, "You are now off duty.");
DestroyDynamic3DTextLabel(Text3D:PlayerAdminLabel[MAX_PLAYERS]);
}
else
{
Text3D:PlayerAdminLabel = CreateDynamic3DTextLabel(ReturnAdminLevel(playerid), 0xFFA500FF, 0.0, 0.0, 0.1, 5.0, .attachedplayer = playerid, .testlos = 1);
SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on duty as a %s", ReturnAdminLevel(id));
PlayerInfo[playerid][pAdminDuty] = 1;
}
}
else
return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not an Administrator!");
return 1;
}

