Raised This Month: $ Target: $400
 0% 

Kick by timezone


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
wickedd
Veteran Member
Join Date: Nov 2009
Old 09-22-2017 , 19:48   Re: Kick by timezone
Reply With Quote #4

You don't need the GeoIP module since you're using 1.8.3, it's already include. However, you still need GeoLite2 City.
Download the binary and install it in addons/amxmodx/data folder.

Here you go
PHP Code:
#include <amxmodx>
#include <geoip>

new szIPMAX_PLAYERS ][ 16 ], szStatesMAX_PLAYERS ][ 15 ], s_kick
new Trie:s_load

new States[][] =
{    
    
"Texas",
    
"Mississippi"   // Add the states here
}

public 
plugin_init()
{
    
register_plugin"States Kicker""0.1""csykosoma" )
    
s_kick register_cvar"states_kick""1" /* 1 = Kick the states on the list. 2 = Allow only the states from the list*/

    
s_load TrieCreate( )
        
    for( new 
0sizeofStates ); i++ )
    {
        
TrieSetCells_loadStates], )
    }
}

public 
client_authorizedid )
{
    
get_user_ipidszIPid ], charsmaxszIP[] ), )
    
geoip_region_nameszIPid ], szStatesid ], charsmaxszStates[] )  )

    switch( 
get_pcvar_nums_kick ) )
    {
        case 
1:
        {
            if( 
TrieKeyExistss_loadszStatesid ] ) )
            {
                
server_cmd"kick #%i ^"Your State Is Not Allowed^""get_user_useridid ) )
            }
        }
        case 
2:
        {            
            if( !
TrieKeyExistss_loadszStatesid ] ) )
            {
                
server_cmd"kick #%i ^"Your States Is Not Allowed^""get_user_useridid ) )
            }
        }
    }
}

public 
plugin_end( )
{
    
TrieDestroys_load )

__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 09-23-2017 at 09:52.
wickedd 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 00:26.


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