01.10.2014, 10:10
(
Последний раз редактировалось Josh_Main; 01.10.2014 в 10:22.
Причина: edit
)
Hey, how come when I set an admin to level 1, it defines the admin level in-game as unassigned administrator?
It's like, when I set an admin to level 1, it sets it to unassigned admin, then sets 2 to guider, then 3 as senior guider, 4 as chief guider etc. when it should be
1 - guider
2 - senior guider
3 - chief guider
4 - server monitor
etc
Any help would be greatly appreciated! Thanks in advanced.
EDIT:
This is my create admin command
pawn Код:
stock GetAdminRank(playerid)
{
new Rank[60];
if(PlayerStat[playerid][AdminLevel] >= 1)
{
if(PlayerStat[playerid][AdminLevel] == 1) format(Rank, sizeof(Rank), "Guider");
if(PlayerStat[playerid][AdminLevel] == 2) format(Rank, sizeof(Rank), "Senior Guider");
if(PlayerStat[playerid][AdminLevel] == 3) format(Rank, sizeof(Rank), "Chief Guider");
if(PlayerStat[playerid][AdminLevel] == 4) format(Rank, sizeof(Rank), "Server Monitor");
if(PlayerStat[playerid][AdminLevel] == 5) format(Rank, sizeof(Rank), "Junior Staff Member");
if(PlayerStat[playerid][AdminLevel] == 6) format(Rank, sizeof(Rank), "General Staff Member");
if(PlayerStat[playerid][AdminLevel] == 7) format(Rank, sizeof(Rank), "Senior Staff Member");
if(PlayerStat[playerid][AdminLevel] == 8) format(Rank, sizeof(Rank), "Staff Executive");
if(PlayerStat[playerid][AdminLevel] == 9) format(Rank, sizeof(Rank), "Staff Director");
if(PlayerStat[playerid][AdminLevel] == 10) format(Rank, sizeof(Rank), "Server Director");
if(PlayerStat[playerid][AdminLevel] == 101) format(Rank, sizeof(Rank), "Server Director [HoS]");
}
else
{
Rank = "Unassigned Administrator";
}
return Rank;
}
1 - guider
2 - senior guider
3 - chief guider
4 - server monitor
etc
Any help would be greatly appreciated! Thanks in advanced.
EDIT:
This is my create admin command
pawn Код:
COMMAND:createadmin(playerid, params[])
{
new targetid, alevel, str[128];
if(PlayerStat[playerid][AdminLevel] < 10) return SendClientMessage(playerid, GREY, "You can't use this command.");
if(sscanf(params,"ud", targetid, alevel))return SendClientMessage(playerid, GREY, "USAGE: /makeadmin [playerid] [adminlevel]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, "That player is not connected!");
if(alevel < 0) return SendClientMessage(playerid, GREY, "Invalid admin level.");
if(PlayerStat[targetid][AdminLevel] <= alevel)
{
format(str, sizeof(str), "You have been promoted to a %s [%d] by %s %s.", GetAdminRank(targetid),alevel, GetAdminRank(playerid), GetOOCName(playerid));
SendClientMessage(targetid, ORANGE, str);
format(str, sizeof(str), "You have promoted %s to a %s [%d]!", GetOOCName(targetid), GetAdminRank(targetid), alevel);
SendClientMessage(playerid, ORANGE, str);
AdminActionLog(str);
PlayerStat[targetid][AdminLevel] = alevel;
}
if(PlayerStat[targetid][AdminLevel] > alevel)
{
format(str, sizeof(str), "You have been demoted to a level %d administrator by %s %s.",alevel, GetAdminRank(playerid), GetOOCName(playerid));
SendClientMessage(targetid, ORANGE, str);
format(str, sizeof(str), "You have demoted %s to a level %d administrator!", GetOOCName(targetid), alevel);
SendClientMessage(playerid, ORANGE, str);
AdminActionLog(str);
PlayerStat[targetid][AdminLevel] = alevel;
}
return 1;
}