Advertisement
Guest User

anti_theft.inc

a guest
May 12th, 2012
652
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. //FS/GM Anti Theft Include by Riccor
  2.  
  3. #if defined _Anti_Theft_included
  4. #endinput
  5. #endif
  6. #define _Anti_Theft_included
  7.  
  8. #include <a_samp>
  9. #include <YSI\y_hooks> //by Y_Less: http://forum.sa-mp.com/showthread.php?t=166016
  10.  
  11. #define IP_PORT "127.0.0.1:7777" //change this to your server host ip and port before compile your scripts with this include.
  12.  
  13. stock AntiTheft()
  14. {
  15. new SIp[32], SPort;
  16. GetServerVarAsString("bind", SIp, sizeof(SIp));
  17. SPort = GetServerVarAsInt("port");
  18. format(SIp, sizeof(SIp), "%s:%d", SIp, SPort);
  19. if(strcmp(SIp, IP_PORT, false))
  20. {
  21. print("This script was stolen. Crashing server now...");
  22. SetTimerEx("Bla", 1, false, "s", ""); //function to crash server
  23. }
  24. return 1;
  25. }
  26.  
  27. hook OnGameModeInit()
  28. {
  29. AntiTheft();
  30. return 1;
  31. }
  32.  
  33. hook OnFilterScriptInit()
  34. {
  35. AntiTheft();
  36. return 1;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement