Hello guys, I made a level cmd in snippet showroom, Now i was trying to make a cmd which shows the admins with ahide off, here is the cmd, it doesn't work, help me pl0x
else if ( cmd == "admins" || cmd == "admin" )
{
local plr, buffer = "";
foreach(playerid, val in playerson )
{
plr = FindPlayer( playerid );
if ( plr && !ahide[ plr.ID ] && stats[plr.ID].Level > 2 ) buffer = buffer + " " + plr.Name + "(" + stats[plr.ID].Level + ")";
}
if ( buffer != "" ) Message(">> Online Admins: " + strip(buffer) );
else Message(">> No admins Online");
}
Just tell me why
foreach( playerid, val in playerson )
and why not
foreach( playerid in playerson )
Even if that is the cause or not I doubt.
ADM Admin Command :P
Quote from: FinchDon on Sep 09, 2015, 03:10 PMADM Admin Command :P
So any problems?
Quote from: Doom_Killer on Sep 09, 2015, 02:23 PMJust tell me why
foreach( playerid, val in playerson )
and why not
foreach( playerid in playerson )
Even if that is the cause or not I doubt.
Actually, I just tested it when i was the only admin present in the server, so maybe this is the problem, I'll try it later
Quote from: KAKAN on Sep 09, 2015, 03:41 PMQuote from: FinchDon on Sep 09, 2015, 03:10 PMADM Admin Command :P
So any problems?
Ye, problem. I can remove your snippet.
But I won't. Coz you all suck.
Actually i don't, I can make it, But I'm way too lazy and also my exams are started
What's not working? Please give more info...
No error, but no message is shown on the server, it should show "No admins online", but its not showing anything
Do you insert played id in playerson when a player joins?
Quote from: rObInX on Sep 10, 2015, 03:15 PMDo you insert played id in playerson when a player joins?
Even if he didn't he should've got the message about no admins online. His code is broken, and he probably has a try catch block around his commands that's suppressing the real error.