AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQUEST] ShowIP (https://forums.alliedmods.net/showthread.php?t=286826)

Adryyy 08-25-2016 17:04

[REQUEST] ShowIP
 
Hi, i have this code

Code:

#include <amxmodx>
#include <amxmisc>
#include <geoip>

#pragma semicolon 1

new const g_version[] = "0.1";

public plugin_init()
{
    register_plugin( "ShowIP", g_version, "compaq" );

    register_concmd( "amx_showip", "cmdShow", 0 );
}

public cmdShow( i_Index, iLevel, iCid )
{
    if( !cmd_access( i_Index, iLevel, iCid, 0 ) )
    {
        return PLUGIN_HANDLED;
    }

    static iPlayers[ 32 ], iNum, i, Index;
    get_players( iPlayers, iNum, "c" );

    for( i = 0; i < iNum; i++ )
    {
        Index = iPlayers[ i ];

        if( is_user_connected( Index ) )
        {
            static szName[ 33 ], Ip[ 33 ], szCountry[ 46 ];
            get_user_name( Index, szName, charsmax( szName ) );
            get_user_ip( Index, Ip, charsmax( Ip ) );
            geoip_country( Ip, szCountry, charsmax( szCountry ) );

            client_print( i_Index, print_console, "IP | Country" );
            client_print( i_Index, print_console, "%s | %s", szName, szCountry );
        }
    }

    return PLUGIN_CONTINUE;
}

You can do the maximum to display 5? Like 'amx_help' pages

Adryyy 08-26-2016 15:50

Re: [REQUEST] ShowIP
 
Bump

JoaoVieira 09-03-2016 12:01

Re: [REQUEST] ShowIP
 
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <geoip>

#pragma semicolon 1

new const g_version[] = "0.1";

public 
plugin_init()
{
    
register_plugin"ShowIP"g_version"compaq" );

    
register_concmd"amx_showip""cmdShow");
}

public 
cmdShowi_IndexiLeveliCid )
{
    if( !
cmd_accessi_IndexiLeveliCid) )
    {
        return 
PLUGIN_HANDLED;
    }

    static 
iPlayers32 ], iNumiIndex;
    
get_playersiPlayersiNum"c" );

    for( 
0iNumi++ )
    {
        
Index iPlayers];

        if( 
is_user_connectedIndex ) )
        {
            static 
szName33 ], Ip33 ], szCountry46 ];
            
get_user_nameIndexszNamecharsmaxszName ) );
            
get_user_ipIndexIpcharsmaxIp ) );
            
geoip_countryIpszCountrycharsmaxszCountry ) );

            
client_printi_Indexprint_console"IP | Country" );
            
client_printi_Indexprint_console"%s | %s IP: %s"szNameszCountryIp );
        }
    }

    return 
PLUGIN_CONTINUE;



Adryyy 09-05-2016 13:26

Re: [REQUEST] ShowIP
 
What is the difference :))

JoaoVieira 09-06-2016 08:08

Re: [REQUEST] ShowIP
 
Quote:

Originally Posted by Adryyy (Post 2451408)
What is the difference :))

did it work?

Freezo Begin 09-06-2016 08:18

Re: [REQUEST] ShowIP
 
Quote:

Originally Posted by JoaoVieira (Post 2451650)
did it work?

He said he want it like amx_help, displayed by pages.

amx_showip 1( page 1 )
amx_showip 2( page 2 )

You have just add the IP from client_print.

JoaoVieira 09-06-2016 09:13

Re: [REQUEST] ShowIP
 
Quote:

Originally Posted by Freezo Begin (Post 2451651)
He said he want it like amx_help, displayed by pages.

amx_showip 1( page 1 )
amx_showip 2( page 2 )

You have just add the IP from client_print.

He edited...

Adryyy 09-06-2016 17:44

Re: [REQUEST] ShowIP
 
....i solved


All times are GMT -4. The time now is 03:05.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.