match for IP
Hello !
I'm trying to create a plugin for my community only, and I want to match for IP (listen) to protect my work against leechers or non-community members. I'm thinking about: new serverip; serverip = get_cvar_pointer(ip); But if I echo it, server dies ... I'm thinking about something like (php code) $mainclass = "66.66.66"; $serverip = get_cvar_pointer(ip); $serveripEXPLODE = explode(".", $serverip"); $serveripDONE = $serveripEXPLODE[0] . "." . $serveripEXPLODE[1] . "." . $serveripEXPLODE[2]; if(!$serveripDONE==$serverip) { server_cmd("quit"); } else { [...] } So, if user doesn't have system CVAR IP containing "66.66.66" then it will kill the server Thank you in advance ! |
Re: match for IP
This is AMXX Scripting Forum not PHP isnt it?
|
Re: match for IP
You're right, but ... trying to learn ...
I did something like this: #include <amxmodx> new serverip[64]; [...] get_cvar_string("ip",serverip,63); [...] client_print(id, "ServerIPCVAR %s", serverip); but: home/groups/amxmodx/tmp3/text7p4iyD.sma(44) : error 035: argument type mismatch (argument 2) ... |
Re: match for IP
Display the whole code.
Also, get_cvar_string("ip",serverip,63) Why do you wrap ip in quotes? :/ |
Re: match for IP
Quote:
|
Re: match for IP
Ah, didn't notice that at first glance. Thanks for the explanation.
|
Re: match for IP
haha you can hex that out in a second sorry :-/
|
Re: match for IP
Quote:
Code:
|
Re: match for IP
Quote:
|
Re: match for IP
If you are using "developer 1", you will notice that your console is shown in the top left of your screen.
print_notify prints messages in that same section (not sure if it goes to your console, but I'd assume it does). |
| All times are GMT -4. The time now is 08:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.