/admins online command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /admins online command (
/showthread.php?tid=98049)
/admins online command -
Pawel2k9 - 18.09.2009
Hello i have an admins online command:
Code:
if (strcmp(cmd, "/admins online", true) == 0 || strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "Administrators Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[playerid][pAdmin] >= 2000)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Head Admin: %s", sendername);
SendClientMessage(playerid, COLOR_RED, string);
}
else if(PlayerInfo[playerid][pAdmin] >= 1000 && PlayerInfo[playerid][pAdmin] < 2000)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Vice Admin: %s", sendername);
SendClientMessage(playerid, COLOR_PINKER, string);
}
else if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdmin] < 1000)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Admin: %s", sendername);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 2)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Admin Prуbny: %s", sendername);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
}
}
return 1;
}
the problem is that it shows every admin as Vice Admin even if you lvl 2000 or 1 you are shown as a Vice admin, does any one know why ?? thx
Re: /admins online command -
EirikhO - 18.09.2009
Could we see the script that sets the admin level aswell, please?
Re: /admins online command -
coole210 - 18.09.2009
....
Re: /admins online command -
Pawel2k9 - 19.09.2009
ok i found out what is wrong but still cant fix it if you are admin 2000( head admin )you see every admin as head admin, if you a vice admin you see everyadmin as a vice admin and if you are not an admin at all you dont see e any admins online :/ any one know why?
Re: /admins online command -
Sznupek - 19.09.2009
Try to exchange each
pawn Code:
PlayerInfo[playerid][pAdmin]
...for
Re: /admins online command -
Pawel2k9 - 19.09.2009
how will playerid changing to i will help ? i and playerid is basically thesame thing :/
Re: /admins online command -
ilikepie2221 - 19.09.2009
playerid is the player who typed the command. i loops through every player checking if their admins. Basically, if you use playerid, it will fail.