Locking a gamemode [+REP]
#15

Quote:
Originally Posted by NaS
View Post
If you set bind to a wrong IP (server cfg) the server will not start.
If you leave it empty or set it to localhost the server will shut down due to the code he uses in his script.

So it basically does what it should, it prevents most of the people from running his script on another server.
Quote:
Originally Posted by AmigaBlizzard
View Post
If you know the IP of the server (like getting it through the GetServerIP function posted above), you could compare it and use
PHP Code:
    SendRconCommand("exit"); 
To shutdown the server when the IP doesn't match to the string you hardcoded.

You only need to give the amx file, as this file is your compiled script.
Just don't give your pwn file and you should be safe, they won't be able to edit it.
Quote:
Originally Posted by MicroKyrr
View Post
Add this somewhere in your script

PHP Code:
stock GetServerIP()
{
    new static, 
sIp[16];
    
GetServerVarAsString("bind"sIpsizeof(sIp));
    return 
sIp;

Add this in your server.cfg
PHP Code:
bind yourserverip 
It will look like this [This is example , just copy "bind yourserverip"
PHP Code:
echo Executing Server Config...
lanmode 0
rcon_password changeme
maxplayers 50
port 7777
hostname SA
-MP 0.3 Server
gamemode0 grandlarc 1
filterscripts gl_actions gl_realtime gl_property gl_mapicon ls_elevator attachments skinchanger vspawner ls_mall ls_beachside
announce 0
chatlogging 0
weburl www
.sa-mp.com
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat 
[%H:%M:%S]
language English
bind yourserverip 
First of all, I'd like the thank the three of you for helping me.
I got a question though. Assuming I did add these codelines into my script, what will happen if he removes/doesn't add the "bind yourserverip" line?
Reply


Messages In This Thread
Locking a gamemode [+REP] - by Amit1998 - 01.03.2016, 20:49
Re: Locking a gamemode [+REP] - by Spydah - 01.03.2016, 20:53
Re: Locking a gamemode [+REP] - by Amit1998 - 01.03.2016, 20:55
Re: Locking a gamemode [+REP] - by [NWA]Hannes - 01.03.2016, 21:00
Re: Locking a gamemode [+REP] - by Abagail - 01.03.2016, 21:41
Re: Locking a gamemode [+REP] - by Amit1998 - 01.03.2016, 22:00
Re: Locking a gamemode [+REP] - by benjenden - 01.03.2016, 22:15
Re: Locking a gamemode [+REP] - by Amit1998 - 01.03.2016, 22:36
Re: Locking a gamemode [+REP] - by NaS - 01.03.2016, 23:46
Re: Locking a gamemode [+REP] - by MicroKyrr - 02.03.2016, 09:28
Re: Locking a gamemode [+REP] - by AmigaBlizzard - 02.03.2016, 15:04
Re: Locking a gamemode [+REP] - by MicroKyrr - 02.03.2016, 22:19
Re: Locking a gamemode [+REP] - by Wolfe - 02.03.2016, 22:46
Re: Locking a gamemode [+REP] - by NaS - 03.03.2016, 09:30
Re: Locking a gamemode [+REP] - by Amit1998 - 03.03.2016, 11:09
Re: Locking a gamemode [+REP] - by iKarim - 03.03.2016, 11:24
Re: Locking a gamemode [+REP] - by NaS - 03.03.2016, 12:14
Re: Locking a gamemode [+REP] - by Amit1998 - 03.03.2016, 12:53
Re: Locking a gamemode [+REP] - by CalvinC - 03.03.2016, 13:03
Re: Locking a gamemode [+REP] - by NaS - 03.03.2016, 13:41
Re: Locking a gamemode [+REP] - by Amit1998 - 04.03.2016, 08:44
Re: Locking a gamemode [+REP] - by xEF - 04.03.2016, 19:32
Re: Locking a gamemode [+REP] - by NaS - 05.03.2016, 12:47
Re: Locking a gamemode [+REP] - by xEF - 05.03.2016, 12:54

Forum Jump:


Users browsing this thread: 1 Guest(s)