Advertisement
Guest User

Nex-AC

a guest
Jul 1st, 2015
820
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 147.34 KB | None | 0 0
  1. //Nex-AC by Nexius v1.0 (0.3.7-R1)
  2.  
  3. #if defined _nex_ac_included
  4.     #endinput
  5. #endif
  6. #define _nex_ac_included
  7.  
  8. #include <a_samp>
  9.  
  10. #if !defined FILTERSCRIPT
  11.  
  12. #define DEBUG
  13.  
  14. #include <nex-ac_ru.lang>   //Localization
  15.  
  16. #if !defined _nex_ac_lang_included
  17.     #error Anticheat Nex-AC requires the installation of localization!
  18. #endif
  19.  
  20. #define NEX_AC_VERSION              "1.0"
  21. #define SERVER_VERSION              "0.3.7"
  22.  
  23. #define CONFIG_FILE                 "nex-ac_settings.cfg"
  24. #define MAX_CLASSES                 319
  25. #define DEFAULT_COLOR               -1
  26.  
  27. #define USE_VENDING_MACHINES        true
  28. #define USE_TUNING_GARAGES          true
  29. #define USE_AMMUNATIONS             true
  30. #define USE_RESTAURANTS             true
  31. #define USE_PAYNSPRAY               true
  32. #define USE_CASINOS                 true
  33.  
  34. #define MAX_CONNECTS_FROM_IP        1
  35. #define MAX_RCON_LOGIN_ATTEMPT      1
  36. #define MAX_MSGS_REC_DIFF           799
  37. #define MAX_PING                    500
  38. #define MIN_TIME_RECONNECT          12      //In seconds
  39.  
  40. #define MAX_NOP_WARNINGS            1
  41. #define MAX_PING_WARNINGS           1
  42. #define MAX_AIR_WARNINGS            2
  43. #define MAX_AIR_VEH_WARNINGS        2
  44. #define MAX_FLYHACK_VEH_WARNINGS    2
  45. #define MAX_CARSHOT_WARNINGS        3
  46. #define MAX_PRO_AIM_WARNINGS        1
  47. #define MAX_AFK_GHOST_WARNINGS      2
  48. #define MAX_RAPID_FIRE_WARNINGS     1
  49.  
  50. #define fpublic:%0(%1) forward %0(%1); public %0(%1)
  51. #define abs(%1) (((%1) < 0) ? (-(%1)) : ((%1)))
  52.  
  53. static bool:ACAllow[] =
  54. {
  55.     true,   //0 Anti-AirBreak (onfoot)
  56.     true,   //1 Anti-AirBreak (in vehicle)
  57.     true,   //2 Anti-teleport hack (onfoot)
  58.     true,   //3 Anti-teleport hack (in vehicle)
  59.     true,   //4 Anti-teleport hack (into/between vehicles)
  60.     true,   //5 Anti-teleport hack (vehicle to player)
  61.     true,   //6 Anti-teleport hack (pickups)
  62.     true,   //7 Anti-FlyHack (onfoot)
  63.     true,   //8 Anti-FlyHack (in vehicle)
  64.     true,   //9 Anti-SpeedHack (onfoot)
  65.     true,   //10 Anti-SpeedHack (in vehicle)
  66.     true,   //11 Anti-Health hack (in vehicle)
  67.     true,   //12 Anti-Health hack (onfoot)
  68.     true,   //13 Anti-Armour hack
  69.     true,   //14 Anti-Money hack
  70.     true,   //15 Anti-Weapon hack
  71.     true,   //16 Anti-Ammo hack (add)
  72.     true,   //17 Anti-Ammo hack (infinite)
  73.     true,   //18 Anti-Special actions hack
  74.     true,   //19 Anti-GodMode from bullets (onfoot)
  75.     true,   //20 Anti-GodMode from bullets (in vehicle)
  76.     true,   //21 Anti-Invisible hack
  77.     true,   //22 Anti-lagcomp-spoof
  78.     true,   //23 Anti-Tuning hack
  79.     true,   //24 Anti-Parkour mod
  80.     true,   //25 Anti-Quick turn
  81.     true,   //26 Anti-Rapid fire
  82.     true,   //27 Anti-FakeSpawn
  83.     true,   //28 Anti-FakeKill
  84.     true,   //29 Anti-Pro Aim
  85.     true,   //30 Anti-CJ run
  86.     true,   //31 Anti-CarShot
  87.     true,   //32 Anti-CarJack
  88.     true,   //33 Anti-UnFreeze
  89.     true,   //34 Anti-AFK Ghost
  90.     true,   //35 Anti-Full Aiming
  91.  
  92.     true,   //36 Anti-Fake NPC
  93.     true,   //37 Anti-Reconnect
  94.     true,   //38 Anti-High ping
  95.     true,   //39 Anti-Dialog hack
  96.     true,   //40 Protection from the sandbox
  97.     true,   //41 Protection against an invalid version
  98.     true,   //42 Anti-Rcon hack
  99.  
  100.     true,   //43 Anti-Tuning crasher
  101.     true,   //44 Anti-Invalid seat crasher
  102.     true,   //45 Anti-Dialog crasher
  103.     true,   //46 Anti-Attached object crasher
  104.     true,   //47 Anti-Weapon Crasher
  105.  
  106.     true,   //48 Flood protection connects to one slot
  107.     true,   //49 Anti-flood callback functions
  108.     true,   //50 Anti-flood change seat
  109.  
  110.     true,   //51 Anti-Ddos
  111.  
  112.     true    //52 Anti-NOP's
  113. };
  114.  
  115. static const Mtfc[][] =
  116. {
  117.     {250, 3},   //0 OnDialogResponse
  118.     {800, 2},   //1 OnEnterExitModShop
  119.     {250, 3},   //2 OnPlayerClickMap
  120.     {450, 2},   //3 OnPlayerClickPlayer
  121.     {150, 3},   //4 OnPlayerClickTextDraw
  122.     {400, 3},   //5 OnPlayerCommandText
  123.     {150, 3},   //6 OnPlayerEnterVehicle
  124.     {150, 3},   //7 OnPlayerExitVehicle
  125.     {800, 2},   //8 OnPlayerPickUpPickup
  126.     {150, 3},   //9 OnPlayerRequestClass
  127.     {250, 3},   //10 OnPlayerSelectedMenuRow
  128.     {600, 3},   //11 OnPlayerStateChange
  129.     {530, 2},   //12 OnVehicleMod
  130.     {530, 2},   //13 OnVehiclePaintjob
  131.     {530, 2},   //14 OnVehicleRespray
  132.     {300, 1},   //15 OnVehicleDeath
  133.     {450, 2},   //16 OnPlayerText
  134.     {500, 2},   //17 OnPlayerEnterCheckpoint
  135.     {500, 2},   //18 OnPlayerLeaveCheckpoint
  136.     {150, 3},   //19 OnPlayerRequestSpawn
  137.     {250, 3},   //20 OnPlayerExitedMenu
  138.     {500, 2},   //21 OnPlayerEnterRaceCheckpoint
  139.     {500, 2},   //22 OnPlayerLeaveRaceCheckpoint
  140.     {150, 3},   //23 OnPlayerClickPlayerTextDraw
  141.     {51, 9},    //24 OnVehicleDamageStatusUpdate
  142.     {180, 3},   //25 OnVehicleSirenStateChange
  143.     {150, 3},   //26 OnPlayerSelectObject
  144.     {150, 3}    //27 Cross-public
  145. },
  146.  
  147. MaxPassengers[] =
  148. {
  149.     0x10331113, 0x11311131, 0x11331313, 0x80133301, 0x1381F110,
  150.     0x10311103, 0x10001F10, 0x11113311, 0x13113311,0x31101100,
  151.     0x30001301, 0x11031311, 0x11111331, 0x10013111, 0x01131100,
  152.     0x11111110, 0x11100031, 0x11130221, 0x33113311, 0x11111101,
  153.     0x33101133, 0x101001F0, 0x03133111, 0xFF11113F, 0x13330111,
  154.     0xFF131111, 0x0000FF3F
  155. },
  156.  
  157. VehicleMods[] =
  158. {
  159.     0x033C2700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  160.     0x021A27FA, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  161.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  162.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  163.     0x023B2785, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  164.     0x02BC4703, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  165.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  166.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  167.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  168.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  169.     0x03BA278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  170.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  171.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  172.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  173.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  174.     0x028E078A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  175.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  176.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  177.     0x02310744, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  178.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  179.     0x0228073A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  180.     0x02BD4701, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  181.     0x023A2780, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  182.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  183.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  184.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  185.     0x0228077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  186.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  187.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  188.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  189.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  190.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  191.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  192.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  193.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  194.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  195.     0x027A27CA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  196.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  197.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  198.     0x0282278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  199.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  200.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  201.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  202.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  203.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  204.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  205.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  206.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  207.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  208.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  209.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  210.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  211.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  212.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  213.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  214.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  215.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  216.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  217.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  218.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  219.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  220.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  221.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  222.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  223.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  224.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  225.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  226.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  227.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  228.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  229.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  230.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  231.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  232.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  233.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  234.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  235.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  236.     0x023E07C0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  237.     0x03703730, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  238.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  239.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  240.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  241.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  242.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  243.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  244.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  245.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  246.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  247.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  248.     0x031D2775, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  249.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  250.     0x02BE4788, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  251.     0x02010771, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  252.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  253.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  254.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  255.     0x029A0FCE, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000,
  256.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  257.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  258.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  259.     0x03382700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  260.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  261.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  262.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  263.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  264.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  265.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  266.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  267.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  268.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  269.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  270.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  271.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  272.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  273.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  274.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  275.     0x023F8795, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  276.     0x029F078C, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  277.     0x029627EA, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  278.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  279.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  280.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  281.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  282.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  283.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  284.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  285.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  286.     0x0236C782, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  287.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  288.     0x029E1FCA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  289.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  290.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  291.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  292.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  293.     0x02000700, 0x00000000, 0x00FFFE00, 0xFC000437, 0x00000000, 0x021C0000,
  294.     0x02000700, 0x00000000, 0x00FFFE00, 0x03FE6007, 0x00000000, 0x00000000,
  295.     0x02000700, 0x00000000, 0x00FFFE00, 0x00001B87, 0x00000001, 0x01E00000,
  296.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  297.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  298.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  299.     0x039E07D2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  300.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  301.     0x023CC700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000,
  302.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  303.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  304.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  305.     0x038E07D6, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  306.     0x023D0709, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000,
  307.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  308.     0x029E1F8A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  309.     0x029C077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  310.     0x02BD076C, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  311.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  312.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  313.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  314.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  315.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  316.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  317.     0x02000700, 0x00000000, 0xFFFFFE00, 0x00000007, 0x00000000, 0x000001F8,
  318.     0x02000700, 0x00000000, 0x00FFFFFE, 0x00000007, 0xC0000000, 0x00002007,
  319.     0xFE000700, 0x00000003, 0x00FFFE00, 0x00000007, 0x00003C00, 0x00000600,
  320.     0xCE000700, 0xFF800000, 0x00FFFE01, 0x00000007, 0x3C000000, 0x00000000,
  321.     0x02000700, 0x000003FC, 0x00FFFE00, 0x00000007, 0x003C0000, 0x00001800,
  322.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  323.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  324.     0x02000700, 0x007FE000, 0x00FFFE00, 0x00000007, 0x03C00000, 0x00000000,
  325.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  326.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000047, 0x0000003E, 0x3C000000,
  327.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  328.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  329.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  330.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  331.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  332.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  333.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  334.     0x02000700, 0x00001C00, 0x00FFFE00, 0x0000000F, 0x00000000, 0x0003C000,
  335.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x000003C0, 0xC0000000,
  336.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  337.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  338.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  339.     0x029607C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  340.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  341.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  342.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  343.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  344.     0x03FFE7CD, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  345.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  346.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  347.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  348.     0x031727F1, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000,
  349.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  350.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  351.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  352.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  353.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  354.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  355.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  356.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  357.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  358.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  359.     0x025627F0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  360.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  361.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  362.     0x039E07C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  363.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  364.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  365.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  366.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  367.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  368.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  369.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  370.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000
  371. },
  372.  
  373. #if USE_AMMUNATIONS
  374.     AmmuNationInfo[][] =
  375.     {
  376.         {200, 30}//22 9mm
  377.         {600, 30}//23 Silenced 9mm
  378.         {1200, 10}, //24 Desert Eagle
  379.         {600, 15}//25 Shotgun
  380.         {800, 12}//26 Sawnoff Shotgun
  381.         {1000, 10}, //27 Combat Shotgun
  382.         {500, 60}//28 Micro SMG/Uzi
  383.         {2000, 90}, //29 MP5
  384.         {3500, 120},//30 AK-47
  385.         {4500, 90}, //31 M4
  386.         {300, 60}   //32 Tec-9
  387.     },
  388.  
  389.     Float:AmmuNations[][] =
  390.     {
  391.         {296.5541, -38.5138, 1001.5156},
  392.         {295.7008, -80.8109, 1001.5156},
  393.         {290.1963, -109.7721, 1001.5156},
  394.         {312.2592, -166.1385, 999.601}
  395.     },
  396. #endif
  397.  
  398. #if USE_RESTAURANTS
  399.     Float:Restaurants[][] =
  400.     {
  401.         {374.0, -119.641, 1001.4922},
  402.         {368.789, -6.857, 1001.8516},
  403.         {375.566, -68.222, 1001.5151}
  404.     },
  405. #endif
  406.  
  407. #if USE_PAYNSPRAY
  408.     Float:PayNSpray[][] =
  409.     {
  410.         {2064.2842, -1831.4736, 13.5469},
  411.         {-2425.7822, 1022.1392, 50.3977},
  412.         {-1420.5195, 2584.2305, 55.8433},
  413.         {487.6401, -1739.9479, 11.1385},
  414.         {1024.8651, -1024.087, 32.1016},
  415.         {-1904.7019, 284.5968, 41.0469},
  416.         {1975.2384, 2162.5088, 11.0703},
  417.         {2393.4456, 1491.5537, 10.5616},
  418.         {720.0854, -457.8807, 16.3359},
  419.         {-99.9417, 1117.9048, 19.7417}
  420.     },
  421. #endif
  422.  
  423. #if USE_VENDING_MACHINES
  424.     Float:VendingMachines[][] =
  425.     {
  426.         {-862.82, 1536.6, 21.98},
  427.         {2271.72, -76.46, 25.96},
  428.         {1277.83, 372.51, 18.95},
  429.         {662.42, -552.16, 15.71},
  430.         {201.01, -107.61, 0.89},
  431.         {-253.74, 2597.95, 62.24},
  432.         {-253.74, 2599.75, 62.24},
  433.         {-76.03, 1227.99, 19.12},
  434.         {-14.7, 1175.35, 18.95},
  435.         {-1455.11, 2591.66, 55.23},
  436.         {2352.17, -1357.15, 23.77},
  437.         {2325.97, -1645.13, 14.21},
  438.         {2139.51, -1161.48, 23.35},
  439.         {2153.23, -1016.14, 62.23},
  440.         {1928.73, -1772.44, 12.94},
  441.         {1154.72, -1460.89, 15.15},
  442.         {2480.85, -1959.27, 12.96},
  443.         {2060.11, -1897.64, 12.92},
  444.         {1729.78, -1943.04, 12.94},
  445.         {1634.1, -2237.53, 12.89},
  446.         {1789.21, -1369.26, 15.16},
  447.         {-2229.18, 286.41, 34.7},
  448.         {2319.99, 2532.85, 10.21},
  449.         {2845.72, 1295.04, 10.78},
  450.         {2503.14, 1243.69, 10.21},
  451.         {2647.69, 1129.66, 10.21},
  452.         {-2420.21, 984.57, 44.29},
  453.         {-2420.17, 985.94, 44.29},
  454.         {2085.77, 2071.35, 10.45},
  455.         {1398.84, 2222.6, 10.42},
  456.         {1659.46, 1722.85, 10.21},
  457.         {1520.14, 1055.26, 10.0},
  458.         {-1980.78, 142.66, 27.07},
  459.         {-2118.96, -423.64, 34.72},
  460.         {-2118.61, -422.41, 34.72},
  461.         {-2097.27, -398.33, 34.72},
  462.         {-2092.08, -490.05, 34.72},
  463.         {-2063.27, -490.05, 34.72},
  464.         {-2005.64, -490.05, 34.72},
  465.         {-2034.46, -490.05, 34.72},
  466.         {-2068.56, -398.33, 34.72},
  467.         {-2039.85, -398.33, 34.72},
  468.         {-2011.14, -398.33, 34.72},
  469.         {-1350.11, 492.28, 10.58},
  470.         {-1350.11, 493.85, 10.58},
  471.         {2222.36, 1602.64, 1000.06},
  472.         {2222.2, 1606.77, 1000.05},
  473.         {2155.9, 1606.77, 1000.05},
  474.         {2155.84, 1607.87, 1000.06},
  475.         {2209.9, 1607.19, 1000.05},
  476.         {2202.45, 1617.0, 1000.06},
  477.         {2209.24, 1621.21, 1000.06},
  478.         {2576.7, -1284.43, 1061.09},
  479.         {330.67, 178.5, 1020.07},
  480.         {331.92, 178.5, 1020.07},
  481.         {350.9, 206.08, 1008.47},
  482.         {361.56, 158.61, 1008.47},
  483.         {371.59, 178.45, 1020.07},
  484.         {374.89, 188.97, 1008.47},
  485.         {-19.03, -57.83, 1003.63},
  486.         {-36.14, -57.87, 1003.63},
  487.         {316.87, -140.35, 998.58},
  488.         {2225.2, -1153.42, 1025.9},
  489.         {-15.1, -140.22, 1003.63},
  490.         {-16.53, -140.29, 1003.63},
  491.         {-35.72, -140.22, 1003.63},
  492.         {373.82, -178.14, 1000.73},
  493.         {379.03, -178.88, 1000.73},
  494.         {495.96, -24.32, 1000.73},
  495.         {500.56, -1.36, 1000.73},
  496.         {501.82, -1.42, 1000.73},
  497.         {-33.87, -186.76, 1003.63},
  498.         {-32.44, -186.69, 1003.63},
  499.         {-16.11, -91.64, 1003.63},
  500.         {-17.54, -91.71, 1003.63}
  501.     },
  502. #endif
  503.  
  504. #if USE_CASINOS
  505.     Float:Casinos[][] =
  506.     {
  507.         {2241.2878, 1617.1624, 1006.1797, 2.0},
  508.         {2240.9736, 1604.6592, 1006.1797, 6.0},
  509.         {2242.5427, 1592.8726, 1006.1836, 6.0},
  510.         {2230.2124, 1592.1426, 1006.1832, 6.0},
  511.         {2230.4717, 1604.484, 1006.186, 6.0},
  512.         {2230.3298, 1616.9272, 1006.1799, 3.0},
  513.         {2251.9407, 1586.1736, 1006.186, 1.0},
  514.         {2218.6785, 1587.3448, 1006.1749, 1.0},
  515.         {2219.2773, 1591.7467, 1006.1867, 1.0},
  516.         {2218.5408, 1589.3229, 1006.184, 1.0},
  517.         {2218.6477, 1593.6279, 1006.1797, 1.0},
  518.         {2221.926, 1603.8285, 1006.1797, 1.0},
  519.         {2218.5095, 1603.8385, 1006.1797, 1.0},
  520.         {2219.9597, 1603.9216, 1006.1797, 1.0},
  521.         {2216.3054, 1603.7996, 1006.1819, 1.0},
  522.         {2218.731, 1619.8046, 1006.1794, 1.0},
  523.         {2218.9407, 1617.8413, 1006.1821, 1.0},
  524.         {2218.668, 1615.4681, 1006.1797, 1.0},
  525.         {2218.6418, 1613.2629, 1006.1797, 1.0},
  526.         {2252.4272, 1589.8412, 1006.1797, 5.0},
  527.         {2252.4229, 1596.6169, 1006.1797, 5.0},
  528.         {2255.1565, 1608.8784, 1006.186, 1.0},
  529.         {2254.8496, 1610.8605, 1006.1797, 1.0},
  530.         {2255.2917, 1612.9167, 1006.1797, 1.0},
  531.         {2255.033, 1614.8892, 1006.1797, 1.0},
  532.         {2255.1213, 1616.8284, 1006.1797, 1.0},
  533.         {2255.2161, 1618.8005, 1006.1797, 1.0},
  534.         {2268.5281, 1606.4894, 1006.1797, 1.0},
  535.         {2270.4922, 1606.8539, 1006.1797, 1.0},
  536.         {2272.5693, 1606.4473, 1006.1797, 1.0},
  537.         {2274.5391, 1607.0122, 1006.1797, 1.0},
  538.         {2271.8447, 1586.1633, 1006.1797, 1.0},
  539.         {2261.4844, 1586.1724, 1006.1797, 1.0},
  540.         {2257.4507, 1589.6555, 1006.1797, 5.0},
  541.         {2267.8994, 1589.8672, 1006.1797, 5.0},
  542.         {2262.8486, 1590.026, 1006.1797, 5.0},
  543.         {2272.6458, 1589.7704, 1006.1797, 5.0},
  544.         {2272.6533, 1596.5682, 1006.1797, 5.0},
  545.         {2270.4895, 1596.4606, 1006.1797, 5.0},
  546.         {2265.4441, 1596.4299, 1006.1797, 5.0},
  547.         {2260.0308, 1596.7987, 1006.1797, 5.0},
  548.         {2254.9907, 1596.241, 1006.1797, 5.0},
  549.         {1956.9524, 988.2533, 992.4688, 2.0},
  550.         {1961.6155, 993.0375, 992.4688, 2.0},
  551.         {1963.7998, 998.4406, 992.4745, 2.0},
  552.         {1936.2885, 987.1995, 992.4745, 2.0},
  553.         {1944.9768, 986.3937, 992.4688, 2.0},
  554.         {1940.7397, 990.9521, 992.4609, 2.0},
  555.         {1940.0966, 1005.8996, 992.4688, 6.0},
  556.         {1938.8785, 1014.1768, 992.4688, 6.0},
  557.         {1938.8811, 1021.4434, 992.4688, 6.0},
  558.         {1966.5975, 1006.6469, 992.4745, 6.0},
  559.         {1966.5979, 1014.1024, 992.4688, 6.0},
  560.         {1939.8351, 1029.912, 992.4688, 6.0},
  561.         {1956.854, 1047.3718, 992.4688, 6.0},
  562.         {1961.356, 1042.8112, 992.4688, 6.0},
  563.         {1963.811, 1037.1263, 992.4745, 6.0},
  564.         {1961.733, 1025.8929, 992.4688, 10.0},
  565.         {1961.708, 1010.3194, 992.4688, 10.0},
  566.         {1966.5989, 1029.7954, 992.4745, 6.0},
  567.         {1961.4139, 1017.8281, 992.4688, 10.0},
  568.         {1966.5985, 1021.7686, 992.4688, 6.0},
  569.         {1128.7106, -1.9779, 1000.6797, 1.0},
  570.         {1125.2388, 1.61, 1000.6797, 1.0},
  571.         {1125.1249, -5.0489, 1000.6797, 1.0},
  572.         {1127.4139, 3.0199, 1000.6797, 1.0},
  573.         {1135.0634, -3.8695, 1000.6797, 1.0},
  574.         {1135.0861, 0.6107, 1000.6797, 1.0},
  575.         {1132.8943, -1.7139, 1000.6797, 1.0},
  576.         {1125.3727, 3.0315, 1000.6797, 1.0},
  577.         {1119.0272, -1.4916, 1000.6924, 1.0}
  578.     },
  579. #endif
  580.  
  581. PickupAmmo[] =
  582. {
  583.     1,      //0 Fist
  584.     1,      //1 Brass Knuckles
  585.     1,      //2 Golf Club
  586.     1,      //3 Nightstick
  587.     1,      //4 Knife
  588.     1,      //5 Baseball Bat
  589.     1,      //6 Shovel
  590.     1,      //7 Pool Cue
  591.     1,      //8 Katana
  592.     1,      //9 Chainsaw
  593.     1,      //10 Purple Dildo
  594.     1,      //11 Dildo
  595.     1,      //12 Vibrator
  596.     1,      //13 Silver Vibrator
  597.     1,      //14 Flowers
  598.     1,      //15 Cane
  599.     8,      //16 Grenade
  600.     8,      //17 Tear Gas
  601.     8,      //18 Molotov Cocktail
  602.     0,      //19
  603.     0,      //20
  604.     0,      //21
  605.     30,     //22 9mm
  606.     10,     //23 Silenced 9mm
  607.     10,     //24 Desert Eagle
  608.     15,     //25 Shotgun
  609.     10,     //26 Sawnoff Shotgun
  610.     10,     //27 Combat Shotgun
  611.     60,     //28 Micro SMG/Uzi
  612.     60,     //29 MP5
  613.     80,     //30 AK-47
  614.     80,     //31 M4
  615.     60,     //32 Tec-9
  616.     20,     //33 Country Rifle
  617.     10,     //34 Sniper Rifle
  618.     4,      //35 RPG
  619.     3,      //36 HS Rocket
  620.     100,    //37 Flamethrower
  621.     100,    //38 Minigun
  622.     5,      //39 Satchel Charge
  623.     1,      //40 Detonator
  624.     500,    //41 Spraycan
  625.     200,    //42 Fire Extinguisher
  626.     32,     //43 Camera
  627.     1,      //44 Night Vis Goggles
  628.     1,      //45 Thermal Goggles
  629.     1       //46 Parachute
  630. };
  631.  
  632. enum ACInfo
  633. {
  634.     Float:pPos[3],
  635.     Float:pDropJP[3],
  636.     Float:pSetPos[3],
  637.     Float:pSetVehHealth,
  638.     Float:pSpeed,
  639.     pHealth,
  640.     pArmour,
  641.     pMoney,
  642.     pClassid,
  643.     pLastWeapon,
  644.     pEnterVeh,
  645.     pEnterVehTime,
  646.     pVeh,
  647.     pSeat,
  648.     pDialog,
  649.     pAnim,
  650.     pSpecAct,
  651.     pNextSpecAct,
  652.     pLastSpecAct,
  653.     pShotTime,
  654.     pSpawnTime,
  655.     pLastUpdate,
  656.     pTimerID,
  657.     pKicked,
  658.     pIp[16],
  659.     pSet[12],
  660.     pGtc[17],
  661.     pWeapon[13],
  662.     pAmmo[13],
  663.     pSetWeapon[13],
  664.     pGiveAmmo[13],
  665.     pSpawnWeapon[3],
  666.     pSpawnAmmo[3],
  667.     pGtcSetWeapon[13],
  668.     pGtcGiveAmmo[13],
  669.     pNOPCount[11],
  670.     pCheatCount[12],
  671.     pCall[sizeof Mtfc],
  672.     pFloodCount[sizeof Mtfc],
  673.     bool:pACAllow[sizeof ACAllow],
  674.     bool:pStuntBonus,
  675.     bool:pModShop,
  676.     bool:pFreeze,
  677.     bool:pOnline,
  678.     bool:pSpawnRes,
  679.     bool:pDeathRes,
  680.     bool:pVehDmgRes,
  681.     bool:pDmgRes,
  682.     bool:pDead,
  683.     bool:pShot,
  684.     bool:pTpToZ,
  685.     bool:pParachute,
  686.     bool:pIntEnterExits
  687. }
  688.  
  689. enum ACVehInfo
  690. {
  691.     Float:vVel[3],
  692.     Float:vSpeedDiff,
  693.     Float:vPosDiff,
  694.     Float:vZAngle,
  695.     Float:vHealth,
  696.     vDriver,
  697.     vInt,
  698.     vPaintJob,
  699.     bool:vSpawned
  700. }
  701.  
  702. enum ACPickInfo
  703. {
  704.     Float:pPos[3],
  705.     pType,
  706.     pWeapon,
  707.     bool:pIsStatic
  708. }
  709.  
  710. static
  711.     StatsInfo[6],
  712.     Class[MAX_CLASSES][3][2],
  713.     AntiCheatInfo[MAX_PLAYERS][ACInfo],
  714.     AntiCheatVehInfo[MAX_VEHICLES][ACVehInfo],
  715.     AntiCheatPickInfo[MAX_PICKUPS][ACPickInfo],
  716.     bool:IntEnterExits = true,
  717.     bool:StuntBonus = true,
  718.     bool:VehFriendlyFire,
  719.     bool:LagCompMode,
  720.     bool:PedAnims;
  721.  
  722. fpublic: ac_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
  723. {
  724.     new vehicleid = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
  725.     if(vehicleid != 65535)
  726.     {
  727.         AntiCheatVehInfo[vehicleid][vInt] = 0;
  728.         AntiCheatVehInfo[vehicleid][vPaintJob] = 3;
  729.         AntiCheatVehInfo[vehicleid][vPosDiff] = 0.0;
  730.         AntiCheatVehInfo[vehicleid][vSpawned] = true;
  731.         AntiCheatVehInfo[vehicleid][vSpeedDiff] = 0.0;
  732.         AntiCheatVehInfo[vehicleid][vHealth] = 1000.0;
  733.         for(new i = 2; i != -1; --i) AntiCheatVehInfo[vehicleid][vVel][i] = 0.0;
  734.         AntiCheatVehInfo[vehicleid][vDriver] = 65535;
  735.     }
  736.     return vehicleid;
  737. }
  738.  
  739. fpublic: ac_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren)
  740. {
  741.     new vehicleid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren);
  742.     if(vehicleid != 65535)
  743.     {
  744.         AntiCheatVehInfo[vehicleid][vInt] = 0;
  745.         AntiCheatVehInfo[vehicleid][vPaintJob] = 3;
  746.         AntiCheatVehInfo[vehicleid][vPosDiff] = 0.0;
  747.         AntiCheatVehInfo[vehicleid][vSpawned] = true;
  748.         AntiCheatVehInfo[vehicleid][vSpeedDiff] = 0.0;
  749.         AntiCheatVehInfo[vehicleid][vHealth] = 1000.0;
  750.         for(new i = 2; i != -1; --i) AntiCheatVehInfo[vehicleid][vVel][i] = 0.0;
  751.         AntiCheatVehInfo[vehicleid][vDriver] = 65535;
  752.     }
  753.     return vehicleid;
  754. }
  755.  
  756. fpublic: ac_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren)
  757. {
  758.     new vehicleid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay, addsiren);
  759.     if(vehicleid != 65535)
  760.     {
  761.         AntiCheatVehInfo[vehicleid][vInt] = 0;
  762.         AntiCheatVehInfo[vehicleid][vPaintJob] = 3;
  763.         AntiCheatVehInfo[vehicleid][vPosDiff] = 0.0;
  764.         AntiCheatVehInfo[vehicleid][vSpeedDiff] = 0.0;
  765.         AntiCheatVehInfo[vehicleid][vHealth] = 1000.0;
  766.         for(new i = 2; i != -1; --i) AntiCheatVehInfo[vehicleid][vVel][i] = 0.0;
  767.         if(!(568 < vehicletype < 571)) AntiCheatVehInfo[vehicleid][vSpawned] = true;
  768.         AntiCheatVehInfo[vehicleid][vDriver] = 65535;
  769.     }
  770.     return vehicleid;
  771. }
  772.  
  773. fpublic: ac_AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  774. {
  775.     new classid = AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  776.     if(classid < MAX_CLASSES)
  777.     {
  778.         Class[classid][0][0] = weapon1;
  779.         Class[classid][0][1] = weapon1_ammo;
  780.         Class[classid][1][0] = weapon2;
  781.         Class[classid][1][1] = weapon2_ammo;
  782.         Class[classid][2][0] = weapon3;
  783.         Class[classid][2][1] = weapon3_ammo;
  784.     }
  785.     return classid;
  786. }
  787.  
  788. fpublic: ac_AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  789. {
  790.     new classid = AddPlayerClassEx(teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  791.     if(classid < MAX_CLASSES)
  792.     {
  793.         #undef MAX_CLASSES
  794.         Class[classid][0][0] = weapon1;
  795.         Class[classid][0][1] = weapon1_ammo;
  796.         Class[classid][1][0] = weapon2;
  797.         Class[classid][1][1] = weapon2_ammo;
  798.         Class[classid][2][0] = weapon3;
  799.         Class[classid][2][1] = weapon3_ammo;
  800.     }
  801.     return classid;
  802. }
  803.  
  804. fpublic: ac_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  805. {
  806.     if(!SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)) return 0;
  807.     AntiCheatInfo[playerid][pSpawnWeapon][0] = weapon1;
  808.     AntiCheatInfo[playerid][pSpawnAmmo][0] = weapon1_ammo;
  809.     AntiCheatInfo[playerid][pSpawnWeapon][1] = weapon2;
  810.     AntiCheatInfo[playerid][pSpawnAmmo][1] = weapon2_ammo;
  811.     AntiCheatInfo[playerid][pSpawnWeapon][2] = weapon3;
  812.     AntiCheatInfo[playerid][pSpawnAmmo][2] = weapon3_ammo;
  813.     return 1;
  814. }
  815.  
  816. fpublic: ac_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld)
  817. {
  818.     new pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
  819.     if(pickupid == -1) return 0;
  820.     switch(type)
  821.     {
  822.         case 2, 3, 15, 22:
  823.         {
  824.             switch(model)
  825.             {
  826.                 case 370: AntiCheatPickInfo[pickupid][pType] = 2;
  827.                 case 1240: AntiCheatPickInfo[pickupid][pType] = 3;
  828.                 case 1242: AntiCheatPickInfo[pickupid][pType] = 4;
  829.                 case 321..369, 371, 372:
  830.                 {
  831.                     for(new i = 46; i != -1; --i)
  832.                     {
  833.                         if(GetWeaponModel(i) == model)
  834.                         {
  835.                             AntiCheatPickInfo[pickupid][pType] = 1;
  836.                             AntiCheatPickInfo[pickupid][pWeapon] = i;
  837.                             break;
  838.                         }
  839.                     }
  840.                 }
  841.             }
  842.         }
  843.     }
  844.     AntiCheatPickInfo[pickupid][pIsStatic] = true;
  845.     AntiCheatPickInfo[pickupid][pPos][0] = X;
  846.     AntiCheatPickInfo[pickupid][pPos][1] = Y;
  847.     AntiCheatPickInfo[pickupid][pPos][2] = Z;
  848.     return 1;
  849. }
  850.  
  851. fpublic: ac_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld)
  852. {
  853.     new pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
  854.     if(pickupid != -1)
  855.     {
  856.         switch(type)
  857.         {
  858.             case 2, 3, 15, 22:
  859.             {
  860.                 switch(model)
  861.                 {
  862.                     case 370: AntiCheatPickInfo[pickupid][pType] = 2;
  863.                     case 1240: AntiCheatPickInfo[pickupid][pType] = 3;
  864.                     case 1242: AntiCheatPickInfo[pickupid][pType] = 4;
  865.                     case 321..369, 371, 372:
  866.                     {
  867.                         for(new i = 46; i != -1; --i)
  868.                         {
  869.                             if(GetWeaponModel(i) == model)
  870.                             {
  871.                                 AntiCheatPickInfo[pickupid][pType] = 1;
  872.                                 AntiCheatPickInfo[pickupid][pWeapon] = i;
  873.                                 break;
  874.                             }
  875.                         }
  876.                     }
  877.                 }
  878.             }
  879.         }
  880.         AntiCheatPickInfo[pickupid][pIsStatic] = false;
  881.         AntiCheatPickInfo[pickupid][pPos][0] = X;
  882.         AntiCheatPickInfo[pickupid][pPos][1] = Y;
  883.         AntiCheatPickInfo[pickupid][pPos][2] = Z;
  884.     }
  885.     return pickupid;
  886. }
  887.  
  888. fpublic: ac_DestroyVehicle(vehicleid)
  889. {
  890.     if(!DestroyVehicle(vehicleid)) return 0;
  891.     AntiCheatVehInfo[vehicleid][vSpawned] = false;
  892.     return 1;
  893. }
  894.  
  895. fpublic: ac_DestroyPickup(pickup)
  896. {
  897.     if(!DestroyPickup(pickup)) return 0;
  898.     AntiCheatPickInfo[pickup][pType] = 0;
  899.     return 1;
  900. }
  901.  
  902. fpublic: ac_DisableInteriorEnterExits()
  903. {
  904.     IntEnterExits = false;
  905.     return DisableInteriorEnterExits();
  906. }
  907.  
  908. fpublic: ac_UsePlayerPedAnims()
  909. {
  910.     PedAnims = true;
  911.     return UsePlayerPedAnims();
  912. }
  913.  
  914. fpublic: ac_EnableVehicleFriendlyFire()
  915. {
  916.     VehFriendlyFire = true;
  917.     return EnableVehicleFriendlyFire();
  918. }
  919.  
  920. fpublic: ac_EnableStuntBonusForAll(enable)
  921. {
  922.     StuntBonus = !!enable;
  923.     for(new i = GetPlayerPoolSize(); i != -1; --i)
  924.     {
  925.         if(IsPlayerConnected(i)) AntiCheatInfo[i][pStuntBonus] = StuntBonus;
  926.     }
  927.     return EnableStuntBonusForAll(enable);
  928. }
  929.  
  930. fpublic: ac_EnableStuntBonusForPlayer(playerid, enable)
  931. {
  932.     if(!EnableStuntBonusForPlayer(playerid, enable)) return 0;
  933.     AntiCheatInfo[playerid][pStuntBonus] = !!enable;
  934.     return 1;
  935. }
  936.  
  937. fpublic: ac_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
  938. {
  939.     if(!ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2)) return 0;
  940.     AntiCheatInfo[playerid][pDialog] = dialogid;
  941.     return 1;
  942. }
  943.  
  944. fpublic: ac_TogglePlayerControllable(playerid, toggle)
  945. {
  946.     if(!TogglePlayerControllable(playerid, toggle)) return 0;
  947.     AntiCheatInfo[playerid][pFreeze] = !!toggle;
  948.     return 1;
  949. }
  950.  
  951. fpublic: ac_TogglePlayerSpectating(playerid, toggle)
  952. {
  953.     if(!TogglePlayerSpectating(playerid, toggle)) return 0;
  954.     AntiCheatInfo[playerid][pSet][6] = 1;
  955.     AntiCheatInfo[playerid][pNOPCount][8] = 0;
  956.     AntiCheatInfo[playerid][pGtc][12] = GetTickCount();
  957.     if(!toggle)
  958.     {
  959.         AntiCheatInfo[playerid][pSet][7] = 1;
  960.         AntiCheatInfo[playerid][pNOPCount][9] = 0;
  961.         AntiCheatInfo[playerid][pGtc][13] = AntiCheatInfo[playerid][pGtc][12];
  962.     }
  963.     return 1;
  964. }
  965.  
  966. fpublic: ac_SpawnPlayer(playerid)
  967. {
  968.     if(!SpawnPlayer(playerid)) return 0;
  969.     AntiCheatInfo[playerid][pSet][7] = 1;
  970.     AntiCheatInfo[playerid][pNOPCount][9] = 0;
  971.     AntiCheatInfo[playerid][pGtc][13] = GetTickCount();
  972.     return 1;
  973. }
  974.  
  975. fpublic: ac_SetPlayerHealth(playerid, Float:health)
  976. {
  977.     if(health > 16777250) health = 16777250.0;
  978.     if(!SetPlayerHealth(playerid, health)) return 0;
  979.     if(health < 0.0) health = 0.0;
  980.     AntiCheatInfo[playerid][pNOPCount][3] = 0;
  981.     AntiCheatInfo[playerid][pSet][1] = floatround(health, floatround_tozero);
  982.     AntiCheatInfo[playerid][pGtc][3] = GetTickCount();
  983.     return 1;
  984. }
  985.  
  986. fpublic: ac_SetPlayerArmour(playerid, Float:armour)
  987. {
  988.     if(armour > 16777250) armour = 16777250.0;
  989.     if(!SetPlayerArmour(playerid, armour)) return 0;
  990.     if(armour < 0.0) armour = 0.0;
  991.     AntiCheatInfo[playerid][pNOPCount][5] = 0;
  992.     AntiCheatInfo[playerid][pSet][2] = floatround(armour, floatround_tozero);
  993.     AntiCheatInfo[playerid][pGtc][5] = GetTickCount();
  994.     return 1;
  995. }
  996.  
  997. fpublic: ac_GivePlayerWeapon(playerid, weaponid, ammo)
  998. {
  999.     if(!IsPlayerConnected(playerid)) return 0;
  1000.     new s = GetWeaponSlot(weaponid);
  1001.     if(!(!AntiCheatInfo[playerid][pAmmo][s] && !ammo))
  1002.     {
  1003.         AntiCheatInfo[playerid][pNOPCount][0] = 0;
  1004.         AntiCheatInfo[playerid][pNOPCount][1] = 0;
  1005.         if(15 < weaponid < 44)
  1006.         {
  1007.             if(2 < s < 6 || (AntiCheatInfo[playerid][pSetWeapon][s]
  1008.             == -1 ? AntiCheatInfo[playerid][pWeapon][s]
  1009.             : AntiCheatInfo[playerid][pSetWeapon][s]) == weaponid)
  1010.             {
  1011.                 AntiCheatInfo[playerid][pGiveAmmo][s]
  1012.                 = (AntiCheatInfo[playerid][pGiveAmmo][s] == -65535
  1013.                 ? AntiCheatInfo[playerid][pAmmo][s]
  1014.                 : AntiCheatInfo[playerid][pGiveAmmo][s]) + ammo;
  1015.             }
  1016.             else AntiCheatInfo[playerid][pGiveAmmo][s] = ammo;
  1017.             if(AntiCheatInfo[playerid][pGiveAmmo][s] < -32768) ammo
  1018.             = AntiCheatInfo[playerid][pGiveAmmo][s] = -32768;
  1019.             else if(AntiCheatInfo[playerid][pGiveAmmo][s] > 32767) ammo
  1020.             = AntiCheatInfo[playerid][pGiveAmmo][s] = 32767;
  1021.             if(weaponid == 40 && ammo
  1022.             > 0) AntiCheatInfo[playerid][pGiveAmmo][s] = ammo = 1;
  1023.         }
  1024.         AntiCheatInfo[playerid][pSet][3]
  1025.         = AntiCheatInfo[playerid][pSetWeapon][s] = weaponid;
  1026.     }
  1027.     GivePlayerWeapon(playerid, weaponid, ammo);
  1028.     AntiCheatInfo[playerid][pGtcGiveAmmo][s] = AntiCheatInfo[playerid][pGtcSetWeapon][s]
  1029.     = AntiCheatInfo[playerid][pGtc][2] = GetTickCount();
  1030.     return 1;
  1031. }
  1032.  
  1033. fpublic: ac_SetPlayerAmmo(playerid, weaponslot, ammo)
  1034. {
  1035.     if(!IsPlayerConnected(playerid)) return 0;
  1036.     if(ammo < -32768) ammo = -32768;
  1037.     else if(ammo > 32767) ammo = 32767;
  1038.     if(weaponslot == 40 && ammo) ammo = 1;
  1039.     SetPlayerAmmo(playerid, weaponslot, ammo);
  1040.     if(15 < weaponslot < 44)
  1041.     {
  1042.         new s = GetWeaponSlot(weaponslot);
  1043.         if(AntiCheatInfo[playerid][pWeapon][s])
  1044.         {
  1045.             AntiCheatInfo[playerid][pNOPCount][1] = 0;
  1046.             AntiCheatInfo[playerid][pGiveAmmo][s] = ammo;
  1047.             AntiCheatInfo[playerid][pGtcGiveAmmo][s] = GetTickCount();
  1048.         }
  1049.     }
  1050.     return 1;
  1051. }
  1052.  
  1053. fpublic: ac_SetPlayerArmedWeapon(playerid, weaponid)
  1054. {
  1055.     if(!SetPlayerArmedWeapon(playerid, weaponid)) return 0;
  1056.     if(weaponid == AntiCheatInfo[playerid][pWeapon][GetWeaponSlot(weaponid)])
  1057.     {
  1058.         AntiCheatInfo[playerid][pNOPCount][0] = 0;
  1059.         AntiCheatInfo[playerid][pSet][3] = weaponid;
  1060.         AntiCheatInfo[playerid][pGtc][2] = GetTickCount();
  1061.     }
  1062.     return 1;
  1063. }
  1064.  
  1065. fpublic: ac_ResetPlayerWeapons(playerid)
  1066. {
  1067.     if(!ResetPlayerWeapons(playerid)) return 0;
  1068.     for(new i = 12; i != -1; --i)
  1069.     {
  1070.         AntiCheatInfo[playerid][pWeapon][i] = 0;
  1071.         AntiCheatInfo[playerid][pAmmo][i] = 0;
  1072.         AntiCheatInfo[playerid][pSetWeapon][i] = -1;
  1073.         AntiCheatInfo[playerid][pGiveAmmo][i] = -65535;
  1074.     }
  1075.     AntiCheatInfo[playerid][pSet][3] = 0;
  1076.     AntiCheatInfo[playerid][pGtc][7] = GetTickCount();
  1077.     return 1;
  1078. }
  1079.  
  1080. fpublic: ac_GivePlayerMoney(playerid, money)
  1081. {
  1082.     if(!GivePlayerMoney(playerid, money)) return 0;
  1083.     AntiCheatInfo[playerid][pMoney] += money;
  1084.     return 1;
  1085. }
  1086.  
  1087. fpublic: ac_ResetPlayerMoney(playerid)
  1088. {
  1089.     if(!ResetPlayerMoney(playerid)) return 0;
  1090.     AntiCheatInfo[playerid][pMoney] = 0;
  1091.     return 1;
  1092. }
  1093.  
  1094. fpublic: ac_GetPlayerMoney(playerid) return (IsPlayerConnected(playerid) ? AntiCheatInfo[playerid][pMoney] : 0);
  1095.  
  1096. fpublic: ac_SetPlayerSpecialAction(playerid, actionid)
  1097. {
  1098.     if(!SetPlayerSpecialAction(playerid, actionid)) return 0;
  1099.     if(actionid == 2 || actionid == 68 || 4 < actionid < 9
  1100.     || 9 < actionid < 12 || 19 < actionid < 26 || !actionid
  1101.     && AntiCheatInfo[playerid][pSpecAct] != 10 || actionid
  1102.     == 13 && AntiCheatInfo[playerid][pSpecAct] == 11)
  1103.     {
  1104.         AntiCheatInfo[playerid][pNOPCount][6] = 0;
  1105.         if((actionid == 68 || 9 < actionid < 12 || 19
  1106.         < actionid < 26) && 4 < AntiCheatInfo[playerid][pSpecAct]
  1107.         < 9) AntiCheatInfo[playerid][pNextSpecAct] = actionid;
  1108.         else
  1109.         {
  1110.             if(actionid == 13) actionid = 0;
  1111.             else if(actionid == 2) AntiCheatInfo[playerid][pNextSpecAct]
  1112.             = AntiCheatInfo[playerid][pSpecAct];
  1113.             else AntiCheatInfo[playerid][pNextSpecAct] = -1;
  1114.             AntiCheatInfo[playerid][pSet][4] = actionid;
  1115.             AntiCheatInfo[playerid][pGtc][6] = GetTickCount();
  1116.             if(AntiCheatInfo[playerid][pSpecAct]
  1117.             == 11) AntiCheatInfo[playerid][pGtc][6] += 2500;
  1118.         }
  1119.     }
  1120.     return 1;
  1121. }
  1122.  
  1123. fpublic: ac_SetPlayerInterior(playerid, interiorid)
  1124. {
  1125.     if(!SetPlayerInterior(playerid, interiorid)) return 0;
  1126.     while(interiorid < 0) interiorid += 256;
  1127.     if(interiorid != GetPlayerInterior(playerid))
  1128.     {
  1129.         AntiCheatInfo[playerid][pNOPCount][2] = 0;
  1130.         AntiCheatInfo[playerid][pSet][0] = interiorid;
  1131.         AntiCheatInfo[playerid][pGtc][0] = GetTickCount();
  1132.     }
  1133.     return 1;
  1134. }
  1135.  
  1136. fpublic: ac_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
  1137. {
  1138.     if(!SetPlayerPos(playerid, x, y, z)) return 0;
  1139.     AntiCheatInfo[playerid][pSet][8] = 1;
  1140.     AntiCheatInfo[playerid][pNOPCount][10] = 0;
  1141.     AntiCheatInfo[playerid][pSetPos][0] = AntiCheatInfo[playerid][pPos][0] = x;
  1142.     AntiCheatInfo[playerid][pSetPos][1] = AntiCheatInfo[playerid][pPos][1] = y;
  1143.     AntiCheatInfo[playerid][pSetPos][2] = AntiCheatInfo[playerid][pPos][2] = z;
  1144.     AntiCheatInfo[playerid][pGtc][11] = GetTickCount();
  1145.     return 1;
  1146. }
  1147.  
  1148. fpublic: ac_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z)
  1149. {
  1150.     if(!SetPlayerPosFindZ(playerid, x, y, z)) return 0;
  1151.     AntiCheatInfo[playerid][pSet][8] = 1;
  1152.     AntiCheatInfo[playerid][pTpToZ] = true;
  1153.     AntiCheatInfo[playerid][pNOPCount][10] = 0;
  1154.     AntiCheatInfo[playerid][pSetPos][0] = AntiCheatInfo[playerid][pPos][0] = x;
  1155.     AntiCheatInfo[playerid][pSetPos][1] = AntiCheatInfo[playerid][pPos][1] = y;
  1156.     AntiCheatInfo[playerid][pGtc][11] = GetTickCount();
  1157.     return 1;
  1158. }
  1159.  
  1160. fpublic: ac_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z)
  1161. {
  1162.     if(!SetPlayerVelocity(playerid, X, Y, Z)) return 0;
  1163.     AntiCheatInfo[playerid][pSpeed] = GetSpeed(X, Y, Z);
  1164.     AntiCheatInfo[playerid][pGtc][10] = GetTickCount();
  1165.     return 1;
  1166. }
  1167.  
  1168. fpublic: ac_PutPlayerInVehicle(playerid, vehicleid, seatid)
  1169. {
  1170.     if(!PutPlayerInVehicle(playerid, vehicleid, seatid)) return 0;
  1171.     if(AntiCheatVehInfo[vehicleid][vSpawned])
  1172.     {
  1173.         new model = GetVehicleModel(vehicleid) - 400;
  1174.         AntiCheatInfo[playerid][pNOPCount][7] = 0;
  1175.         AntiCheatInfo[playerid][pSet][9] = vehicleid;
  1176.         if(seatid > MaxPassengers[model >>> 3] >>> ((model
  1177.         & 7) << 2) & 0xF) AntiCheatInfo[playerid][pSet][5] = -1;
  1178.         else AntiCheatInfo[playerid][pSet][5] = seatid;
  1179.         AntiCheatInfo[playerid][pGtc][1] = GetTickCount();
  1180.     }
  1181.     return 1;
  1182. }
  1183.  
  1184. fpublic: ac_RemovePlayerFromVehicle(playerid)
  1185. {
  1186.     if(!RemovePlayerFromVehicle(playerid)) return 0;
  1187.     AntiCheatInfo[playerid][pSet][11] = 1;
  1188.     AntiCheatInfo[playerid][pGtc][8] = GetTickCount();
  1189.     return 1;
  1190. }
  1191.  
  1192. fpublic: ac_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z)
  1193. {
  1194.     if(!SetVehiclePos(vehicleid, x, y, z)) return 0;
  1195.     for(new i = 2; i != -1; --i) AntiCheatVehInfo[vehicleid][vVel][i] = 0.0;
  1196.     if(AntiCheatVehInfo[vehicleid][vDriver] != 65535)
  1197.     {
  1198.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSet][8] = 1;
  1199.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pNOPCount][10] = 0;
  1200.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSetPos][0]
  1201.         = AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pPos][0] = x;
  1202.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSetPos][1]
  1203.         = AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pPos][1] = y;
  1204.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSetPos][2]
  1205.         = AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pPos][2] = z;
  1206.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][11] =
  1207.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][9] = GetTickCount();
  1208.     }
  1209.     return 1;
  1210. }
  1211.  
  1212. fpublic: ac_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  1213. {
  1214.     if(!SetVehicleVelocity(vehicleid, X, Y, Z)) return 0;
  1215.     if(AntiCheatVehInfo[vehicleid][vDriver] != 65535)
  1216.     {
  1217.         AntiCheatVehInfo[vehicleid][vVel][0] = X;
  1218.         AntiCheatVehInfo[vehicleid][vVel][1] = Y;
  1219.         AntiCheatVehInfo[vehicleid][vVel][2] = Z;
  1220.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][9] = GetTickCount();
  1221.     }
  1222.     return 1;
  1223. }
  1224.  
  1225. fpublic: ac_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  1226. {
  1227.     if(!SetVehicleAngularVelocity(vehicleid, X, Y, Z)) return 0;
  1228.     if(AntiCheatVehInfo[vehicleid][vDriver] != 65535)
  1229.     {
  1230.         AntiCheatVehInfo[vehicleid][vVel][0] = X;
  1231.         AntiCheatVehInfo[vehicleid][vVel][1] = Y;
  1232.         AntiCheatVehInfo[vehicleid][vVel][2] = Z;
  1233.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][9] = GetTickCount();
  1234.     }
  1235.     return 1;
  1236. }
  1237.  
  1238. fpublic: ac_ChangeVehiclePaintjob(vehicleid, paintjobid)
  1239. {
  1240.     if(!ChangeVehiclePaintjob(vehicleid, paintjobid)) return 0;
  1241.     AntiCheatVehInfo[vehicleid][vPaintJob] = paintjobid;
  1242.     return 1;
  1243. }
  1244.  
  1245. fpublic: ac_SetVehicleHealth(vehicleid, Float:health)
  1246. {
  1247.     if(health < 0.0) health = 0.0;
  1248.     if(!SetVehicleHealth(vehicleid, health)) return 0;
  1249.     if(AntiCheatVehInfo[vehicleid][vDriver] != 65535)
  1250.     {
  1251.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pNOPCount][4] = 0;
  1252.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSetVehHealth] = health;
  1253.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][4] = GetTickCount();
  1254.     }
  1255.     return 1;
  1256. }
  1257.  
  1258. fpublic: ac_RepairVehicle(vehicleid)
  1259. {
  1260.     if(!RepairVehicle(vehicleid)) return 0;
  1261.     if(AntiCheatVehInfo[vehicleid][vDriver] != 65535)
  1262.     {
  1263.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pNOPCount][4] = 0;
  1264.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pSetVehHealth] = 1000.0;
  1265.         AntiCheatInfo[AntiCheatVehInfo[vehicleid][vDriver]][pGtc][4] = GetTickCount();
  1266.     }
  1267.     return 1;
  1268. }
  1269.  
  1270. #endif
  1271.  
  1272. stock acc_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
  1273.     return CallRemoteFunction("ac_AddStaticVehicle", "iffffii", modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
  1274.  
  1275. #if defined _ALS_AddStaticVehicle
  1276.     #undef AddStaticVehicle
  1277. #else
  1278.     #define _ALS_AddStaticVehicle
  1279. #endif
  1280. #define AddStaticVehicle acc_AddStaticVehicle
  1281.  
  1282. stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren = 0)
  1283.     return CallRemoteFunction("ac_AddStaticVehicleEx", "iffffiid", modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren);
  1284.  
  1285. #if defined _ALS_AddStaticVehicleEx
  1286.     #undef AddStaticVehicleEx
  1287. #else
  1288.     #define _ALS_AddStaticVehicleEx
  1289. #endif
  1290. #define AddStaticVehicleEx acc_AddStaticVehicleEx
  1291.  
  1292. stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren = 0)
  1293.     return CallRemoteFunction("ac_CreateVehicle", "iffffiid", vehicletype, x, y, z, rotation, color1, color2, respawn_delay, addsiren);
  1294.  
  1295. #if defined _ALS_CreateVehicle
  1296.     #undef CreateVehicle
  1297. #else
  1298.     #define _ALS_CreateVehicle
  1299. #endif
  1300. #define CreateVehicle acc_CreateVehicle
  1301.  
  1302. stock acc_AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  1303.     return CallRemoteFunction("ac_AddPlayerClass", "iffffiiiiii", modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1304.  
  1305. #if defined _ALS_AddPlayerClass
  1306.     #undef AddPlayerClass
  1307. #else
  1308.     #define _ALS_AddPlayerClass
  1309. #endif
  1310. #define AddPlayerClass acc_AddPlayerClass
  1311.  
  1312. stock acc_AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  1313.     return CallRemoteFunction("ac_AddPlayerClassEx", "iiffffiiiiii", teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1314.  
  1315. #if defined _ALS_AddPlayerClassEx
  1316.     #undef AddPlayerClassEx
  1317. #else
  1318.     #define _ALS_AddPlayerClassEx
  1319. #endif
  1320. #define AddPlayerClassEx acc_AddPlayerClassEx
  1321.  
  1322. stock acc_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  1323.     return CallRemoteFunction("ac_SetSpawnInfo", "iiiffffiiiiii", playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1324.  
  1325. #if defined _ALS_SetSpawnInfo
  1326.     #undef SetSpawnInfo
  1327. #else
  1328.     #define _ALS_SetSpawnInfo
  1329. #endif
  1330. #define SetSpawnInfo acc_SetSpawnInfo
  1331.  
  1332. stock acc_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0) return CallRemoteFunction("ac_AddStaticPickup", "iifffd", model, type, X, Y, Z, virtualworld);
  1333.  
  1334. #if defined _ALS_AddStaticPickup
  1335.     #undef AddStaticPickup
  1336. #else
  1337.     #define _ALS_AddStaticPickup
  1338. #endif
  1339. #define AddStaticPickup acc_AddStaticPickup
  1340.  
  1341. stock acc_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0) return CallRemoteFunction("ac_CreatePickup", "iifffd", model, type, X, Y, Z, virtualworld);
  1342.  
  1343. #if defined _ALS_CreatePickup
  1344.     #undef CreatePickup
  1345. #else
  1346.     #define _ALS_CreatePickup
  1347. #endif
  1348. #define CreatePickup acc_CreatePickup
  1349.  
  1350. stock acc_DestroyVehicle(vehicleid) return CallRemoteFunction("ac_DestroyVehicle", "i", vehicleid);
  1351.  
  1352. #if defined _ALS_DestroyVehicle
  1353.     #undef DestroyVehicle
  1354. #else
  1355.     #define _ALS_DestroyVehicle
  1356. #endif
  1357. #define DestroyVehicle acc_DestroyVehicle
  1358.  
  1359. stock acc_DestroyPickup(pickup) return CallRemoteFunction("ac_DestroyPickup", "i", pickup);
  1360.  
  1361. #if defined _ALS_DestroyPickup
  1362.     #undef DestroyPickup
  1363. #else
  1364.     #define _ALS_DestroyPickup
  1365. #endif
  1366. #define DestroyPickup acc_DestroyPickup
  1367.  
  1368. stock acc_DisableInteriorEnterExits() return CallRemoteFunction("ac_DisableInteriorEnterExits", "");
  1369.  
  1370. #if defined _ALS_DisableInteriorEnterExits
  1371.     #undef DisableInteriorEnterExits
  1372. #else
  1373.     #define _ALS_DisableInteriorEnterExits
  1374. #endif
  1375. #define DisableInteriorEnterExits acc_DisableInteriorEnterExits
  1376.  
  1377. stock acc_UsePlayerPedAnims() return CallRemoteFunction("ac_UsePlayerPedAnims", "");
  1378.  
  1379. #if defined _ALS_UsePlayerPedAnims
  1380.     #undef UsePlayerPedAnims
  1381. #else
  1382.     #define _ALS_UsePlayerPedAnims
  1383. #endif
  1384. #define UsePlayerPedAnims acc_UsePlayerPedAnims
  1385.  
  1386. stock acc_EnableVehicleFriendlyFire() return CallRemoteFunction("ac_EnableVehicleFriendlyFire", "");
  1387.  
  1388. #if defined _ALS_EnableVehicleFriendlyFire
  1389.     #undef EnableVehicleFriendlyFire
  1390. #else
  1391.     #define _ALS_EnableVehicleFriendlyFire
  1392. #endif
  1393. #define EnableVehicleFriendlyFire acc_EnableVehicleFriendlyFire
  1394.  
  1395. stock acc_EnableStuntBonusForAll(enable) return CallRemoteFunction("ac_EnableStuntBonusForAll", "i", enable);
  1396.  
  1397. #if defined _ALS_EnableStuntBonusForAll
  1398.     #undef EnableStuntBonusForAll
  1399. #else
  1400.     #define _ALS_EnableStuntBonusForAll
  1401. #endif
  1402. #define EnableStuntBonusForAll acc_EnableStuntBonusForAll
  1403.  
  1404. stock acc_EnableStuntBonusForPlayer(playerid, enable) return CallRemoteFunction("ac_EnableStuntBonusForPlayer", "ii", playerid, enable);
  1405.  
  1406. #if defined _ALS_EnableStuntBonusForPlayer
  1407.     #undef EnableStuntBonusForPlayer
  1408. #else
  1409.     #define _ALS_EnableStuntBonusForPlayer
  1410. #endif
  1411. #define EnableStuntBonusForPlayer acc_EnableStuntBonusForPlayer
  1412.  
  1413. stock acc_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
  1414.     return CallRemoteFunction("ac_ShowPlayerDialog", "idissss", playerid, dialogid, style, caption, info, button1, button2);
  1415.  
  1416. #if defined _ALS_ShowPlayerDialog
  1417.     #undef ShowPlayerDialog
  1418. #else
  1419.     #define _ALS_ShowPlayerDialog
  1420. #endif
  1421. #define ShowPlayerDialog acc_ShowPlayerDialog
  1422.  
  1423. stock acc_TogglePlayerControllable(playerid, toggle) return CallRemoteFunction("ac_TogglePlayerControllable", "ii", playerid, toggle);
  1424.  
  1425. #if defined _ALS_TogglePlayerControllable
  1426.     #undef TogglePlayerControllable
  1427. #else
  1428.     #define _ALS_TogglePlayerControllable
  1429. #endif
  1430. #define TogglePlayerControllable acc_TogglePlayerControllable
  1431.  
  1432. stock acc_TogglePlayerSpectating(playerid, toggle) return CallRemoteFunction("ac_TogglePlayerSpectating", "ii", playerid, toggle);
  1433.  
  1434. #if defined _ALS_TogglePlayerSpectating
  1435.     #undef TogglePlayerSpectating
  1436. #else
  1437.     #define _ALS_TogglePlayerSpectating
  1438. #endif
  1439. #define TogglePlayerSpectating acc_TogglePlayerSpectating
  1440.  
  1441. stock acc_SpawnPlayer(playerid) return CallRemoteFunction("ac_SpawnPlayer", "i", playerid);
  1442.  
  1443. #if defined _ALS_SpawnPlayer
  1444.     #undef SpawnPlayer
  1445. #else
  1446.     #define _ALS_SpawnPlayer
  1447. #endif
  1448. #define SpawnPlayer acc_SpawnPlayer
  1449.  
  1450. stock acc_SetPlayerHealth(playerid, Float:health) return CallRemoteFunction("ac_SetPlayerHealth", "if", playerid, health);
  1451.  
  1452. #if defined _ALS_SetPlayerHealth
  1453.     #undef SetPlayerHealth
  1454. #else
  1455.     #define _ALS_SetPlayerHealth
  1456. #endif
  1457. #define SetPlayerHealth acc_SetPlayerHealth
  1458.  
  1459. stock acc_SetPlayerArmour(playerid, Float:armour) return CallRemoteFunction("ac_SetPlayerArmour", "if", playerid, armour);
  1460.  
  1461. #if defined _ALS_SetPlayerArmour
  1462.     #undef SetPlayerArmour
  1463. #else
  1464.     #define _ALS_SetPlayerArmour
  1465. #endif
  1466. #define SetPlayerArmour acc_SetPlayerArmour
  1467.  
  1468. stock acc_GivePlayerWeapon(playerid, weaponid, ammo) return CallRemoteFunction("ac_GivePlayerWeapon", "iid", playerid, weaponid, ammo);
  1469.  
  1470. #if defined _ALS_GivePlayerWeapon
  1471.     #undef GivePlayerWeapon
  1472. #else
  1473.     #define _ALS_GivePlayerWeapon
  1474. #endif
  1475. #define GivePlayerWeapon acc_GivePlayerWeapon
  1476.  
  1477. stock acc_SetPlayerAmmo(playerid, weaponslot, ammo) return CallRemoteFunction("ac_SetPlayerAmmo", "iid", playerid, weaponslot, ammo);
  1478.  
  1479. #if defined _ALS_SetPlayerAmmo
  1480.     #undef SetPlayerAmmo
  1481. #else
  1482.     #define _ALS_SetPlayerAmmo
  1483. #endif
  1484. #define SetPlayerAmmo acc_SetPlayerAmmo
  1485.  
  1486. stock acc_SetPlayerArmedWeapon(playerid, weaponid) return CallRemoteFunction("ac_SetPlayerArmedWeapon", "ii", playerid, weaponid);
  1487.  
  1488. #if defined _ALS_SetPlayerArmedWeapon
  1489.     #undef SetPlayerArmedWeapon
  1490. #else
  1491.     #define _ALS_SetPlayerArmedWeapon
  1492. #endif
  1493. #define SetPlayerArmedWeapon acc_SetPlayerArmedWeapon
  1494.  
  1495. stock acc_ResetPlayerWeapons(playerid) return CallRemoteFunction("ac_ResetPlayerWeapons", "i", playerid);
  1496.  
  1497. #if defined _ALS_ResetPlayerWeapons
  1498.     #undef ResetPlayerWeapons
  1499. #else
  1500.     #define _ALS_ResetPlayerWeapons
  1501. #endif
  1502. #define ResetPlayerWeapons acc_ResetPlayerWeapons
  1503.  
  1504. stock acc_GivePlayerMoney(playerid, money) return CallRemoteFunction("ac_GivePlayerMoney", "id", playerid, money);
  1505.  
  1506. #if defined _ALS_GivePlayerMoney
  1507.     #undef GivePlayerMoney
  1508. #else
  1509.     #define _ALS_GivePlayerMoney
  1510. #endif
  1511. #define GivePlayerMoney acc_GivePlayerMoney
  1512.  
  1513. stock acc_ResetPlayerMoney(playerid) return CallRemoteFunction("ac_ResetPlayerMoney", "i", playerid);
  1514.  
  1515. #if defined _ALS_ResetPlayerMoney
  1516.     #undef ResetPlayerMoney
  1517. #else
  1518.     #define _ALS_ResetPlayerMoney
  1519. #endif
  1520. #define ResetPlayerMoney acc_ResetPlayerMoney
  1521.  
  1522. static stock bad_GetPlayerMoney(playerid) return GetPlayerMoney(playerid);
  1523.  
  1524. stock acc_GetPlayerMoney(playerid) return CallRemoteFunction("ac_GetPlayerMoney", "i", playerid);
  1525.  
  1526. #if defined _ALS_GetPlayerMoney
  1527.     #undef GetPlayerMoney
  1528. #else
  1529.     #define _ALS_GetPlayerMoney
  1530. #endif
  1531. #define GetPlayerMoney acc_GetPlayerMoney
  1532.  
  1533. stock acc_SetPlayerSpecialAction(playerid, actionid) return CallRemoteFunction("ac_SetPlayerSpecialAction", "ii", playerid, actionid);
  1534.  
  1535. #if defined _ALS_SetPlayerSpecialAction
  1536.     #undef SetPlayerSpecialAction
  1537. #else
  1538.     #define _ALS_SetPlayerSpecialAction
  1539. #endif
  1540. #define SetPlayerSpecialAction acc_SetPlayerSpecialAction
  1541.  
  1542. stock acc_SetPlayerInterior(playerid, interiorid) return CallRemoteFunction("ac_SetPlayerInterior", "ii", playerid, interiorid);
  1543.  
  1544. #if defined _ALS_SetPlayerInterior
  1545.     #undef SetPlayerInterior
  1546. #else
  1547.     #define _ALS_SetPlayerInterior
  1548. #endif
  1549. #define SetPlayerInterior acc_SetPlayerInterior
  1550.  
  1551. stock acc_SetPlayerPos(playerid, Float:x, Float:y, Float:z) return CallRemoteFunction("ac_SetPlayerPos", "ifff", playerid, x, y, z);
  1552.  
  1553. #if defined _ALS_SetPlayerPos
  1554.     #undef SetPlayerPos
  1555. #else
  1556.     #define _ALS_SetPlayerPos
  1557. #endif
  1558. #define SetPlayerPos acc_SetPlayerPos
  1559.  
  1560. stock acc_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z) return CallRemoteFunction("ac_SetPlayerPosFindZ", "ifff", playerid, x, y, z);
  1561.  
  1562. #if defined _ALS_SetPlayerPosFindZ
  1563.     #undef SetPlayerPosFindZ
  1564. #else
  1565.     #define _ALS_SetPlayerPosFindZ
  1566. #endif
  1567. #define SetPlayerPosFindZ acc_SetPlayerPosFindZ
  1568.  
  1569. stock acc_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z) return CallRemoteFunction("ac_SetPlayerVelocity", "ifff", playerid, X, Y, Z);
  1570.  
  1571. #if defined _ALS_SetPlayerVelocity
  1572.     #undef SetPlayerVelocity
  1573. #else
  1574.     #define _ALS_SetPlayerVelocity
  1575. #endif
  1576. #define SetPlayerVelocity acc_SetPlayerVelocity
  1577.  
  1578. stock acc_PutPlayerInVehicle(playerid, vehicleid, seatid) return CallRemoteFunction("ac_PutPlayerInVehicle", "iii", playerid, vehicleid, seatid);
  1579.  
  1580. #if defined _ALS_PutPlayerInVehicle
  1581.     #undef PutPlayerInVehicle
  1582. #else
  1583.     #define _ALS_PutPlayerInVehicle
  1584. #endif
  1585. #define PutPlayerInVehicle acc_PutPlayerInVehicle
  1586.  
  1587. stock acc_RemovePlayerFromVehicle(playerid) return CallRemoteFunction("ac_RemovePlayerFromVehicle", "i", playerid);
  1588.  
  1589. #if defined _ALS_RemovePlayerFromVehicle
  1590.     #undef RemovePlayerFromVehicle
  1591. #else
  1592.     #define _ALS_RemovePlayerFromVehicle
  1593. #endif
  1594. #define RemovePlayerFromVehicle acc_RemovePlayerFromVehicle
  1595.  
  1596. stock acc_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z) return CallRemoteFunction("ac_SetVehiclePos", "ifff", vehicleid, x, y, z);
  1597.  
  1598. #if defined _ALS_SetVehiclePos
  1599.     #undef SetVehiclePos
  1600. #else
  1601.     #define _ALS_SetVehiclePos
  1602. #endif
  1603. #define SetVehiclePos acc_SetVehiclePos
  1604.  
  1605. stock acc_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z) return CallRemoteFunction("ac_SetVehicleVelocity", "ifff", vehicleid, X, Y, Z);
  1606.  
  1607. #if defined _ALS_SetVehicleVelocity
  1608.     #undef SetVehicleVelocity
  1609. #else
  1610.     #define _ALS_SetVehicleVelocity
  1611. #endif
  1612. #define SetVehicleVelocity acc_SetVehicleVelocity
  1613.  
  1614. stock acc_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z) return CallRemoteFunction("ac_SetVehicleAngularVelocity", "ifff", vehicleid, X, Y, Z);
  1615.  
  1616. #if defined _ALS_SetVehicleAngularVelocity
  1617.     #undef SetVehicleAngularVelocity
  1618. #else
  1619.     #define _ALS_SetVehicleAngularVelocity
  1620. #endif
  1621. #define SetVehicleAngularVelocity acc_SetVehicleAngularVelocity
  1622.  
  1623. stock acc_ChangeVehiclePaintjob(vehicleid, paintjobid) return CallRemoteFunction("ac_ChangeVehiclePaintjob", "ii", vehicleid, paintjobid);
  1624.  
  1625. #if defined _ALS_ChangeVehiclePaintjob
  1626.     #undef ChangeVehiclePaintjob
  1627. #else
  1628.     #define _ALS_ChangeVehiclePaintjob
  1629. #endif
  1630. #define ChangeVehiclePaintjob acc_ChangeVehiclePaintjob
  1631.  
  1632. stock acc_SetVehicleHealth(vehicleid, Float:health) return CallRemoteFunction("ac_SetVehicleHealth", "if", vehicleid, health);
  1633.  
  1634. #if defined _ALS_SetVehicleHealth
  1635.     #undef SetVehicleHealth
  1636. #else
  1637.     #define _ALS_SetVehicleHealth
  1638. #endif
  1639. #define SetVehicleHealth acc_SetVehicleHealth
  1640.  
  1641. stock acc_RepairVehicle(vehicleid) return CallRemoteFunction("ac_RepairVehicle", "i", vehicleid);
  1642.  
  1643. #if defined _ALS_RepairVehicle
  1644.     #undef RepairVehicle
  1645. #else
  1646.     #define _ALS_RepairVehicle
  1647. #endif
  1648. #define RepairVehicle acc_RepairVehicle
  1649.  
  1650. #if !defined FILTERSCRIPT
  1651.  
  1652. public OnGameModeInit()
  1653. {
  1654.     if(!LoadCfg()) printf(CFG_OPENING_ERROR, CONFIG_FILE);
  1655.     if(ACAllow[42]) SendRconCommand("rcon 0");
  1656.     LagCompMode = !!GetServerVarAsInt("lagcompmode");
  1657.     print(" ");
  1658.     print("--------------------------------------");
  1659.     print(LOADED_MSG_1);
  1660.     printf(LOADED_MSG_2, NEX_AC_VERSION);
  1661.     #undef NEX_AC_VERSION
  1662.     print(LOADED_MSG_3);
  1663.     print("--------------------------------------\n");
  1664.     new a = 1;
  1665.     #if defined ac_OnGameModeInit
  1666.         a = ac_OnGameModeInit();
  1667.     #endif
  1668.     new strtmp[10];
  1669.     GetServerVarAsString("version", strtmp, sizeof strtmp);
  1670.     if(strcmp(strtmp, SERVER_VERSION)) print(VERSION_WARNING);
  1671.     #undef SERVER_VERSION
  1672.     return a;
  1673. }
  1674.  
  1675. #if defined _ALS_OnGameModeInit
  1676.     #undef OnGameModeInit
  1677. #else
  1678.     #define _ALS_OnGameModeInit
  1679. #endif
  1680. #define OnGameModeInit ac_OnGameModeInit
  1681. #if defined ac_OnGameModeInit
  1682.     forward ac_OnGameModeInit();
  1683. #endif
  1684.  
  1685. public OnGameModeExit()
  1686. {
  1687.     new a = 1;
  1688.     #if defined ac_OnGameModeExit
  1689.         a = ac_OnGameModeExit();
  1690.     #endif
  1691.     print(" ");
  1692.     print("--------------------------------------");
  1693.     print(STATS_STRING_1);
  1694.     print(STATS_STRING_2);
  1695.     printf(STATS_STRING_3, StatsInfo[0]);
  1696.     printf(STATS_STRING_4, StatsInfo[1]);
  1697.     printf(STATS_STRING_5, StatsInfo[2]);
  1698.     printf(STATS_STRING_6, StatsInfo[3]);
  1699.     printf(STATS_STRING_7, StatsInfo[4]);
  1700.     printf(STATS_STRING_8, StatsInfo[5]);
  1701.     print("--------------------------------------\n");
  1702.     return a;
  1703. }
  1704.  
  1705. #if defined _ALS_OnGameModeExit
  1706.     #undef OnGameModeExit
  1707. #else
  1708.     #define _ALS_OnGameModeExit
  1709. #endif
  1710. #define OnGameModeExit ac_OnGameModeExit
  1711. #if defined ac_OnGameModeExit
  1712.     forward ac_OnGameModeExit();
  1713. #endif
  1714.  
  1715. public OnPlayerConnect(playerid)
  1716. {
  1717.     GetPlayerIp(playerid, AntiCheatInfo[playerid][pIp], 16);
  1718.     if(IsPlayerNPC(playerid))
  1719.     {
  1720.         if(ACAllow[36] && strcmp(AntiCheatInfo[playerid][pIp],
  1721.         "127.0.0.1")) KickWithCode(playerid, "", 0, 36);
  1722.         AntiCheatInfo[playerid][pTimerID] = -1;
  1723.     }
  1724.     else
  1725.     {
  1726.         if(ACAllow[48] && AntiCheatInfo[playerid][pOnline]) KickWithCode(playerid, "", 0, 48);
  1727.         if(ACAllow[41])
  1728.         {
  1729.             new version[8];
  1730.             GetPlayerVersion(playerid, version, sizeof version);
  1731.             if(!strcmp(version, "unknown", true))
  1732.             {
  1733.                 #if defined DEBUG
  1734.                     printf(DEBUG_CODE_2, playerid, version);
  1735.                 #endif
  1736.                 KickWithCode(playerid, "", 0, 41);
  1737.             }
  1738.         }
  1739.         new i;
  1740.         if(ACAllow[40])
  1741.         {
  1742.             i = GetPlayerPoolSize();
  1743.             for(new f = MAX_CONNECTS_FROM_IP; i != -1; --i)
  1744.             {
  1745.                 if(IsPlayerConnected(i) && !IsPlayerNPC(i) && i != playerid
  1746.                 && !strcmp(AntiCheatInfo[playerid][pIp], AntiCheatInfo[i][pIp], false))
  1747.                 {
  1748.                     f--;
  1749.                     if(!f)
  1750.                     {
  1751.                         #if defined DEBUG
  1752.                             printf(DEBUG_CODE_3, playerid, MAX_CONNECTS_FROM_IP);
  1753.                         #endif
  1754.                         #undef MAX_CONNECTS_FROM_IP
  1755.                         KickWithCode(playerid, "", 0, 40);
  1756.                     }
  1757.                 }
  1758.             }
  1759.         }
  1760.         AntiCheatInfo[playerid][pDead] = true;
  1761.         AntiCheatInfo[playerid][pSpawnRes] = false;
  1762.         AntiCheatInfo[playerid][pDeathRes] = false;
  1763.         AntiCheatInfo[playerid][pIntEnterExits] = IntEnterExits;
  1764.         AntiCheatInfo[playerid][pStuntBonus] = StuntBonus;
  1765.         AntiCheatInfo[playerid][pCheatCount][0] = 0;
  1766.         AntiCheatInfo[playerid][pLastWeapon] = 0;
  1767.         AntiCheatInfo[playerid][pDialog] = -1;
  1768.         AntiCheatInfo[playerid][pKicked] = 0;
  1769.         AntiCheatInfo[playerid][pMoney] = 0;
  1770.         AntiCheatInfo[playerid][pAnim] = -2;
  1771.         for(i = 12; i != -1; --i)
  1772.         {
  1773.             AntiCheatInfo[playerid][pSetWeapon][i] = -1;
  1774.             AntiCheatInfo[playerid][pGiveAmmo][i] = -65535;
  1775.         }
  1776.         for(i = 27; i != -1; --i) AntiCheatInfo[playerid][pFloodCount][i] = 0;
  1777.         for(i = 2; i != -1; --i) AntiCheatInfo[playerid][pDropJP][i] = 20001.0;
  1778.         for(i = sizeof(ACAllow) - 1; i != -1; --i) AntiCheatInfo[playerid][pACAllow][i] = ACAllow[i];
  1779.         AntiCheatInfo[playerid][pTimerID] = SetTimerEx("acTimer", 1000, false, "i", playerid);
  1780.     }
  1781.     AntiCheatInfo[playerid][pOnline] = true;
  1782.     #if defined ac_OnPlayerConnect
  1783.         return ac_OnPlayerConnect(playerid);
  1784.     #else
  1785.         return 1;
  1786.     #endif
  1787. }
  1788.  
  1789. #if defined _ALS_OnPlayerConnect
  1790.     #undef OnPlayerConnect
  1791. #else
  1792.     #define _ALS_OnPlayerConnect
  1793. #endif
  1794. #define OnPlayerConnect ac_OnPlayerConnect
  1795. #if defined ac_OnPlayerConnect
  1796.     forward ac_OnPlayerConnect(playerid);
  1797. #endif
  1798.  
  1799. public OnPlayerDisconnect(playerid, reason)
  1800. {
  1801.     if(AntiCheatInfo[playerid][pOnline])
  1802.     {
  1803.         AntiCheatInfo[playerid][pOnline] = false;
  1804.         if(!IsPlayerNPC(playerid))
  1805.         {
  1806.             KillTimer(AntiCheatInfo[playerid][pTimerID]);
  1807.             if(!reason) Kick(playerid);
  1808.             if(AntiCheatInfo[playerid][pACAllow][37]) BlockIpAddress(AntiCheatInfo[playerid][pIp],
  1809.             (MIN_TIME_RECONNECT * 1000) - (reason ? 0 : GetServerVarAsInt("playertimeout")));
  1810.             #undef MIN_TIME_RECONNECT
  1811.         }
  1812.         if(AntiCheatInfo[playerid][pVeh]
  1813.         && AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] == playerid)
  1814.         {
  1815.             AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] = 65535;
  1816.             if(AntiCheatInfo[playerid][pKicked] == 2)
  1817.             {
  1818.                 LinkVehicleToInterior(AntiCheatInfo[playerid][pVeh],
  1819.                 AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vInt]);
  1820.                 SetVehicleZAngle(AntiCheatInfo[playerid][pVeh],
  1821.                 AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vZAngle]);
  1822.                 SetVehiclePos(AntiCheatInfo[playerid][pVeh], AntiCheatInfo[playerid][pPos][0],
  1823.                 AntiCheatInfo[playerid][pPos][1], AntiCheatInfo[playerid][pPos][2]);
  1824.                 SetVehicleHealth(AntiCheatInfo[playerid][pVeh],
  1825.                 AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vHealth]);
  1826.                 ChangeVehiclePaintjob(AntiCheatInfo[playerid][pVeh],
  1827.                 AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vPaintJob]);
  1828.             }
  1829.         }
  1830.         #if defined ac_OnPlayerDisconnect
  1831.             return ac_OnPlayerDisconnect(playerid, reason);
  1832.         #endif
  1833.     }
  1834.     return 1;
  1835. }
  1836.  
  1837. #if defined _ALS_OnPlayerDisconnect
  1838.     #undef OnPlayerDisconnect
  1839. #else
  1840.     #define _ALS_OnPlayerDisconnect
  1841. #endif
  1842. #define OnPlayerDisconnect ac_OnPlayerDisconnect
  1843. #if defined ac_OnPlayerDisconnect
  1844.     forward ac_OnPlayerDisconnect(playerid, reason);
  1845. #endif
  1846.  
  1847. public OnPlayerSpawn(playerid)
  1848. {
  1849.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  1850.     if(!IsPlayerNPC(playerid))
  1851.     {
  1852.         new i = GetTickCount();
  1853.         if(AntiCheatInfo[playerid][pACAllow][27] && AntiCheatInfo[playerid][pSet][7] == -1
  1854.         && (!AntiCheatInfo[playerid][pSpawnRes] || i < AntiCheatInfo[playerid][pSpawnTime]
  1855.         + 1000)) KickWithCode(playerid, "", 0, 27);
  1856.         for(i = 10; i != -1; --i) AntiCheatInfo[playerid][pSet][i] = -1;
  1857.         for(i = 12; i != -1; --i)
  1858.         {
  1859.             AntiCheatInfo[playerid][pWeapon][i] = 0;
  1860.             AntiCheatInfo[playerid][pAmmo][i] = 0;
  1861.             AntiCheatInfo[playerid][pSetWeapon][i] = -1;
  1862.             AntiCheatInfo[playerid][pGiveAmmo][i] = -65535;
  1863.         }
  1864.         AntiCheatInfo[playerid][pParachute] = false;
  1865.         AntiCheatInfo[playerid][pVehDmgRes] = false;
  1866.         AntiCheatInfo[playerid][pSpawnRes] = false;
  1867.         AntiCheatInfo[playerid][pNextSpecAct] = -1;
  1868.         AntiCheatInfo[playerid][pLastSpecAct] = 0;
  1869.         AntiCheatInfo[playerid][pModShop] = false;
  1870.         AntiCheatInfo[playerid][pDmgRes] = false;
  1871.         AntiCheatInfo[playerid][pFreeze] = true;
  1872.         AntiCheatInfo[playerid][pTpToZ] = false;
  1873.         AntiCheatInfo[playerid][pDead] = false;
  1874.         AntiCheatInfo[playerid][pSpecAct] = 0;
  1875.         AntiCheatInfo[playerid][pSpeed] = 0.0;
  1876.         AntiCheatInfo[playerid][pSeat] = -1;
  1877.         AntiCheatInfo[playerid][pVeh] = 0;
  1878.         SetPlayerHealth(playerid, 100.0);
  1879.         SetPlayerArmour(playerid, 0.0);
  1880.         for(i = 2; i != -1; --i)
  1881.         {
  1882.             if(AntiCheatInfo[playerid][pSpawnWeapon][i] != -1)
  1883.             {
  1884.                 AntiCheatInfo[playerid][pWeapon][GetWeaponSlot(AntiCheatInfo[playerid]
  1885.                 [pSpawnWeapon][i])] = AntiCheatInfo[playerid][pSpawnWeapon][i];
  1886.                 AntiCheatInfo[playerid][pAmmo][GetWeaponSlot(AntiCheatInfo[playerid]
  1887.                 [pSpawnWeapon][i])] = AntiCheatInfo[playerid][pSpawnAmmo][i];
  1888.             }
  1889.         }
  1890.     }
  1891.     #if defined ac_OnPlayerSpawn
  1892.         return ac_OnPlayerSpawn(playerid);
  1893.     #else
  1894.         return 1;
  1895.     #endif
  1896. }
  1897.  
  1898. #if defined _ALS_OnPlayerSpawn
  1899.     #undef OnPlayerSpawn
  1900. #else
  1901.     #define _ALS_OnPlayerSpawn
  1902. #endif
  1903. #define OnPlayerSpawn ac_OnPlayerSpawn
  1904. #if defined ac_OnPlayerSpawn
  1905.     forward ac_OnPlayerSpawn(playerid);
  1906. #endif
  1907.  
  1908. public OnPlayerDeath(playerid, killerid, reason)
  1909. {
  1910.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  1911.     if(AntiCheatInfo[playerid][pACAllow][28] && (AntiCheatInfo[playerid][pDead]
  1912.     || !AntiCheatInfo[playerid][pDeathRes] && reason != 255 && (reason != 54
  1913.     || killerid != 65535))) KickWithCode(playerid, "", 0, 28);
  1914.     AntiCheatInfo[playerid][pDeathRes] = false;
  1915.     AntiCheatInfo[playerid][pSpawnRes] = true;
  1916.     AntiCheatInfo[playerid][pDead] = true;
  1917.     new a = 1;
  1918.     #if defined ac_OnPlayerDeath
  1919.         a = ac_OnPlayerDeath(playerid, killerid, reason);
  1920.     #endif
  1921.     AntiCheatInfo[playerid][pSpawnTime] = GetTickCount();
  1922.     return a;
  1923. }
  1924.  
  1925. #if defined _ALS_OnPlayerDeath
  1926.     #undef OnPlayerDeath
  1927. #else
  1928.     #define _ALS_OnPlayerDeath
  1929. #endif
  1930. #define OnPlayerDeath ac_OnPlayerDeath
  1931. #if defined ac_OnPlayerDeath
  1932.     forward ac_OnPlayerDeath(playerid, killerid, reason);
  1933. #endif
  1934.  
  1935. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  1936. {
  1937.     AntiCheatInfo[playerid][pDeathRes] = true;
  1938.     #if defined ac_OnPlayerTakeDamage
  1939.         return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid, bodypart);
  1940.     #else
  1941.         return 1;
  1942.     #endif
  1943. }
  1944.  
  1945. #if defined _ALS_OnPlayerTakeDamage
  1946.     #undef OnPlayerTakeDamage
  1947. #else
  1948.     #define _ALS_OnPlayerTakeDamage
  1949. #endif
  1950. #define OnPlayerTakeDamage ac_OnPlayerTakeDamage
  1951. #if defined ac_OnPlayerTakeDamage
  1952.     forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  1953. #endif
  1954.  
  1955. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1956. {
  1957.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  1958.     new i = GetTickCount();
  1959.     if(AntiCheatInfo[playerid][pACAllow][49])
  1960.     {
  1961.         if(i < AntiCheatInfo[playerid][pCall][0] + Mtfc[0][0]) FloodDetect(playerid, 0);
  1962.         else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  1963.         else AntiCheatInfo[playerid][pFloodCount][0] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  1964.     }
  1965.     if(AntiCheatInfo[playerid][pACAllow][39] && dialogid
  1966.     != AntiCheatInfo[playerid][pDialog]) return KickWithCode(playerid, "", 0, 39);
  1967.     AntiCheatInfo[playerid][pDialog] = -1;
  1968.     if(AntiCheatInfo[playerid][pACAllow][45])
  1969.     {
  1970.         while((i = strfind(inputtext, "%")) != -1) strdel(inputtext, i, i + 1);
  1971.     }
  1972.     i = 1;
  1973.     #if defined ac_OnDialogResponse
  1974.         i = ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  1975.     #endif
  1976.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][0] = GetTickCount();
  1977.     return i;
  1978. }
  1979.  
  1980. #if defined _ALS_OnDialogResponse
  1981.     #undef OnDialogResponse
  1982. #else
  1983.     #define _ALS_OnDialogResponse
  1984. #endif
  1985. #define OnDialogResponse ac_OnDialogResponse
  1986. #if defined ac_OnDialogResponse
  1987.     forward ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  1988. #endif
  1989.  
  1990. public OnEnterExitModShop(playerid, enterexit, interiorid)
  1991. {
  1992.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  1993.     #if !USE_TUNING_GARAGES
  1994.         return KickWithCode(playerid, "", 0, 23, 1);
  1995.     #else
  1996.         new i = GetTickCount();
  1997.         if(AntiCheatInfo[playerid][pACAllow][49])
  1998.         {
  1999.             if(i < AntiCheatInfo[playerid][pCall][1] + Mtfc[1][0]) FloodDetect(playerid, 1);
  2000.             else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2001.             else AntiCheatInfo[playerid][pFloodCount][1] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2002.         }
  2003.         AntiCheatInfo[playerid][pSet][0] = interiorid;
  2004.         AntiCheatInfo[playerid][pModShop] = !!enterexit;
  2005.         i = 1;
  2006.         #if defined ac_OnEnterExitModShop
  2007.             i = ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  2008.         #endif
  2009.         AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][1] = GetTickCount();
  2010.         return i;
  2011.     #endif
  2012.     #undef USE_TUNING_GARAGES
  2013. }
  2014.  
  2015. #if defined _ALS_OnEnterExitModShop
  2016.     #undef OnEnterExitModShop
  2017. #else
  2018.     #define _ALS_OnEnterExitModShop
  2019. #endif
  2020. #define OnEnterExitModShop ac_OnEnterExitModShop
  2021. #if defined ac_OnEnterExitModShop
  2022.     forward ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  2023. #endif
  2024.  
  2025. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  2026. {
  2027.     if(!IsPlayerConnected(playerid)
  2028.     || AntiCheatInfo[playerid][pKicked]) return 0;
  2029.     new i = GetPlayerVehicleID(playerid);
  2030.     if(newinteriorid != AntiCheatInfo[playerid][pSet][0])
  2031.     {
  2032.         if(i)
  2033.         {
  2034.             if(AntiCheatInfo[playerid][pACAllow][3]) KickWithCode(playerid, "", 0, 3, 1);
  2035.         }
  2036.         else if(AntiCheatInfo[playerid][pACAllow][2]
  2037.         && !AntiCheatInfo[playerid][pIntEnterExits]) KickWithCode(playerid, "", 0, 2, 1);
  2038.         GetPlayerPos(playerid, AntiCheatInfo[playerid][pPos][0],
  2039.         AntiCheatInfo[playerid][pPos][1], AntiCheatInfo[playerid][pPos][2]);
  2040.     }
  2041.     if(!AntiCheatInfo[playerid][pKicked] && i) AntiCheatVehInfo[i][vInt] = newinteriorid;
  2042.     AntiCheatInfo[playerid][pSet][0] = -1;
  2043.     i = 1;
  2044.     #if defined ac_OnPlayerInteriorChange
  2045.         i = ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  2046.     #endif
  2047.     AntiCheatInfo[playerid][pGtc][11] = GetTickCount() + 1400;
  2048.     return i;
  2049. }
  2050.  
  2051. #if defined _ALS_OnPlayerInteriorChange
  2052.     #undef OnPlayerInteriorChange
  2053. #else
  2054.     #define _ALS_OnPlayerInteriorChange
  2055. #endif
  2056. #define OnPlayerInteriorChange ac_OnPlayerInteriorChange
  2057. #if defined ac_OnPlayerInteriorChange
  2058.     forward ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  2059. #endif
  2060.  
  2061. public OnRconLoginAttempt(ip[], password[], success)
  2062. {
  2063.     if(ACAllow[42])
  2064.     {
  2065.         static iptables[MAX_PLAYERS][2], ip_index;
  2066.         new i, current_ip = IpToInt(ip);
  2067.         for(; i < ip_index && i < sizeof iptables; ++i)
  2068.         {
  2069.             if(iptables[i][0] == current_ip)
  2070.             {
  2071.                 if(success) iptables[i][1] = 0;
  2072.                 else
  2073.                 {
  2074.                     if(++iptables[i][1] > MAX_RCON_LOGIN_ATTEMPT)
  2075.                     {
  2076.                         #if defined DEBUG
  2077.                             printf(DEBUG_CODE_4, ip, password);
  2078.                         #endif
  2079.                         iptables[i][1] = 0;
  2080.                         KickWithCode(65535, ip, 1, 42, 1);
  2081.                     }
  2082.                 }
  2083.                 i = -1;
  2084.                 break;
  2085.             }
  2086.         }
  2087.         if(i == -1 && !success)
  2088.         {
  2089.             iptables[ip_index][0] = current_ip;
  2090.             if(++iptables[ip_index][1] > MAX_RCON_LOGIN_ATTEMPT)
  2091.             {
  2092.                 #undef MAX_RCON_LOGIN_ATTEMPT
  2093.                 #if defined DEBUG
  2094.                     printf(DEBUG_CODE_4, ip, password, iptables[ip_index][1]);
  2095.                 #endif
  2096.                 iptables[ip_index][1] = 0;
  2097.                 KickWithCode(65535, ip, 1, 42, 2);
  2098.             }
  2099.             if(++ip_index > sizeof(iptables) - 1) ip_index = 0;
  2100.             iptables[ip_index][1] = 0;
  2101.         }
  2102.     }
  2103.     #if defined ac_OnRconLoginAttempt
  2104.         return ac_OnRconLoginAttempt(ip, password, success);
  2105.     #else
  2106.         return 1;
  2107.     #endif
  2108. }
  2109.  
  2110. #if defined _ALS_OnRconLoginAttempt
  2111.     #undef OnRconLoginAttempt
  2112. #else
  2113.     #define _ALS_OnRconLoginAttempt
  2114. #endif
  2115. #define OnRconLoginAttempt ac_OnRconLoginAttempt
  2116. #if defined ac_OnRconLoginAttempt
  2117.     forward ac_OnRconLoginAttempt(ip[], password[], success);
  2118. #endif
  2119.  
  2120. public OnPlayerUpdate(playerid)
  2121. {
  2122.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  2123.     static gpp, bool:ur;
  2124.     ur = false;
  2125.     if(!IsPlayerNPC(playerid))
  2126.     {
  2127.         gpp = GetPlayerPing(playerid);
  2128.         if(AntiCheatInfo[playerid][pACAllow][38])
  2129.         {
  2130.             if(gpp > MAX_PING)
  2131.             {
  2132.                 if(++AntiCheatInfo[playerid][pCheatCount][0]
  2133.                 > MAX_PING_WARNINGS) return KickWithCode(playerid, "", 0, 38);
  2134.                 #undef MAX_PING_WARNINGS
  2135.             }
  2136.             else AntiCheatInfo[playerid][pCheatCount][0] = 0;
  2137.         }
  2138.         static stateanim;
  2139.         stateanim = GetPlayerState(playerid);
  2140.         if(stateanim != 9)
  2141.         {
  2142.             gpp += 100;
  2143.             static gtc, w, s, a;
  2144.             gtc = GetTickCount();
  2145.             a = GetPlayerAmmo(playerid);
  2146.             w = GetPlayerWeapon(playerid);
  2147.             s = GetWeaponSlot(w);
  2148.             if(AntiCheatInfo[playerid][pSet][3] != -1)
  2149.             {
  2150.                 if(AntiCheatInfo[playerid][pSet][3] == w)
  2151.                 {
  2152.                     AntiCheatInfo[playerid][pSet][3] = -1;
  2153.                     AntiCheatInfo[playerid][pSetWeapon][s] = -1;
  2154.                     AntiCheatInfo[playerid][pWeapon][s] = w;
  2155.                 }
  2156.                 else if(AntiCheatInfo[playerid][pACAllow][52] && !(1 < stateanim < 4)
  2157.                 && gtc > AntiCheatInfo[playerid][pGtc][2] + gpp
  2158.                 && ++AntiCheatInfo[playerid][pNOPCount][0] > MAX_NOP_WARNINGS)
  2159.                 {
  2160.                     #if defined DEBUG
  2161.                         printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  2162.                     #endif
  2163.                     return KickWithCode(playerid, "", 0, 52, 1);
  2164.                 }
  2165.             }
  2166.             if(AntiCheatInfo[playerid][pGiveAmmo][s] != -65535)
  2167.             {
  2168.                 if(AntiCheatInfo[playerid][pGiveAmmo][s] == a)
  2169.                 {
  2170.                     AntiCheatInfo[playerid][pGiveAmmo][s] = -65535;
  2171.                     AntiCheatInfo[playerid][pAmmo][s] = a;
  2172.                 }
  2173.                 else if(AntiCheatInfo[playerid][pACAllow][52] && gtc
  2174.                 > AntiCheatInfo[playerid][pGtcGiveAmmo][s] + gpp
  2175.                 && ++AntiCheatInfo[playerid][pNOPCount][1] > MAX_NOP_WARNINGS)
  2176.                 {
  2177.                     #if defined DEBUG
  2178.                         printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  2179.                     #endif
  2180.                     return KickWithCode(playerid, "", 0, 52, 2);
  2181.                 }
  2182.             }
  2183.             static i;
  2184.             i = GetPlayerInterior(playerid);
  2185.             if(AntiCheatInfo[playerid][pLastWeapon] != w)
  2186.             {
  2187.                 if(AntiCheatInfo[playerid][pWeapon][s] != w)
  2188.                 {
  2189.                     if(w == 40 || w == 46 && AntiCheatInfo[playerid][pVeh]
  2190.                     && AntiCheatInfo[playerid][pParachute])
  2191.                     {
  2192.                         AntiCheatInfo[playerid][pWeapon][s] = w;
  2193.                         AntiCheatInfo[playerid][pAmmo][s] = a;
  2194.                     }
  2195.                     else if(21 < w < 33 && IsPlayerInAmmuNation(playerid, i))
  2196.                     {
  2197.                         if(AntiCheatInfo[playerid][pSet][10]
  2198.                         != -1) AntiCheatInfo[playerid][pSet][10] += AmmuNationInfo[w-22][0];
  2199.                         else AntiCheatInfo[playerid][pSet][10] = AmmuNationInfo[w-22][0];
  2200.                         AntiCheatInfo[playerid][pAmmo][s] = AmmuNationInfo[w-22][1];
  2201.                         AntiCheatInfo[playerid][pCheatCount][10] = 0;
  2202.                         AntiCheatInfo[playerid][pWeapon][s] = w;
  2203.                         ur = true;
  2204.                     }
  2205.                     else if(AntiCheatInfo[playerid][pACAllow][15]
  2206.                     && gtc > AntiCheatInfo[playerid][pGtc][7]
  2207.                     + gpp) return KickWithCode(playerid, "", 0, 15, 1);
  2208.                 }
  2209.                 AntiCheatInfo[playerid][pShot] = false;
  2210.             }
  2211.             else if(AntiCheatInfo[playerid][pAmmo][s] != a)
  2212.             {
  2213.                 switch(w)
  2214.                 {
  2215.                     case 16, 17, 18, 35, 36, 39, 43:
  2216.                     {
  2217.                         if(AntiCheatInfo[playerid][pACAllow][16] && (!AntiCheatInfo[playerid][pAmmo][s]
  2218.                         || AntiCheatInfo[playerid][pAmmo][s] - 1 != a)) return KickWithCode(playerid, "", 0, 16, 1);
  2219.                         AntiCheatInfo[playerid][pAmmo][s]--;
  2220.                     }
  2221.                 }
  2222.             }
  2223.             static Float:health;
  2224.             GetPlayerHealth(playerid, health);
  2225.             if(AntiCheatInfo[playerid][pSet][1] != -1)
  2226.             {
  2227.                 if(AntiCheatInfo[playerid][pSet][1] > 255)
  2228.                 {
  2229.                     while(health < AntiCheatInfo[playerid][pSet][1]) health += 256;
  2230.                 }
  2231.                 if(AntiCheatInfo[playerid][pSet][1] == health) AntiCheatInfo[playerid][pSet][1] = -1;
  2232.                 else if(AntiCheatInfo[playerid][pACAllow][52] && gtc > AntiCheatInfo[playerid][pGtc][3]
  2233.                 + gpp && ++AntiCheatInfo[playerid][pNOPCount][3] > MAX_NOP_WARNINGS)
  2234.                 {
  2235.                     #if defined DEBUG
  2236.                         printf(DEBUG_CODE_5, playerid, "SetPlayerHealth");
  2237.                     #endif
  2238.                     return KickWithCode(playerid, "", 0, 52, 3);
  2239.                 }
  2240.             }
  2241.             else if(AntiCheatInfo[playerid][pACAllow][12])
  2242.             {
  2243.                 while(AntiCheatInfo[playerid][pHealth] > health + 255) health += 256;
  2244.                 if(health > AntiCheatInfo[playerid][pHealth] && !(health <= AntiCheatInfo[playerid][pHealth] + 70.0
  2245.                 && IsPlayerInRestaurant(playerid, i)) && !(health <= AntiCheatInfo[playerid][pHealth] + 35.0
  2246.                 && IsPlayerNearVendingMachine(playerid, i))) return KickWithCode(playerid, "", 0, 12);
  2247.             }
  2248.             if(AntiCheatInfo[playerid][pACAllow][19] && AntiCheatInfo[playerid][pDmgRes])
  2249.             {
  2250.                 if(health < AntiCheatInfo[playerid][pHealth]) AntiCheatInfo[playerid][pDmgRes] = false;
  2251.                 else if(gtc > AntiCheatInfo[playerid][pGtc][14] + gpp && ++AntiCheatInfo[playerid][pCheatCount][9]
  2252.                 > MAX_NOP_WARNINGS) return KickWithCode(playerid, "", 0, 19);
  2253.             }
  2254.             static Float:armour;
  2255.             GetPlayerArmour(playerid, armour);
  2256.             if(AntiCheatInfo[playerid][pSet][2] != -1)
  2257.             {
  2258.                 if(AntiCheatInfo[playerid][pSet][2] > 255)
  2259.                 {
  2260.                     while(armour < AntiCheatInfo[playerid][pSet][2]) armour += 256;
  2261.                 }
  2262.                 if(AntiCheatInfo[playerid][pSet][2] == armour) AntiCheatInfo[playerid][pSet][2] = -1;
  2263.                 else if(AntiCheatInfo[playerid][pACAllow][52] && gtc > AntiCheatInfo[playerid][pGtc][5]
  2264.                 + gpp && ++AntiCheatInfo[playerid][pNOPCount][5] > MAX_NOP_WARNINGS)
  2265.                 {
  2266.                     #if defined DEBUG
  2267.                         printf(DEBUG_CODE_5, playerid, "SetPlayerArmour");
  2268.                     #endif
  2269.                     return KickWithCode(playerid, "", 0, 52, 4);
  2270.                 }
  2271.             }
  2272.             else if(AntiCheatInfo[playerid][pACAllow][13])
  2273.             {
  2274.                 while(AntiCheatInfo[playerid][pArmour] > armour + 255) armour += 256;
  2275.                 if(armour > AntiCheatInfo[playerid][pArmour])
  2276.                 {
  2277.                     if(IsPlayerInAmmuNation(playerid, i))
  2278.                     {
  2279.                         if(AntiCheatInfo[playerid][pSet][10]
  2280.                         != -1) AntiCheatInfo[playerid][pSet][10] += 200;
  2281.                         else AntiCheatInfo[playerid][pSet][10] = 200;
  2282.                         AntiCheatInfo[playerid][pCheatCount][10] = 0;
  2283.                         ur = true;
  2284.                     }
  2285.                     else return KickWithCode(playerid, "", 0, 13);
  2286.                 }
  2287.             }
  2288.             static vehid;
  2289.             vehid = GetPlayerVehicleID(playerid);
  2290.             a = bad_GetPlayerMoney(playerid);
  2291.             if(AntiCheatInfo[playerid][pACAllow][14] && a > AntiCheatInfo[playerid][pMoney])
  2292.             {
  2293.                 if(!(AntiCheatInfo[playerid][pStuntBonus] && vehid)
  2294.                 && !IsPlayerInCasino(playerid, i))
  2295.                 {
  2296.                     a = AntiCheatInfo[playerid][pMoney];
  2297.                     ResetPlayerMoney(playerid);
  2298.                     GivePlayerMoney(playerid, a);
  2299.                 }
  2300.             }
  2301.             else if(AntiCheatInfo[playerid][pSet][10] != -1 && a < AntiCheatInfo[playerid][pMoney])
  2302.             {
  2303.                 if(AntiCheatInfo[playerid][pSet][10]
  2304.                 == (AntiCheatInfo[playerid][pMoney] - a)) AntiCheatInfo[playerid][pSet][10] = -1;
  2305.                 else if(AntiCheatInfo[playerid][pACAllow][15] && gtc > AntiCheatInfo[playerid][pGtc][15]
  2306.                 + 1030 && ++AntiCheatInfo[playerid][pCheatCount][10]
  2307.                 > MAX_NOP_WARNINGS) return KickWithCode(playerid, "", 0, 15, 3);
  2308.             }
  2309.             if(AntiCheatInfo[playerid][pACAllow][52])
  2310.             {
  2311.                 if(AntiCheatInfo[playerid][pSet][0] != -1 && gtc > AntiCheatInfo[playerid][pGtc][0]
  2312.                 + gpp && ++AntiCheatInfo[playerid][pNOPCount][2] > MAX_NOP_WARNINGS)
  2313.                 {
  2314.                     #if defined DEBUG
  2315.                         printf(DEBUG_CODE_5, playerid, "SetPlayerInterior");
  2316.                     #endif
  2317.                     return KickWithCode(playerid, "", 0, 52, 5);
  2318.                 }
  2319.                 if(AntiCheatInfo[playerid][pSet][6] != -1 && gtc > AntiCheatInfo[playerid][pGtc][12]
  2320.                 + gpp && ++AntiCheatInfo[playerid][pNOPCount][8] > MAX_NOP_WARNINGS)
  2321.                 {
  2322.                     #if defined DEBUG
  2323.                         printf(DEBUG_CODE_5, playerid, "TogglePlayerSpectating");
  2324.                     #endif
  2325.                     return KickWithCode(playerid, "", 0, 52, 6);
  2326.                 }
  2327.                 if(AntiCheatInfo[playerid][pSet][7] != -1 && gtc > AntiCheatInfo[playerid][pGtc][13]
  2328.                 + gpp && ++AntiCheatInfo[playerid][pNOPCount][9] > MAX_NOP_WARNINGS)
  2329.                 {
  2330.                     #if defined DEBUG
  2331.                         printf(DEBUG_CODE_5, playerid, "SpawnPlayer");
  2332.                     #endif
  2333.                     return KickWithCode(playerid, "", 0, 52, 7);
  2334.                 }
  2335.                 if(AntiCheatInfo[playerid][pSet][11] != -1 && vehid
  2336.                 && gtc > AntiCheatInfo[playerid][pGtc][8] + gpp + 3000)
  2337.                 {
  2338.                     #if defined DEBUG
  2339.                         printf(DEBUG_CODE_5, playerid, "RemovePlayerFromVehicle");
  2340.                     #endif
  2341.                     return KickWithCode(playerid, "", 0, 52, 8);
  2342.                 }
  2343.             }
  2344.             static Float:ppos[3];
  2345.             s = GetPlayerVehicleSeat(playerid);
  2346.             GetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]);
  2347.             if(AntiCheatInfo[playerid][pSet][9] != -1)
  2348.             {
  2349.                 if(AntiCheatInfo[playerid][pSet][9] == vehid
  2350.                 && (AntiCheatInfo[playerid][pSet][5] == s
  2351.                 || AntiCheatInfo[playerid][pSet][5] == -1))
  2352.                 {
  2353.                     if(AntiCheatInfo[playerid][pVeh]
  2354.                     && AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] == playerid)
  2355.                     {
  2356.                         if(GetVehicleModel(AntiCheatInfo[playerid][pVeh]) == 457
  2357.                         && !AntiCheatInfo[playerid][pWeapon][1]) AntiCheatInfo[playerid][pWeapon][1] = 2;
  2358.                         AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] = 65535;
  2359.                     }
  2360.                     if(!s)
  2361.                     {
  2362.                         AntiCheatVehInfo[vehid][vDriver] = playerid;
  2363.                         GetVehicleZAngle(vehid, AntiCheatVehInfo[vehid][vZAngle]);
  2364.                         AntiCheatInfo[playerid][pSetVehHealth] = -1;
  2365.                     }
  2366.                     AntiCheatInfo[playerid][pVehDmgRes] = false;
  2367.                     AntiCheatInfo[playerid][pSet][11] = -1;
  2368.                     AntiCheatInfo[playerid][pSet][9] = -1;
  2369.                     AntiCheatInfo[playerid][pSet][8] = -1;
  2370.                     AntiCheatInfo[playerid][pSet][5] = -1;
  2371.                     AntiCheatInfo[playerid][pSeat] = s;
  2372.                 }
  2373.                 else if(AntiCheatInfo[playerid][pACAllow][52] && gtc > AntiCheatInfo[playerid][pGtc][1]
  2374.                 + gpp && ++AntiCheatInfo[playerid][pNOPCount][7] > MAX_NOP_WARNINGS)
  2375.                 {
  2376.                     #if defined DEBUG
  2377.                         printf(DEBUG_CODE_5, playerid, "PutPlayerInVehicle");
  2378.                     #endif
  2379.                     return KickWithCode(playerid, "", 0, 52, 9);
  2380.                 }
  2381.             }
  2382.             else
  2383.             {
  2384.                 if(AntiCheatInfo[playerid][pSet][8] != -1)
  2385.                 {
  2386.                     if(IsPlayerInRangeOfPoint(playerid, 3.0, AntiCheatInfo[playerid][pSetPos][0],
  2387.                     AntiCheatInfo[playerid][pSetPos][1], (AntiCheatInfo[playerid][pTpToZ]
  2388.                     ? ppos[2] : AntiCheatInfo[playerid][pSetPos][2])))
  2389.                     {
  2390.                         AntiCheatInfo[playerid][pSet][8] = -1;
  2391.                         AntiCheatInfo[playerid][pGtc][11] = 0;
  2392.                         AntiCheatInfo[playerid][pTpToZ] = false;
  2393.                     }
  2394.                     else if(gtc > AntiCheatInfo[playerid][pGtc][11] + gpp)
  2395.                     {
  2396.                         AntiCheatInfo[playerid][pTpToZ] = false;
  2397.                         if(AntiCheatInfo[playerid][pACAllow][52]
  2398.                         && ++AntiCheatInfo[playerid][pNOPCount][10]
  2399.                         > MAX_NOP_WARNINGS)
  2400.                         {
  2401.                             #if defined DEBUG
  2402.                                 printf(DEBUG_CODE_5, playerid, "SetPlayerPos");
  2403.                             #endif
  2404.                             return KickWithCode(playerid, "", 0, 52, 10);
  2405.                         }
  2406.                     }
  2407.                 }
  2408.                 static Float:pvel[3], Float:vctsize, specact;
  2409.                 vctsize = GetPlayerDistanceFromPoint(playerid, AntiCheatInfo[playerid][pPos][0],
  2410.                 AntiCheatInfo[playerid][pPos][1], AntiCheatInfo[playerid][pPos][2]);
  2411.                 specact = GetPlayerSpecialAction(playerid);
  2412.                 if(vehid)
  2413.                 {
  2414.                     if(!AntiCheatInfo[playerid][pVeh])
  2415.                     {
  2416.                         if(AntiCheatInfo[playerid][pACAllow][4] && (AntiCheatInfo[playerid][pEnterVeh] != vehid
  2417.                         || gtc < AntiCheatInfo[playerid][pEnterVehTime] + 600)) return KickWithCode(playerid, "", 0, 4, 1);
  2418.                     }
  2419.                     else if(AntiCheatInfo[playerid][pVeh] != vehid)
  2420.                     {
  2421.                         if(AntiCheatInfo[playerid][pACAllow][4]) return KickWithCode(playerid, "", 0, 4, 2);
  2422.                     }
  2423.                     else if(AntiCheatInfo[playerid][pACAllow][50]
  2424.                     && AntiCheatInfo[playerid][pSeat]
  2425.                     != s) return KickWithCode(playerid, "", 0, 50);
  2426.                     if(stateanim == 2)
  2427.                     {
  2428.                         if(AntiCheatInfo[playerid][pACAllow][32] && AntiCheatVehInfo[vehid][vDriver] != 65535
  2429.                         && AntiCheatVehInfo[vehid][vDriver] != playerid) return ClearAnimations(playerid, 1);
  2430.                         if(AntiCheatInfo[playerid][pACAllow][35] && GetPlayerCameraMode(playerid)
  2431.                         == 55) return KickWithCode(playerid, "", 0, 35);
  2432.                         static Float:vhealth;
  2433.                         GetVehicleHealth(vehid, vhealth);
  2434.                         if(AntiCheatInfo[playerid][pSetVehHealth] != -1)
  2435.                         {
  2436.                             if(vhealth == AntiCheatInfo[playerid][pSetVehHealth]) AntiCheatInfo[playerid][pSetVehHealth] = -1;
  2437.                             else if(AntiCheatInfo[playerid][pACAllow][52] && gtc > AntiCheatInfo[playerid][pGtc][4]
  2438.                             + gpp && ++AntiCheatInfo[playerid][pNOPCount][4] > MAX_NOP_WARNINGS)
  2439.                             {
  2440.                                 #if defined DEBUG
  2441.                                     printf(DEBUG_CODE_5, playerid, "SetVehicleHealth");
  2442.                                 #endif
  2443.                                 return KickWithCode(playerid, "", 0, 52, 11);
  2444.                             }
  2445.                         }
  2446.                         else if(AntiCheatInfo[playerid][pACAllow][11] && vhealth
  2447.                         > AntiCheatVehInfo[vehid][vHealth] && !AntiCheatInfo[playerid][pModShop]
  2448.                         && !IsPlayerInPayNSpray(playerid, i)) return KickWithCode(playerid, "", 0, 11);
  2449.                         if(AntiCheatInfo[playerid][pACAllow][20] && AntiCheatInfo[playerid][pVehDmgRes])
  2450.                         {
  2451.                             if(vhealth < AntiCheatVehInfo[vehid][vHealth]) AntiCheatInfo[playerid][pVehDmgRes] = false;
  2452.                             else if(gtc > AntiCheatInfo[playerid][pGtc][16] + gpp && ++AntiCheatInfo[playerid][pCheatCount][11]
  2453.                             > MAX_NOP_WARNINGS) return KickWithCode(playerid, "", 0, 20);
  2454.                         }
  2455.                         static Float:zangle;
  2456.                         GetVehicleZAngle(vehid, zangle);
  2457.                         while(zangle < 0.0) zangle += 360.0;
  2458.                         while(zangle > 360.0) zangle -= 360.0;
  2459.                         GetVehicleVelocity(vehid, pvel[0], pvel[1], pvel[2]);
  2460.                         if(gtc > AntiCheatInfo[playerid][pGtc][9] + gpp)
  2461.                         {
  2462.                             i = GetVehicleModel(vehid);
  2463.                             static Float:vsp, Float:spdiff;
  2464.                             vsp = GetSpeed(pvel[0], pvel[1], pvel[2]);
  2465.                             spdiff = vsp - GetSpeed(AntiCheatVehInfo[vehid][vVel][0],
  2466.                             AntiCheatVehInfo[vehid][vVel][1], AntiCheatVehInfo[vehid][vVel][2]);
  2467.                             if(AntiCheatInfo[playerid][pACAllow][10] && spdiff >= 20.0 && AntiCheatVehInfo[vehid][vHealth]
  2468.                             == vhealth && AntiCheatVehInfo[vehid][vSpeedDiff] <= spdiff && (!IsBikeVehicle(i) || floatabs(pvel[0])
  2469.                             > 0.3 || floatabs(pvel[1]) > 0.3 || floatabs(pvel[2]) > 0.3)) return KickWithCode(playerid, "", 0, 10, 1);
  2470.                             if(AntiCheatInfo[playerid][pACAllow][25] && vsp > 15.0 && floatabs(spdiff) < 25.0
  2471.                             && floatround(floatabs(zangle - AntiCheatVehInfo[vehid][vZAngle])) == 180 && (pvel[0] < 0.0)
  2472.                             != (AntiCheatVehInfo[vehid][vVel][0] < 0.0) && (pvel[1] < 0.0) != (AntiCheatVehInfo[vehid][vVel][1] < 0.0)
  2473.                             && (pvel[2] < 0.0) != (AntiCheatVehInfo[vehid][vVel][2] < 0.0)) return KickWithCode(playerid, "", 0, 25);
  2474.                             static Float:zdiff;
  2475.                             zdiff = ppos[2] - AntiCheatInfo[playerid][pPos][2];
  2476.                             if(IsAirVehicle(i))
  2477.                             {
  2478.                                 if(AntiCheatInfo[playerid][pACAllow][10] && vsp > 269.0) return KickWithCode(playerid, "", 0, 10, 2);
  2479.                             }
  2480.                             else if(AntiCheatInfo[playerid][pACAllow][8] && pvel[2] >= 0.1 && pvel[2]
  2481.                             > AntiCheatVehInfo[vehid][vVel][2] && floatabs(AntiCheatInfo[playerid][pPos][0] - ppos[0])
  2482.                             < zdiff * 1.2 && floatabs(AntiCheatInfo[playerid][pPos][1] - ppos[1]) < zdiff * 1.2)
  2483.                             {
  2484.                                 if(++AntiCheatInfo[playerid][pCheatCount][3]
  2485.                                 > MAX_FLYHACK_VEH_WARNINGS) return KickWithCode(playerid, "", 0, 8, 1);
  2486.                             }
  2487.                             else AntiCheatInfo[playerid][pCheatCount][3] = 0;
  2488.                             if(vctsize > 0.4 && gtc > AntiCheatInfo[playerid][pGtc][11] + gpp)
  2489.                             {
  2490.                                 if(vctsize > 15.0 && vctsize > AntiCheatVehInfo[vehid][vPosDiff] + ((vctsize / 3) * 1.5))
  2491.                                 {
  2492.                                     if(AntiCheatInfo[playerid][pACAllow][3] && AntiCheatInfo[playerid][pPos][2]
  2493.                                     > -97.0) return KickWithCode(playerid, "", 0, 3, 2);
  2494.                                 }
  2495.                                 else if(AntiCheatInfo[playerid][pACAllow][1] && vsp < 16.0 && vctsize > 0.8)
  2496.                                 {
  2497.                                     if(++AntiCheatInfo[playerid][pCheatCount][2]
  2498.                                     > MAX_AIR_VEH_WARNINGS) return KickWithCode(playerid, "", 0, 1);
  2499.                                     #undef MAX_AIR_VEH_WARNINGS
  2500.                                 }
  2501.                                 else AntiCheatInfo[playerid][pCheatCount][2] = 0;
  2502.                             }
  2503.                             AntiCheatVehInfo[vehid][vSpeedDiff] = spdiff;
  2504.                         }
  2505.                         for(i = 2; i != -1; --i) AntiCheatVehInfo[vehid][vVel][i] = pvel[i];
  2506.                         AntiCheatVehInfo[vehid][vPosDiff] = vctsize;
  2507.                         AntiCheatVehInfo[vehid][vHealth] = vhealth;
  2508.                         AntiCheatVehInfo[vehid][vZAngle] = zangle;
  2509.                     }
  2510.                     AntiCheatInfo[playerid][pSeat] = s;
  2511.                 }
  2512.                 else
  2513.                 {
  2514.                     if(AntiCheatInfo[playerid][pACAllow][47]
  2515.                     && GetPlayerCameraMode(playerid) == 53)
  2516.                     {
  2517.                         GetPlayerCameraPos(playerid, pvel[0], pvel[1], pvel[2]);
  2518.                         if(floatabs(pvel[0]) > 50000.0 || floatabs(pvel[1]) > 50000.0
  2519.                         || floatabs(pvel[2]) > 50000.0) return KickWithCode(playerid, "", 0, 47, 1);
  2520.                     }
  2521.                     stateanim = GetPlayerAnimationIndex(playerid);
  2522.                     GetPlayerVelocity(playerid, pvel[0], pvel[1], pvel[2]);
  2523.                     pvel[0] = GetSpeed(pvel[0], pvel[1], pvel[2]);
  2524.                     if(AntiCheatInfo[playerid][pAnim] != stateanim)
  2525.                     {
  2526.                         switch(stateanim)
  2527.                         {
  2528.                             case -1:
  2529.                             {
  2530.                                 if(AntiCheatInfo[playerid][pACAllow][24]) return KickWithCode(playerid, "", 0, 24);
  2531.                             }
  2532.                             case 958..979:
  2533.                             {
  2534.                                 if(AntiCheatInfo[playerid][pACAllow][7]
  2535.                                 && w != 46) return KickWithCode(playerid, "", 0, 7, 1);
  2536.                             }
  2537.                             case 1058:
  2538.                             {
  2539.                                 if(AntiCheatInfo[playerid][pACAllow][7]) return KickWithCode(playerid, "", 0, 7, 2);
  2540.                             }
  2541.                             case 1231:
  2542.                             {
  2543.                                 if(AntiCheatInfo[playerid][pACAllow][30])
  2544.                                 {
  2545.                                     i = GetPlayerSkin(playerid);
  2546.                                     if(!PedAnims && i && i != 74) return KickWithCode(playerid, "", 0, 30);
  2547.                                 }
  2548.                             }
  2549.                         }
  2550.                     }
  2551.                     else if(AntiCheatInfo[playerid][pACAllow][7] && pvel[0] > 30.0
  2552.                     && 1537 < stateanim < 1545) return KickWithCode(playerid, "", 0, 7, 3);
  2553.                     if(AntiCheatInfo[playerid][pSet][4] != -1)
  2554.                     {
  2555.                         if(specact == AntiCheatInfo[playerid][pSet][4])
  2556.                         {
  2557.                             AntiCheatInfo[playerid][pSet][4] = -1;
  2558.                             AntiCheatInfo[playerid][pSpecAct] = specact;
  2559.                         }
  2560.                         else if(AntiCheatInfo[playerid][pACAllow][52] && gtc > AntiCheatInfo[playerid][pGtc][6]
  2561.                         + gpp && ++AntiCheatInfo[playerid][pNOPCount][6] > MAX_NOP_WARNINGS)
  2562.                         {
  2563.                             #if defined DEBUG
  2564.                                 printf(DEBUG_CODE_5, playerid, "SetPlayerSpecialAction");
  2565.                             #endif
  2566.                             return KickWithCode(playerid, "", 0, 52, 12);
  2567.                         }
  2568.                     }
  2569.                     else if(specact != AntiCheatInfo[playerid][pSpecAct])
  2570.                     {
  2571.                         if(specact == AntiCheatInfo[playerid][pNextSpecAct]) AntiCheatInfo[playerid][pNextSpecAct] = -1;
  2572.                         else if(AntiCheatInfo[playerid][pACAllow][18])
  2573.                         {
  2574.                             switch(specact)
  2575.                             {
  2576.                                 case 0:
  2577.                                 {
  2578.                                     switch(AntiCheatInfo[playerid][pSpecAct])
  2579.                                     {
  2580.                                         case 11, 24, 25: return KickWithCode(playerid, "", 0, 18, 1);
  2581.                                     }
  2582.                                 }
  2583.                                 case 1:
  2584.                                 {
  2585.                                     if(AntiCheatInfo[playerid][pSpecAct]
  2586.                                     && !(19 < AntiCheatInfo[playerid][pSpecAct]
  2587.                                     < 25)) return KickWithCode(playerid, "", 0, 18, 2);
  2588.                                 }
  2589.                                 case 2:
  2590.                                 {
  2591.                                     if(!IsPlayerInRangeOfPoint(playerid, 3.0,
  2592.                                     AntiCheatInfo[playerid][pDropJP][0], AntiCheatInfo[playerid][pDropJP][1],
  2593.                                     AntiCheatInfo[playerid][pDropJP][2])) return KickWithCode(playerid, "", 0, 18, 3);
  2594.                                     for(i = 2; i != -1; --i) AntiCheatInfo[playerid][pDropJP][i] = 20001.0;
  2595.                                 }
  2596.                                 case 3:
  2597.                                 {
  2598.                                     switch(AntiCheatInfo[playerid][pSpecAct])
  2599.                                     {
  2600.                                         case 2, 5..8, 11, 68: return KickWithCode(playerid, "", 0, 18, 4);
  2601.                                     }
  2602.                                 }
  2603.                                 default:
  2604.                                 {
  2605.                                     if(!(19 < specact < 25 && AntiCheatInfo[playerid][pSpecAct] == 1 && specact
  2606.                                     == AntiCheatInfo[playerid][pLastSpecAct]) && !((specact == 4 || specact == 11 || specact == 24
  2607.                                     || specact == 25) && AntiCheatInfo[playerid][pVeh]) && !(AntiCheatInfo[playerid][pSpecAct] == 3
  2608.                                     && specact == AntiCheatInfo[playerid][pLastSpecAct])) return KickWithCode(playerid, "", 0, 18, 5);
  2609.                                 }
  2610.                             }
  2611.                         }
  2612.                         AntiCheatInfo[playerid][pLastSpecAct] = AntiCheatInfo[playerid][pSpecAct];
  2613.                     }
  2614.                     if(gtc > AntiCheatInfo[playerid][pGtc][10] + gpp && GetPlayerSurfingVehicleID(playerid)
  2615.                     == 65535 && GetPlayerSurfingObjectID(playerid) == 65535)
  2616.                     {
  2617.                         if(AntiCheatInfo[playerid][pACAllow][9] && pvel[0] > 211.0
  2618.                         && AntiCheatInfo[playerid][pSpeed] < pvel[0]) return KickWithCode(playerid, "", 0, 9);
  2619.                         if(vctsize > 0.5 && gtc > AntiCheatInfo[playerid][pGtc][11] + gpp)
  2620.                         {
  2621.                             if(vctsize > 30.0)
  2622.                             {
  2623.                                 if(AntiCheatInfo[playerid][pACAllow][2]
  2624.                                 && AntiCheatInfo[playerid][pPos][2]
  2625.                                 > -97.0) return KickWithCode(playerid, "", 0, 2, 2);
  2626.                             }
  2627.                             else if(pvel[0] <= vctsize * (vctsize < 1.0 ? 30.0 : 5.0))
  2628.                             {
  2629.                                 if(pvel[0] < 3.0 && vctsize > 3.0)
  2630.                                 {
  2631.                                     if(AntiCheatInfo[playerid][pACAllow][2]) return KickWithCode(playerid, "", 0, 2, 3);
  2632.                                 }
  2633.                                 else if(AntiCheatInfo[playerid][pACAllow][0] && pvel[0]
  2634.                                 && ++AntiCheatInfo[playerid][pCheatCount][1]
  2635.                                 > MAX_AIR_WARNINGS) return KickWithCode(playerid, "", 0, 0);
  2636.                                 #undef MAX_AIR_WARNINGS
  2637.                             }
  2638.                         }
  2639.                         AntiCheatInfo[playerid][pSpeed] = pvel[0];
  2640.                     }
  2641.                     AntiCheatInfo[playerid][pAnim] = stateanim;
  2642.                 }
  2643.                 AntiCheatInfo[playerid][pSpecAct] = specact;
  2644.                 AntiCheatInfo[playerid][pHealth] = floatround(health, floatround_tozero);
  2645.                 AntiCheatInfo[playerid][pArmour] = floatround(armour, floatround_tozero);
  2646.             }
  2647.             for(i = 2; i != -1; --i) AntiCheatInfo[playerid][pPos][i] = ppos[i];
  2648.             AntiCheatInfo[playerid][pLastWeapon] = w;
  2649.             AntiCheatInfo[playerid][pVeh] = vehid;
  2650.             AntiCheatInfo[playerid][pMoney] = a;
  2651.         }
  2652.     }
  2653.     gpp = 1;
  2654.     #if defined ac_OnPlayerUpdate
  2655.         gpp = ac_OnPlayerUpdate(playerid);
  2656.     #endif
  2657.     AntiCheatInfo[playerid][pLastUpdate] = GetTickCount();
  2658.     if(ur) AntiCheatInfo[playerid][pGtc][15] = AntiCheatInfo[playerid][pLastUpdate];
  2659.     if(AntiCheatInfo[playerid][pACAllow][33] && gpp) return AntiCheatInfo[playerid][pFreeze];
  2660.     return gpp;
  2661. }
  2662.  
  2663. #if defined _ALS_OnPlayerUpdate
  2664.     #undef OnPlayerUpdate
  2665. #else
  2666.     #define _ALS_OnPlayerUpdate
  2667. #endif
  2668. #define OnPlayerUpdate ac_OnPlayerUpdate
  2669. #if defined ac_OnPlayerUpdate
  2670.     forward ac_OnPlayerUpdate(playerid);
  2671. #endif
  2672.  
  2673. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2674. {
  2675.     if(newkeys & 16 && AntiCheatInfo[playerid][pSpecAct]
  2676.     == 2 && GetPlayerSpecialAction(playerid) != 2)
  2677.     {
  2678.         for(new i = 2; i != -1; --i) AntiCheatInfo[playerid][pDropJP][i] = AntiCheatInfo[playerid][pPos][i];
  2679.     }
  2680.     #if defined ac_OnPlayerKeyStateChange
  2681.         return ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  2682.     #else
  2683.         return 1;
  2684.     #endif
  2685. }
  2686.  
  2687. #if defined _ALS_OnPlayerKeyStateChange
  2688.     #undef OnPlayerKeyStateChange
  2689. #else
  2690.     #define _ALS_OnPlayerKeyStateChange
  2691. #endif
  2692. #define OnPlayerKeyStateChange ac_OnPlayerKeyStateChange
  2693. #if defined ac_OnPlayerKeyStateChange
  2694.     forward ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  2695. #endif
  2696.  
  2697. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  2698. {
  2699.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  2700.     new i = GetTickCount();
  2701.     if(AntiCheatInfo[playerid][pACAllow][49])
  2702.     {
  2703.         if(i < AntiCheatInfo[playerid][pCall][2] + Mtfc[2][0]) return FloodDetect(playerid, 2);
  2704.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2705.         else AntiCheatInfo[playerid][pFloodCount][2] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2706.     }
  2707.     i = 1;
  2708.     #if defined ac_OnPlayerClickMap
  2709.         i = ac_OnPlayerClickMap(playerid, fX, fY, fZ);
  2710.     #endif
  2711.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][2] = GetTickCount();
  2712.     return i;
  2713. }
  2714.  
  2715. #if defined _ALS_OnPlayerClickMap
  2716.     #undef OnPlayerClickMap
  2717. #else
  2718.     #define _ALS_OnPlayerClickMap
  2719. #endif
  2720. #define OnPlayerClickMap ac_OnPlayerClickMap
  2721. #if defined ac_OnPlayerClickMap
  2722.     forward ac_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
  2723. #endif
  2724.  
  2725. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  2726. {
  2727.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  2728.     new i = GetTickCount();
  2729.     if(AntiCheatInfo[playerid][pACAllow][49])
  2730.     {
  2731.         if(i < AntiCheatInfo[playerid][pCall][3] + Mtfc[3][0]) return FloodDetect(playerid, 3);
  2732.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2733.         else AntiCheatInfo[playerid][pFloodCount][3] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2734.     }
  2735.     i = 1;
  2736.     #if defined ac_OnPlayerClickPlayer
  2737.         i = ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  2738.     #endif
  2739.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][3] = GetTickCount();
  2740.     return i;
  2741. }
  2742.  
  2743. #if defined _ALS_OnPlayerClickPlayer
  2744.     #undef OnPlayerClickPlayer
  2745. #else
  2746.     #define _ALS_OnPlayerClickPlayer
  2747. #endif
  2748. #define OnPlayerClickPlayer ac_OnPlayerClickPlayer
  2749. #if defined ac_OnPlayerClickPlayer
  2750.     forward ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  2751. #endif
  2752.  
  2753. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  2754. {
  2755.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  2756.     new i = GetTickCount();
  2757.     if(AntiCheatInfo[playerid][pACAllow][49])
  2758.     {
  2759.         if(i < AntiCheatInfo[playerid][pCall][4] + Mtfc[4][0]) return FloodDetect(playerid, 4);
  2760.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2761.         else AntiCheatInfo[playerid][pFloodCount][4] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2762.     }
  2763.     i = 1;
  2764.     #if defined ac_OnPlayerClickTextDraw
  2765.         i = ac_OnPlayerClickTextDraw(playerid, clickedid);
  2766.     #endif
  2767.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][4] = GetTickCount();
  2768.     return i;
  2769. }
  2770.  
  2771. #if defined _ALS_OnPlayerClickTextDraw
  2772.     #undef OnPlayerClickTextDraw
  2773. #else
  2774.     #define _ALS_OnPlayerClickTextDraw
  2775. #endif
  2776. #define OnPlayerClickTextDraw ac_OnPlayerClickTextDraw
  2777. #if defined ac_OnPlayerClickTextDraw
  2778.     forward ac_OnPlayerClickTextDraw(playerid, Text:clickedid);
  2779. #endif
  2780.  
  2781. public OnPlayerCommandText(playerid, cmdtext[])
  2782. {
  2783.     if(AntiCheatInfo[playerid][pKicked]) return 1;
  2784.     new i = GetTickCount();
  2785.     if(AntiCheatInfo[playerid][pACAllow][49])
  2786.     {
  2787.         if(i < AntiCheatInfo[playerid][pCall][5] + Mtfc[5][0])
  2788.         {
  2789.             FloodDetect(playerid, 5);
  2790.             return 1;
  2791.         }
  2792.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2793.         else AntiCheatInfo[playerid][pFloodCount][5] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2794.     }
  2795.     i = 0;
  2796.     #if defined ac_OnPlayerCommandText
  2797.         i = ac_OnPlayerCommandText(playerid, cmdtext);
  2798.     #endif
  2799.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][5] = GetTickCount();
  2800.     return i;
  2801. }
  2802.  
  2803. #if defined _ALS_OnPlayerCommandText
  2804.     #undef OnPlayerCommandText
  2805. #else
  2806.     #define _ALS_OnPlayerCommandText
  2807. #endif
  2808. #define OnPlayerCommandText ac_OnPlayerCommandText
  2809. #if defined ac_OnPlayerCommandText
  2810.     forward ac_OnPlayerCommandText(playerid, cmdtext[]);
  2811. #endif
  2812.  
  2813. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2814. {
  2815.     if(!IsPlayerConnected(playerid)
  2816.     || AntiCheatInfo[playerid][pKicked]) return 0;
  2817.     new i = GetTickCount(), bool:ur;
  2818.     if(!IsPlayerNPC(playerid))
  2819.     {
  2820.         if(AntiCheatInfo[playerid][pACAllow][49])
  2821.         {
  2822.             if(i < AntiCheatInfo[playerid][pCall][6] + Mtfc[6][0]) return FloodDetect(playerid, 6);
  2823.             if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2824.             else AntiCheatInfo[playerid][pFloodCount][6] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2825.         }
  2826.         i = GetVehicleModel(vehicleid);
  2827.         if(AntiCheatInfo[playerid][pACAllow][44]
  2828.         && i == -1) return KickWithCode(playerid, "", 0, 44, 1);
  2829.         new Float:TmpPos[3];
  2830.         GetVehiclePos(vehicleid, TmpPos[0], TmpPos[1], TmpPos[2]);
  2831.         TmpPos[0] = VectorSize(AntiCheatInfo[playerid][pPos][0]
  2832.         - TmpPos[0], AntiCheatInfo[playerid][pPos][1] - TmpPos[1],
  2833.         AntiCheatInfo[playerid][pPos][2] - TmpPos[2]);
  2834.         if(AntiCheatInfo[playerid][pACAllow][4] && (!(i == 577 || i == 592) && TmpPos[0]
  2835.         > 15.0 || TmpPos[0] > 40.0)) return KickWithCode(playerid, "", 0, 4, 3);
  2836.         if(AntiCheatInfo[playerid][pEnterVeh] == vehicleid) ur = true;
  2837.         else
  2838.         {
  2839.             new TmpPrm1, TmpPrm2;
  2840.             GetVehicleParamsEx(vehicleid, TmpPrm2, TmpPrm2,
  2841.             TmpPrm2, TmpPrm1, TmpPrm2, TmpPrm2, TmpPrm2);
  2842.             if(TmpPrm1)
  2843.             {
  2844.                 AntiCheatInfo[playerid][pEnterVeh] = vehicleid;
  2845.                 if(IsBoatVehicle(i)) AntiCheatInfo[playerid][pEnterVehTime] = 0, ur = true;
  2846.             }
  2847.         }
  2848.     }
  2849.     i = 1;
  2850.     #if defined ac_OnPlayerEnterVehicle
  2851.         i = ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  2852.     #endif
  2853.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][6] = GetTickCount();
  2854.     if(!ur) AntiCheatInfo[playerid][pEnterVehTime] = AntiCheatInfo[playerid][pCall][27];
  2855.     return i;
  2856. }
  2857.  
  2858. #if defined _ALS_OnPlayerEnterVehicle
  2859.     #undef OnPlayerEnterVehicle
  2860. #else
  2861.     #define _ALS_OnPlayerEnterVehicle
  2862. #endif
  2863. #define OnPlayerEnterVehicle ac_OnPlayerEnterVehicle
  2864. #if defined ac_OnPlayerEnterVehicle
  2865.     forward ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  2866. #endif
  2867.  
  2868. public OnPlayerExitVehicle(playerid, vehicleid)
  2869. {
  2870.     if(!IsPlayerConnected(playerid)
  2871.     || AntiCheatInfo[playerid][pKicked]) return 0;
  2872.     new i = GetTickCount();
  2873.     if(!IsPlayerNPC(playerid) && AntiCheatInfo[playerid][pACAllow][49])
  2874.     {
  2875.         if(i < AntiCheatInfo[playerid][pCall][7] + Mtfc[7][0]) return FloodDetect(playerid, 7);
  2876.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2877.         else AntiCheatInfo[playerid][pFloodCount][7] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2878.     }
  2879.     switch(GetVehicleModel(AntiCheatInfo[playerid][pVeh]))
  2880.     {
  2881.         case 417, 425, 447, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520,
  2882.         548, 553, 563, 577, 592, 593: AntiCheatInfo[playerid][pParachute] = true;
  2883.         default: AntiCheatInfo[playerid][pParachute] = false;
  2884.     }
  2885.     i = 1;
  2886.     #if defined ac_OnPlayerExitVehicle
  2887.         i = ac_OnPlayerExitVehicle(playerid, vehicleid);
  2888.     #endif
  2889.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][7] = GetTickCount();
  2890.     return i;
  2891. }
  2892.  
  2893. #if defined _ALS_OnPlayerExitVehicle
  2894.     #undef OnPlayerExitVehicle
  2895. #else
  2896.     #define _ALS_OnPlayerExitVehicle
  2897. #endif
  2898. #define OnPlayerExitVehicle ac_OnPlayerExitVehicle
  2899. #if defined ac_OnPlayerExitVehicle
  2900.     forward ac_OnPlayerExitVehicle(playerid, vehicleid);
  2901. #endif
  2902.  
  2903. public OnPlayerPickUpPickup(playerid, pickupid)
  2904. {
  2905.     if(!IsPlayerConnected(playerid)
  2906.     || AntiCheatInfo[playerid][pKicked]) return 0;
  2907.     new i = GetTickCount();
  2908.     if(AntiCheatInfo[playerid][pACAllow][49])
  2909.     {
  2910.         if(i < AntiCheatInfo[playerid][pCall][8] + Mtfc[8][0]) FloodDetect(playerid, 8);
  2911.         else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2912.         else AntiCheatInfo[playerid][pFloodCount][8] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2913.     }
  2914.     if(AntiCheatInfo[playerid][pACAllow][6]
  2915.     && (!(-1 < pickupid < MAX_PICKUPS) || !IsPlayerInRangeOfPoint(playerid,
  2916.     3.0, AntiCheatPickInfo[pickupid][pPos][0], AntiCheatPickInfo[pickupid][pPos][1],
  2917.     AntiCheatPickInfo[pickupid][pPos][2]))) return KickWithCode(playerid, "", 0, 6);
  2918.     switch(AntiCheatPickInfo[pickupid][pType])
  2919.     {
  2920.         case 1:
  2921.         {
  2922.             i = GetWeaponSlot(AntiCheatPickInfo[pickupid][pWeapon]);
  2923.             AntiCheatInfo[playerid][pWeapon][i] = AntiCheatPickInfo[pickupid][pWeapon];
  2924.             if(AntiCheatInfo[playerid][pWeapon][i] == AntiCheatPickInfo[pickupid][pWeapon]
  2925.             || 2 < i < 6) AntiCheatInfo[playerid][pAmmo][i] += PickupAmmo[AntiCheatPickInfo[pickupid][pWeapon]];
  2926.             else AntiCheatInfo[playerid][pAmmo][i] = PickupAmmo[AntiCheatPickInfo[pickupid][pWeapon]];
  2927.         }
  2928.         case 2: AntiCheatInfo[playerid][pSpecAct] = 2;
  2929.         case 3: AntiCheatInfo[playerid][pHealth] = 100;
  2930.         case 4: AntiCheatInfo[playerid][pArmour] = 100;
  2931.     }
  2932.     i = 1;
  2933.     #if defined ac_OnPlayerPickUpPickup
  2934.         if(!AntiCheatPickInfo[pickupid][pIsStatic]) i = ac_OnPlayerPickUpPickup(playerid, pickupid);
  2935.     #endif
  2936.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][8] = GetTickCount();
  2937.     return i;
  2938. }
  2939.  
  2940. #if defined _ALS_OnPlayerPickUpPickup
  2941.     #undef OnPlayerPickUpPickup
  2942. #else
  2943.     #define _ALS_OnPlayerPickUpPickup
  2944. #endif
  2945. #define OnPlayerPickUpPickup ac_OnPlayerPickUpPickup
  2946. #if defined ac_OnPlayerPickUpPickup
  2947.     forward ac_OnPlayerPickUpPickup(playerid, pickupid);
  2948. #endif
  2949.  
  2950. public OnPlayerRequestClass(playerid, classid)
  2951. {
  2952.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  2953.     new i = GetTickCount();
  2954.     if(!IsPlayerNPC(playerid))
  2955.     {
  2956.         if(AntiCheatInfo[playerid][pACAllow][49])
  2957.         {
  2958.             if(i < AntiCheatInfo[playerid][pCall][9] + Mtfc[9][0]) return FloodDetect(playerid, 9);
  2959.             if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2960.             else AntiCheatInfo[playerid][pFloodCount][9] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2961.         }
  2962.         AntiCheatInfo[playerid][pClassid] = classid;
  2963.     }
  2964.     i = 1;
  2965.     #if defined ac_OnPlayerRequestClass
  2966.         i = ac_OnPlayerRequestClass(playerid, classid);
  2967.     #endif
  2968.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][9] = GetTickCount();
  2969.     return i;
  2970. }
  2971.  
  2972. #if defined _ALS_OnPlayerRequestClass
  2973.     #undef OnPlayerRequestClass
  2974. #else
  2975.     #define _ALS_OnPlayerRequestClass
  2976. #endif
  2977. #define OnPlayerRequestClass ac_OnPlayerRequestClass
  2978. #if defined ac_OnPlayerRequestClass
  2979.     forward ac_OnPlayerRequestClass(playerid, classid);
  2980. #endif
  2981.  
  2982. public OnPlayerSelectedMenuRow(playerid, row)
  2983. {
  2984.     if(!IsPlayerConnected(playerid)
  2985.     || AntiCheatInfo[playerid][pKicked]) return 0;
  2986.     new i = GetTickCount();
  2987.     if(AntiCheatInfo[playerid][pACAllow][49])
  2988.     {
  2989.         if(i < AntiCheatInfo[playerid][pCall][10] + Mtfc[10][0]) FloodDetect(playerid, 10);
  2990.         else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  2991.         else AntiCheatInfo[playerid][pFloodCount][10] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  2992.     }
  2993.     i = 1;
  2994.     #if defined ac_OnPlayerSelectedMenuRow
  2995.         i = ac_OnPlayerSelectedMenuRow(playerid, row);
  2996.     #endif
  2997.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][10] = GetTickCount();
  2998.     return i;
  2999. }
  3000.  
  3001. #if defined _ALS_OnPlayerSelectedMenuRow
  3002.     #undef OnPlayerSelectedMenuRow
  3003. #else
  3004.     #define _ALS_OnPlayerSelectedMenuRow
  3005. #endif
  3006. #define OnPlayerSelectedMenuRow ac_OnPlayerSelectedMenuRow
  3007. #if defined ac_OnPlayerSelectedMenuRow
  3008.     forward ac_OnPlayerSelectedMenuRow(playerid, row);
  3009. #endif
  3010.  
  3011. public OnPlayerStateChange(playerid, newstate, oldstate)
  3012. {
  3013.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3014.     new i = GetTickCount(), bool:ur;
  3015.     if(!IsPlayerNPC(playerid))
  3016.     {
  3017.         if(AntiCheatInfo[playerid][pACAllow][49])
  3018.         {
  3019.             if(i < AntiCheatInfo[playerid][pCall][11] + Mtfc[11][0])
  3020.             {
  3021.                 if(newstate != 1 || oldstate != 8) FloodDetect(playerid, 11);
  3022.             }
  3023.             else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3024.             else AntiCheatInfo[playerid][pFloodCount][11] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3025.         }
  3026.         if(1 < oldstate < 4)
  3027.         {
  3028.             switch(oldstate)
  3029.             {
  3030.                 case 2:
  3031.                 {
  3032.                     if(AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver]
  3033.                     == playerid) AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver] = 65535;
  3034.                     if(GetVehicleModel(AntiCheatInfo[playerid][pVeh]) == 457
  3035.                     && !AntiCheatInfo[playerid][pWeapon][1]) AntiCheatInfo[playerid][pWeapon][1] = 2;
  3036.                     AntiCheatInfo[playerid][pVehDmgRes] = false;
  3037.                 }
  3038.                 case 3:
  3039.                 {
  3040.                     if(AntiCheatInfo[playerid][pACAllow][2]
  3041.                     && newstate == 1 && !IsPlayerInRangeOfPoint(playerid, 15.0,
  3042.                     AntiCheatInfo[playerid][pPos][0], AntiCheatInfo[playerid][pPos][1],
  3043.                     AntiCheatInfo[playerid][pPos][2]) && !(AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver]
  3044.                     != 65535 && i > AntiCheatInfo[AntiCheatVehInfo[AntiCheatInfo[playerid][pVeh]][vDriver]][pLastUpdate]
  3045.                     + 2000)) KickWithCode(playerid, "", 0, 2, 4);
  3046.                 }
  3047.             }
  3048.             new Float:TmpVel[3];
  3049.             GetPlayerVelocity(playerid, TmpVel[0], TmpVel[1], TmpVel[2]);
  3050.             AntiCheatInfo[playerid][pSpeed] = GetSpeed(TmpVel[0], TmpVel[1], TmpVel[2]);
  3051.             ur = true;
  3052.         }
  3053.         switch(newstate)
  3054.         {
  3055.             case 1:
  3056.             {
  3057.                 AntiCheatInfo[playerid][pSet][11] = -1;
  3058.                 AntiCheatInfo[playerid][pEnterVeh] = 0;
  3059.                 GetPlayerPos(playerid, AntiCheatInfo[playerid][pPos][0],
  3060.                 AntiCheatInfo[playerid][pPos][1], AntiCheatInfo[playerid][pPos][2]);
  3061.             }
  3062.             case 2:
  3063.             {
  3064.                 i = GetPlayerVehicleID(playerid);
  3065.                 if(AntiCheatInfo[playerid][pACAllow][44])
  3066.                 {
  3067.                     new seatid = GetPlayerVehicleSeat(playerid);
  3068.                     if(seatid != 128)
  3069.                     {
  3070.                         new model = GetVehicleModel(i) - 400;
  3071.                         if(seatid || model < 0 || MaxPassengers[model >>> 3] >>> ((model & 7) << 2) & 0xF == 15
  3072.                         && AntiCheatInfo[playerid][pSet][9] == -1) KickWithCode(playerid, "", 0, 44, 2);
  3073.                     }
  3074.                 }
  3075.                 if(AntiCheatInfo[playerid][pSet][9] == -1)
  3076.                 {
  3077.                     AntiCheatVehInfo[i][vDriver] = playerid;
  3078.                     GetVehicleZAngle(i, AntiCheatVehInfo[i][vZAngle]);
  3079.                     GetPlayerPos(playerid, AntiCheatInfo[playerid][pPos][0],
  3080.                     AntiCheatInfo[playerid][pPos][1], AntiCheatInfo[playerid][pPos][2]);
  3081.                     AntiCheatInfo[playerid][pSetVehHealth] = -1;
  3082.                 }
  3083.             }
  3084.             case 3:
  3085.             {
  3086.                 AntiCheatInfo[playerid][pCheatCount][4] = 0;
  3087.                 if(AntiCheatInfo[playerid][pACAllow][44])
  3088.                 {
  3089.                     i = GetPlayerVehicleSeat(playerid);
  3090.                     if(i != 128)
  3091.                     {
  3092.                         new model = GetVehicleModel(GetPlayerVehicleID(playerid)) - 400;
  3093.                         if(model < 0) KickWithCode(playerid, "", 0, 44, 3);
  3094.                         else
  3095.                         {
  3096.                             model = (MaxPassengers[model >>> 3] >>> ((model & 7) << 2)) & 0xF;
  3097.                             if(i < 1 || (model == 15 || i > model)
  3098.                             && AntiCheatInfo[playerid][pSet][9]
  3099.                             == -1) KickWithCode(playerid, "", 0, 44, 4);
  3100.                         }
  3101.                     }
  3102.                 }
  3103.             }
  3104.             case 9:
  3105.             {
  3106.                 if(AntiCheatInfo[playerid][pACAllow][21]
  3107.                 && AntiCheatInfo[playerid][pSet][6]
  3108.                 == -1) KickWithCode(playerid, "", 0, 21);
  3109.                 AntiCheatInfo[playerid][pSet][6] = -1;
  3110.                 AntiCheatInfo[playerid][pSpawnRes] = true;
  3111.                 AntiCheatInfo[playerid][pSpawnTime] = 0;
  3112.             }
  3113.         }
  3114.     }
  3115.     i = 1;
  3116.     #if defined ac_OnPlayerStateChange
  3117.         i = ac_OnPlayerStateChange(playerid, newstate, oldstate);
  3118.     #endif
  3119.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][11] = GetTickCount();
  3120.     if(ur) AntiCheatInfo[playerid][pGtc][10] = AntiCheatInfo[playerid][pCall][27];
  3121.     return i;
  3122. }
  3123.  
  3124. #if defined _ALS_OnPlayerStateChange
  3125.     #undef OnPlayerStateChange
  3126. #else
  3127.     #define _ALS_OnPlayerStateChange
  3128. #endif
  3129. #define OnPlayerStateChange ac_OnPlayerStateChange
  3130. #if defined ac_OnPlayerStateChange
  3131.     forward ac_OnPlayerStateChange(playerid, newstate, oldstate);
  3132. #endif
  3133.  
  3134. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  3135. {
  3136.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3137.     static i, bool:ur, bool:ur2;
  3138.     i = GetTickCount();
  3139.     ur = ur2 = false;
  3140.     if(!IsPlayerNPC(playerid))
  3141.     {
  3142.         if(AntiCheatInfo[playerid][pACAllow][22]
  3143.         && !LagCompMode) return KickWithCode(playerid, "", 0, 22);
  3144.         if(AntiCheatInfo[playerid][pACAllow][34] && i
  3145.         > AntiCheatInfo[playerid][pLastUpdate] + 3000)
  3146.         {
  3147.             if(++AntiCheatInfo[playerid][pCheatCount][5]
  3148.             > MAX_AFK_GHOST_WARNINGS) return KickWithCode(playerid, "", 0, 34);
  3149.             #undef MAX_AFK_GHOST_WARNINGS
  3150.         }
  3151.         else AntiCheatInfo[playerid][pCheatCount][5] = 0;
  3152.         if(AntiCheatInfo[playerid][pACAllow][29] && hittype == 1 && i
  3153.         < AntiCheatInfo[hitid][pLastUpdate] + 1500 && !IsPlayerInAnyVehicle(hitid)
  3154.         && GetPlayerSurfingVehicleID(hitid) == 65535 && GetPlayerSurfingObjectID(hitid) == 65535)
  3155.         {
  3156.             static Float:fPos[4];
  3157.             GetPlayerLastShotVectors(playerid, fPos[3], fPos[3], fPos[3], fPos[0], fPos[1], fPos[2]);
  3158.             if(!IsPlayerInRangeOfPoint(hitid, 3.0, fPos[0], fPos[1], fPos[2]))
  3159.             {
  3160.                 if(++AntiCheatInfo[playerid][pCheatCount][6]
  3161.                 > MAX_PRO_AIM_WARNINGS) return KickWithCode(playerid, "", 0, 29);
  3162.                 #undef MAX_PRO_AIM_WARNINGS
  3163.             }
  3164.             else AntiCheatInfo[playerid][pCheatCount][6] = 0;
  3165.         }
  3166.         else AntiCheatInfo[playerid][pCheatCount][6] = 0;
  3167.         switch(hittype)
  3168.         {
  3169.             case 1:
  3170.             {
  3171.                 if(AntiCheatInfo[playerid][pACAllow][19]
  3172.                 && AntiCheatInfo[hitid][pFreeze]
  3173.                 && i > AntiCheatInfo[hitid][pGtc][14]
  3174.                 + GetPlayerPing(hitid) + 100)
  3175.                 {
  3176.                     static t, j;
  3177.                     t = GetPlayerTeam(playerid);
  3178.                     j = GetPlayerInterior(hitid);
  3179.                     if((t == 255 || t != GetPlayerTeam(hitid))
  3180.                     && !IsPlayerInRestaurant(playerid, j)
  3181.                     && !IsPlayerInAmmuNation(playerid,
  3182.                     j)) AntiCheatInfo[hitid][pCheatCount][9] = 0, ur = true;
  3183.                 }
  3184.             }
  3185.             case 2:
  3186.             {
  3187.                 if(AntiCheatInfo[playerid][pACAllow][20]
  3188.                 && AntiCheatVehInfo[hitid][vDriver] != 65535
  3189.                 && AntiCheatInfo[AntiCheatVehInfo[hitid][vDriver]][pFreeze])
  3190.                 {
  3191.                     static t;
  3192.                     t = GetPlayerTeam(playerid);
  3193.                     if(!VehFriendlyFire || t == 255
  3194.                     || t != GetPlayerTeam(AntiCheatVehInfo[hitid][vDriver]))
  3195.                     {
  3196.                         AntiCheatInfo[AntiCheatVehInfo[hitid][vDriver]][pCheatCount][11] = 0;
  3197.                         ur2 = true;
  3198.                     }
  3199.                 }
  3200.             }
  3201.         }
  3202.         static s;
  3203.         s = GetPlayerState(playerid);
  3204.         if(s != 2)
  3205.         {
  3206.             if(AntiCheatInfo[playerid][pACAllow][47] && (s != 3 && GetPlayerWeapon(playerid) != weaponid
  3207.             || weaponid != 38 && !(21 < weaponid < 35))) return KickWithCode(playerid, "", 0, 47, 2);
  3208.             i -= AntiCheatInfo[playerid][pShotTime];
  3209.             if(AntiCheatInfo[playerid][pShot])
  3210.             {
  3211.                 if(AntiCheatInfo[playerid][pACAllow][26] && weaponid != 38)
  3212.                 {
  3213.                     if(weaponid == 28 || weaponid == 32)
  3214.                     {
  3215.                         if(i < 30 && ++AntiCheatInfo[playerid][pCheatCount][8]
  3216.                         > MAX_RAPID_FIRE_WARNINGS) return KickWithCode(playerid, "", 0, 26, 1);
  3217.                     }
  3218.                     else if(i < 70 || 32 < weaponid < 35 && i < 386)
  3219.                     {
  3220.                         if(++AntiCheatInfo[playerid][pCheatCount][8]
  3221.                         > MAX_RAPID_FIRE_WARNINGS) return KickWithCode(playerid, "", 0, 26, 2);
  3222.                     }
  3223.                     else AntiCheatInfo[playerid][pCheatCount][8] = 0;
  3224.                 }
  3225.             }
  3226.             else
  3227.             {
  3228.                 if(AntiCheatInfo[playerid][pACAllow][26] && i
  3229.                 < 30) return KickWithCode(playerid, "", 0, 26, 3);
  3230.                 AntiCheatInfo[playerid][pCheatCount][8] = 0;
  3231.                 AntiCheatInfo[playerid][pShot] = true;
  3232.             }
  3233.             s = GetWeaponSlot(weaponid);
  3234.             if(AntiCheatInfo[playerid][pACAllow][17])
  3235.             {
  3236.                 if(!AntiCheatInfo[playerid][pAmmo][s]) return KickWithCode(playerid, "", 0, 17, 1);
  3237.                 if((i = abs(AntiCheatInfo[playerid][pAmmo][s] - GetPlayerAmmo(playerid))))
  3238.                 {
  3239.                     switch(weaponid)
  3240.                     {
  3241.                         case 26:
  3242.                         {
  3243.                             if(i > 2 || ++AntiCheatInfo[playerid][pCheatCount][7]
  3244.                             > 2) return KickWithCode(playerid, "", 0, 17, 2);
  3245.                         }
  3246.                         case 22, 29..31:
  3247.                         {
  3248.                             if(i > 1 || ++AntiCheatInfo[playerid][pCheatCount][7]
  3249.                             > 1) return KickWithCode(playerid, "", 0, 17, 3);
  3250.                         }
  3251.                         case 28, 32:
  3252.                         {
  3253.                             if(i > 8) return KickWithCode(playerid, "", 0, 17, 4);
  3254.                         }
  3255.                         case 38:
  3256.                         {
  3257.                             if(++AntiCheatInfo[playerid][pCheatCount][7]
  3258.                             > 5) return KickWithCode(playerid, "", 0, 17, 5);
  3259.                         }
  3260.                         default: return KickWithCode(playerid, "", 0, 17, 6);
  3261.                     }
  3262.                 }
  3263.                 else AntiCheatInfo[playerid][pCheatCount][7] = 0;
  3264.             }
  3265.             AntiCheatInfo[playerid][pAmmo][s]--;
  3266.             if(AntiCheatInfo[playerid][pAmmo][s] < -32768) AntiCheatInfo[playerid][pAmmo][s] += 65536;
  3267.             else if(!AntiCheatInfo[playerid][pAmmo][s] && AntiCheatInfo[playerid][pSet][3]
  3268.             == weaponid) AntiCheatInfo[playerid][pSet][3] = AntiCheatInfo[playerid][pSetWeapon][s] = -1;
  3269.         }
  3270.     }
  3271.     i = 1;
  3272.     #if defined ac_OnPlayerWeaponShot
  3273.         i = ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
  3274.     #endif
  3275.     AntiCheatInfo[playerid][pShotTime] = GetTickCount();
  3276.     if(i)
  3277.     {
  3278.         if(ur)
  3279.         {
  3280.             AntiCheatInfo[hitid][pDmgRes] = true;
  3281.             AntiCheatInfo[hitid][pGtc][14] = AntiCheatInfo[playerid][pShotTime];
  3282.         }
  3283.         if(ur2)
  3284.         {
  3285.             AntiCheatInfo[AntiCheatVehInfo[hitid][vDriver]][pVehDmgRes] = true;
  3286.             AntiCheatInfo[AntiCheatVehInfo[hitid][vDriver]][pGtc][16]
  3287.             = AntiCheatInfo[playerid][pShotTime];
  3288.         }
  3289.     }
  3290.     return i;
  3291. }
  3292.  
  3293. #if defined _ALS_OnPlayerWeaponShot
  3294.     #undef OnPlayerWeaponShot
  3295. #else
  3296.     #define _ALS_OnPlayerWeaponShot
  3297. #endif
  3298. #define OnPlayerWeaponShot ac_OnPlayerWeaponShot
  3299. #if defined ac_OnPlayerWeaponShot
  3300.     forward ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  3301. #endif
  3302.  
  3303. public OnVehicleMod(playerid, vehicleid, componentid)
  3304. {
  3305.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3306.     new i = GetTickCount();
  3307.     if(AntiCheatInfo[playerid][pACAllow][49])
  3308.     {
  3309.         if(i < AntiCheatInfo[playerid][pCall][12] + Mtfc[12][0]) FloodDetect(playerid, 12);
  3310.         else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3311.         else AntiCheatInfo[playerid][pFloodCount][12] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3312.     }
  3313.     if(AntiCheatInfo[playerid][pACAllow][23] && !AntiCheatInfo[playerid][pModShop]) return KickWithCode(playerid, "", 0, 23, 2);
  3314.     if(AntiCheatInfo[playerid][pACAllow][43] && !IsComponentidCompatible(GetVehicleModel(vehicleid),
  3315.     componentid)) return KickWithCode(playerid, "", 0, 43, 1);
  3316.     i = 1;
  3317.     #if defined ac_OnVehicleMod
  3318.         i = ac_OnVehicleMod(playerid, vehicleid, componentid);
  3319.     #endif
  3320.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][12] = GetTickCount();
  3321.     return i;
  3322. }
  3323.  
  3324. #if defined _ALS_OnVehicleMod
  3325.     #undef OnVehicleMod
  3326. #else
  3327.     #define _ALS_OnVehicleMod
  3328. #endif
  3329. #define OnVehicleMod ac_OnVehicleMod
  3330. #if defined ac_OnVehicleMod
  3331.     forward ac_OnVehicleMod(playerid, vehicleid, componentid);
  3332. #endif
  3333.  
  3334. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  3335. {
  3336.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3337.     new i = GetTickCount();
  3338.     if(AntiCheatInfo[playerid][pACAllow][49])
  3339.     {
  3340.         if(i < AntiCheatInfo[playerid][pCall][13] + Mtfc[13][0]) FloodDetect(playerid, 13);
  3341.         else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3342.         else AntiCheatInfo[playerid][pFloodCount][13] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3343.     }
  3344.     if(AntiCheatInfo[playerid][pACAllow][23] && !AntiCheatInfo[playerid][pModShop]) KickWithCode(playerid, "", 0, 23, 3);
  3345.     else if(AntiCheatInfo[playerid][pACAllow][43] && !(-1 < paintjobid < 3)) KickWithCode(playerid, "", 0, 43, 2);
  3346.     else AntiCheatVehInfo[vehicleid][vPaintJob] = paintjobid;
  3347.     i = 1;
  3348.     #if defined ac_OnVehiclePaintjob
  3349.         i = ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  3350.     #endif
  3351.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][13] = GetTickCount();
  3352.     return i;
  3353. }
  3354.  
  3355. #if defined _ALS_OnVehiclePaintjob
  3356.     #undef OnVehiclePaintjob
  3357. #else
  3358.     #define _ALS_OnVehiclePaintjob
  3359. #endif
  3360. #define OnVehiclePaintjob ac_OnVehiclePaintjob
  3361. #if defined ac_OnVehiclePaintjob
  3362.     forward ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  3363. #endif
  3364.  
  3365. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  3366. {
  3367.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3368.     new i = GetTickCount();
  3369.     if(AntiCheatInfo[playerid][pACAllow][49])
  3370.     {
  3371.         if(i < AntiCheatInfo[playerid][pCall][14] + Mtfc[14][0]) FloodDetect(playerid, 14);
  3372.         else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3373.         else AntiCheatInfo[playerid][pFloodCount][14] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3374.     }
  3375.     i = 1;
  3376.     #if defined ac_OnVehicleRespray
  3377.         i = ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  3378.     #endif
  3379.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][14] = GetTickCount();
  3380.     return i;
  3381. }
  3382.  
  3383. #if defined _ALS_OnVehicleRespray
  3384.     #undef OnVehicleRespray
  3385. #else
  3386.     #define _ALS_OnVehicleRespray
  3387. #endif
  3388. #define OnVehicleRespray ac_OnVehicleRespray
  3389. #if defined ac_OnVehicleRespray
  3390.     forward ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  3391. #endif
  3392.  
  3393. public OnVehicleSpawn(vehicleid)
  3394. {
  3395.     AntiCheatVehInfo[vehicleid][vPaintJob] = 3;
  3396.     AntiCheatVehInfo[vehicleid][vPosDiff] = 0.0;
  3397.     AntiCheatVehInfo[vehicleid][vSpawned] = true;
  3398.     AntiCheatVehInfo[vehicleid][vSpeedDiff] = 0.0;
  3399.     AntiCheatVehInfo[vehicleid][vHealth] = 1000.0;
  3400.     for(new i = 2; i != -1; --i) AntiCheatVehInfo[vehicleid][vVel][i] = 0.0;
  3401.     AntiCheatVehInfo[vehicleid][vDriver] = 65535;
  3402.     #if defined ac_OnVehicleSpawn
  3403.         return ac_OnVehicleSpawn(vehicleid);
  3404.     #else
  3405.         return 1;
  3406.     #endif
  3407. }
  3408.  
  3409. #if defined _ALS_OnVehicleSpawn
  3410.     #undef OnVehicleSpawn
  3411. #else
  3412.     #define _ALS_OnVehicleSpawn
  3413. #endif
  3414. #define OnVehicleSpawn ac_OnVehicleSpawn
  3415. #if defined ac_OnVehicleSpawn
  3416.     forward ac_OnVehicleSpawn(vehicleid);
  3417. #endif
  3418.  
  3419. public OnVehicleDeath(vehicleid, killerid)
  3420. {
  3421.     new i = GetTickCount();
  3422.     if(killerid != 65535 && AntiCheatInfo[killerid][pACAllow][49])
  3423.     {
  3424.         if(i < AntiCheatInfo[killerid][pCall][15] + Mtfc[15][0]) FloodDetect(killerid, 15);
  3425.         else if(i < AntiCheatInfo[killerid][pCall][27] + Mtfc[27][0]) FloodDetect(killerid, 27);
  3426.         else AntiCheatInfo[killerid][pFloodCount][15] = AntiCheatInfo[killerid][pFloodCount][27] = 0;
  3427.     }
  3428.     AntiCheatVehInfo[vehicleid][vSpawned] = false;
  3429.     i = 1;
  3430.     #if defined ac_OnVehicleDeath
  3431.         i = ac_OnVehicleDeath(vehicleid, killerid);
  3432.     #endif
  3433.     if(killerid != 65535) AntiCheatInfo[killerid][pCall][27]
  3434.     = AntiCheatInfo[killerid][pCall][15] = GetTickCount();
  3435.     return i;
  3436. }
  3437.  
  3438. #if defined _ALS_OnVehicleDeath
  3439.     #undef OnVehicleDeath
  3440. #else
  3441.     #define _ALS_OnVehicleDeath
  3442. #endif
  3443. #define OnVehicleDeath ac_OnVehicleDeath
  3444. #if defined ac_OnVehicleDeath
  3445.     forward ac_OnVehicleDeath(vehicleid, killerid);
  3446. #endif
  3447.  
  3448. public OnPlayerText(playerid, text[])
  3449. {
  3450.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3451.     new i = GetTickCount();
  3452.     if(AntiCheatInfo[playerid][pACAllow][49])
  3453.     {
  3454.         if(i < AntiCheatInfo[playerid][pCall][16] + Mtfc[16][0]) return FloodDetect(playerid, 16);
  3455.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3456.         else AntiCheatInfo[playerid][pFloodCount][16] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3457.     }
  3458.     i = 1;
  3459.     #if defined ac_OnPlayerText
  3460.         i = ac_OnPlayerText(playerid, text);
  3461.     #endif
  3462.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][16] = GetTickCount();
  3463.     return i;
  3464. }
  3465.  
  3466. #if defined _ALS_OnPlayerText
  3467.     #undef OnPlayerText
  3468. #else
  3469.     #define _ALS_OnPlayerText
  3470. #endif
  3471. #define OnPlayerText ac_OnPlayerText
  3472. #if defined ac_OnPlayerText
  3473.     forward ac_OnPlayerText(playerid, text[]);
  3474. #endif
  3475.  
  3476. public OnPlayerEnterCheckpoint(playerid)
  3477. {
  3478.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3479.     new i = GetTickCount();
  3480.     if(AntiCheatInfo[playerid][pACAllow][49])
  3481.     {
  3482.         if(i < AntiCheatInfo[playerid][pCall][17] + Mtfc[17][0]) return FloodDetect(playerid, 17);
  3483.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3484.         else AntiCheatInfo[playerid][pFloodCount][17] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3485.     }
  3486.     i = 1;
  3487.     #if defined ac_OnPlayerEnterCheckpoint
  3488.         i = ac_OnPlayerEnterCheckpoint(playerid);
  3489.     #endif
  3490.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][17] = GetTickCount();
  3491.     return i;
  3492. }
  3493.  
  3494. #if defined _ALS_OnPlayerEnterCheckpoint
  3495.     #undef OnPlayerEnterCheckpoint
  3496. #else
  3497.     #define _ALS_OnPlayerEnterCheckpoint
  3498. #endif
  3499. #define OnPlayerEnterCheckpoint ac_OnPlayerEnterCheckpoint
  3500. #if defined ac_OnPlayerEnterCheckpoint
  3501.     forward ac_OnPlayerEnterCheckpoint(playerid);
  3502. #endif
  3503.  
  3504. public OnPlayerLeaveCheckpoint(playerid)
  3505. {
  3506.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3507.     new i = GetTickCount();
  3508.     if(AntiCheatInfo[playerid][pACAllow][49])
  3509.     {
  3510.         if(i < AntiCheatInfo[playerid][pCall][18] + Mtfc[18][0]) return FloodDetect(playerid, 18);
  3511.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3512.         else AntiCheatInfo[playerid][pFloodCount][18] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3513.     }
  3514.     i = 1;
  3515.     #if defined ac_OnPlayerLeaveCheckpoint
  3516.         i = ac_OnPlayerLeaveCheckpoint(playerid);
  3517.     #endif
  3518.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][18] = GetTickCount();
  3519.     return i;
  3520. }
  3521.  
  3522. #if defined _ALS_OnPlayerLeaveCheckpoint
  3523.     #undef OnPlayerLeaveCheckpoint
  3524. #else
  3525.     #define _ALS_OnPlayerLeaveCheckpoint
  3526. #endif
  3527. #define OnPlayerLeaveCheckpoint ac_OnPlayerLeaveCheckpoint
  3528. #if defined ac_OnPlayerLeaveCheckpoint
  3529.     forward ac_OnPlayerLeaveCheckpoint(playerid);
  3530. #endif
  3531.  
  3532. public OnPlayerRequestSpawn(playerid)
  3533. {
  3534.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3535.     new i = GetTickCount();
  3536.     if(!IsPlayerNPC(playerid))
  3537.     {
  3538.         if(AntiCheatInfo[playerid][pACAllow][49])
  3539.         {
  3540.             if(i < AntiCheatInfo[playerid][pCall][19] + Mtfc[19][0]) return FloodDetect(playerid, 19);
  3541.             if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3542.             else AntiCheatInfo[playerid][pFloodCount][19] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3543.         }
  3544.         for(i = 2; i != -1; --i)
  3545.         {
  3546.             AntiCheatInfo[playerid][pSpawnWeapon][i] = Class[AntiCheatInfo[playerid][pClassid]][i][0];
  3547.             AntiCheatInfo[playerid][pSpawnAmmo][i] = Class[AntiCheatInfo[playerid][pClassid]][i][1];
  3548.         }
  3549.     }
  3550.     i = 1;
  3551.     #if defined ac_OnPlayerRequestSpawn
  3552.         i = ac_OnPlayerRequestSpawn(playerid);
  3553.     #endif
  3554.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][19] = GetTickCount();
  3555.     if(i) AntiCheatInfo[playerid][pSet][7] = 1;
  3556.     return i;
  3557. }
  3558.  
  3559. #if defined _ALS_OnPlayerRequestSpawn
  3560.     #undef OnPlayerRequestSpawn
  3561. #else
  3562.     #define _ALS_OnPlayerRequestSpawn
  3563. #endif
  3564. #define OnPlayerRequestSpawn ac_OnPlayerRequestSpawn
  3565. #if defined ac_OnPlayerRequestSpawn
  3566.     forward ac_OnPlayerRequestSpawn(playerid);
  3567. #endif
  3568.  
  3569. public OnPlayerExitedMenu(playerid)
  3570. {
  3571.     if(!IsPlayerConnected(playerid)
  3572.     || AntiCheatInfo[playerid][pKicked]) return 0;
  3573.     new i = GetTickCount();
  3574.     if(AntiCheatInfo[playerid][pACAllow][49])
  3575.     {
  3576.         if(i < AntiCheatInfo[playerid][pCall][20] + Mtfc[20][0]) FloodDetect(playerid, 20);
  3577.         else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3578.         else AntiCheatInfo[playerid][pFloodCount][20] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3579.     }
  3580.     i = 1;
  3581.     #if defined ac_OnPlayerExitedMenu
  3582.         i = ac_OnPlayerExitedMenu(playerid);
  3583.     #endif
  3584.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][20] = GetTickCount();
  3585.     return i;
  3586. }
  3587.  
  3588. #if defined _ALS_OnPlayerExitedMenu
  3589.     #undef OnPlayerExitedMenu
  3590. #else
  3591.     #define _ALS_OnPlayerExitedMenu
  3592. #endif
  3593. #define OnPlayerExitedMenu ac_OnPlayerExitedMenu
  3594. #if defined ac_OnPlayerExitedMenu
  3595.     forward ac_OnPlayerExitedMenu(playerid);
  3596. #endif
  3597.  
  3598. public OnPlayerEnterRaceCheckpoint(playerid)
  3599. {
  3600.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3601.     new i = GetTickCount();
  3602.     if(AntiCheatInfo[playerid][pACAllow][49])
  3603.     {
  3604.         if(i < AntiCheatInfo[playerid][pCall][21] + Mtfc[21][0]) return FloodDetect(playerid, 21);
  3605.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3606.         else AntiCheatInfo[playerid][pFloodCount][21] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3607.     }
  3608.     i = 1;
  3609.     #if defined ac_OnPlayerEnterRaceCheckpoint
  3610.         i = ac_OnPlayerEnterRaceCheckpoint(playerid);
  3611.     #endif
  3612.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][21] = GetTickCount();
  3613.     return i;
  3614. }
  3615.  
  3616. #if defined _ALS_OnPlayerEnter\
  3617.     RaceCheckpoint
  3618.     #undef OnPlayerEnterRaceCheckpoint
  3619. #else
  3620.     #define _ALS_OnPlayerEnterRaceCheckpoint
  3621. #endif
  3622. #define OnPlayerEnterRaceCheckpoint ac_OnPlayerEnterRaceCheckpoint
  3623. #if defined ac_OnPlayerEnterRaceCheckpoint
  3624.     forward ac_OnPlayerEnterRaceCheckpoint(playerid);
  3625. #endif
  3626.  
  3627. public OnPlayerLeaveRaceCheckpoint(playerid)
  3628. {
  3629.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3630.     new i = GetTickCount();
  3631.     if(AntiCheatInfo[playerid][pACAllow][49])
  3632.     {
  3633.         if(i < AntiCheatInfo[playerid][pCall][22] + Mtfc[22][0]) return FloodDetect(playerid, 22);
  3634.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3635.         else AntiCheatInfo[playerid][pFloodCount][22] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3636.     }
  3637.     i = 1;
  3638.     #if defined ac_OnPlayerLeaveRaceCheckpoint
  3639.         i = ac_OnPlayerLeaveRaceCheckpoint(playerid);
  3640.     #endif
  3641.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][22] = GetTickCount();
  3642.     return i;
  3643. }
  3644.  
  3645. #if defined _ALS_OnPlayerLeave\
  3646.     RaceCheckpoint
  3647.     #undef OnPlayerLeaveRaceCheckpoint
  3648. #else
  3649.     #define _ALS_OnPlayerLeaveRaceCheckpoint
  3650. #endif
  3651. #define OnPlayerLeaveRaceCheckpoint ac_OnPlayerLeaveRaceCheckpoint
  3652. #if defined ac_OnPlayerLeaveRaceCheckpoint
  3653.     forward ac_OnPlayerLeaveRaceCheckpoint(playerid);
  3654. #endif
  3655.  
  3656. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  3657. {
  3658.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3659.     new i = GetTickCount();
  3660.     if(AntiCheatInfo[playerid][pACAllow][49])
  3661.     {
  3662.         if(i < AntiCheatInfo[playerid][pCall][23] + Mtfc[23][0]) return FloodDetect(playerid, 23);
  3663.         if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3664.         else AntiCheatInfo[playerid][pFloodCount][23] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3665.     }
  3666.     i = 1;
  3667.     #if defined ac_OnPlayerClickPlayerTextDraw
  3668.         i = ac_OnPlayerClickPlayerTextDraw(playerid, playertextid);
  3669.     #endif
  3670.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][23] = GetTickCount();
  3671.     return i;
  3672. }
  3673.  
  3674. #if defined _ALS_OnPlayerClick\
  3675.     PlayerTextDraw
  3676.     #undef OnPlayerClickPlayerTextDraw
  3677. #else
  3678.     #define _ALS_OnPlayerClickPlayerTextDraw
  3679. #endif
  3680. #define OnPlayerClickPlayerTextDraw ac_OnPlayerClickPlayerTextDraw
  3681. #if defined ac_OnPlayerClickPlayerTextDraw
  3682.     forward ac_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
  3683. #endif
  3684.  
  3685. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  3686. {
  3687.     new i = GetTickCount();
  3688.     if(AntiCheatInfo[playerid][pACAllow][49])
  3689.     {
  3690.         if(i < AntiCheatInfo[playerid][pCall][24] + Mtfc[24][0]) FloodDetect(playerid, 24);
  3691.         else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3692.         else AntiCheatInfo[playerid][pFloodCount][24] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3693.     }
  3694.     i = 1;
  3695.     #if defined ac_OnVehicleDamage\
  3696.     StatusUpdate
  3697.         i = ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  3698.     #endif
  3699.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][24] = GetTickCount();
  3700.     return i;
  3701. }
  3702.  
  3703. #if defined _ALS_OnVehicleDamage\
  3704.     StatusUpdate
  3705.     #undef OnVehicleDamageStatusUpdate
  3706. #else
  3707.     #define _ALS_OnVehicleDamageStatusUpdate
  3708. #endif
  3709. #define OnVehicleDamageStatusUpdate ac_OnVehicleDamageStatusUpdate
  3710. #if defined ac_OnVehicleDamageStatusUpdate
  3711.     forward ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  3712. #endif
  3713.  
  3714. public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
  3715. {
  3716.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3717.     new i = GetTickCount();
  3718.     if(AntiCheatInfo[playerid][pACAllow][49])
  3719.     {
  3720.         if(i < AntiCheatInfo[playerid][pCall][25] + Mtfc[25][0]) FloodDetect(playerid, 25);
  3721.         else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3722.         else AntiCheatInfo[playerid][pFloodCount][25] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3723.     }
  3724.     i = 1;
  3725.     #if defined ac_OnVehicleSirenStateChange
  3726.         i = ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  3727.     #endif
  3728.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][25] = GetTickCount();
  3729.     return i;
  3730. }
  3731.  
  3732. #if defined _ALS_OnVehicleSirenStateChange
  3733.     #undef OnVehicleSirenStateChange
  3734. #else
  3735.     #define _ALS_OnVehicleSirenStateChange
  3736. #endif
  3737. #define OnVehicleSirenStateChange ac_OnVehicleSirenStateChange
  3738. #if defined ac_OnVehicleSirenStateChange
  3739.     forward ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  3740. #endif
  3741.  
  3742. public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  3743. {
  3744.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3745.     new i = GetTickCount();
  3746.     if(AntiCheatInfo[playerid][pACAllow][49])
  3747.     {
  3748.         if(i < AntiCheatInfo[playerid][pCall][26] + Mtfc[26][0]) FloodDetect(playerid, 26);
  3749.         else if(i < AntiCheatInfo[playerid][pCall][27] + Mtfc[27][0]) FloodDetect(playerid, 27);
  3750.         else AntiCheatInfo[playerid][pFloodCount][26] = AntiCheatInfo[playerid][pFloodCount][27] = 0;
  3751.     }
  3752.     i = 1;
  3753.     #if defined ac_OnPlayerSelectObject
  3754.         i = ac_OnPlayerSelectObject(playerid, type, objectid, modelid, fX, fY, fZ);
  3755.     #endif
  3756.     AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][26] = GetTickCount();
  3757.     return i;
  3758. }
  3759.  
  3760. #if defined _ALS_OnPlayerSelectObject
  3761.     #undef OnPlayerSelectObject
  3762. #else
  3763.     #define _ALS_OnPlayerSelectObject
  3764. #endif
  3765. #define OnPlayerSelectObject ac_OnPlayerSelectObject
  3766. #if defined ac_OnPlayerSelectObject
  3767.     forward ac_OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
  3768. #endif
  3769.  
  3770. public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  3771. {
  3772.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3773.     static Float:vpos[4];
  3774.     GetVehiclePos(vehicleid, vpos[0], vpos[1], vpos[2]);
  3775.     vpos[3] = GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z);
  3776.     if(passenger_seat)
  3777.     {
  3778.         static Float:zdiff;
  3779.         zdiff = new_z - vpos[2];
  3780.         if(AntiCheatInfo[playerid][pACAllow][31] && (floatabs(vel_x) > 0.3 && floatabs(vel_x)
  3781.         >= floatabs(AntiCheatVehInfo[vehicleid][vVel][0]) || floatabs(vel_y) > 0.3 && floatabs(vel_y)
  3782.         >= floatabs(AntiCheatVehInfo[vehicleid][vVel][1])) && vpos[2] < new_z + 5.0)
  3783.         {
  3784.             if(++AntiCheatInfo[playerid][pCheatCount][4]
  3785.             > MAX_CARSHOT_WARNINGS) return KickWithCode(playerid, "", 0, 31);
  3786.             #undef MAX_CARSHOT_WARNINGS
  3787.         }
  3788.         else if(AntiCheatInfo[playerid][pACAllow][8] && vel_z >= 0.1 && vel_z
  3789.         > AntiCheatVehInfo[vehicleid][vVel][2] && floatabs(vpos[0] - new_x)
  3790.         < zdiff * 1.2 && floatabs(vpos[1] - new_y) < zdiff * 1.2)
  3791.         {
  3792.             if(++AntiCheatInfo[playerid][pCheatCount][3]
  3793.             > MAX_FLYHACK_VEH_WARNINGS) return KickWithCode(playerid, "", 0, 8, 2);
  3794.             #undef MAX_FLYHACK_VEH_WARNINGS
  3795.         }
  3796.         else AntiCheatInfo[playerid][pCheatCount][4]
  3797.         = AntiCheatInfo[playerid][pCheatCount][3] = 0;
  3798.     }
  3799.     if(AntiCheatInfo[playerid][pACAllow][5] && vpos[3] > 15.0 && vpos[2] > -70.0
  3800.     && vpos[3] > AntiCheatVehInfo[vehicleid][vPosDiff] + ((vpos[3] / 3) * 1.5))
  3801.     {
  3802.         GetVehicleZAngle(vehicleid, AntiCheatVehInfo[vehicleid][vZAngle]);
  3803.         SetVehicleZAngle(vehicleid, AntiCheatVehInfo[vehicleid][vZAngle]);
  3804.         SetVehiclePos(vehicleid, vpos[0], vpos[1], vpos[2]);
  3805.         return 0;
  3806.     }
  3807.     static a;
  3808.     a = 1;
  3809.     #if defined ac_OnUnoccupiedVehicleUpdate
  3810.         a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z, vel_x, vel_y, vel_z);
  3811.     #endif
  3812.     if(a)
  3813.     {
  3814.         AntiCheatVehInfo[vehicleid][vSpeedDiff]
  3815.         = GetSpeed(vel_x, vel_y, vel_z) - GetSpeed(AntiCheatVehInfo[vehicleid][vVel][0],
  3816.         AntiCheatVehInfo[vehicleid][vVel][1], AntiCheatVehInfo[vehicleid][vVel][2]);
  3817.         AntiCheatVehInfo[vehicleid][vPosDiff] = vpos[3];
  3818.         AntiCheatVehInfo[vehicleid][vVel][0] = vel_x;
  3819.         AntiCheatVehInfo[vehicleid][vVel][1] = vel_y;
  3820.         AntiCheatVehInfo[vehicleid][vVel][2] = vel_z;
  3821.     }
  3822.     return a;
  3823. }
  3824.  
  3825. #if defined _ALS_OnUnoccupiedVehicleUpdate
  3826.     #undef OnUnoccupiedVehicleUpdate
  3827. #else
  3828.     #define _ALS_OnUnoccupiedVehicleUpdate
  3829. #endif
  3830. #define OnUnoccupiedVehicleUpdate ac_OnUnoccupiedVehicleUpdate
  3831. #if defined ac_OnUnoccupiedVehicleUpdate
  3832.     forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z);
  3833. #endif
  3834.  
  3835. public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
  3836. {
  3837.     if(AntiCheatInfo[playerid][pKicked]) return 0;
  3838.     if(AntiCheatInfo[playerid][pACAllow][46] && 383 < modelid < 394) return KickWithCode(playerid, "", 0, 46);
  3839.     #if defined ac_OnPlayerEditAttachedObject
  3840.         return ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  3841.     #else
  3842.         return 1;
  3843.     #endif
  3844. }
  3845.  
  3846. #if defined _ALS_OnPlayerEditAttachedObject
  3847.     #undef OnPlayerEditAttachedObject
  3848. #else
  3849.     #define _ALS_OnPlayerEditAttachedObject
  3850. #endif
  3851. #define OnPlayerEditAttachedObject ac_OnPlayerEditAttachedObject
  3852. #if defined ac_OnPlayerEditAttachedObject
  3853.     forward ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ);
  3854. #endif
  3855.  
  3856. fpublic: acTimer(playerid)
  3857. {
  3858.     if(!IsPlayerConnected(playerid) || AntiCheatInfo[playerid][pKicked]) return 0;
  3859.     if(AntiCheatInfo[playerid][pACAllow][51] && NetStats_MessagesRecvPerSecond(playerid)
  3860.     > MAX_MSGS_REC_DIFF) KickWithCode(playerid, "", 0, 51);
  3861.     #undef MAX_MSGS_REC_DIFF
  3862.     static gtc, gpp, bool:ur;
  3863.     gtc = GetTickCount();
  3864.     ur = false;
  3865.     gpp = GetPlayerPing(playerid) + 100;
  3866.     if(gtc > AntiCheatInfo[playerid][pGtc][7] + gpp)
  3867.     {
  3868.         for(new i, w, a, bool:cw, s = GetWeaponSlot(GetPlayerWeapon(playerid)); i < 13; ++i)
  3869.         {
  3870.             GetPlayerWeaponData(playerid, i, w, a);
  3871.             if(w == 39) cw = true;
  3872.             if(s != i)
  3873.             {
  3874.                 if(AntiCheatInfo[playerid][pSetWeapon][i] != -1)
  3875.                 {
  3876.                     if(AntiCheatInfo[playerid][pSetWeapon][i] == w)
  3877.                     {
  3878.                         AntiCheatInfo[playerid][pSetWeapon][i] = -1;
  3879.                         AntiCheatInfo[playerid][pWeapon][i] = w;
  3880.                     }
  3881.                     else if(AntiCheatInfo[playerid][pACAllow][52]
  3882.                     && gtc > AntiCheatInfo[playerid][pGtcSetWeapon][i] + gpp
  3883.                     && ++AntiCheatInfo[playerid][pNOPCount][0] > MAX_NOP_WARNINGS)
  3884.                     {
  3885.                         #if defined DEBUG
  3886.                             printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  3887.                         #endif
  3888.                         KickWithCode(playerid, "", 0, 52, 13);
  3889.                     }
  3890.                 }
  3891.                 else
  3892.                 {
  3893.                     if(AntiCheatInfo[playerid][pWeapon][i] != w)
  3894.                     {
  3895.                         if(!w)
  3896.                         {
  3897.                             AntiCheatInfo[playerid][pWeapon][i] = 0;
  3898.                             AntiCheatInfo[playerid][pAmmo][i] = a;
  3899.                         }
  3900.                         else if(w == 40 && cw || w == 46 && AntiCheatInfo[playerid][pVeh]
  3901.                         && AntiCheatInfo[playerid][pParachute])
  3902.                         {
  3903.                             AntiCheatInfo[playerid][pWeapon][i] = w;
  3904.                             AntiCheatInfo[playerid][pAmmo][i] = a;
  3905.                         }
  3906.                         else if(AntiCheatInfo[playerid][pACAllow][15] && !((15 < w < 40
  3907.                         || 40 < w < 44) && !a)) KickWithCode(playerid, "", 0, 15, 2);
  3908.                     }
  3909.                     if(AntiCheatInfo[playerid][pGiveAmmo][i] != -65535)
  3910.                     {
  3911.                         if(AntiCheatInfo[playerid][pGiveAmmo][i] == a)
  3912.                         {
  3913.                             AntiCheatInfo[playerid][pGiveAmmo][i] = -65535;
  3914.                             AntiCheatInfo[playerid][pAmmo][i] = a;
  3915.                         }
  3916.                         else if(AntiCheatInfo[playerid][pACAllow][52] && gtc
  3917.                         > AntiCheatInfo[playerid][pGtcGiveAmmo][i] + gpp)
  3918.                         {
  3919.                             if(++AntiCheatInfo[playerid][pNOPCount][1] > MAX_NOP_WARNINGS)
  3920.                             {
  3921.                                 #undef MAX_NOP_WARNINGS
  3922.                                 #if defined DEBUG
  3923.                                     printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  3924.                                 #endif
  3925.                                 KickWithCode(playerid, "", 0, 52, 14);
  3926.                             }
  3927.                         }
  3928.                     }
  3929.                     if(15 < w < 44)
  3930.                     {
  3931.                         if(w == 40 && !a) AntiCheatInfo[playerid][pAmmo][i] = 0;
  3932.                         else if(AntiCheatInfo[playerid][pACAllow][16] && a
  3933.                         > AntiCheatInfo[playerid][pAmmo][i]) KickWithCode(playerid, "", 0, 16, 2);
  3934.                     }
  3935.                 }
  3936.             }
  3937.             else if(21 < w < 33 || 40 < w < 43
  3938.             || !LagCompMode && (15 < w < 40 || w == 43))
  3939.             {
  3940.                 if(AntiCheatInfo[playerid][pACAllow][16] && a > AntiCheatInfo[playerid][pAmmo][i]
  3941.                 && AntiCheatInfo[playerid][pGiveAmmo][i] == -65535)
  3942.                 {
  3943.                     if(21 < w < 33 && !ur && IsPlayerInAmmuNation(playerid,
  3944.                     GetPlayerInterior(playerid)) && AmmuNationInfo[w-22][1]
  3945.                     == abs(a - AntiCheatInfo[playerid][pAmmo][i]))
  3946.                     {
  3947.                         #undef abs
  3948.                         if(AntiCheatInfo[playerid][pSet][10]
  3949.                         != -1) AntiCheatInfo[playerid][pSet][10] += AmmuNationInfo[w-22][0];
  3950.                         else AntiCheatInfo[playerid][pSet][10] = AmmuNationInfo[w-22][0];
  3951.                         AntiCheatInfo[playerid][pAmmo][i] += AmmuNationInfo[w-22][1];
  3952.                         AntiCheatInfo[playerid][pCheatCount][10] = 0;
  3953.                         ur = true;
  3954.                     }
  3955.                     else if(!LagCompMode) KickWithCode(playerid, "", 0, 16, 3);
  3956.                 }
  3957.                 else if(AntiCheatInfo[playerid][pAmmo][i]
  3958.                 && !LagCompMode) AntiCheatInfo[playerid][pAmmo][i] = a;
  3959.             }
  3960.         }
  3961.     }
  3962.     AntiCheatInfo[playerid][pCheatCount][1] = 0;
  3963.     AntiCheatInfo[playerid][pCheatCount][2] = 0;
  3964.     if(ur) AntiCheatInfo[playerid][pGtc][15] = GetTickCount();
  3965.     AntiCheatInfo[playerid][pTimerID] = SetTimerEx("acTimer", 1000, false, "i", playerid);
  3966.     return 1;
  3967. }
  3968.  
  3969. fpublic: ac_OnCheatDetected(playerid, ip_address[], type, code)
  3970. {
  3971.     if(type) BlockIpAddress(ip_address, 0);
  3972.     else
  3973.     {
  3974.         switch(code)
  3975.         {
  3976.             case 32: SendClientMessage(playerid, DEFAULT_COLOR, MAX_CONNECTS_MSG);
  3977.             case 40: SendClientMessage(playerid, DEFAULT_COLOR, UNKNOWN_CLIENT_MSG);
  3978.             default:
  3979.             {
  3980.                 new strtmp[70];
  3981.                 format(strtmp, sizeof strtmp, KICK_MSG, code);
  3982.                 SendClientMessage(playerid, DEFAULT_COLOR, strtmp);
  3983.                 #undef DEFAULT_COLOR
  3984.             }
  3985.         }
  3986.         new pping = GetPlayerPing(playerid) + 100;
  3987.         SetTimerEx("ac_KickTimer", (pping > MAX_PING ? MAX_PING : pping), false, "i", playerid);
  3988.         #undef MAX_PING
  3989.         if(GetPlayerState(playerid) == 2) AntiCheatInfo[playerid][pKicked] = 2;
  3990.         else AntiCheatInfo[playerid][pKicked] = 1;
  3991.     }
  3992.     return 1;
  3993. }
  3994.  
  3995. fpublic: ac_KickTimer(playerid) return Kick(playerid);
  3996.  
  3997. #undef fpublic
  3998.  
  3999. stock EnableAntiCheat(acid, enable)
  4000. {
  4001.     if(!(-1 < acid < sizeof ACAllow)) return 0;
  4002.     ACAllow[acid] = !!enable;
  4003.     for(enable = GetPlayerPoolSize(); enable != -1; --enable)
  4004.     {
  4005.         if(IsPlayerConnected(enable)) AntiCheatInfo[enable][pACAllow][acid] = ACAllow[acid];
  4006.     }
  4007.     return 1;
  4008. }
  4009.  
  4010. stock EnableAntiCheatForPlayer(playerid, acid, enable)
  4011. {
  4012.     if(!IsPlayerConnected(playerid) || !(-1 < acid < sizeof ACAllow)) return 0;
  4013.     AntiCheatInfo[playerid][pACAllow][acid] = !!enable;
  4014.     return 1;
  4015. }
  4016.  
  4017. static stock GetWeaponModel(weaponid)
  4018. {
  4019.     switch(weaponid)
  4020.     {
  4021.         case 1: return 331;
  4022.         case 2..8: return weaponid + 331;
  4023.         case 9: return 341;
  4024.         case 10..15: return weaponid + 311;
  4025.         case 16..18: return weaponid + 326;
  4026.         case 22..29: return weaponid + 324;
  4027.         case 30, 31: return weaponid + 325;
  4028.         case 32: return 372;
  4029.         case 33..45: return weaponid + 324;
  4030.         case 46: return 371;
  4031.     }
  4032.     return 0;
  4033. }
  4034.  
  4035. static GetWeaponSlot(weaponid)
  4036. {
  4037.     switch(weaponid)
  4038.     {
  4039.         case 0, 1: return 0;
  4040.         case 2..9: return 1;
  4041.         case 10..15: return 10;
  4042.         case 16..18, 39: return 8;
  4043.         case 22..24: return 2;
  4044.         case 25..27: return 3;
  4045.         case 28, 29, 32: return 4;
  4046.         case 30, 31: return 5;
  4047.         case 33, 34: return 6;
  4048.         case 35..38: return 7;
  4049.         case 40: return 12;
  4050.         case 41..43: return 9;
  4051.         case 44..46: return 11;
  4052.     }
  4053.     return -1;
  4054. }
  4055.  
  4056. static GetSpeed(Float:vX, Float:vY, Float:vZ) return floatround(VectorSize(vX, vY, vZ) * 179.28625);
  4057.  
  4058. static IsPlayerInRestaurant(playerid, interiorid)
  4059. {
  4060.     #if USE_RESTAURANTS
  4061.         new i;
  4062.         switch(interiorid)
  4063.         {
  4064.             case 5: i = 0;
  4065.             case 9: i = 1;
  4066.             case 10: i = 2;
  4067.             default: return false;
  4068.         }
  4069.         return IsPlayerInRangeOfPoint(playerid, 2.5, Restaurants[i][0],
  4070.         Restaurants[i][1], Restaurants[i][2]);
  4071.     #else
  4072.         return false;
  4073.     #endif
  4074.     #undef USE_RESTAURANTS
  4075. }
  4076.  
  4077. static IsPlayerInAmmuNation(playerid, interiorid)
  4078. {
  4079.     #if USE_AMMUNATIONS
  4080.         new i, s;
  4081.         switch(interiorid)
  4082.         {
  4083.             case 1: i = 0, s = -1;
  4084.             case 4: i = 1, s = 0;
  4085.             case 6: i = 3, s = 1;
  4086.             default: return false;
  4087.         }
  4088.         for(; i != s; --i)
  4089.         {
  4090.             if(IsPlayerInRangeOfPoint(playerid, 2.5, AmmuNations[i][0],
  4091.             AmmuNations[i][1], AmmuNations[i][2])) return true;
  4092.         }
  4093.     #endif
  4094.     #undef USE_AMMUNATIONS
  4095.     return false;
  4096. }
  4097.  
  4098. static IsPlayerInPayNSpray(playerid, interiorid)
  4099. {
  4100.     #if USE_PAYNSPRAY
  4101.         if(!interiorid)
  4102.         {
  4103.             for(new i = sizeof(PayNSpray) - 1; i != -1; --i)
  4104.             {
  4105.                 if(IsPlayerInRangeOfPoint(playerid, 7.5, PayNSpray[i][0],
  4106.                 PayNSpray[i][1], PayNSpray[i][2])) return true;
  4107.             }
  4108.         }
  4109.     #endif
  4110.     #undef USE_PAYNSPRAY
  4111.     return false;
  4112. }
  4113.  
  4114. static IsPlayerNearVendingMachine(playerid, interiorid)
  4115. {
  4116.     #if USE_VENDING_MACHINES
  4117.         new i, s;
  4118.         switch(interiorid)
  4119.         {
  4120.             case 0: i = 44, s = -1;
  4121.             case 1: i = 51, s = 44;
  4122.             case 2: i = 52, s = 51;
  4123.             case 3: i = 58, s = 52;
  4124.             case 6: i = 60, s = 58;
  4125.             case 7: i = 61, s = 60;
  4126.             case 15: i = 62, s = 61;
  4127.             case 16: i = 65, s = 62;
  4128.             case 17: i = 72, s = 65;
  4129.             case 18: i = 74, s = 72;
  4130.             default: return false;
  4131.         }
  4132.         for(; i != s; --i)
  4133.         {
  4134.             if(IsPlayerInRangeOfPoint(playerid, 1.5, VendingMachines[i][0],
  4135.             VendingMachines[i][1], VendingMachines[i][2])) return true;
  4136.         }
  4137.     #endif
  4138.     #undef USE_VENDING_MACHINES
  4139.     return false;
  4140. }
  4141.  
  4142. static IsPlayerInCasino(playerid, interiorid)
  4143. {
  4144.     #if USE_CASINOS
  4145.         new i, s;
  4146.         switch(interiorid)
  4147.         {
  4148.             case 1: i = 41, s = -1;
  4149.             case 10: i = 61, s = 41;
  4150.             case 12: i = 70, s = 61;
  4151.             default: return false;
  4152.         }
  4153.         for(; i != s; --i)
  4154.         {
  4155.             if(IsPlayerInRangeOfPoint(playerid, Casinos[i][3], Casinos[i][0],
  4156.             Casinos[i][1], Casinos[i][2])) return true;
  4157.         }
  4158.     #endif
  4159.     #undef USE_CASINOS
  4160.     return false;
  4161. }
  4162.  
  4163. static IsAirVehicle(modelid)
  4164. {
  4165.     switch(modelid)
  4166.     {
  4167.         case 417, 425, 447, 460, 469, 476, 487, 488, 497, 511,
  4168.         512, 513, 519, 520, 548, 553, 563, 577, 592, 593: return true;
  4169.     }
  4170.     return false;
  4171. }
  4172.  
  4173. static IsBikeVehicle(modelid)
  4174. {
  4175.     switch(modelid)
  4176.     {
  4177.         case 481, 509, 510: return true;
  4178.     }
  4179.     return false;
  4180. }
  4181.  
  4182. static IsBoatVehicle(modelid)
  4183. {
  4184.     switch(modelid)
  4185.     {
  4186.         case 430, 446, 452, 453, 454,
  4187.         472, 473, 484, 493, 595: return true;
  4188.     }
  4189.     return false;
  4190. }
  4191.  
  4192. static IsComponentidCompatible(modelid, componentid)
  4193. {
  4194.     if(modelid != -1)
  4195.     {
  4196.         switch(componentid)
  4197.         {
  4198.             case 1000..1191:
  4199.             {
  4200.                 componentid -= 1000;
  4201.                 if(VehicleMods[(modelid - 400) * 6 + (componentid >>> 5)]
  4202.                 & 1 << (componentid & 0b00011111)) return true;
  4203.             }
  4204.             case 1192, 1193:
  4205.             {
  4206.                 if(modelid == 576) return true;
  4207.             }
  4208.         }
  4209.     }
  4210.     return false;
  4211. }
  4212.  
  4213. static IpToInt(const s_szIP[])
  4214. {
  4215.     new aiBytes[1], iPos;
  4216.     aiBytes{0} = strval(s_szIP[iPos]);
  4217.     while(iPos < 15 && s_szIP[iPos++] != '.'){}
  4218.     aiBytes{1} = strval(s_szIP[iPos]);
  4219.     while(iPos < 15 && s_szIP[iPos++] != '.'){}
  4220.     aiBytes{2} = strval(s_szIP[iPos]);
  4221.     while(iPos < 15 && s_szIP[iPos++] != '.'){}
  4222.     aiBytes{3} = strval(s_szIP[iPos]);
  4223.     return aiBytes[0];
  4224. }
  4225.  
  4226. static FloodDetect(playerid, publicid)
  4227. {
  4228.     if(!AntiCheatInfo[playerid][pKicked])
  4229.     {
  4230.         if(++AntiCheatInfo[playerid][pFloodCount][publicid] > Mtfc[publicid][1])
  4231.         {
  4232.             #if defined DEBUG
  4233.                 printf(DEBUG_CODE_1, playerid, Mtfc[publicid][1], publicid);
  4234.                 #undef DEBUG
  4235.             #endif
  4236.             return KickWithCode(playerid, "", 0, 49, publicid);
  4237.         }
  4238.         AntiCheatInfo[playerid][pCall][27] = AntiCheatInfo[playerid][pCall][publicid] = GetTickCount();
  4239.     }
  4240.     return 0;
  4241. }
  4242.  
  4243. static KickWithCode(playerid, ip_address[], type, code, code2 = 0)
  4244. {
  4245.     if(!type && (!IsPlayerConnected(playerid)
  4246.     || AntiCheatInfo[playerid][pKicked])
  4247.     || !(-1 < code < sizeof ACAllow)) return 0;
  4248.     StatsInfo[5]++;
  4249.     switch(code)
  4250.     {
  4251.         case 1..37, 41, 55: StatsInfo[0]++;
  4252.         case 0, 38, 40, 42, 44, 52..54: StatsInfo[4]++;
  4253.         case 43: StatsInfo[1]++;
  4254.         case 49..51: StatsInfo[3]++;
  4255.         case 45..48: StatsInfo[2]++;
  4256.     }
  4257.     new strtmp[6];
  4258.     if(code2) format(strtmp, sizeof strtmp, " (%d)", code2);
  4259.     if(type) printf(SUSPICION_2, ip_address, code, strtmp);
  4260.     else printf(SUSPICION_1, playerid, code, strtmp);
  4261.     #if defined OnCheatDetected
  4262.         OnCheatDetected(playerid, ip_address, type, code);
  4263.     #else
  4264.         ac_OnCheatDetected(playerid, ip_address, type, code);
  4265.     #endif
  4266.     return 0;
  4267. }
  4268.  
  4269. static LoadCfg()
  4270. {
  4271.     new i, File:cfgFile, string[415], strtmp[9];
  4272.     if(fexist(CONFIG_FILE))
  4273.     {
  4274.         if((cfgFile = fopen(CONFIG_FILE, io_read)))
  4275.         {
  4276.             while(fread(cfgFile, string))
  4277.             {
  4278.                 if((i = strfind(string, "//")) != -1)
  4279.                 {
  4280.                     strmid(string, strtmp, i + 2, i + 3);
  4281.                     string[i] = '\0';
  4282.                     if(-1 < (i = strval(strtmp)) < sizeof ACAllow) ACAllow[i] = !!strval(string);
  4283.                 }
  4284.             }
  4285.             fclose(cfgFile);
  4286.         }
  4287.         else return 0;
  4288.     }
  4289.     else if((cfgFile = fopen(CONFIG_FILE, io_write)))
  4290.     {
  4291.         #undef CONFIG_FILE
  4292.         for(; i < sizeof ACAllow; ++i)
  4293.         {
  4294.             format(strtmp, sizeof strtmp, "%d //%d\r\n", ACAllow[i], i);
  4295.             strcat(string, strtmp);
  4296.         }
  4297.         fwrite(cfgFile, string);
  4298.         fclose(cfgFile);
  4299.     }
  4300.     else return 0;
  4301.     return 1;
  4302. }
  4303.  
  4304. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement