Raised This Month: $ Target: $400
 0% 

Checking ip same.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yoni279
Member
Join Date: Feb 2010
Old 06-02-2013 , 18:35   Re: Checking ip same.
Reply With Quote #1

Quote:
Originally Posted by DeagLe.Studio View Post
Code:
#include < amxmodx >

public client_putinserver( Client )
{
    for( new Index = 1; Index <= get_maxplayers( ); Index++ )
    {
        static AddressIP[ 32 ], AddressIP2[ 32 ];
        get_user_ip( Client, AddressIP, charsmax( AddressIP ) );
        get_user_ip( Index, AddressIP2, charsmax( AddressIP2 ) );
        
        if( equali( AddressIP, AddressIP2 ) )    
        {
            static Name[ 32 ];
            get_user_name( Client, Name, charsmax( Name ) );
            server_cmd( "amx_kick ^"%s^"", Name );    
        }
    }
}
Try this again
its say someone arleady in server with same ip but isn't true.
yoni279 is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-02-2013 , 18:38   Re: Checking ip same.
Reply With Quote #2

So i don't know
TheDS1337 is offline
yoni279
Member
Join Date: Feb 2010
Old 06-02-2013 , 18:41   Re: Checking ip same.
Reply With Quote #3

Quote:
Originally Posted by DeagLe.Studio View Post
So i don't know
ok thnx about your help i will wait for other people.

Last edited by yoni279; 06-02-2013 at 18:41.
yoni279 is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-02-2013 , 18:42   Re: Checking ip same.
Reply With Quote #4

You are welcome
TheDS1337 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-02-2013 , 18:43   Re: Checking ip same.
Reply With Quote #5

DeagLe.Studio,
You are forgetting to check if Index == Client
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-02-2013 , 18:45   Re: Checking ip same.
Reply With Quote #6

Quote:
Originally Posted by YamiKaitou View Post
DeagLe.Studio,
You are forgetting to check if Index == Client
I was thinking... i don't need to check because i used equali function
and thank's for this point

Last edited by TheDS1337; 06-02-2013 at 18:46.
TheDS1337 is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-02-2013 , 18:47   Re: Checking ip same.
Reply With Quote #7

Code:
#include < amxmodx >

public client_putinserver( Client )
{
    for( new Index = 1; Index <= get_maxplayers( ); Index++ )
    {
        if( Index != Client )
            return 1;

        static AddressIP[ 32 ], AddressIP2[ 32 ];
        get_user_ip( Client, AddressIP, charsmax( AddressIP ) );
        get_user_ip( Index, AddressIP2, charsmax( AddressIP2 ) );
        
        if( equali( AddressIP, AddressIP2 ) )    
        {
            static Name[ 32 ];
            get_user_name( Client, Name, charsmax( Name ) );
            server_cmd( "amx_kick ^"%s^"", Name );    
        }
    }
    return 0;
}

Last edited by TheDS1337; 06-02-2013 at 18:48.
TheDS1337 is offline
yoni279
Member
Join Date: Feb 2010
Old 06-02-2013 , 19:02   Re: Checking ip same.
Reply With Quote #8

Quote:
Originally Posted by DeagLe.Studio View Post
Code:
#include < amxmodx >

public client_putinserver( Client )
{
    for( new Index = 1; Index <= get_maxplayers( ); Index++ )
    {
        if( Index != Client )
            return 1;

        static AddressIP[ 32 ], AddressIP2[ 32 ];
        get_user_ip( Client, AddressIP, charsmax( AddressIP ) );
        get_user_ip( Index, AddressIP2, charsmax( AddressIP2 ) );
        
        if( equali( AddressIP, AddressIP2 ) )    
        {
            static Name[ 32 ];
            get_user_name( Client, Name, charsmax( Name ) );
            server_cmd( "amx_kick ^"%s^"", Name );    
        }
    }
    return 0;
}
now its stuck here:
if( Index != Client ) return 1;

and not move if player with same ip connect or no its stuck here
yoni279 is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-02-2013 , 19:04   Re: Checking ip same.
Reply With Quote #9

try change return 1 to return 0
TheDS1337 is offline
yoni279
Member
Join Date: Feb 2010
Old 06-02-2013 , 19:09   Re: Checking ip same.
Reply With Quote #10

Quote:
Originally Posted by DeagLe.Studio View Post
try change return 1 to return 0
its same its stuck in if(index != client)
yoni279 is offline
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