AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   How to get server Ip (https://forums.alliedmods.net/showthread.php?t=162561)

m0skVi4a 07-20-2011 12:56

How to get server Ip
 
Hellol
Can someone gives me a simple code for a way to detect the outpu ip(My ip(example - my ip is 77.78.123.45, not the server ip)) and if the output ip's == cvar ip to run a command

Exolent[jNr] 07-20-2011 13:13

Re: How to get server Ip
 
get_user_ip(), use 0 as player index to get server's IP.
Use equal() to check if IPs are equal.

m0skVi4a 07-20-2011 13:23

Re: How to get server Ip
 
I can not ask the command get_user_ip
Can you make only this

Exolent[jNr] 07-20-2011 13:33

Re: How to get server Ip
 
You are in Scripting Help section, and this is the complete basics that I told you.
In this section, you are expected to be able to have knowledge of scripting.
If you cannot script, then I will move this thread to Suggestions/Requests.

m0skVi4a 07-20-2011 13:40

Re: How to get server Ip
 
yes thank you

HBxander 07-20-2011 20:03

Re: How to get server Ip
 
Exolent i dont get it, is this correct formatted?

Code:
new server_ip [ 60 ] get_user_ip ( 0, server_ip, sizeof ( server_ip ) - 1 ) if ( !equal ( server_ip, ip_required ) )

then your code, and so on?

Kreation 07-20-2011 20:07

Re: How to get server Ip
 
Yes, that would check if the ip of the server is not the same as 'ip_required'.

m0skVi4a 07-21-2011 02:27

Re: How to get server Ip
 
And the īp_requires" is the IP thah is by cvar. And if server_ip ip_required are not identical
my comand


All times are GMT -4. The time now is 01:30.

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