Raised This Month: $ Target: $400
 0% 

is worth and possible cache user ip and auth in index as global string var?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-03-2013 , 15:47   Re: is worth and possible cache user ip and auth in index as global string var?
Reply With Quote #6

PHP Code:
#include < amxmodx >

public plugin_init()
{
    
register_clcmd("say /info""ClCmd_Say_Info");
}

GGETPLAYERAUTHID(idbGet false)
{
    static 
szAuthid[33][32];
    if( 
bGet )
    {
        
get_user_authid(idszAuthid[id], charsmax(szAuthid[]));
    }
    return 
szAuthid[id];
}

public 
client_connect(id)
{
    
GETPLAYERIP(idtrue);
}

public 
client_authorized(id)
{
    
GGETPLAYERAUTHID(idtrue);
}

GETPLAYERAUTHID(idbGet false)
{
    static 
szAuthid[33][32];
    if( 
bGet )
    {
        
get_user_authid(idszAuthid[id], charsmax(szAuthid[]));
    }
    return 
szAuthid[id];
}

GETPLAYERIP(idbGet false)
{
    static 
szAddress[33][16];
    if( 
bGet )
    {
        
get_user_ip(idszAddress[id], charsmax(szAddress[]), 1);
    }
    return 
szAddress[id];
}

public 
ClCmd_Say_Info(id)
{
    
client_print(idprint_chat"Your IP is ^"%s^" and your SteamID is ^"%s^""GETPLAYERIP(id), GETPLAYERAUTHID(id));
}

// function in which you need to use steamid more that one and ip more than once :
public function( id )
{
    static 
szAuthid[32], szIp[16];
    
szAuthid GETPLAYERAUTHID(id);
    
szIp GETPLAYERIP(id);

    if( !(
'0' <= szAuthid[10] <= '9') && !IsLocalIpszIp ) )
    {
        
client_print(idprint_chat"Your IP is ^"%s^" and your SteamID is ^"%s^" tell us you are not using steam"szIpszAuthid);
    }
}

IsLocalIp( const IP[] )
{
    return 
false;

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



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 15:58.


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