Raised This Month: $51 Target: $400
 12% 

[REQUEST] ShowIP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Adryyy
Member
Join Date: Oct 2011
Old 08-25-2016 , 17:04   [REQUEST] ShowIP
Reply With Quote #1

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

Last edited by Adryyy; 08-26-2016 at 15:49.
Adryyy is offline
Send a message via Yahoo to Adryyy Send a message via Skype™ to Adryyy
Adryyy
Member
Join Date: Oct 2011
Old 08-26-2016 , 15:50   Re: [REQUEST] ShowIP
Reply With Quote #2

Bump
Adryyy is offline
Send a message via Yahoo to Adryyy Send a message via Skype™ to Adryyy
JoaoVieira
Senior Member
Join Date: May 2013
Location: Portugal
Old 09-03-2016 , 12:01   Re: [REQUEST] ShowIP
Reply With Quote #3

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;

JoaoVieira is offline
Adryyy
Member
Join Date: Oct 2011
Old 09-05-2016 , 13:26   Re: [REQUEST] ShowIP
Reply With Quote #4

What is the difference )
Adryyy is offline
Send a message via Yahoo to Adryyy Send a message via Skype™ to Adryyy
JoaoVieira
Senior Member
Join Date: May 2013
Location: Portugal
Old 09-06-2016 , 08:08   Re: [REQUEST] ShowIP
Reply With Quote #5

Quote:
Originally Posted by Adryyy View Post
What is the difference )
did it work?
JoaoVieira is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 09-06-2016 , 08:18   Re: [REQUEST] ShowIP
Reply With Quote #6

Quote:
Originally Posted by JoaoVieira View Post
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.

Last edited by Freezo Begin; 09-06-2016 at 08:20.
Freezo Begin is offline
JoaoVieira
Senior Member
Join Date: May 2013
Location: Portugal
Old 09-06-2016 , 09:13   Re: [REQUEST] ShowIP
Reply With Quote #7

Quote:
Originally Posted by Freezo Begin View Post
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...
JoaoVieira is offline
Adryyy
Member
Join Date: Oct 2011
Old 09-06-2016 , 17:44   Re: [REQUEST] ShowIP
Reply With Quote #8

....i solved
Adryyy is offline
Send a message via Yahoo to Adryyy Send a message via Skype™ to Adryyy
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:32.


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