14.06.2015, 16:25
Anyone got a proper working /setadminname and /aduty so that an admin sets their admin name to go on duty with.
new gAdminName[MAX_PLAYERS]; new gADuty[MAX_PLAYERS]; new gNormalName[MAX_PLAYERS]; CMD:adminname(playerid, params[]){ if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Administrators only."); if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /adminname [name]"); format(gAdminName[playerid], 128, params); new string[128]; format(string, sizeof(string), "Admin name changed to %s.", gAdminName[playerid]); SendClientMessage(playerid, -1, string); format(gNormalName[playerid], 128, GetName(playerid)); return 1; } CMD:aduty(playerid, params[]){ if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Administrators only."); if(gADuty[playerid] == 0){ gADuty[playerid] = 1; SendClientMessage(playerid, -1, "You have gone on Administrative duty."); SetPlayerName(playerid, gAdminName[playerid]); } else{ gADuty[playerid] = 0; SendClientMessage(playerid, -1, "You have gone off Administrative duty."); SetPlayerName(playerid, gNormalName[playerid]); } return 1; }