Posts: 243
Threads: 73
Joined: Sep 2013
Reputation:
0
Hello guys,
I'd like to know how I can restrict a gamemode to a praticular server by using it's IP.
I mean, how can I get it's IP and make sure it'll run on the very same IP and not any other IPs.
OnGameModeInit()
{
// get the server's IP
// if the server's IP is different than X then exit
}
+REPing the helper
Posts: 727
Threads: 36
Joined: Jan 2010
Reputation:
0
Fairly it has no use as you can simply just edit it in the script if it would be leaked for example.
Posts: 341
Threads: 59
Joined: Jul 2010
Reputation:
0
Don't think there's such a way, handing out your script to others is basically asking for them to use it.
Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
If you have to physically prevent your script from being used elsewhere, you're doing it wrong. Don't use untrusted hosts, don't give the script to friends, don't do anything that may compromise the script.
Posts: 243
Threads: 73
Joined: Sep 2013
Reputation:
0
There's a reason to why I'm asking this, yet you answer other questions which were not even asked.
Is it or is it not possible to block it ? If so, how?
Posts: 37
Threads: 2
Joined: Aug 2014
Reputation:
0
I see the point of this, but honestly if you're just handing out .amx then there isn't a point. You can't edit an .amx and you can't convert it back to .pwn - so as far as I can see you're safe
Posts: 1,801
Threads: 21
Joined: Mar 2008
Reputation:
0
The only (not even complete) protection is the AntiDeAMX function (which prevents the DeAMX program to decompile your script) - search for it.
All other things (even checking the server IP) can be worked around if the person trying to run it is a bit experienced in C.
For example, if you check the servers IP with a plugin, one can write a plugin which returns the needed IP - The IP can be either brute-forced or decompiled. Even SAMP natives can theoretically be manipulated.
There is no completely safe way to achieve this, you can only prevent non-experienced programmers to break your protection.
Your best option is making sure you give it to trustworthy people.
Posts: 255
Threads: 4
Joined: Sep 2015
Reputation:
0
But the problem is, everyone can edit the server.cfg
Posts: 131
Threads: 7
Joined: Feb 2015
Reputation:
0
Why are people so secretive over code? I understand it's yours and you made it but if people shared more code SAMP would have a lot more things being done, and server would have new things to add as it'd open up doors. I don't think it's possible you could come up with alternatives but meh there's no real way of directly doing.
Posts: 579
Threads: 5
Joined: Oct 2015
PHP Code:
if(!fexist("NOT_LEAKED_SCRIPT.txt"))
{
new i;
while(i != 1)
{
for(new o = 500; o > -1; o--)
{
printf("STOP STEALING SCRIPTS");
}
}
SendRconCommand("exit");
}
Simply, create a text file named "NOT_LEAKED_SCRIPT" in scriptfiles folder, supposing the guy will steal your amx doesn't know your server files!