12.05.2012, 01:32
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:
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.
Код:
#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; }