SA-MP Forums Archive
dialog help/ - 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)
+--- Thread: dialog help/ (/showthread.php?tid=282305)



dialog help/ - iGetty - 10.09.2011

How can I make a /members command in Dialog?

It will show the online players in green names, and offline players in white?

Please help.

pawn Code:
command(members, playerid, params[])
{
    //rest here
}



Re: dialog help/ - Basicz - 10.09.2011

pawn Code:
COMMAND:members( playerid, params[ ] )
{
    foreach (Player, i)
    {
        if ( gTeam[ i ] == gTeam[ playerid ] )
        {
            new name[ 24 ] = "No one";
            if ( i != playerid ) {
            GetPlayerName( i, 24 ); } new output[ 64 ], totalstr[ 1024 ]; }
            format( output, 64, "{00FF00}%s\n", name );
            strcat( totalstr, output );
        }
    }
 
    ShowPlayerDialog( playerid, 1337, DIALOG_STYLE_MSGBOX, "ONLINE MEMBERS", totalstr, "okay", "" );

    return 1;
}
p.s.: this one i created is without offline members.

Hope it works and helps.


Re: dialog help/ - iGetty - 10.09.2011

Thanks mate, I'll have a peek.