Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: KAKAN on Sep 09, 2015, 01:33 PM

Title: Admin command
Post by: KAKAN on Sep 09, 2015, 01:33 PM
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");
    }
Title: Re: Admin command
Post by: DizzasTeR on Sep 09, 2015, 02:23 PM
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.
Title: Re: Admin command
Post by: FinchDon on Sep 09, 2015, 03:10 PM
ADM Admin Command :P
Title: Re: Admin command
Post by: KAKAN on Sep 09, 2015, 03:41 PM
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
Title: Re: Admin command
Post by: rObInX on Sep 09, 2015, 05:04 PM
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.
Title: Re: Admin command
Post by: KAKAN on Sep 09, 2015, 05:06 PM
Actually i don't, I can make it, But I'm way too lazy and also my exams are started
Title: Re: Admin command
Post by: Thijn on Sep 09, 2015, 06:10 PM
What's not working? Please give more info...
Title: Re: Admin command
Post by: KAKAN on Sep 09, 2015, 06:12 PM
No error, but no message is shown on the server, it should show "No admins online", but its not showing anything
Title: Re: Admin command
Post by: rObInX on Sep 10, 2015, 03:15 PM
Do you insert played id in playerson when a player joins?
Title: Re: Admin command
Post by: Thijn on Sep 10, 2015, 05:19 PM
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.