AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Getting Server IP and compare it with String (https://forums.alliedmods.net/showthread.php?t=185499)

Kia 05-18-2012 09:37

Getting Server IP and compare it with String
 
Hello everybody,
I got this Code :

PHP Code:

public ip_check()
{
    new 
szIP[64]
    
get_cvar_string("ip"szIP63)
    
    new 
Allowed[64]
    
copy(Allowed63"111.111.111.111")
    
    if(
szIP Allowed)
    {
        
client_print(0,print_chat,"1, %s, %s",szIP,Allowed)
    }
    else
    {
        
client_print(0,print_chat,"0, %s, %s",szIP,Allowed)
    }
    


It does compile, but when I want to check it, I get always the Server IP at "Allowed".
Anyone knows how to fix?

Greetz,
Kia.

hornet 05-18-2012 09:40

Re: Getting Server IP and compare it with String
 
You want:

PHP Code:

if( equalszIPAllowed) ) 



All times are GMT -4. The time now is 00:20.

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