CMD:admins(playerid) { new flag = 0, str[128]; SendClientMessage(playerid, COLOR_AQUA, "Administrators online:"); foreach(new i:Player) { if(PlayerInfo[playerid][pAdmin] > 0) { flag = 1; if(PlayerInfo[playerid][pAdmin] == KEY_ACTION) return format(str, sizeof(str), "{00ff6b}[Paused]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i)); if(PlayerInfo[playerid][pAdminDuty] == 1) { format(str, sizeof(str), "{00ff6b}[Available]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i)); } else format(str, sizeof(str), "{FF0000}[Unavailable]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i)); return SendClientMessage(i, -1, str); } } if(flag == 0) return SendClientMessage(playerid, -1, "There are no admins available currently."); return 1; }
PlayerInfo[playerid][pAdmin] == KEY_ACTION
CMD:admins(playerid) { new flag = 0, str[128]; SendClientMessage(playerid, COLOR_AQUA, "Administrators online:"); foreach(new i:Player) { if(PlayerInfo[playerid][pAdmin] > 0) { flag = 1; if(PlayerInfo[playerid][pAdmin] == KEY_ACTION) return format(str, sizeof(str), "{00ff6b}[Paused]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i)); if(PlayerInfo[playerid][pAdminDuty] == 1) { format(str, sizeof(str), "{00ff6b}[Available]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i)); } else format(str, sizeof(str), "{FF0000}[Unavailable]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i)); return SendClientMessage(i, -1, str); } } if(flag == 0) return SendClientMessage(playerid, -1, "There are no admins available currently."); return 1; }
CMD:admins(playerid)
{
new bool:flag, str[128];
SendClientMessage(playerid, COLOR_AQUA, "Administrators online:");
foreach(new i:Player)
{
if(PlayerInfo[i][pAdmin] > 0)
{
flag = true;
if(PlayerInfo[i][pAdmin] == KEY_ACTION)
format(str, sizeof(str), "{00ff6b}[Paused]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
else if(PlayerInfo[playerid][pAdminDuty] == 1)
format(str, sizeof(str), "{00ff6b}[Available]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
else
format(str, sizeof(str), "{FF0000}[Unavailable]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
SendClientMessage(i, -1, str);
}
}
if(!flag)
SendClientMessage(playerid, -1, "There are no admins available currently.");
return 1;
}
Welp, a few notes on this that could be the issue,
Код:
CMD:admins(playerid) { new flag = 0, str[128]; SendClientMessage(playerid, COLOR_AQUA, "Administrators online:"); foreach(new i:Player) { if(PlayerInfo[playerid][pAdmin] > 0) { flag = 1; if(PlayerInfo[playerid][pAdmin] == KEY_ACTION) return format(str, sizeof(str), "{00ff6b}[Paused]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i)); if(PlayerInfo[playerid][pAdminDuty] == 1) { format(str, sizeof(str), "{00ff6b}[Available]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i)); } else format(str, sizeof(str), "{FF0000}[Unavailable]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i)); return SendClientMessage(i, -1, str); } } if(flag == 0) return SendClientMessage(playerid, -1, "There are no admins available currently."); return 1; } pawn Код:
|
Still doesn't work.
The admins doesn't stack in /admins, and only themselves are shown |
CMD:admins(playerid)
{
new bool:flag, str[128];
SendClientMessage(playerid, COLOR_AQUA, "Administrators online:");
foreach(new i:Player)
{
if(PlayerInfo[i][pAdmin] > 0)
{
flag = true;
if(PlayerInfo[i][pAdmin] == KEY_ACTION)
format(str, sizeof(str), "{00ff6b}[Paused]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
else if(PlayerInfo[playerid][pAdminDuty] == 1)
format(str, sizeof(str), "{00ff6b}[Available]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
else
format(str, sizeof(str), "{FF0000}[Unavailable]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
SendClientMessage(playerid, -1, str);
}
}
if(!flag)
SendClientMessage(playerid, -1, "There are no admins available currently.");
return 1;
}
Wait shit my bad, try this:
pawn Код:
|
CMD:admins(playerid)
{
new bool:flag, str[128];
SendClientMessage(playerid, COLOR_AQUA, "Administrators online:");
foreach(new i:Player)
{
if(PlayerInfo[i][pAdmin] > 0)
{
flag = true;
if(PlayerInfo[i][pAdmin] == KEY_ACTION)
format(str, sizeof(str), "{00ff6b}[Paused]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
else if(PlayerInfo[i][pAdminDuty] == 1)
format(str, sizeof(str), "{00ff6b}[Available]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
else
format(str, sizeof(str), "{FF0000}[Unavailable]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
SendClientMessage(playerid, -1, str);
}
}
if(!flag)
SendClientMessage(playerid, -1, "There are no admins available currently.");
return 1;
}
Hey screw it, i'm pretty sure the last code i posted works, the only thing weird i see is the usage of KEY_ACTION and other than that it's a variable value issue that should be in other parts of the script, whether its a duty or a pause one.
|
Fixed it by editing PlayerInfo[playerid][pAdminDuty] == 1) to PlayerInfo[i][pAdminDuty] == 1)
|