30.10.2018, 03:04
Code:
ReturnAdminName(playerid) { new string[64] ; switch (PlayerInfo[playerid][pAdmin]) { case 1: Create3DTextLabel("Moderator", 0xFFA500FF, 30.0, 40.0, 50.0, 40.0, 0); case 2: Create3DTextLabel("Game Administrator", 0xFFA500FF, 30.0, 40.0, 50.0, 40.0, 0); case 3: Create3DTextLabel("Lead Administrator", 0xFFA500FF, 30.0, 40.0, 50.0, 40.0, 0); case 4: Create3DTextLabel("Server Manager", 0xFFA500FF, 30.0, 40.0, 50.0, 40.0, 0); default: string = "Undefined"; } return string; } CMD:aduty(playerid, params[]) { new Text3D:LabelAdmin[MAX_PLAYERS] = {TEXT3D:INVALID_3DTEXT_ID, ...}; if(IsAdmin(playerid)) { if(IsOnAdminDuty(playerid)) { PlayerInfo[playerid][pAdminDuty] = 0; SendClientMessage(playerid, COLOR_YELLOW, "You are now off duty."); Delete3DTextLabel(LabelAdmin[playerid]); LabelAdmin[playerid] = INVALID_3DTEXT_ID; } else { new adminName[24]; format(adminName, sizeof(adminName), "%s", ReturnAdminName(playerid)); LabelAdmin[playerid] = Create3DTextLabel(adminName, 0xFFA500FF, 30.0, 40.0, 50.0, 40.0, 0); Attach3DTextLabelToPlayer(LabelAdmin[playerid], playerid, 0.0, 0.0, 0.7); SendClientMessageEx(playerid, COLOR_YELLOW, "You are now on duty as a %s", ReturnAdminLevel(playerid)); PlayerInfo[playerid][pAdminDuty] = 1; } } else return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not an Administrator!"); return 1; }