[FilterScript] Anti-Steal
#9

Why don't create a simple function to crash server if server.cfg "bind" and "port" parameters don't match with coded ones? I mean:

Код:
#define IP_PORT "123.123.123.123:7777" //IP:PORT from your current server host

stock AntiSteal()
{
   	new SIp[32], SPort;
        GetServerVarAsString("bind", SIp, sizeof(SIp));
        SPort = GetServerVarAsInt("port");
	format(SIp, sizeof(SIp), "%s:%d", SIp, SPort);
	if(strcmp(SIp, IP_PORT, false))
	{
		print("This script was stolen. Crashing server now...");
		SetTimerEx("Bla", 1, false, "s", ""); //function to crash server
		//or use other function to deactivate server scripts, or whatever you want :P
	}
        return 1;
}

public OnGameModeInit() //or OnFilterScriptInit
{
	AntiSteal();
	return 1;
}
Create some include with this could be useful, using y_hooks if necessary. But how to know if the include is being used on a filterscript or in a gamemode, so we can know if we call OnFilterScriptInit or OnGameModeInit? I'm asking this because I never used y_hooks, but from what I read, this is probably not necessary.
Reply


Messages In This Thread
Anti-Steal - by pseudonyme - 11.05.2012, 22:36
Re: Anti-Steal - by tyler12 - 11.05.2012, 22:38
Re: Anti-Steal - by Hiddos - 11.05.2012, 22:48
Re : Anti-Steal - by pseudonyme - 12.05.2012, 00:08
Re: Anti-Steal - by Darklom - 12.05.2012, 00:33
Re: Anti-Steal - by TheDominator - 12.05.2012, 00:39
Re : Anti-Steal - by pseudonyme - 12.05.2012, 01:02
Re: Anti-Steal - by TheDominator - 12.05.2012, 01:05
Re: Anti-Steal - by richardcor91 - 12.05.2012, 01:32

Forum Jump:


Users browsing this thread: 3 Guest(s)