02.02.2013, 16:33
Why do the /admins show me and then when I type /aduty it doesn't show anything?
Here is the /admins command:
Here is the /aduty command:
Here is the /admins command:
pawn Code:
CMD:admins(playerid, params[])
{
new string[256];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Online Administrators{FFFFFF}:");
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin])
{
if(aDuty[i])
{
format(string, sizeof(string), "{AFAFAF}[{FF9900}Name{FFFFFF}: %s{AFAFAF}] [{FF9900}Rank{FFFFFF}: %s{AFAFAF}] [{FF9900}Status{FFFFFF}: Administrating{AFAFAF}]", GetPlayerNameEx(i), RPALN(i));
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
format(string, sizeof(string), "{AFAFAF}[{FF9900}Name{FFFFFF}: %s{AFAFAF}] [{FF9900}Rank{FFFFFF}: %s{AFAFAF}] [{FF9900}Status{FFFFFF}: Roleplaying{AFAFAF}]", GetPlayerNameEx(i), RPALN(i));
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "There are currently no Administrators online at the moment.");
return 1;
}
}
return 1;
}
pawn Code:
CMD:aduty(playerid, params[])
{
new string[128], file[32];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid])
{
format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
format(string, sizeof(string), "%s {FFFFFF}is now on duty as a {33CCFF}%s{FFFFFF}.", GetPlayerNameEx(playerid), RPALN(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
aDuty[playerid] = 1;
}
else
{
if(Spec[playerid]) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: You cannot go off duty while spectating someone.");
format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
format(string, sizeof(string), "%s {FFFFFF}is now off duty as a {33CCFF}%s{FFFFFF}.", GetPlayerNameEx(playerid), RPALN(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
aDuty[playerid] = 0;
}
return 1;
}