Raised This Month: $ Target: $400
 0% 

Checking ip same.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-02-2013 , 16:26   Re: Checking ip same.
Reply With Quote #1

PHP Code:
#include <amxmodx>

public plugin_cfg() register_plugin("Kick same Client IP",AMXX_VERSION_STR,"SmileY");

public 
client_putinserver(id)
{
    new 
iPlayers[32],iNum,Players;
    
get_players(iPlayers,iNum,"ch"); // Do not Kick BOTs or HLTVs
    
    
new szIP[33][17];
    
get_user_ip(id,szIP[id],charsmax(szIP[]),1// Get Users IP without port
    
    
for(new i;iNum;i++)  // Get all users IPs in server, and check if it is equal another address what is already in use
    
{
        
Players iPlayers[i];

        if(
Players == id) continue; // Removes self from LOOP to not check the same IP
        
        
get_user_ip(Players,szIP[i],charsmax(szIP[]),1); // Get IP of all players
        
        
if(equali(szIP[i],szIP[id])) server_cmd("kick #%d ^"Sorrythis IP address is already in use in server^"",get_user_userid(id));
    }

I suggest to test with care
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 06-02-2013 at 16:28.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 16:14.


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