Admin name
#1

Anyone got a proper working /setadminname and /aduty so that an admin sets their admin name to go on duty with.
Reply
#2

Код:
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;
}
Note: I did NOT have time to check over this, so it is best that you do so yourself, as there MAY be mistakes. Also, this is basic - I would firstly need to know exactly how you wanted the script to be, in order to advance it. You can do that yourself though. You will also need to tell me which source of saving you use so that I can make it save for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)