Admin command

Started by KAKAN, Sep 09, 2015, 01:33 PM

Previous topic - Next topic

KAKAN

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");
    }
oh no

DizzasTeR

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.

FinchDon

For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

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
oh no

rObInX

Quote from: KAKAN on Sep 09, 2015, 03:41 PM
Quote 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.

KAKAN

Actually i don't, I can make it, But I'm way too lazy and also my exams are started
oh no

Thijn

What's not working? Please give more info...

KAKAN

No error, but no message is shown on the server, it should show "No admins online", but its not showing anything
oh no

rObInX

Do you insert played id in playerson when a player joins?

Thijn

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.