SA-MP Forums Archive
Help with /admins - 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: Help with /admins (/showthread.php?tid=268337)



Help with /admins - Millionaire - 12.07.2011

Hello!
I am using ladmin script , in that anyone type /admins it wont show any admin name (Only show the count).It should show name of the admin.Anyone help me?
Thank you..


Re: Help with /admins - Basicz - 12.07.2011

An example of an /admins command ( with IsPlayerAdmin check, change with your own. )

pawn Код:
CMD:admins( playerid, params[ ] )
{
    new
        iCounts,
        tempString[ 128 ],
        admName[ 24 ]
    ;

    SendClientMessage( playerid, -1, "Current online administrators:" );

    foreach (Player, i)
    {
        if ( IsPlayerAdmin( i ) )
        {
            counts ++;

            GetPlayerName( i, admName, sizeof admName );

            format( tempString, sizeof ( tempString ), "%s ( %d )", admName, i );

            // format( tempString, sizeof ( tempString ), "%s ( %d ) : Level : %d.", admName, i, pInfo[ playerid ][ pLevel ] );

            SendClientMessage( playerid, tempString );
        }
    }

    if ( !counts )
        SendClientMessage( playerid, "No administrators online." );

    return 1;
}
That should helps.


Re: Help with /admins - Millionaire - 12.07.2011

it shows these errors
pawn Код:
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(12949) : error 017: undefined symbol "foreach"
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(12951) : error 017: undefined symbol "i"
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(12953) : error 017: undefined symbol "counts"
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(12953) : warning 215: expression has no effect
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(12955) : error 017: undefined symbol "i"
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(12957) : error 017: undefined symbol "i"
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(12961) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(12965) : error 017: undefined symbol "counts"
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(12966) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(12942) : warning 203: symbol is never used: "iCounts"
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(19001) : error 017: undefined symbol "foreach"
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(19002) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Ironboy\Desktop\0.3c package\SATDM v13 Latest\gamemodes\SATDM.pwn(19004) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


11 Errors.



Re: Help with /admins - Shadoww5 - 12.07.2011

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/admins"true) == 0)
    {
        new 
bool:foundstr[30];
        for(new 
0MAX_PLAYERS++)
        {
            if(
IsPlayerAdmin(i))
            {
                
GetPlayerName(istr24);
                
format(strsizeof str"  » %s"str);
                
SendClientMessage(playerid0xFFFF00FFstr);
                
found true;
            }
        }
        if(!
found) { SendClientMessageplayerid"No administrators online." ); }
        return 
1;
    }
    return 
0;




Re: Help with /admins - Millionaire - 12.07.2011

ok ty