Advertisement
Guest User

Untitled

a guest
Jun 30th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 243.37 KB | None | 0 0
  1. //Ricardo by Ricardo the Bot v1.9.36 (0.3.DL-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 OnTrailerUpdate
  11.     #error Please download SA-MP 0.3.DL R1 server package!
  12. #endif
  13.  
  14. #if !defined FILTERSCRIPT
  15.  
  16. #if !defined DEBUG
  17.     #define DEBUG
  18. #endif
  19.  
  20. #if !defined _nex_ac_lang_included
  21.     #include <nex-ac_id.lang>   //Localization
  22. #endif
  23.  
  24. #define NEX_AC_VERSION              "1.9.36"
  25. #define AC_SERVER_VERSION           "0.3.DL-R1"
  26.  
  27. #if !defined AC_CONFIG_FILE
  28.     #define AC_CONFIG_FILE              "nex-ac_settings.cfg"
  29. #endif
  30.  
  31. #if !defined AC_MAX_CLASSES
  32.     #define AC_MAX_CLASSES              320
  33. #endif
  34.  
  35. #if !defined AC_DEFAULT_COLOR
  36.     #define AC_DEFAULT_COLOR            -1
  37. #endif
  38.  
  39. #if !defined AC_USE_VENDING_MACHINES
  40.     #define AC_USE_VENDING_MACHINES     true
  41. #endif
  42.  
  43. #if !defined AC_USE_TUNING_GARAGES
  44.     #define AC_USE_TUNING_GARAGES       true
  45. #endif
  46.  
  47. #if !defined AC_USE_AMMUNATIONS
  48.     #define AC_USE_AMMUNATIONS          true
  49. #endif
  50.  
  51. #if !defined AC_USE_RESTAURANTS
  52.     #define AC_USE_RESTAURANTS          true
  53. #endif
  54.  
  55. #if !defined AC_USE_PAYNSPRAY
  56.     #define AC_USE_PAYNSPRAY            true
  57. #endif
  58.  
  59. #if !defined AC_USE_CASINOS
  60.     #define AC_USE_CASINOS              true
  61. #endif
  62.  
  63. #if !defined AC_USE_QUERY
  64.     #define AC_USE_QUERY                true
  65. #endif
  66.  
  67. #if !defined AC_MAX_CONNECTS_FROM_IP
  68.     #define AC_MAX_CONNECTS_FROM_IP     1
  69. #endif
  70.  
  71. #if !defined AC_MAX_RCON_LOGIN_ATTEMPT
  72.     #define AC_MAX_RCON_LOGIN_ATTEMPT   1
  73. #endif
  74.  
  75. #if !defined AC_MAX_MSGS_REC_DIFF
  76.     #define AC_MAX_MSGS_REC_DIFF        800
  77. #endif
  78.  
  79. #if !defined AC_MAX_PING
  80.     #define AC_MAX_PING                 500
  81. #endif
  82.  
  83. #if !defined AC_MIN_TIME_RECONNECT
  84.     #define AC_MIN_TIME_RECONNECT       12      //In seconds
  85. #endif
  86.  
  87. #if !defined AC_MAX_NOP_WARNINGS
  88.     #define AC_MAX_NOP_WARNINGS         3
  89. #endif
  90.  
  91. #if !defined AC_MAX_PING_WARNINGS
  92.     #define AC_MAX_PING_WARNINGS        5
  93. #endif
  94.  
  95. #if !defined AC_MAX_AIR_WARNINGS
  96.     #define AC_MAX_AIR_WARNINGS         3
  97. #endif
  98.  
  99. #if !defined AC_MAX_AIR_VEH_WARNINGS
  100.     #define AC_MAX_AIR_VEH_WARNINGS     3
  101. #endif
  102.  
  103. #if !defined AC_MAX_FLYHACK_VEH_WARNINGS
  104.     #define AC_MAX_FLYHACK_VEH_WARNINGS 3
  105. #endif
  106.  
  107. #if !defined AC_MAX_FLYHACK_B_WARNINGS
  108.     #define AC_MAX_FLYHACK_B_WARNINGS   5
  109. #endif
  110.  
  111. #if !defined AC_MAX_CARSHOT_WARNINGS
  112.     #define AC_MAX_CARSHOT_WARNINGS     3
  113. #endif
  114.  
  115. #if !defined AC_MAX_PRO_AIM_WARNINGS
  116.     #define AC_MAX_PRO_AIM_WARNINGS     2
  117. #endif
  118.  
  119. #if !defined AC_MAX_AFK_GHOST_WARNINGS
  120.     #define AC_MAX_AFK_GHOST_WARNINGS   2
  121. #endif
  122.  
  123. #if !defined AC_MAX_RAPID_FIRE_WARNINGS
  124.     #define AC_MAX_RAPID_FIRE_WARNINGS  3
  125. #endif
  126.  
  127. #if !defined AC_MAX_GODMODE_WARNINGS
  128.     #define AC_MAX_GODMODE_WARNINGS     2
  129. #endif
  130.  
  131. #if !defined AC_MAX_GODMODE_VEH_WARNINGS
  132.     #define AC_MAX_GODMODE_VEH_WARNINGS 2
  133. #endif
  134.  
  135. #if !defined AC_MAX_SILENT_AIM_WARNINGS
  136.     #define AC_MAX_SILENT_AIM_WARNINGS  2
  137. #endif
  138.  
  139. #if !defined AC_MAX_FLYHACK_WARNINGS
  140.     #define AC_MAX_FLYHACK_WARNINGS     2
  141. #endif
  142.  
  143. #if !defined AC_MAX_SPEEDHACK_WARNINGS
  144.     #define AC_MAX_SPEEDHACK_WARNINGS   1
  145. #endif
  146.  
  147. #if !defined AC_MAX_MONEY_WARNINGS
  148.     #define AC_MAX_MONEY_WARNINGS       2
  149. #endif
  150.  
  151. #define ac_fpublic%0(%1) forward %0(%1); public %0(%1)
  152. #define ac_AbsoluteAngle(%0) floatadd(floatround(%0, floatround_floor) % 360, floatfract(%0))
  153. #define ac_abs(%0) (((%0) < 0) ? (-(%0)) : ((%0)))
  154.  
  155. //These are the default settings that will be set if no configuration file will be found
  156. //Don't change these values if you already have 'scriptfiles\nex-ac_settings.cfg'
  157. static bool:ac_ACAllow[] =
  158. {
  159.     true,   //0 Anti-AirBreak (onfoot)
  160.     true,   //1 Anti-AirBreak (in vehicle)
  161.     true,   //2 Anti-teleport hack (onfoot)
  162.     true,   //3 Anti-teleport hack (in vehicle)
  163.     true,   //4 Anti-teleport hack (into/between vehicles)
  164.     true,   //5 Anti-teleport hack (vehicle to player)
  165.     true,   //6 Anti-teleport hack (pickups)
  166.     true,   //7 Anti-FlyHack (onfoot)
  167.     true,   //8 Anti-FlyHack (in vehicle)
  168.     true,   //9 Anti-SpeedHack (onfoot)
  169.     true,   //10 Anti-SpeedHack (in vehicle)
  170.     true,   //11 Anti-Health hack (in vehicle)
  171.     true,   //12 Anti-Health hack (onfoot)
  172.     true,   //13 Anti-Armour hack
  173.     true,   //14 Anti-Money hack
  174.     true,   //15 Anti-Weapon hack
  175.     true,   //16 Anti-Ammo hack (add)
  176.     true,   //17 Anti-Ammo hack (infinite)
  177.     true,   //18 Anti-Special actions hack
  178.     true,   //19 Anti-GodMode from bullets (onfoot)
  179.     true,   //20 Anti-GodMode from bullets (in vehicle)
  180.     true,   //21 Anti-Invisible hack
  181.     true,   //22 Anti-lagcomp-spoof
  182.     true,   //23 Anti-Tuning hack
  183.     false//24 Anti-Parkour mod
  184.     true,   //25 Anti-Quick turn
  185.     true,   //26 Anti-Rapid fire
  186.     true,   //27 Anti-FakeSpawn
  187.     true,   //28 Anti-FakeKill
  188.     true,   //29 Anti-Pro Aim
  189.     true,   //30 Anti-CJ run
  190.     true,   //31 Anti-CarShot
  191.     true,   //32 Anti-CarJack
  192.     false//33 Anti-UnFreeze
  193.     true,   //34 Anti-AFK Ghost
  194.     true,   //35 Anti-Full Aiming
  195.  
  196.     false//36 Anti-Fake NPC
  197.     true,   //37 Anti-Reconnect
  198.     true,   //38 Anti-High ping
  199.     true,   //39 Anti-Dialog hack
  200.     true,   //40 Protection from the sandbox
  201.     true,   //41 Protection against an invalid version
  202.     true,   //42 Anti-Rcon hack
  203.  
  204.     true,   //43 Anti-Tuning crasher
  205.     true,   //44 Anti-Invalid seat crasher
  206.     true,   //45 Anti-Dialog crasher
  207.     true,   //46 Anti-Attached object crasher
  208.     true,   //47 Anti-Weapon Crasher
  209.  
  210.     true,   //48 Flood protection connects to one slot
  211.     true,   //49 Anti-flood callback functions
  212.     true,   //50 Anti-flood change seat
  213.  
  214.     true,   //51 Anti-Ddos
  215.  
  216.     true    //52 Anti-NOP's
  217. };
  218.  
  219. static const ac_Mtfc[][] =
  220. {
  221.     {200, 5},   //0 OnDialogResponse
  222.     {800, 2},   //1 OnEnterExitModShop
  223.     {250, 3},   //2 OnPlayerClickMap
  224.     {450, 3},   //3 OnPlayerClickPlayer
  225.     {150, 8},   //4 OnPlayerClickTextDraw
  226.     {400, 3},   //5 OnPlayerCommandText
  227.     {150, 5},   //6 OnPlayerEnterVehicle
  228.     {150, 8},   //7 OnPlayerExitVehicle
  229.     {500, 8},   //8 OnPlayerPickUpPickup
  230.     {150, 8},   //9 OnPlayerRequestClass
  231.     {250, 5},   //10 OnPlayerSelectedMenuRow
  232.     {600, 3},   //11 OnPlayerStateChange
  233.     {500, 2},   //12 OnVehicleMod
  234.     {500, 2},   //13 OnVehiclePaintjob
  235.     {500, 2},   //14 OnVehicleRespray
  236.     {300, 1},   //15 OnVehicleDeath
  237.     {450, 2},   //16 OnPlayerText
  238.     {500, 5},   //17 OnPlayerEnterCheckpoint
  239.     {500, 5},   //18 OnPlayerLeaveCheckpoint
  240.     {150, 5},   //19 OnPlayerRequestSpawn
  241.     {250, 5},   //20 OnPlayerExitedMenu
  242.     {500, 5},   //21 OnPlayerEnterRaceCheckpoint
  243.     {500, 5},   //22 OnPlayerLeaveRaceCheckpoint
  244.     {150, 8},   //23 OnPlayerClickPlayerTextDraw
  245.     {51, 9},    //24 OnVehicleDamageStatusUpdate
  246.     {150, 5},   //25 OnVehicleSirenStateChange
  247.     {150, 5},   //26 OnPlayerSelectObject
  248.     {150, 8}    //27 Cross-public
  249. },
  250.  
  251. ac_wSlot[] =
  252. {
  253.     0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10,
  254.     10, 8, 8, 8, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5,
  255.     4, 6, 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11, 11, 11
  256. },
  257.  
  258. ac_wModel[] =
  259. {
  260.     0, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325,
  261.     326, 342, 343, 344, 0, 0, 345, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356,
  262.     372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 371
  263. },
  264.  
  265. ac_vType[] =
  266. {
  267.     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
  268.     0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  269.     0, 0, 0, 0, 0, 0, 3, 2, 5, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0,
  270.     1, 5, 5, 5, 0, 0, 0, 0, 5, 2, 0, 5, 3, 3, 0, 0, 1, 0, 0, 0,
  271.     0, 4, 0, 0, 3, 0, 0, 2, 2, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0,
  272.     0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 1, 1, 1, 0, 0, 0, 0, 0, 1,
  273.     1, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  274.     0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
  275.     0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
  276.     0, 5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 1, 0, 3, 0, 0, 0, 0,
  277.     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  278. },
  279.  
  280. #if AC_USE_TUNING_GARAGES
  281.     ac_cPrice[] =
  282.     {
  283.         400, 550, 200, 250, 100, 150, 80, 500, 500, 200, 1000, 220, 250, 100, 400,
  284.         500, 200, 500, 350, 300, 250, 200, 150, 350, 50, 1000, 480, 480, 770, 680, 370,
  285.         370, 170, 120, 790, 150, 500, 690, 190, 390, 500, 390, 1000, 500, 500, 510, 710,
  286.         670, 530, 810, 620, 670, 530, 130, 210, 230, 520, 430, 620, 720, 530, 180, 550, 430,
  287.         830, 850, 750, 250, 200, 550, 450, 550, 450, 1100, 1030, 980, 1560, 1620, 1200,
  288.         1030, 900, 1230, 820, 1560, 1350, 770, 100, 1500, 150, 650, 450, 100, 750,
  289.         350, 450, 350, 1000, 620, 1140, 1000, 940, 780, 830, 3250, 1610, 1540, 780, 780, 780,
  290.         1610, 1540, 0, 0, 3340, 3250, 2130, 2050, 2040, 780, 940, 780, 940, 780, 860,
  291.         780, 1120, 3340, 3250, 3340, 1650, 3380, 3290, 1590, 830, 800, 1500, 1000, 800,
  292.         580, 470, 870, 980, 150, 150, 100, 100, 490, 600, 890, 1000, 1090, 840, 910,
  293.         1200, 1030, 1030, 920, 930, 550, 1050, 1050, 950, 650, 450, 550, 850, 950,
  294.         850, 950, 970, 880, 990, 900, 950, 1000, 900, 1000, 900, 2050, 2150, 2130,
  295.         2050, 2130, 2040, 2150, 2040, 2095, 2175, 2080, 2200, 1200, 1040, 940, 1100
  296.     },
  297. #endif#if AC_USE_AMMUNATIONS
  298.     ac_AmmuNationInfo[][] =
  299.     {
  300.         {300, 5}, {0, 0}, {0, 0},
  301.         {0, 0}, {0, 0}, {0, 0},
  302.         {200, 30}, {600, 30}, {1200, 15},
  303.         {600, 15}, {800, 12}, {1000, 10},
  304.         {500, 60}, {2000, 90}, {3500, 120},
  305.         {4500, 150}, {300, 60}, {1000, 20},
  306.         {5000, 10}, {10000, 5}, {12000, 5},
  307.         {6000, 80}, {10000, 500}, {2000, 1}
  308.     },
  309.  
  310.     Float:ac_AmmuNations[][] =
  311.     {
  312.         {296.5541, -38.5138, 1001.5156},
  313.         {295.7008, -80.8109, 1001.5156},
  314.         {290.1963, -109.7721, 1001.5156},
  315.         {312.2592, -166.1385, 999.601}
  316.     },
  317. #endif
  318.  
  319. #if AC_USE_RESTAURANTS
  320.     Float:ac_Restaurants[][] =
  321.     {
  322.         {374.0, -119.641, 1001.4922},
  323.         {368.789, -6.857, 1001.8516},
  324.         {375.566, -68.222, 1001.5151}
  325.     },
  326. #endif
  327.  
  328. #if AC_USE_PAYNSPRAY
  329.     Float:ac_PayNSpray[][] =
  330.     {
  331.         {2064.2842, -1831.4736, 13.5469},
  332.         {-2425.7822, 1021.1392, 50.3977},
  333.         {-1420.5195, 2584.2305, 55.8433},
  334.         {487.6401, -1739.9479, 11.1385},
  335.         {1024.8651, -1024.087, 32.1016},
  336.         {-1904.7019, 284.5968, 41.0469},
  337.         {1975.2384, 2162.5088, 11.0703},
  338.         {2393.4456, 1491.5537, 10.5616},
  339.         {720.0854, -455.2807, 16.3359},
  340.         {-99.9417, 1117.9048, 19.7417}
  341.     },
  342. #endif
  343.  
  344. #if AC_USE_VENDING_MACHINES
  345.     Float:ac_vMachines[][] =
  346.     {
  347.         {-862.82, 1536.6, 21.98},
  348.         {2271.72, -76.46, 25.96},
  349.         {1277.83, 372.51, 18.95},
  350.         {662.42, -552.16, 15.71},
  351.         {201.01, -107.61, 0.89},
  352.         {-253.74, 2597.95, 62.24},
  353.         {-253.74, 2599.75, 62.24},
  354.         {-76.03, 1227.99, 19.12},
  355.         {-14.7, 1175.35, 18.95},
  356.         {-1455.11, 2591.66, 55.23},
  357.         {2352.17, -1357.15, 23.77},
  358.         {2325.97, -1645.13, 14.21},
  359.         {2139.51, -1161.48, 23.35},
  360.         {2153.23, -1016.14, 62.23},
  361.         {1928.73, -1772.44, 12.94},
  362.         {1154.72, -1460.89, 15.15},
  363.         {2480.85, -1959.27, 12.96},
  364.         {2060.11, -1897.64, 12.92},
  365.         {1729.78, -1943.04, 12.94},
  366.         {1634.1, -2237.53, 12.89},
  367.         {1789.21, -1369.26, 15.16},
  368.         {-2229.18, 286.41, 34.7},
  369.         {2319.99, 2532.85, 10.21},
  370.         {2845.72, 1295.04, 10.78},
  371.         {2503.14, 1243.69, 10.21},
  372.         {2647.69, 1129.66, 10.21},
  373.         {-2420.21, 984.57, 44.29},
  374.         {-2420.17, 985.94, 44.29},
  375.         {2085.77, 2071.35, 10.45},
  376.         {1398.84, 2222.6, 10.42},
  377.         {1659.46, 1722.85, 10.21},
  378.         {1520.14, 1055.26, 10.0},
  379.         {-1980.78, 142.66, 27.07},
  380.         {-2118.96, -423.64, 34.72},
  381.         {-2118.61, -422.41, 34.72},
  382.         {-2097.27, -398.33, 34.72},
  383.         {-2092.08, -490.05, 34.72},
  384.         {-2063.27, -490.05, 34.72},
  385.         {-2005.64, -490.05, 34.72},
  386.         {-2034.46, -490.05, 34.72},
  387.         {-2068.56, -398.33, 34.72},
  388.         {-2039.85, -398.33, 34.72},
  389.         {-2011.14, -398.33, 34.72},
  390.         {-1350.11, 492.28, 10.58},
  391.         {-1350.11, 493.85, 10.58},
  392.         {2222.36, 1602.64, 1000.06},
  393.         {2222.2, 1606.77, 1000.05},
  394.         {2155.9, 1606.77, 1000.05},
  395.         {2155.84, 1607.87, 1000.06},
  396.         {2209.9, 1607.19, 1000.05},
  397.         {2202.45, 1617.0, 1000.06},
  398.         {2209.24, 1621.21, 1000.06},
  399.         {2576.7, -1284.43, 1061.09},
  400.         {330.67, 178.5, 1020.07},
  401.         {331.92, 178.5, 1020.07},
  402.         {350.9, 206.08, 1008.47},
  403.         {361.56, 158.61, 1008.47},
  404.         {371.59, 178.45, 1020.07},
  405.         {374.89, 188.97, 1008.47},
  406.         {-19.03, -57.83, 1003.63},
  407.         {-36.14, -57.87, 1003.63},
  408.         {316.87, -140.35, 998.58},
  409.         {2225.2, -1153.42, 1025.9},
  410.         {-15.1, -140.22, 1003.63},
  411.         {-16.53, -140.29, 1003.63},
  412.         {-35.72, -140.22, 1003.63},
  413.         {373.82, -178.14, 1000.73},
  414.         {379.03, -178.88, 1000.73},
  415.         {495.96, -24.32, 1000.73},
  416.         {500.56, -1.36, 1000.73},
  417.         {501.82, -1.42, 1000.73},
  418.         {-33.87, -186.76, 1003.63},
  419.         {-32.44, -186.69, 1003.63},
  420.         {-16.11, -91.64, 1003.63},
  421.         {-17.54, -91.71, 1003.63}
  422.     },
  423. #endif
  424.  
  425. #if AC_USE_CASINOS
  426.     Float:ac_Casinos[][] =
  427.     {
  428.         {2241.2878, 1617.1624, 1006.1797, 2.0},
  429.         {2240.9736, 1604.6592, 1006.1797, 6.0},
  430.         {2242.5427, 1592.8726, 1006.1836, 6.0},
  431.         {2230.2124, 1592.1426, 1006.1832, 6.0},
  432.         {2230.4717, 1604.484, 1006.186, 6.0},
  433.         {2230.3298, 1616.9272, 1006.1799, 3.0},
  434.         {2251.9407, 1586.1736, 1006.186, 1.0},
  435.         {2218.6785, 1587.3448, 1006.1749, 1.0},
  436.         {2219.2773, 1591.7467, 1006.1867, 1.0},
  437.         {2218.5408, 1589.3229, 1006.184, 1.0},
  438.         {2218.6477, 1593.6279, 1006.1797, 1.0},
  439.         {2221.926, 1603.8285, 1006.1797, 1.0},
  440.         {2218.5095, 1603.8385, 1006.1797, 1.0},
  441.         {2219.9597, 1603.9216, 1006.1797, 1.0},
  442.         {2216.3054, 1603.7996, 1006.1819, 1.0},
  443.         {2218.731, 1619.8046, 1006.1794, 1.0},
  444.         {2218.9407, 1617.8413, 1006.1821, 1.0},
  445.         {2218.668, 1615.4681, 1006.1797, 1.0},
  446.         {2218.6418, 1613.2629, 1006.1797, 1.0},
  447.         {2252.4272, 1589.8412, 1006.1797, 5.0},
  448.         {2252.4229, 1596.6169, 1006.1797, 5.0},
  449.         {2255.1565, 1608.8784, 1006.186, 1.0},
  450.         {2254.8496, 1610.8605, 1006.1797, 1.0},
  451.         {2255.2917, 1612.9167, 1006.1797, 1.0},
  452.         {2255.033, 1614.8892, 1006.1797, 1.0},
  453.         {2255.1213, 1616.8284, 1006.1797, 1.0},
  454.         {2255.2161, 1618.8005, 1006.1797, 1.0},
  455.         {2268.5281, 1606.4894, 1006.1797, 1.0},
  456.         {2270.4922, 1606.8539, 1006.1797, 1.0},
  457.         {2272.5693, 1606.4473, 1006.1797, 1.0},
  458.         {2274.5391, 1607.0122, 1006.1797, 1.0},
  459.         {2271.8447, 1586.1633, 1006.1797, 1.0},
  460.         {2261.4844, 1586.1724, 1006.1797, 1.0},
  461.         {2257.4507, 1589.6555, 1006.1797, 5.0},
  462.         {2267.8994, 1589.8672, 1006.1797, 5.0},
  463.         {2262.8486, 1590.026, 1006.1797, 5.0},
  464.         {2272.6458, 1589.7704, 1006.1797, 5.0},
  465.         {2272.6533, 1596.5682, 1006.1797, 5.0},
  466.         {2270.4895, 1596.4606, 1006.1797, 5.0},
  467.         {2265.4441, 1596.4299, 1006.1797, 5.0},
  468.         {2260.0308, 1596.7987, 1006.1797, 5.0},
  469.         {2254.9907, 1596.241, 1006.1797, 5.0},
  470.         {1956.9524, 988.2533, 992.4688, 2.0},
  471.         {1961.6155, 993.0375, 992.4688, 2.0},
  472.         {1963.7998, 998.4406, 992.4745, 2.0},
  473.         {1936.2885, 987.1995, 992.4745, 2.0},
  474.         {1944.9768, 986.3937, 992.4688, 2.0},
  475.         {1940.7397, 990.9521, 992.4609, 2.0},
  476.         {1940.0966, 1005.8996, 992.4688, 6.0},
  477.         {1938.8785, 1014.1768, 992.4688, 6.0},
  478.         {1938.8811, 1021.4434, 992.4688, 6.0},
  479.         {1966.5975, 1006.6469, 992.4745, 6.0},
  480.         {1966.5979, 1014.1024, 992.4688, 6.0},
  481.         {1939.8351, 1029.912, 992.4688, 6.0},
  482.         {1956.854, 1047.3718, 992.4688, 6.0},
  483.         {1961.356, 1042.8112, 992.4688, 6.0},
  484.         {1963.811, 1037.1263, 992.4745, 6.0},
  485.         {1961.733, 1025.8929, 992.4688, 10.0},
  486.         {1961.708, 1010.3194, 992.4688, 10.0},
  487.         {1966.5989, 1029.7954, 992.4745, 6.0},
  488.         {1961.4139, 1017.8281, 992.4688, 10.0},
  489.         {1966.5985, 1021.7686, 992.4688, 6.0},
  490.         {1128.7106, -1.9779, 1000.6797, 1.0},
  491.         {1125.2388, 1.61, 1000.6797, 1.0},
  492.         {1125.1249, -5.0489, 1000.6797, 1.0},
  493.         {1127.4139, 3.0199, 1000.6797, 1.0},
  494.         {1135.0634, -3.8695, 1000.6797, 1.0},
  495.         {1135.0861, 0.6107, 1000.6797, 1.0},
  496.         {1132.8943, -1.7139, 1000.6797, 1.0},
  497.         {1125.3727, 3.0315, 1000.6797, 1.0},
  498.         {1119.0272, -1.4916, 1000.6924, 1.0}
  499.     },
  500. #endif
  501.  
  502. ac_pAmmo[] =
  503. {
  504.     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  505.     1, 1, 1, 8, 8, 8, 0, 0, 4, 30, 10, 10, 15,
  506.     10, 10, 60, 60, 80, 80, 60, 20, 10, 4, 3,
  507.     100, 500, 5, 1, 500, 500, 36, 1, 1, 1
  508. },
  509.  
  510. Float:ac_wRange[] =
  511. {
  512.     30.0, 30.0, 30.0, 40.0, 30.0, 40.0,
  513.     30.0, 40.0, 50.0, 50.0, 30.0, 60.0,
  514.     60.0, 50.0, 50.0, 4.0, 65.0
  515. };
  516.  
  517. enum acInfo
  518. {
  519.     Float:acPosX,
  520.     Float:acPosY,
  521.     Float:acPosZ,
  522.     Float:acDropJpX,
  523.     Float:acDropJpY,
  524.     Float:acDropJpZ,
  525.     Float:acSetPosX,
  526.     Float:acSetPosY,
  527.     Float:acSetPosZ,
  528.     Float:acSetVehHealth,
  529.     acSpeed,
  530.     acHealth,
  531.     acArmour,
  532.     acMoney,
  533.     acLastShot,
  534.     acLastWeapon,
  535.     acEnterVeh,
  536.     acLastVeh,
  537.     acVeh,
  538.     acSeat,
  539.     acDialog,
  540.     acNextDialog,
  541.     acInt,
  542.     acAnim,
  543.     acDmgRes,
  544.     acSpecAct,
  545.     acNextSpecAct,
  546.     acLastSpecAct,
  547.     acLastPickup,
  548.     acReloadTime,
  549.     acShotTime,
  550.     acSpawnTime,
  551.     acUpdateTime,
  552.     acEnterVehTime,
  553.     acSpawnWeapon1,
  554.     acSpawnWeapon2,
  555.     acSpawnWeapon3,
  556.     acSpawnAmmo1,
  557.     acSpawnAmmo2,
  558.     acSpawnAmmo3,
  559.     acSpawnRes,
  560.     acTimerID,
  561.     acKickTimerID,
  562.     acLogged,
  563.     acKicked,
  564.     acIp[16],
  565.     acSet[13],
  566.     acGtc[18],
  567.     acWeapon[13],
  568.     acAmmo[13],
  569.     acSetWeapon[13],
  570.     acGiveAmmo[13],
  571.     acGtcSetWeapon[13],
  572.     acGtcGiveAmmo[13],
  573.     acNOPCount[12],
  574.     acCheatCount[17],
  575.     acCall[sizeof ac_Mtfc],
  576.     acFloodCount[sizeof ac_Mtfc],
  577.     bool:acACAllow[sizeof ac_ACAllow],
  578.     bool:acStuntBonus,
  579.     bool:acModShop,
  580.     bool:acUnFrozen,
  581.     bool:acOnline,
  582.     bool:acDeathRes,
  583.     bool:acVehDmgRes,
  584.     bool:acDead,
  585.     bool:acTpToZ,
  586.     bool:acParachute,
  587.     bool:acIntEnterExits,
  588.     bool:acSpec
  589. }
  590.  
  591. enum acVehInfo
  592. {
  593.     Float:acVelX,
  594.     Float:acVelY,
  595.     Float:acVelZ,
  596.     Float:acPosDiff,
  597.     Float:acZAngle,
  598.     Float:acHealth,
  599.     acSpeedDiff,
  600.     acDriver,
  601.     acInt,
  602.     acPaintJob,
  603.     bool:acSpawned
  604. }
  605.  
  606. enum acPickInfo
  607. {
  608.     Float:acPosX,
  609.     Float:acPosY,
  610.     Float:acPosZ,
  611.     acType,
  612.     acWeapon,
  613.     bool:acIsStatic
  614. }
  615.  
  616. static
  617.     ac_sInfo[6],
  618.     ac_Class[AC_MAX_CLASSES][3][2],
  619.     ACInfo[MAX_PLAYERS][acInfo],
  620.     ACVehInfo[MAX_VEHICLES][acVehInfo],
  621.     ACPickInfo[MAX_PICKUPS][acPickInfo],
  622.     bool:ac_IntEnterExits = true,
  623.     bool:ac_StuntBonus = true,
  624.     bool:ac_VehFriendlyFire,
  625.     bool:ac_LagCompMode,
  626.     #if !AC_USE_QUERY
  627.         bool:ac_QueryEnable,
  628.     #endif
  629.     bool:ac_RconEnable,
  630.     bool:ac_PedAnims;
  631.  
  632. ac_fpublic ac_AddStaticVehicle(vehicleid)
  633. {
  634.     ACVehInfo[vehicleid][acInt] =
  635.     ACVehInfo[vehicleid][acSpeedDiff] = 0;
  636.     ACVehInfo[vehicleid][acPaintJob] = 3;
  637.     ACVehInfo[vehicleid][acSpawned] = true;
  638.     ACVehInfo[vehicleid][acHealth] = 1000.0;
  639.     ACVehInfo[vehicleid][acPosDiff] =
  640.     ACVehInfo[vehicleid][acVelX] =
  641.     ACVehInfo[vehicleid][acVelY] =
  642.     ACVehInfo[vehicleid][acVelZ] = 0.0;
  643.     ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  644.     return 1;
  645. }
  646.  
  647. ac_fpublic ac_CreateVehicle(vehicleid, ac_vehicletype)
  648. {
  649.     ACVehInfo[vehicleid][acInt] =
  650.     ACVehInfo[vehicleid][acSpeedDiff] = 0;
  651.     ACVehInfo[vehicleid][acPaintJob] = 3;
  652.     ACVehInfo[vehicleid][acHealth] = 1000.0;
  653.     ACVehInfo[vehicleid][acPosDiff] =
  654.     ACVehInfo[vehicleid][acVelX] =
  655.     ACVehInfo[vehicleid][acVelY] =
  656.     ACVehInfo[vehicleid][acVelZ] = 0.0;
  657.     if(!(569 <= ac_vehicletype <= 570)) ACVehInfo[vehicleid][acSpawned] = true;
  658.     ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  659.     return 1;
  660. }
  661.  
  662. ac_fpublic ac_AddPlayerClass(ac_classid, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
  663. {
  664.     if(ac_classid < AC_MAX_CLASSES)
  665.     {
  666.         #undef AC_MAX_CLASSES
  667.         ac_Class[ac_classid][0][0] = ac_weapon1;
  668.         ac_Class[ac_classid][0][1] = ac_weapon1_ammo;
  669.         ac_Class[ac_classid][1][0] = ac_weapon2;
  670.         ac_Class[ac_classid][1][1] = ac_weapon2_ammo;
  671.         ac_Class[ac_classid][2][0] = ac_weapon3;
  672.         ac_Class[ac_classid][2][1] = ac_weapon3_ammo;
  673.     }
  674.     return 1;
  675. }
  676.  
  677. ac_fpublic ac_SetSpawnInfo(playerid, ac_team, ac_skin, Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
  678. {
  679.     if(!SetSpawnInfo(playerid, ac_team, ac_skin, ac_x, ac_y, ac_z, ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)) return 0;
  680.     ACInfo[playerid][acSpawnWeapon1] = ac_weapon1;
  681.     ACInfo[playerid][acSpawnAmmo1] = ac_weapon1_ammo;
  682.     ACInfo[playerid][acSpawnWeapon2] = ac_weapon2;
  683.     ACInfo[playerid][acSpawnAmmo2] = ac_weapon2_ammo;
  684.     ACInfo[playerid][acSpawnWeapon3] = ac_weapon3;
  685.     ACInfo[playerid][acSpawnAmmo3] = ac_weapon3_ammo;
  686.     return 1;
  687. }
  688.  
  689. ac_fpublic ac_AddStaticPickup(pickupid, ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z)
  690. {
  691.     ACPickInfo[pickupid][acWeapon] = 0;
  692.     switch(ac_type)
  693.     {
  694.         case 2, 3, 15, 22:
  695.         {
  696.             switch(ac_model)
  697.             {
  698.                 case 370: ACPickInfo[pickupid][acType] = 2;
  699.                 case 1240: ACPickInfo[pickupid][acType] = 3;
  700.                 case 1242: ACPickInfo[pickupid][acType] = 4;
  701.                 case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
  702.                 {
  703.                     for(new ac_i = 46; ac_i >= 0; --ac_i)
  704.                     {
  705.                         if(ac_wModel[ac_i] == ac_model)
  706.                         {
  707.                             ACPickInfo[pickupid][acType] = 1;
  708.                             ACPickInfo[pickupid][acWeapon] = ac_i;
  709.                             break;
  710.                         }
  711.                     }
  712.                 }
  713.             }
  714.         }
  715.     }
  716.     ACPickInfo[pickupid][acIsStatic] = true;
  717.     ACPickInfo[pickupid][acPosX] = ac_X;
  718.     ACPickInfo[pickupid][acPosY] = ac_Y;
  719.     ACPickInfo[pickupid][acPosZ] = ac_Z;
  720.     return 1;
  721. }
  722.  
  723. ac_fpublic ac_CreatePickup(pickupid, ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z)
  724. {
  725.     ACPickInfo[pickupid][acWeapon] = 0;
  726.     switch(ac_type)
  727.     {
  728.         case 2, 3, 15, 22:
  729.         {
  730.             switch(ac_model)
  731.             {
  732.                 case 370: ACPickInfo[pickupid][acType] = 2;
  733.                 case 1240: ACPickInfo[pickupid][acType] = 3;
  734.                 case 1242: ACPickInfo[pickupid][acType] = 4;
  735.                 case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
  736.                 {
  737.                     for(new ac_i = 46; ac_i >= 0; --ac_i)
  738.                     {
  739.                         if(ac_wModel[ac_i] == ac_model)
  740.                         {
  741.                             ACPickInfo[pickupid][acType] = 1;
  742.                             ACPickInfo[pickupid][acWeapon] = ac_i;
  743.                             break;
  744.                         }
  745.                     }
  746.                 }
  747.             }
  748.         }
  749.     }
  750.     ACPickInfo[pickupid][acIsStatic] = false;
  751.     ACPickInfo[pickupid][acPosX] = ac_X;
  752.     ACPickInfo[pickupid][acPosY] = ac_Y;
  753.     ACPickInfo[pickupid][acPosZ] = ac_Z;
  754.     return 1;
  755. }
  756.  
  757. #if defined Streamer_SetIntData
  758.     #if defined STREAMER_ENABLE_TAGS
  759.         ac_fpublic ac_CreateDynamicPickup(STREAMER_TAG_PICKUP pickupid, ac_modelid, ac_type)
  760.     #else
  761.         ac_fpublic ac_CreateDynamicPickup(pickupid, ac_modelid, ac_type)
  762.     #endif
  763.     {
  764.         Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 0);
  765.         switch(ac_type)
  766.         {
  767.             case 2, 3, 15, 22:
  768.             {
  769.                 switch(ac_modelid)
  770.                 {
  771.                     case 370: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 2);
  772.                     case 1240: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 3);
  773.                     case 1242: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 4);
  774.                     case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
  775.                     {
  776.                         for(new ac_i = 46; ac_i >= 0; --ac_i)
  777.                         {
  778.                             if(ac_wModel[ac_i] == ac_modelid)
  779.                             {
  780.                                 Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, ac_i + 100);
  781.                                 break;
  782.                             }
  783.                         }
  784.                     }
  785.                 }
  786.             }
  787.         }
  788.         return 1;
  789.     }
  790. #endif
  791.  
  792. #if defined Streamer_UpdateEx
  793.     stock ac_Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, type = -1, compensatedtime = -1, freezeplayer = 1)
  794.     {
  795.         if(!Streamer_UpdateEx(playerid, x, y, z, worldid, interiorid, type, compensatedtime, freezeplayer)) return 0;
  796.         if(compensatedtime >= 0)
  797.         {
  798.             ACInfo[playerid][acSet][8] = 4;
  799.             ACInfo[playerid][acNOPCount][10] = 0;
  800.             ACInfo[playerid][acSetPosX] = x;
  801.             ACInfo[playerid][acSetPosY] = y;
  802.             ACInfo[playerid][acSetPosZ] = z;
  803.             ACInfo[playerid][acGtc][11] = GetTickCount() + 2650;
  804.         }
  805.         return 1;
  806.     }
  807.  
  808.     #if defined _ALS_Streamer_UpdateEx
  809.         #undef Streamer_UpdateEx
  810.     #else
  811.         #define _ALS_Streamer_UpdateEx
  812.     #endif
  813.     #define Streamer_UpdateEx ac_Streamer_UpdateEx
  814. #endif
  815.  
  816. ac_fpublic ac_DestroyVehicle(vehicleid)
  817. {
  818.     if(!DestroyVehicle(vehicleid)) return 0;
  819.     ACVehInfo[vehicleid][acSpawned] = false;
  820.     return 1;
  821. }
  822.  
  823. ac_fpublic ac_DestroyPickup(pickupid)
  824. {
  825.     if(!DestroyPickup(pickupid)) return 0;
  826.     ACPickInfo[pickupid][acType] = 0;
  827.     return 1;
  828. }
  829.  
  830. ac_fpublic ac_DisableInteriorEnterExits()
  831. {
  832.     ac_IntEnterExits = false;
  833.     return DisableInteriorEnterExits();
  834. }
  835.  
  836. ac_fpublic ac_UsePlayerPedAnims()
  837. {
  838.     ac_PedAnims = true;
  839.     return UsePlayerPedAnims();
  840. }
  841.  
  842. ac_fpublic ac_EnableVehicleFriendlyFire()
  843. {
  844.     ac_VehFriendlyFire = true;
  845.     return EnableVehicleFriendlyFire();
  846. }
  847.  
  848. ac_fpublic ac_EnableStuntBonusForAll(enable)
  849. {
  850.     ac_StuntBonus = !!enable;
  851.     #if defined foreach
  852.         foreach(new ac_i : Player) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
  853.     #else
  854.         for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  855.         {
  856.             if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
  857.         }
  858.     #endif
  859.     return EnableStuntBonusForAll(enable);
  860. }
  861.  
  862. ac_fpublic ac_EnableStuntBonusForPlayer(playerid, enable)
  863. {
  864.     if(!EnableStuntBonusForPlayer(playerid, enable)) return 0;
  865.     ACInfo[playerid][acStuntBonus] = !!enable;
  866.     return 1;
  867. }
  868.  
  869. ac_fpublic ac_ShowPlayerDialog(playerid, ac_dialogid)
  870. {
  871.     ACInfo[playerid][acDialog] = ac_dialogid;
  872.     return 1;
  873. }
  874.  
  875. ac_fpublic ac_fs_ShowPlayerDialog(playerid, ac_dialogid)
  876. {
  877.     ACInfo[playerid][acNextDialog] = ac_dialogid;
  878.     return 1;
  879. }
  880.  
  881. ac_fpublic ac_TogglePlayerControllable(playerid, toggle)
  882. {
  883.     if(!TogglePlayerControllable(playerid, toggle)) return 0;
  884.     ACInfo[playerid][acUnFrozen] = !!toggle;
  885.     return 1;
  886. }
  887.  
  888. ac_fpublic ac_TogglePlayerSpectating(playerid, toggle)
  889. {
  890.     if(!TogglePlayerSpectating(playerid, toggle)) return 0;
  891.     if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING || ACInfo[playerid][acSet][6] != -1)
  892.     {
  893.         if(!toggle)
  894.         {
  895.             if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][7] = 4;
  896.             else
  897.             {
  898.                 ACInfo[playerid][acSet][3] =
  899.                 ACInfo[playerid][acSet][4] =
  900.                 ACInfo[playerid][acSet][5] =
  901.                 ACInfo[playerid][acSet][6] =
  902.                 ACInfo[playerid][acSet][8] =
  903.                 ACInfo[playerid][acSet][9] =
  904.                 ACInfo[playerid][acNextSpecAct] = -1;
  905.                 for(new ac_i = 12; ac_i >= 0; --ac_i)
  906.                 {
  907.                     ACInfo[playerid][acSetWeapon][ac_i] = -1;
  908.                     ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  909.                 }
  910.                 ACInfo[playerid][acUnFrozen] = true;
  911.                 ACInfo[playerid][acTpToZ] = false;
  912.                 ACInfo[playerid][acSet][7] = 1;
  913.             }
  914.             ACInfo[playerid][acSpawnRes]++;
  915.             ACInfo[playerid][acSpec] = false;
  916.             ACInfo[playerid][acSpawnTime] = ACInfo[playerid][acNOPCount][9] = 0;
  917.             ACInfo[playerid][acGtc][13] = GetTickCount() + 500;
  918.         }
  919.     }
  920.     else if(toggle)
  921.     {
  922.         ACInfo[playerid][acSet][6] = 1;
  923.         ACInfo[playerid][acNOPCount][8] = 0;
  924.         ACInfo[playerid][acGtc][12] = GetTickCount() + 500;
  925.     }
  926.     return 1;
  927. }
  928.  
  929. ac_fpublic ac_SpawnPlayer(playerid)
  930. {
  931.     if(!SpawnPlayer(playerid)) return 0;
  932.     if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][7] = 5;
  933.     else
  934.     {
  935.         ACInfo[playerid][acSet][3] =
  936.         ACInfo[playerid][acSet][4] =
  937.         ACInfo[playerid][acSet][5] =
  938.         ACInfo[playerid][acSet][8] =
  939.         ACInfo[playerid][acSet][9] =
  940.         ACInfo[playerid][acNextSpecAct] = -1;
  941.         for(new ac_i = 12; ac_i >= 0; --ac_i)
  942.         {
  943.             ACInfo[playerid][acSetWeapon][ac_i] = -1;
  944.             ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  945.         }
  946.         ACInfo[playerid][acTpToZ] = false;
  947.         ACInfo[playerid][acUnFrozen] = true;
  948.         ACInfo[playerid][acSet][7] = 2;
  949.     }
  950.     ACInfo[playerid][acSpawnRes]++;
  951.     ACInfo[playerid][acSpawnTime] = ACInfo[playerid][acNOPCount][9] = 0;
  952.     ACInfo[playerid][acGtc][13] = GetTickCount() + 500;
  953.     return 1;
  954. }
  955.  
  956. ac_fpublic ac_SetPlayerHealth(playerid, Float:ac_health)
  957. {
  958.     if(!SetPlayerHealth(playerid, ac_health)) return 0;
  959.     if(floatcmp(ac_health, 0.0) == -1) ac_health = 0.0;
  960.     ACInfo[playerid][acNOPCount][3] = 0;
  961.     ACInfo[playerid][acSet][1] = floatround(ac_health, floatround_tozero);
  962.     ACInfo[playerid][acGtc][3] = GetTickCount() + 500;
  963.     return 1;
  964. }
  965.  
  966. ac_fpublic ac_SetPlayerArmour(playerid, Float:ac_armour)
  967. {
  968.     if(!SetPlayerArmour(playerid, ac_armour)) return 0;
  969.     if(floatcmp(ac_armour, 0.0) == -1) ac_armour = 0.0;
  970.     ACInfo[playerid][acNOPCount][5] = 0;
  971.     ACInfo[playerid][acSet][2] = floatround(ac_armour, floatround_tozero);
  972.     ACInfo[playerid][acGtc][5] = GetTickCount() + 500;
  973.     return 1;
  974. }
  975.  
  976. ac_fpublic ac_GivePlayerWeapon(playerid, ac_weaponid, ac_ammo)
  977. {
  978.     if(0 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 46)
  979.     {
  980.         new ac_s = ac_wSlot[ac_weaponid];
  981.         ACInfo[playerid][acNOPCount][0] = ACInfo[playerid][acNOPCount][1] = 0;
  982.         if(16 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 43)
  983.         {
  984.             if(3 <= ac_s <= 5 || (ACInfo[playerid][acSetWeapon][ac_s] == -1
  985.             ? ACInfo[playerid][acWeapon][ac_s] : ACInfo[playerid][acSetWeapon][ac_s]) == ac_weaponid)
  986.             {
  987.                 ACInfo[playerid][acGiveAmmo][ac_s] =
  988.                 (ACInfo[playerid][acGiveAmmo][ac_s] == -65535 ? ACInfo[playerid][acAmmo][ac_s]
  989.                 : ACInfo[playerid][acGiveAmmo][ac_s]) + ac_ammo;
  990.             }
  991.             else ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo;
  992.             if(ACInfo[playerid][acGiveAmmo][ac_s] < -32768) ac_ammo = ACInfo[playerid][acGiveAmmo][ac_s] = -32768;
  993.             else if(ACInfo[playerid][acGiveAmmo][ac_s] > 32767) ac_ammo = ACInfo[playerid][acGiveAmmo][ac_s] = 32767;
  994.             ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = ac_weaponid;
  995.             ACInfo[playerid][acReloadTime] = 0;
  996.         }
  997.         else
  998.         {
  999.             ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  1000.             ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = ac_weaponid;
  1001.         }
  1002.         ACInfo[playerid][acGtcGiveAmmo][ac_s] =
  1003.         ACInfo[playerid][acGtcSetWeapon][ac_s] = ACInfo[playerid][acGtc][2] = GetTickCount() + 1650;
  1004.     }
  1005.     return GivePlayerWeapon(playerid, ac_weaponid, ac_ammo);
  1006. }
  1007.  
  1008. ac_fpublic ac_SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo)
  1009. {
  1010.     if(ac_ammo < -32768) ac_ammo = -32768;
  1011.     else if(ac_ammo > 32767) ac_ammo = 32767;
  1012.     if(16 <= ac_weaponslot <= 43)
  1013.     {
  1014.         new ac_s = ac_wSlot[ac_weaponslot];
  1015.         if(ACInfo[playerid][acWeapon][ac_s] > 0 || ACInfo[playerid][acSetWeapon][ac_s] > 0)
  1016.         {
  1017.             ACInfo[playerid][acNOPCount][1] = 0;
  1018.             ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo;
  1019.             ACInfo[playerid][acGtcGiveAmmo][ac_s] = GetTickCount() + 500;
  1020.         }
  1021.     }
  1022.     return SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo);
  1023. }
  1024.  
  1025. ac_fpublic ac_SetPlayerArmedWeapon(playerid, ac_weaponid)
  1026. {
  1027.     if(!SetPlayerArmedWeapon(playerid, ac_weaponid)) return 0;
  1028.     if(0 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 46)
  1029.     {
  1030.         new ac_s = ac_wSlot[ac_weaponid];
  1031.         if((ac_weaponid == ACInfo[playerid][acWeapon][ac_s] || ac_weaponid == ACInfo[playerid][acSetWeapon][ac_s]) &&
  1032.         (ACInfo[playerid][acAmmo][ac_s] != 0 || ACInfo[playerid][acGiveAmmo][ac_s] != 0))
  1033.         {
  1034.             ACInfo[playerid][acNOPCount][0] = 0;
  1035.             ACInfo[playerid][acSet][3] = ac_weaponid;
  1036.             ACInfo[playerid][acGtc][2] = GetTickCount() + 1650;
  1037.         }
  1038.     }
  1039.     return 1;
  1040. }
  1041.  
  1042. ac_fpublic ac_ResetPlayerWeapons(playerid)
  1043. {
  1044.     if(!ResetPlayerWeapons(playerid)) return 0;
  1045.     for(new ac_i = 12; ac_i >= 0; --ac_i)
  1046.     {
  1047.         ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acAmmo][ac_i] = 0;
  1048.         ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1049.         ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1050.     }
  1051.     ACInfo[playerid][acSet][3] = -1;
  1052.     ACInfo[playerid][acGtc][7] = GetTickCount() + 300;
  1053.     return 1;
  1054. }
  1055.  
  1056. ac_fpublic ac_GivePlayerMoney(playerid, ac_money)
  1057. {
  1058.     if(!GivePlayerMoney(playerid, ac_money)) return 0;
  1059.     ACInfo[playerid][acNOPCount][11] = AC_MAX_MONEY_WARNINGS;
  1060.     ACInfo[playerid][acMoney] += ac_money;
  1061.     #undef AC_MAX_MONEY_WARNINGS
  1062.     return 1;
  1063. }
  1064.  
  1065. ac_fpublic ac_ResetPlayerMoney(playerid)
  1066. {
  1067.     if(!ResetPlayerMoney(playerid)) return 0;
  1068.     ACInfo[playerid][acNOPCount][11] = 0;
  1069.     ACInfo[playerid][acMoney] = 0;
  1070.     return 1;
  1071. }
  1072.  
  1073. static bad_GetPlayerMoney(playerid) return GetPlayerMoney(playerid);
  1074.  
  1075. ac_fpublic ac_SetPlayerSpecialAction(playerid, ac_actionid)
  1076. {
  1077.     if(!SetPlayerSpecialAction(playerid, ac_actionid)) return 0;
  1078.     if(ac_actionid == SPECIAL_ACTION_USEJETPACK || SPECIAL_ACTION_CUFFED <= ac_actionid <= SPECIAL_ACTION_CARRY ||
  1079.     (ac_actionid == SPECIAL_ACTION_USECELLPHONE || ac_actionid == 68 || SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4) && ACInfo[playerid][acVeh] == 0 ||
  1080.     ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USECELLPHONE ||
  1081.     (ac_actionid == SPECIAL_ACTION_HANDSUP || SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_DRINK_SPRUNK) && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_ENTER_VEHICLE && ACInfo[playerid][acVeh] == 0 ||
  1082.     ac_actionid == SPECIAL_ACTION_NONE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_DUCK &&
  1083.     ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_ENTER_VEHICLE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_HANDSUP)
  1084.     {
  1085.         ACInfo[playerid][acNOPCount][6] = 0;
  1086.         if((ac_actionid == 68 || SPECIAL_ACTION_HANDSUP <= ac_actionid <= SPECIAL_ACTION_USECELLPHONE ||
  1087.         SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_CARRY) && SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4 ||
  1088.         SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_CARRY && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK ||
  1089.         (ac_actionid == SPECIAL_ACTION_NONE || SPECIAL_ACTION_CUFFED <= ac_actionid <= SPECIAL_ACTION_CARRY) && ACInfo[playerid][acVeh] ||
  1090.         SPECIAL_ACTION_CUFFED <= ac_actionid <= SPECIAL_ACTION_CARRY && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) ACInfo[playerid][acNextSpecAct] = ac_actionid;
  1091.         else
  1092.         {
  1093.             if(ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE) ac_actionid = SPECIAL_ACTION_NONE;
  1094.             else if(ac_actionid == SPECIAL_ACTION_USEJETPACK || ac_actionid == SPECIAL_ACTION_HANDSUP ||
  1095.             SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4) ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct];
  1096.             else ACInfo[playerid][acNextSpecAct] = -1;
  1097.             ACInfo[playerid][acSet][4] = ac_actionid;
  1098.             ACInfo[playerid][acGtc][6] = GetTickCount() + 2650;
  1099.         }
  1100.     }
  1101.     return 1;
  1102. }
  1103.  
  1104. ac_fpublic ac_SetPlayerInterior(playerid, ac_interiorid)
  1105. {
  1106.     if(!SetPlayerInterior(playerid, ac_interiorid)) return 0;
  1107.     ACInfo[playerid][acNOPCount][2] = 0;
  1108.     ACInfo[playerid][acSet][0] = ac_interiorid % 256;
  1109.     ACInfo[playerid][acGtc][0] = GetTickCount() + 1650;
  1110.     return 1;
  1111. }
  1112.  
  1113. ac_fpublic ac_SetPlayerPos(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1114. {
  1115.     if(!SetPlayerPos(playerid, ac_x, ac_y, ac_z)) return 0;
  1116.     ACInfo[playerid][acSet][8] = 1;
  1117.     ACInfo[playerid][acNOPCount][10] = 0;
  1118.     ACInfo[playerid][acSetPosX] = ac_x;
  1119.     ACInfo[playerid][acSetPosY] = ac_y;
  1120.     ACInfo[playerid][acSetPosZ] = ac_z;
  1121.     ACInfo[playerid][acGtc][11] = GetTickCount() + 2650;
  1122.     return 1;
  1123. }
  1124.  
  1125. ac_fpublic ac_SetPlayerPosFindZ(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1126. {
  1127.     if(!SetPlayerPosFindZ(playerid, ac_x, ac_y, ac_z)) return 0;
  1128.     ACInfo[playerid][acSet][8] = 2;
  1129.     ACInfo[playerid][acTpToZ] = true;
  1130.     ACInfo[playerid][acNOPCount][10] = 0;
  1131.     ACInfo[playerid][acSetPosX] = ac_x;
  1132.     ACInfo[playerid][acSetPosY] = ac_y;
  1133.     ACInfo[playerid][acGtc][11] = GetTickCount() + 2650;
  1134.     return 1;
  1135. }
  1136.  
  1137. ac_fpublic ac_SetPlayerVelocity(playerid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1138. {
  1139.     if(!SetPlayerVelocity(playerid, ac_X, ac_Y, ac_Z)) return 0;
  1140.     ACInfo[playerid][acSpeed] = ac_GetSpeed3D(ac_X, ac_Y, ac_Z);
  1141.     ACInfo[playerid][acGtc][10] = GetTickCount() + 300;
  1142.     return 1;
  1143. }
  1144.  
  1145. ac_fpublic ac_PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid)
  1146. {
  1147.     if(!PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid)) return 0;
  1148.     if(!(SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4) &&
  1149.     !(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DRINK_SPRUNK) &&
  1150.     GetPlayerVirtualWorld(playerid) == GetVehicleVirtualWorld(ac_vehicleid))
  1151.     {
  1152.         new ac_model = GetVehicleModel(ac_vehicleid) - 400;
  1153.         ACInfo[playerid][acNOPCount][7] = 0;
  1154.         ACInfo[playerid][acSet][9] = ac_vehicleid;
  1155.         if(ac_model == 31 || ac_model == 37 || ac_IsVehicleSeatOccupied(ac_vehicleid, ac_seatid) ||
  1156.         ac_seatid > ac_MaxPassengers[ac_model >>> 3] >>> ((ac_model & 7) << 2) & 0xF) ACInfo[playerid][acSet][5] = -1;
  1157.         else ACInfo[playerid][acSet][5] = ac_seatid;
  1158.         ACInfo[playerid][acGtc][1] = GetTickCount() + 800;
  1159.     }
  1160.     return 1;
  1161. }
  1162.  
  1163. ac_fpublic ac_RemovePlayerFromVehicle(playerid)
  1164. {
  1165.     if(!RemovePlayerFromVehicle(playerid)) return 0;
  1166.     ACInfo[playerid][acSet][11] = 1;
  1167.     ACInfo[playerid][acGtc][8] = GetTickCount() + 3150;
  1168.     return 1;
  1169. }
  1170.  
  1171. ac_fpublic ac_SetVehiclePos(vehicleid, Float:ac_x, Float:ac_y, Float:ac_z)
  1172. {
  1173.     if(!SetVehiclePos(vehicleid, ac_x, ac_y, ac_z)) return 0;
  1174.     ACVehInfo[vehicleid][acVelX] = ACVehInfo[vehicleid][acVelY] = ACVehInfo[vehicleid][acVelZ] = 0.0;
  1175.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1176.     if(ac_driver != INVALID_PLAYER_ID)
  1177.     {
  1178.         ACInfo[ac_driver][acSet][8] = 3;
  1179.         ACInfo[ac_driver][acNOPCount][10] = 0;
  1180.         ACInfo[ac_driver][acSetPosX] = ac_x;
  1181.         ACInfo[ac_driver][acSetPosY] = ac_y;
  1182.         ACInfo[ac_driver][acSetPosZ] = ac_z;
  1183.         ACInfo[ac_driver][acGtc][11] =
  1184.         ACInfo[ac_driver][acGtc][9] = GetTickCount() + 2650;
  1185.     }
  1186.     return 1;
  1187. }
  1188.  
  1189. ac_fpublic ac_SetVehicleVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1190. {
  1191.     if(!SetVehicleVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0;
  1192.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1193.     if(ac_driver != INVALID_PLAYER_ID)
  1194.     {
  1195.         ACVehInfo[vehicleid][acVelX] = ac_X;
  1196.         ACVehInfo[vehicleid][acVelY] = ac_Y;
  1197.         ACVehInfo[vehicleid][acVelZ] = ac_Z;
  1198.         ACInfo[ac_driver][acGtc][9] = GetTickCount() + 300;
  1199.     }
  1200.     return 1;
  1201. }
  1202.  
  1203. ac_fpublic ac_SetVehicleAngularVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1204. {
  1205.     if(!SetVehicleAngularVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0;
  1206.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1207.     if(ac_driver != INVALID_PLAYER_ID)
  1208.     {
  1209.         ACVehInfo[vehicleid][acVelX] = ac_X;
  1210.         ACVehInfo[vehicleid][acVelY] = ac_Y;
  1211.         ACVehInfo[vehicleid][acVelZ] = ac_Z;
  1212.         ACInfo[ac_driver][acGtc][9] = GetTickCount() + 300;
  1213.     }
  1214.     return 1;
  1215. }
  1216.  
  1217. ac_fpublic ac_LinkVehicleToInterior(vehicleid, ac_interiorid)
  1218. {
  1219.     if(!LinkVehicleToInterior(vehicleid, ac_interiorid)) return 0;
  1220.     ACVehInfo[vehicleid][acInt] = ac_interiorid % 256;
  1221.     return 1;
  1222. }
  1223.  
  1224. ac_fpublic ac_ChangeVehiclePaintjob(vehicleid, ac_paintjobid)
  1225. {
  1226.     if(GetVehicleModel(vehicleid) > 0) ACVehInfo[vehicleid][acPaintJob] = ac_paintjobid;
  1227.     return ChangeVehiclePaintjob(vehicleid, ac_paintjobid);
  1228. }
  1229.  
  1230. ac_fpublic ac_SetVehicleHealth(vehicleid, Float:ac_health)
  1231. {
  1232.     if(!SetVehicleHealth(vehicleid, ac_health)) return 0;
  1233.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1234.     if(ac_driver != INVALID_PLAYER_ID)
  1235.     {
  1236.         ACInfo[ac_driver][acNOPCount][4] = 0;
  1237.         ACInfo[ac_driver][acSetVehHealth] = ac_health;
  1238.         ACInfo[ac_driver][acGtc][4] = GetTickCount() + 800;
  1239.     }
  1240.     else ACVehInfo[vehicleid][acHealth] = ac_health;
  1241.     return 1;
  1242. }
  1243.  
  1244. ac_fpublic ac_RepairVehicle(vehicleid)
  1245. {
  1246.     if(!RepairVehicle(vehicleid)) return 0;
  1247.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1248.     if(ac_driver != INVALID_PLAYER_ID)
  1249.     {
  1250.         ACInfo[ac_driver][acNOPCount][4] = 0;
  1251.         ACInfo[ac_driver][acSetVehHealth] = 1000.0;
  1252.         ACInfo[ac_driver][acGtc][4] = GetTickCount() + 800;
  1253.     }
  1254.     else ACVehInfo[vehicleid][acHealth] = 1000.0;
  1255.     return 1;
  1256. }
  1257.  
  1258. ac_fpublic ac_SetVehicleToRespawn(vehicleid)
  1259. {
  1260.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1261.     if(ac_driver != INVALID_PLAYER_ID) ACInfo[ac_driver][acGtc][9] = GetTickCount() + 300;
  1262.     return SetVehicleToRespawn(vehicleid);
  1263. }
  1264.  
  1265. ac_fpublic ac_EnableAntiCheat(acid, enable)
  1266. {
  1267.     if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1268.     if(acid == 42)
  1269.     {
  1270.         if(enable)
  1271.         {
  1272.             if(!ac_ACAllow[acid])
  1273.             {
  1274.                 #if !AC_USE_QUERY
  1275.                     ac_QueryEnable = !!GetConsoleVarAsBool("query");
  1276.                 #endif
  1277.                 ac_RconEnable = !!GetConsoleVarAsBool("rcon");
  1278.             }
  1279.             #if !AC_USE_QUERY
  1280.                 SendRconCommand("query 0");
  1281.             #endif
  1282.             SendRconCommand("rcon 0");
  1283.         }
  1284.         else
  1285.         {
  1286.             static ac_strtmp[9];
  1287.             #if !AC_USE_QUERY
  1288.                 format(ac_strtmp, sizeof ac_strtmp, "query %b", ac_QueryEnable);
  1289.                 SendRconCommand(ac_strtmp);
  1290.             #endif
  1291.             format(ac_strtmp, sizeof ac_strtmp, "rcon %b", ac_RconEnable);
  1292.             SendRconCommand(ac_strtmp);
  1293.         }
  1294.     }
  1295.     ac_ACAllow[acid] = !!enable;
  1296.     if(enable)
  1297.     {
  1298.         #if defined foreach
  1299.             foreach(new ac_i : Player)
  1300.         #else
  1301.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1302.             {
  1303.                 if(IsPlayerConnected(ac_i))
  1304.         #endif
  1305.         {
  1306.             ACInfo[ac_i][acACAllow][acid] = ac_ACAllow[acid];
  1307.             switch(acid)
  1308.             {
  1309.                 case 7: ACInfo[ac_i][acCheatCount][15] = 0;
  1310.                 case 8: ACInfo[ac_i][acCheatCount][3] = 0;
  1311.                 case 10: ACInfo[ac_i][acCheatCount][16] = 0;
  1312.                 case 15: ACInfo[ac_i][acCheatCount][10] = 0;
  1313.                 case 17: ACInfo[ac_i][acCheatCount][7] = 0;
  1314.                 case 19: ACInfo[ac_i][acCheatCount][9] = 0;
  1315.                 case 20: ACInfo[ac_i][acCheatCount][11] = 0;
  1316.                 case 23: ACInfo[ac_i][acCheatCount][12] = 0;
  1317.                 case 26: ACInfo[ac_i][acCheatCount][14] = ACInfo[ac_i][acCheatCount][8] = 0;
  1318.                 case 29: ACInfo[ac_i][acCheatCount][13] = ACInfo[ac_i][acCheatCount][6] = 0;
  1319.                 case 31: ACInfo[ac_i][acCheatCount][4] = 0;
  1320.                 case 34: ACInfo[ac_i][acCheatCount][5] = 0;
  1321.                 case 38: ACInfo[ac_i][acCheatCount][0] = 0;
  1322.             }
  1323.         }
  1324.         #if !defined foreach
  1325.             }
  1326.         #endif
  1327.     }
  1328.     else
  1329.     {
  1330.         #if defined foreach
  1331.             foreach(new ac_i : Player) ACInfo[ac_i][acACAllow][acid] = ac_ACAllow[acid];
  1332.         #else
  1333.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1334.             {
  1335.                 if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acACAllow][acid] = ac_ACAllow[acid];
  1336.             }
  1337.         #endif
  1338.     }
  1339.     return 1;
  1340. }
  1341.  
  1342. ac_fpublic ac_EnableAntiCheatForPlayer(playerid, acid, enable)
  1343. {
  1344.     if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1345.     ACInfo[playerid][acACAllow][acid] = !!enable;
  1346.     if(enable)
  1347.     {
  1348.         switch(acid)
  1349.         {
  1350.             case 7: ACInfo[playerid][acCheatCount][15] = 0;
  1351.             case 8: ACInfo[playerid][acCheatCount][3] = 0;
  1352.             case 10: ACInfo[playerid][acCheatCount][16] = 0;
  1353.             case 15: ACInfo[playerid][acCheatCount][10] = 0;
  1354.             case 17: ACInfo[playerid][acCheatCount][7] = 0;
  1355.             case 19: ACInfo[playerid][acCheatCount][9] = 0;
  1356.             case 20: ACInfo[playerid][acCheatCount][11] = 0;
  1357.             case 23: ACInfo[playerid][acCheatCount][12] = 0;
  1358.             case 26: ACInfo[playerid][acCheatCount][14] = ACInfo[playerid][acCheatCount][8] = 0;
  1359.             case 29: ACInfo[playerid][acCheatCount][13] = ACInfo[playerid][acCheatCount][6] = 0;
  1360.             case 31: ACInfo[playerid][acCheatCount][4] = 0;
  1361.             case 34: ACInfo[playerid][acCheatCount][5] = 0;
  1362.             case 38: ACInfo[playerid][acCheatCount][0] = 0;
  1363.         }
  1364.     }
  1365.     return 1;
  1366. }
  1367.  
  1368. ac_fpublic ac_IsAntiCheatEnabled(acid)
  1369. {
  1370.     if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1371.     return ac_ACAllow[acid];
  1372. }
  1373.  
  1374. ac_fpublic ac_IsAntiCheatEnabledForPlayer(playerid, acid)
  1375. {
  1376.     if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1377.     return ACInfo[playerid][acACAllow][acid];
  1378. }
  1379.  
  1380. ac_fpublic ac_AntiCheatGetSpeed(playerid) return ACInfo[playerid][acSpeed];
  1381.  
  1382. ac_fpublic ac_AntiCheatGetAnimationIndex(playerid) return ACInfo[playerid][acAnim];
  1383.  
  1384. ac_fpublic ac_AntiCheatGetDialog(playerid) return ACInfo[playerid][acDialog];
  1385.  
  1386. ac_fpublic ac_AntiCheatGetMoney(playerid) return ACInfo[playerid][acMoney];
  1387.  
  1388. ac_fpublic ac_AntiCheatGetEnterVehicle(playerid) return ACInfo[playerid][acEnterVeh];
  1389.  
  1390. ac_fpublic ac_AntiCheatGetVehicleID(playerid) return ACInfo[playerid][acVeh];
  1391.  
  1392. ac_fpublic ac_AntiCheatGetWeapon(playerid) return ACInfo[playerid][acLastWeapon];
  1393.  
  1394. ac_fpublic ac_AntiCheatGetVehicleSeat(playerid) return ACInfo[playerid][acSeat];
  1395.  
  1396. ac_fpublic ac_AntiCheatGetSpecialAction(playerid) return ACInfo[playerid][acSpecAct];
  1397.  
  1398. ac_fpublic ac_AntiCheatGetLastSpecialActio(playerid) return ACInfo[playerid][acLastSpecAct];
  1399.  
  1400. ac_fpublic ac_AntiCheatGetLastShotWeapon(playerid) return ACInfo[playerid][acLastShot];
  1401.  
  1402. ac_fpublic ac_AntiCheatGetLastPickup(playerid) return ACInfo[playerid][acLastPickup];
  1403.  
  1404. ac_fpublic ac_AntiCheatGetLastUpdateTime(playerid) return ACInfo[playerid][acUpdateTime];
  1405.  
  1406. ac_fpublic ac_AntiCheatGetLastReloadTime(playerid) return ACInfo[playerid][acReloadTime];
  1407.  
  1408. ac_fpublic ac_AntiCheatGetLastEnteredVehTi(playerid) return ACInfo[playerid][acEnterVehTime];
  1409.  
  1410. ac_fpublic ac_AntiCheatGetLastShotTime(playerid) return ACInfo[playerid][acShotTime];
  1411.  
  1412. ac_fpublic ac_AntiCheatGetLastSpawnTime(playerid) return ACInfo[playerid][acSpawnTime];
  1413.  
  1414. ac_fpublic ac_AntiCheatIntEnterExitsIsEnab(playerid) return ACInfo[playerid][acIntEnterExits];
  1415.  
  1416. ac_fpublic ac_AntiCheatStuntBonusIsEnabled(playerid) return ACInfo[playerid][acStuntBonus];
  1417.  
  1418. ac_fpublic ac_AntiCheatIsInModShop(playerid) return ACInfo[playerid][acModShop];
  1419.  
  1420. ac_fpublic ac_AntiCheatIsFrozen(playerid) return !ACInfo[playerid][acUnFrozen];
  1421.  
  1422. ac_fpublic ac_AntiCheatIsDead(playerid) return ACInfo[playerid][acDead];
  1423.  
  1424. ac_fpublic ac_AntiCheatIsConnected(playerid) return ACInfo[playerid][acOnline];
  1425.  
  1426. ac_fpublic ac_AntiCheatGetNextDialog(playerid) return ACInfo[playerid][acNextDialog];
  1427.  
  1428. #endif
  1429.  
  1430. stock acc_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
  1431. {
  1432.     new ac_vehicleid = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
  1433.     if(ac_vehicleid != INVALID_VEHICLE_ID)
  1434.     {
  1435.         #if defined FILTERSCRIPT
  1436.             CallRemoteFunction("ac_AddStaticVehicle", "i", ac_vehicleid);
  1437.         #else
  1438.             ac_AddStaticVehicle(ac_vehicleid);
  1439.         #endif
  1440.     }
  1441.     return ac_vehicleid;
  1442. }
  1443.  
  1444. #if defined _ALS_AddStaticVehicle
  1445.     #undef AddStaticVehicle
  1446. #else
  1447.     #define _ALS_AddStaticVehicle
  1448. #endif
  1449. #define AddStaticVehicle acc_AddStaticVehicle
  1450.  
  1451. stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren = 0)
  1452. {
  1453.     new ac_vehicleid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren);
  1454.     if(ac_vehicleid != INVALID_VEHICLE_ID)
  1455.     {
  1456.         #if defined FILTERSCRIPT
  1457.             CallRemoteFunction("ac_AddStaticVehicle", "i", ac_vehicleid);
  1458.         #else
  1459.             ac_AddStaticVehicle(ac_vehicleid);
  1460.         #endif
  1461.     }
  1462.     return ac_vehicleid;
  1463. }
  1464.  
  1465. #if defined _ALS_AddStaticVehicleEx
  1466.     #undef AddStaticVehicleEx
  1467. #else
  1468.     #define _ALS_AddStaticVehicleEx
  1469. #endif
  1470. #define AddStaticVehicleEx acc_AddStaticVehicleEx
  1471.  
  1472. stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren = 0)
  1473. {
  1474.     new ac_vehicleid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay, addsiren);
  1475.     if(ac_vehicleid != INVALID_VEHICLE_ID)
  1476.     {
  1477.         #if defined FILTERSCRIPT
  1478.             CallRemoteFunction("ac_CreateVehicle", "ii", ac_vehicleid, vehicletype);
  1479.         #else
  1480.             ac_CreateVehicle(ac_vehicleid, vehicletype);
  1481.         #endif
  1482.     }
  1483.     return ac_vehicleid;
  1484. }
  1485.  
  1486. #if defined _ALS_CreateVehicle
  1487.     #undef CreateVehicle
  1488. #else
  1489.     #define _ALS_CreateVehicle
  1490. #endif
  1491. #define CreateVehicle acc_CreateVehicle
  1492.  
  1493. 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)
  1494. {
  1495.     new ac_classid = AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1496.     #if defined FILTERSCRIPT
  1497.         CallRemoteFunction("ac_AddPlayerClass", "iiiiiii", ac_classid, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1498.     #else
  1499.         ac_AddPlayerClass(ac_classid, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1500.     #endif
  1501.     return ac_classid;
  1502. }
  1503.  
  1504. #if defined _ALS_AddPlayerClass
  1505.     #undef AddPlayerClass
  1506. #else
  1507.     #define _ALS_AddPlayerClass
  1508. #endif
  1509. #define AddPlayerClass acc_AddPlayerClass
  1510.  
  1511. 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)
  1512. {
  1513.     new ac_classid = AddPlayerClassEx(teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1514.     #if defined FILTERSCRIPT
  1515.         CallRemoteFunction("ac_AddPlayerClass", "iiiiiii", ac_classid, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1516.     #else
  1517.         ac_AddPlayerClass(ac_classid, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1518.     #endif
  1519.     return ac_classid;
  1520. }
  1521.  
  1522. #if defined _ALS_AddPlayerClassEx
  1523.     #undef AddPlayerClassEx
  1524. #else
  1525.     #define _ALS_AddPlayerClassEx
  1526. #endif
  1527. #define AddPlayerClassEx acc_AddPlayerClassEx
  1528.  
  1529. stock acc_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  1530. {
  1531.     #if defined FILTERSCRIPT
  1532.         return CallRemoteFunction("ac_SetSpawnInfo", "iiiffffiiiiii", playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1533.     #else
  1534.         return ac_SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1535.     #endif
  1536. }
  1537.  
  1538. #if defined _ALS_SetSpawnInfo
  1539.     #undef SetSpawnInfo
  1540. #else
  1541.     #define _ALS_SetSpawnInfo
  1542. #endif
  1543. #define SetSpawnInfo acc_SetSpawnInfo
  1544.  
  1545. stock acc_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)
  1546. {
  1547.     new ac_pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
  1548.     if(ac_pickupid != -1)
  1549.     {
  1550.         #if defined FILTERSCRIPT
  1551.             return CallRemoteFunction("ac_AddStaticPickup", "iiifff", ac_pickupid, model, type, X, Y, Z);
  1552.         #else
  1553.             return ac_AddStaticPickup(ac_pickupid, model, type, X, Y, Z);
  1554.         #endif
  1555.     }
  1556.     return 0;
  1557. }
  1558.  
  1559. #if defined _ALS_AddStaticPickup
  1560.     #undef AddStaticPickup
  1561. #else
  1562.     #define _ALS_AddStaticPickup
  1563. #endif
  1564. #define AddStaticPickup acc_AddStaticPickup
  1565.  
  1566. stock acc_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)
  1567. {
  1568.     new ac_pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
  1569.     if(ac_pickupid != -1)
  1570.     {
  1571.         #if defined FILTERSCRIPT
  1572.             CallRemoteFunction("ac_CreatePickup", "iiifff", ac_pickupid, model, type, X, Y, Z);
  1573.         #else
  1574.             ac_CreatePickup(ac_pickupid, model, type, X, Y, Z);
  1575.         #endif
  1576.     }
  1577.     return ac_pickupid;
  1578. }
  1579.  
  1580. #if defined _ALS_CreatePickup
  1581.     #undef CreatePickup
  1582. #else
  1583.     #define _ALS_CreatePickup
  1584. #endif
  1585. #define CreatePickup acc_CreatePickup
  1586.  
  1587. #if defined CreateDynamicPickup
  1588.     #if defined STREAMER_ENABLE_TAGS
  1589.         stock STREAMER_TAG_PICKUP acc_CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0)
  1590.         {
  1591.             new STREAMER_TAG_PICKUP ac_pickupid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
  1592.     #else
  1593.         stock acc_CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0, areaid = -1, priority = 0)
  1594.         {
  1595.             new ac_pickupid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
  1596.     #endif
  1597.         if(_:ac_pickupid > 0)
  1598.         {
  1599.             #if defined FILTERSCRIPT
  1600.                 CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickupid, modelid, type);
  1601.             #else
  1602.                 ac_CreateDynamicPickup(ac_pickupid, modelid, type);
  1603.             #endif
  1604.         }
  1605.         return ac_pickupid;
  1606.     }
  1607.  
  1608.     #if defined _ALS_CreateDynamicPickup
  1609.         #undef CreateDynamicPickup
  1610.     #else
  1611.         #define _ALS_CreateDynamicPickup
  1612.     #endif
  1613.     #define CreateDynamicPickup acc_CreateDynamicPickup
  1614. #endif
  1615.  
  1616. #if defined CreateDynamicPickupEx
  1617.     #if defined STREAMER_ENABLE_TAGS
  1618.         stock STREAMER_TAG_PICKUP acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, STREAMER_TAG_AREA areas[] = { STREAMER_TAG_AREA -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
  1619.         {
  1620.             new STREAMER_TAG_PICKUP ac_pickupid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
  1621.     #else
  1622.             stock acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, areas[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
  1623.         {
  1624.             new ac_pickupid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
  1625.     #endif
  1626.         if(_:ac_pickupid > 0)
  1627.         {
  1628.             #if defined FILTERSCRIPT
  1629.                 CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickupid, modelid, type);
  1630.             #else
  1631.                 ac_CreateDynamicPickup(ac_pickupid, modelid, type);
  1632.             #endif
  1633.         }
  1634.         return ac_pickupid;
  1635.     }
  1636.  
  1637.     #if defined _ALS_CreateDynamicPickupEx
  1638.         #undef CreateDynamicPickupEx
  1639.     #else
  1640.         #define _ALS_CreateDynamicPickupEx
  1641.     #endif
  1642.     #define CreateDynamicPickupEx acc_CreateDynamicPickupEx
  1643. #endif
  1644.  
  1645. stock acc_DestroyVehicle(vehicleid)
  1646. {
  1647.     #if defined FILTERSCRIPT
  1648.         return CallRemoteFunction("ac_DestroyVehicle", "i", vehicleid);
  1649.     #else
  1650.         return ac_DestroyVehicle(vehicleid);
  1651.     #endif
  1652. }
  1653.  
  1654. #if defined _ALS_DestroyVehicle
  1655.     #undef DestroyVehicle
  1656. #else
  1657.     #define _ALS_DestroyVehicle
  1658. #endif
  1659. #define DestroyVehicle acc_DestroyVehicle
  1660.  
  1661. stock acc_DestroyPickup(pickup)
  1662. {
  1663.     #if defined FILTERSCRIPT
  1664.         return CallRemoteFunction("ac_DestroyPickup", "i", pickup);
  1665.     #else
  1666.         return ac_DestroyPickup(pickup);
  1667.     #endif
  1668. }
  1669.  
  1670. #if defined _ALS_DestroyPickup
  1671.     #undef DestroyPickup
  1672. #else
  1673.     #define _ALS_DestroyPickup
  1674. #endif
  1675. #define DestroyPickup acc_DestroyPickup
  1676.  
  1677. stock acc_DisableInteriorEnterExits()
  1678. {
  1679.     #if defined FILTERSCRIPT
  1680.         return CallRemoteFunction("ac_DisableInteriorEnterExits", "");
  1681.     #else
  1682.         return ac_DisableInteriorEnterExits();
  1683.     #endif
  1684. }
  1685.  
  1686. #if defined _ALS_DisableInteriorEnterExits
  1687.     #undef DisableInteriorEnterExits
  1688. #else
  1689.     #define _ALS_DisableInteriorEnterExits
  1690. #endif
  1691. #define DisableInteriorEnterExits acc_DisableInteriorEnterExits
  1692.  
  1693. stock acc_UsePlayerPedAnims()
  1694. {
  1695.     #if defined FILTERSCRIPT
  1696.         return CallRemoteFunction("ac_UsePlayerPedAnims", "");
  1697.     #else
  1698.         return ac_UsePlayerPedAnims();
  1699.     #endif
  1700. }
  1701.  
  1702. #if defined _ALS_UsePlayerPedAnims
  1703.     #undef UsePlayerPedAnims
  1704. #else
  1705.     #define _ALS_UsePlayerPedAnims
  1706. #endif
  1707. #define UsePlayerPedAnims acc_UsePlayerPedAnims
  1708.  
  1709. stock acc_EnableVehicleFriendlyFire()
  1710. {
  1711.     #if defined FILTERSCRIPT
  1712.         return CallRemoteFunction("ac_EnableVehicleFriendlyFire", "");
  1713.     #else
  1714.         return ac_EnableVehicleFriendlyFire();
  1715.     #endif
  1716. }
  1717.  
  1718. #if defined _ALS_EnableVehicleFriendlyFire
  1719.     #undef EnableVehicleFriendlyFire
  1720. #else
  1721.     #define _ALS_EnableVehicleFriendlyFire
  1722. #endif
  1723. #define EnableVehicleFriendlyFire acc_EnableVehicleFriendlyFire
  1724.  
  1725. stock acc_EnableStuntBonusForAll(enable)
  1726. {
  1727.     #if defined FILTERSCRIPT
  1728.         return CallRemoteFunction("ac_EnableStuntBonusForAll", "i", enable);
  1729.     #else
  1730.         return ac_EnableStuntBonusForAll(enable);
  1731.     #endif
  1732. }
  1733.  
  1734. #if defined _ALS_EnableStuntBonusForAll
  1735.     #undef EnableStuntBonusForAll
  1736. #else
  1737.     #define _ALS_EnableStuntBonusForAll
  1738. #endif
  1739. #define EnableStuntBonusForAll acc_EnableStuntBonusForAll
  1740.  
  1741. stock acc_EnableStuntBonusForPlayer(playerid, enable)
  1742. {
  1743.     #if defined FILTERSCRIPT
  1744.         return CallRemoteFunction("ac_EnableStuntBonusForPlayer", "ii", playerid, enable);
  1745.     #else
  1746.         return ac_EnableStuntBonusForPlayer(playerid, enable);
  1747.     #endif
  1748. }
  1749.  
  1750. #if defined _ALS_EnableStuntBonusForPlayer
  1751.     #undef EnableStuntBonusForPlayer
  1752. #else
  1753.     #define _ALS_EnableStuntBonusForPlayer
  1754. #endif
  1755. #define EnableStuntBonusForPlayer acc_EnableStuntBonusForPlayer
  1756.  
  1757. #if defined _inc_y_dialog || defined _INC_y_dialog
  1758.     stock ac_Dialog_Show(playerid, style, string:title[], string:caption[], string:button1[], string:button2[] = "", dialog = -1)
  1759.     {
  1760.         if(IsPlayerConnected(playerid))
  1761.         {
  1762.             #if defined FILTERSCRIPT
  1763.                 CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialog);
  1764.             #else
  1765.                 ac_ShowPlayerDialog(playerid, dialog);
  1766.             #endif
  1767.         }
  1768.         return Dialog_Show(playerid, style, title, caption, button1, button2, dialog);
  1769.     }
  1770.  
  1771.     #if defined _ALS_Dialog_Show
  1772.         #undef Dialog_Show
  1773.     #else
  1774.         #define _ALS_Dialog_Show
  1775.     #endif
  1776.     #define Dialog_Show ac_Dialog_Show
  1777. #endif
  1778.  
  1779. stock acc_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
  1780. {
  1781.     if(ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2))
  1782.     {
  1783.         #if defined FILTERSCRIPT
  1784.             return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
  1785.         #else
  1786.             return ac_ShowPlayerDialog(playerid, dialogid);
  1787.         #endif
  1788.     }
  1789.     return 0;
  1790. }
  1791.  
  1792. #if defined _ALS_ShowPlayerDialog
  1793.     #undef ShowPlayerDialog
  1794. #else
  1795.     #define _ALS_ShowPlayerDialog
  1796. #endif
  1797. #define ShowPlayerDialog acc_ShowPlayerDialog
  1798.  
  1799. stock acc_TogglePlayerControllable(playerid, toggle)
  1800. {
  1801.     #if defined FILTERSCRIPT
  1802.         return CallRemoteFunction("ac_TogglePlayerControllable", "ii", playerid, toggle);
  1803.     #else
  1804.         return ac_TogglePlayerControllable(playerid, toggle);
  1805.     #endif
  1806. }
  1807.  
  1808. #if defined _ALS_TogglePlayerControllable
  1809.     #undef TogglePlayerControllable
  1810. #else
  1811.     #define _ALS_TogglePlayerControllable
  1812. #endif
  1813. #define TogglePlayerControllable acc_TogglePlayerControllable
  1814.  
  1815. stock acc_TogglePlayerSpectating(playerid, toggle)
  1816. {
  1817.     #if defined FILTERSCRIPT
  1818.         return CallRemoteFunction("ac_TogglePlayerSpectating", "ii", playerid, toggle);
  1819.     #else
  1820.         return ac_TogglePlayerSpectating(playerid, toggle);
  1821.     #endif
  1822. }
  1823.  
  1824. #if defined _ALS_TogglePlayerSpectating
  1825.     #undef TogglePlayerSpectating
  1826. #else
  1827.     #define _ALS_TogglePlayerSpectating
  1828. #endif
  1829. #define TogglePlayerSpectating acc_TogglePlayerSpectating
  1830.  
  1831. stock acc_SpawnPlayer(playerid)
  1832. {
  1833.     #if defined FILTERSCRIPT
  1834.         return CallRemoteFunction("ac_SpawnPlayer", "i", playerid);
  1835.     #else
  1836.         return ac_SpawnPlayer(playerid);
  1837.     #endif
  1838. }
  1839.  
  1840. #if defined _ALS_SpawnPlayer
  1841.     #undef SpawnPlayer
  1842. #else
  1843.     #define _ALS_SpawnPlayer
  1844. #endif
  1845. #define SpawnPlayer acc_SpawnPlayer
  1846.  
  1847. stock acc_SetPlayerHealth(playerid, Float:health)
  1848. {
  1849.     if(floatcmp(health, 1048576.0) >= 0) health = 1048575.0;
  1850.     #if defined FILTERSCRIPT
  1851.         return CallRemoteFunction("ac_SetPlayerHealth", "if", playerid, health);
  1852.     #else
  1853.         return ac_SetPlayerHealth(playerid, health);
  1854.     #endif
  1855. }
  1856.  
  1857. #if defined _ALS_SetPlayerHealth
  1858.     #undef SetPlayerHealth
  1859. #else
  1860.     #define _ALS_SetPlayerHealth
  1861. #endif
  1862. #define SetPlayerHealth acc_SetPlayerHealth
  1863.  
  1864. stock acc_SetPlayerArmour(playerid, Float:armour)
  1865. {
  1866.     if(floatcmp(armour, 1048576.0) >= 0) armour = 1048575.0;
  1867.     #if defined FILTERSCRIPT
  1868.         return CallRemoteFunction("ac_SetPlayerArmour", "if", playerid, armour);
  1869.     #else
  1870.         return ac_SetPlayerArmour(playerid, armour);
  1871.     #endif
  1872. }
  1873.  
  1874. #if defined _ALS_SetPlayerArmour
  1875.     #undef SetPlayerArmour
  1876. #else
  1877.     #define _ALS_SetPlayerArmour
  1878. #endif
  1879. #define SetPlayerArmour acc_SetPlayerArmour
  1880.  
  1881. stock acc_GivePlayerWeapon(playerid, weaponid, ammo)
  1882. {
  1883.     if(!IsPlayerConnected(playerid)) return 0;
  1884.     #if defined FILTERSCRIPT
  1885.         return CallRemoteFunction("ac_GivePlayerWeapon", "iid", playerid, weaponid, ammo);
  1886.     #else
  1887.         return ac_GivePlayerWeapon(playerid, weaponid, ammo);
  1888.     #endif
  1889. }
  1890.  
  1891. #if defined _ALS_GivePlayerWeapon
  1892.     #undef GivePlayerWeapon
  1893. #else
  1894.     #define _ALS_GivePlayerWeapon
  1895. #endif
  1896. #define GivePlayerWeapon acc_GivePlayerWeapon
  1897.  
  1898. stock acc_SetPlayerAmmo(playerid, weaponslot, ammo)
  1899. {
  1900.     if(!IsPlayerConnected(playerid)) return 0;
  1901.     #if defined FILTERSCRIPT
  1902.         return CallRemoteFunction("ac_SetPlayerAmmo", "iid", playerid, weaponslot, ammo);
  1903.     #else
  1904.         return ac_SetPlayerAmmo(playerid, weaponslot, ammo);
  1905.     #endif
  1906. }
  1907.  
  1908. #if defined _ALS_SetPlayerAmmo
  1909.     #undef SetPlayerAmmo
  1910. #else
  1911.     #define _ALS_SetPlayerAmmo
  1912. #endif
  1913. #define SetPlayerAmmo acc_SetPlayerAmmo
  1914.  
  1915. stock acc_SetPlayerArmedWeapon(playerid, weaponid)
  1916. {
  1917.     #if defined FILTERSCRIPT
  1918.         return CallRemoteFunction("ac_SetPlayerArmedWeapon", "ii", playerid, weaponid);
  1919.     #else
  1920.         return ac_SetPlayerArmedWeapon(playerid, weaponid);
  1921.     #endif
  1922. }
  1923.  
  1924. #if defined _ALS_SetPlayerArmedWeapon
  1925.     #undef SetPlayerArmedWeapon
  1926. #else
  1927.     #define _ALS_SetPlayerArmedWeapon
  1928. #endif
  1929. #define SetPlayerArmedWeapon acc_SetPlayerArmedWeapon
  1930.  
  1931. stock acc_ResetPlayerWeapons(playerid)
  1932. {
  1933.     #if defined FILTERSCRIPT
  1934.         return CallRemoteFunction("ac_ResetPlayerWeapons", "i", playerid);
  1935.     #else
  1936.         return ac_ResetPlayerWeapons(playerid);
  1937.     #endif
  1938. }
  1939.  
  1940. #if defined _ALS_ResetPlayerWeapons
  1941.     #undef ResetPlayerWeapons
  1942. #else
  1943.     #define _ALS_ResetPlayerWeapons
  1944. #endif
  1945. #define ResetPlayerWeapons acc_ResetPlayerWeapons
  1946.  
  1947. stock acc_GivePlayerMoney(playerid, money)
  1948. {
  1949.     #if defined FILTERSCRIPT
  1950.         return CallRemoteFunction("ac_GivePlayerMoney", "id", playerid, money);
  1951.     #else
  1952.         return ac_GivePlayerMoney(playerid, money);
  1953.     #endif
  1954. }
  1955.  
  1956. #if defined _ALS_GivePlayerMoney
  1957.     #undef GivePlayerMoney
  1958. #else
  1959.     #define _ALS_GivePlayerMoney
  1960. #endif
  1961. #define GivePlayerMoney acc_GivePlayerMoney
  1962.  
  1963. stock acc_ResetPlayerMoney(playerid)
  1964. {
  1965.     #if defined FILTERSCRIPT
  1966.         return CallRemoteFunction("ac_ResetPlayerMoney", "i", playerid);
  1967.     #else
  1968.         return ac_ResetPlayerMoney(playerid);
  1969.     #endif
  1970. }
  1971.  
  1972. #if defined _ALS_ResetPlayerMoney
  1973.     #undef ResetPlayerMoney
  1974. #else
  1975.     #define _ALS_ResetPlayerMoney
  1976. #endif
  1977. #define ResetPlayerMoney acc_ResetPlayerMoney
  1978.  
  1979. stock acc_GetPlayerMoney(playerid)
  1980. {
  1981.     if(!IsPlayerConnected(playerid)) return 0;
  1982.     #if defined FILTERSCRIPT
  1983.         return CallRemoteFunction("ac_AntiCheatGetMoney", "i", playerid);
  1984.     #else
  1985.         return ac_AntiCheatGetMoney(playerid);
  1986.     #endif
  1987. }
  1988.  
  1989. #if defined _ALS_GetPlayerMoney
  1990.     #undef GetPlayerMoney
  1991. #else
  1992.     #define _ALS_GetPlayerMoney
  1993. #endif
  1994. #define GetPlayerMoney acc_GetPlayerMoney
  1995.  
  1996. stock acc_SetPlayerSpecialAction(playerid, actionid)
  1997. {
  1998.     #if defined FILTERSCRIPT
  1999.         return CallRemoteFunction("ac_SetPlayerSpecialAction", "ii", playerid, actionid);
  2000.     #else
  2001.         return ac_SetPlayerSpecialAction(playerid, actionid);
  2002.     #endif
  2003. }
  2004.  
  2005. #if defined _ALS_SetPlayerSpecialAction
  2006.     #undef SetPlayerSpecialAction
  2007. #else
  2008.     #define _ALS_SetPlayerSpecialAction
  2009. #endif
  2010. #define SetPlayerSpecialAction acc_SetPlayerSpecialAction
  2011.  
  2012. stock acc_SetPlayerInterior(playerid, interiorid)
  2013. {
  2014.     #if defined FILTERSCRIPT
  2015.         return CallRemoteFunction("ac_SetPlayerInterior", "ii", playerid, interiorid);
  2016.     #else
  2017.         return ac_SetPlayerInterior(playerid, interiorid);
  2018.     #endif
  2019. }
  2020.  
  2021. #if defined _ALS_SetPlayerInterior
  2022.     #undef SetPlayerInterior
  2023. #else
  2024.     #define _ALS_SetPlayerInterior
  2025. #endif
  2026. #define SetPlayerInterior acc_SetPlayerInterior
  2027.  
  2028. stock acc_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
  2029. {
  2030.     #if defined FILTERSCRIPT
  2031.         return CallRemoteFunction("ac_SetPlayerPos", "ifff", playerid, x, y, z);
  2032.     #else
  2033.         return ac_SetPlayerPos(playerid, x, y, z);
  2034.     #endif
  2035. }
  2036.  
  2037. #if defined _ALS_SetPlayerPos
  2038.     #undef SetPlayerPos
  2039. #else
  2040.     #define _ALS_SetPlayerPos
  2041. #endif
  2042. #define SetPlayerPos acc_SetPlayerPos
  2043.  
  2044. stock acc_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z)
  2045. {
  2046.     #if defined FILTERSCRIPT
  2047.         return CallRemoteFunction("ac_SetPlayerPosFindZ", "ifff", playerid, x, y, z);
  2048.     #else
  2049.         return ac_SetPlayerPosFindZ(playerid, x, y, z);
  2050.     #endif
  2051. }
  2052.  
  2053. #if defined _ALS_SetPlayerPosFindZ
  2054.     #undef SetPlayerPosFindZ
  2055. #else
  2056.     #define _ALS_SetPlayerPosFindZ
  2057. #endif
  2058. #define SetPlayerPosFindZ acc_SetPlayerPosFindZ
  2059.  
  2060. stock acc_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z)
  2061. {
  2062.     #if defined FILTERSCRIPT
  2063.         return CallRemoteFunction("ac_SetPlayerVelocity", "ifff", playerid, X, Y, Z);
  2064.     #else
  2065.         return ac_SetPlayerVelocity(playerid, X, Y, Z);
  2066.     #endif
  2067. }
  2068.  
  2069. #if defined _ALS_SetPlayerVelocity
  2070.     #undef SetPlayerVelocity
  2071. #else
  2072.     #define _ALS_SetPlayerVelocity
  2073. #endif
  2074. #define SetPlayerVelocity acc_SetPlayerVelocity
  2075.  
  2076. stock acc_PutPlayerInVehicle(playerid, vehicleid, seatid)
  2077. {
  2078.     #if defined FILTERSCRIPT
  2079.         return CallRemoteFunction("ac_PutPlayerInVehicle", "iii", playerid, vehicleid, seatid);
  2080.     #else
  2081.         return ac_PutPlayerInVehicle(playerid, vehicleid, seatid);
  2082.     #endif
  2083. }
  2084.  
  2085. #if defined _ALS_PutPlayerInVehicle
  2086.     #undef PutPlayerInVehicle
  2087. #else
  2088.     #define _ALS_PutPlayerInVehicle
  2089. #endif
  2090. #define PutPlayerInVehicle acc_PutPlayerInVehicle
  2091.  
  2092. stock acc_RemovePlayerFromVehicle(playerid)
  2093. {
  2094.     #if defined FILTERSCRIPT
  2095.         return CallRemoteFunction("ac_RemovePlayerFromVehicle", "i", playerid);
  2096.     #else
  2097.         return ac_RemovePlayerFromVehicle(playerid);
  2098.     #endif
  2099. }
  2100.  
  2101. #if defined _ALS_RemovePlayerFromVehicle
  2102.     #undef RemovePlayerFromVehicle
  2103. #else
  2104.     #define _ALS_RemovePlayerFromVehicle
  2105. #endif
  2106. #define RemovePlayerFromVehicle acc_RemovePlayerFromVehicle
  2107.  
  2108. stock acc_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z)
  2109. {
  2110.     #if defined FILTERSCRIPT
  2111.         return CallRemoteFunction("ac_SetVehiclePos", "ifff", vehicleid, x, y, z);
  2112.     #else
  2113.         return ac_SetVehiclePos(vehicleid, x, y, z);
  2114.     #endif
  2115. }
  2116.  
  2117. #if defined _ALS_SetVehiclePos
  2118.     #undef SetVehiclePos
  2119. #else
  2120.     #define _ALS_SetVehiclePos
  2121. #endif
  2122. #define SetVehiclePos acc_SetVehiclePos
  2123.  
  2124. stock acc_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  2125. {
  2126.     #if defined FILTERSCRIPT
  2127.         return CallRemoteFunction("ac_SetVehicleVelocity", "ifff", vehicleid, X, Y, Z);
  2128.     #else
  2129.         return ac_SetVehicleVelocity(vehicleid, X, Y, Z);
  2130.     #endif
  2131. }
  2132.  
  2133. #if defined _ALS_SetVehicleVelocity
  2134.     #undef SetVehicleVelocity
  2135. #else
  2136.     #define _ALS_SetVehicleVelocity
  2137. #endif
  2138. #define SetVehicleVelocity acc_SetVehicleVelocity
  2139.  
  2140. stock acc_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  2141. {
  2142.     #if defined FILTERSCRIPT
  2143.         return CallRemoteFunction("ac_SetVehicleAngularVelocity", "ifff", vehicleid, X, Y, Z);
  2144.     #else
  2145.         return ac_SetVehicleAngularVelocity(vehicleid, X, Y, Z);
  2146.     #endif
  2147. }
  2148.  
  2149. #if defined _ALS_SetVehicleAngularVelocity
  2150.     #undef SetVehicleAngularVelocity
  2151. #else
  2152.     #define _ALS_SetVehicleAngularVelocity
  2153. #endif
  2154. #define SetVehicleAngularVelocity acc_SetVehicleAngularVelocity
  2155.  
  2156. stock acc_LinkVehicleToInterior(vehicleid, interiorid)
  2157. {
  2158.     #if defined FILTERSCRIPT
  2159.         return CallRemoteFunction("ac_LinkVehicleToInterior", "ii", vehicleid, interiorid);
  2160.     #else
  2161.         return ac_LinkVehicleToInterior(vehicleid, interiorid);
  2162.     #endif
  2163. }
  2164.  
  2165. #if defined _ALS_LinkVehicleToInterior
  2166.     #undef LinkVehicleToInterior
  2167. #else
  2168.     #define _ALS_LinkVehicleToInterior
  2169. #endif
  2170. #define LinkVehicleToInterior acc_LinkVehicleToInterior
  2171.  
  2172. stock acc_ChangeVehiclePaintjob(vehicleid, paintjobid)
  2173. {
  2174.     #if defined FILTERSCRIPT
  2175.         return CallRemoteFunction("ac_ChangeVehiclePaintjob", "ii", vehicleid, paintjobid);
  2176.     #else
  2177.         return ac_ChangeVehiclePaintjob(vehicleid, paintjobid);
  2178.     #endif
  2179. }
  2180.  
  2181. #if defined _ALS_ChangeVehiclePaintjob
  2182.     #undef ChangeVehiclePaintjob
  2183. #else
  2184.     #define _ALS_ChangeVehiclePaintjob
  2185. #endif
  2186. #define ChangeVehiclePaintjob acc_ChangeVehiclePaintjob
  2187.  
  2188. stock acc_SetVehicleHealth(vehicleid, Float:health)
  2189. {
  2190.     if(floatcmp(health, 0.0) == -1) health = 0.0;
  2191.     #if defined FILTERSCRIPT
  2192.         return CallRemoteFunction("ac_SetVehicleHealth", "if", vehicleid, health);
  2193.     #else
  2194.         return ac_SetVehicleHealth(vehicleid, health);
  2195.     #endif
  2196. }
  2197.  
  2198. #if defined _ALS_SetVehicleHealth
  2199.     #undef SetVehicleHealth
  2200. #else
  2201.     #define _ALS_SetVehicleHealth
  2202. #endif
  2203. #define SetVehicleHealth acc_SetVehicleHealth
  2204.  
  2205. stock acc_RepairVehicle(vehicleid)
  2206. {
  2207.     #if defined FILTERSCRIPT
  2208.         return CallRemoteFunction("ac_RepairVehicle", "i", vehicleid);
  2209.     #else
  2210.         return ac_RepairVehicle(vehicleid);
  2211.     #endif
  2212. }
  2213.  
  2214. #if defined _ALS_RepairVehicle
  2215.     #undef RepairVehicle
  2216. #else
  2217.     #define _ALS_RepairVehicle
  2218. #endif
  2219. #define RepairVehicle acc_RepairVehicle
  2220.  
  2221. stock acc_SetVehicleToRespawn(vehicleid)
  2222. {
  2223.     if(GetVehicleModel(vehicleid) > 0)
  2224.     {
  2225.         #if defined FILTERSCRIPT
  2226.             return CallRemoteFunction("ac_SetVehicleToRespawn", "i", vehicleid);
  2227.         #else
  2228.             return ac_SetVehicleToRespawn(vehicleid);
  2229.         #endif
  2230.     }
  2231.     return 0;
  2232. }
  2233.  
  2234. #if defined _ALS_SetVehicleToRespawn
  2235.     #undef SetVehicleToRespawn
  2236. #else
  2237.     #define _ALS_SetVehicleToRespawn
  2238. #endif
  2239. #define SetVehicleToRespawn acc_SetVehicleToRespawn
  2240.  
  2241. stock EnableAntiCheat(acid, enable)
  2242. {
  2243.     #if defined FILTERSCRIPT
  2244.         return CallRemoteFunction("ac_EnableAntiCheat", "ii", acid, enable);
  2245.     #else
  2246.         return ac_EnableAntiCheat(acid, enable);
  2247.     #endif
  2248. }
  2249.  
  2250. stock EnableAntiCheatForPlayer(playerid, acid, enable)
  2251. {
  2252.     if(!IsPlayerConnected(playerid)) return 0;
  2253.     #if defined FILTERSCRIPT
  2254.         return CallRemoteFunction("ac_EnableAntiCheatForPlayer", "iii", playerid, acid, enable);
  2255.     #else
  2256.         return ac_EnableAntiCheatForPlayer(playerid, acid, enable);
  2257.     #endif
  2258. }
  2259.  
  2260. stock IsAntiCheatEnabled(acid)
  2261. {
  2262.     #if defined FILTERSCRIPT
  2263.         return CallRemoteFunction("ac_IsAntiCheatEnabled", "i", acid);
  2264.     #else
  2265.         return ac_IsAntiCheatEnabled(acid);
  2266.     #endif
  2267. }
  2268.  
  2269. stock IsAntiCheatEnabledForPlayer(playerid, acid)
  2270. {
  2271.     if(!IsPlayerConnected(playerid)) return 0;
  2272.     #if defined FILTERSCRIPT
  2273.         return CallRemoteFunction("ac_IsAntiCheatEnabledForPlayer", "ii", playerid, acid);
  2274.     #else
  2275.         return ac_IsAntiCheatEnabledForPlayer(playerid, acid);
  2276.     #endif
  2277. }
  2278.  
  2279. stock AntiCheatGetSpeed(playerid)
  2280. {
  2281.     if(!IsPlayerConnected(playerid)) return 0;
  2282.     #if defined FILTERSCRIPT
  2283.         return CallRemoteFunction("ac_AntiCheatGetSpeed", "i", playerid);
  2284.     #else
  2285.         return ac_AntiCheatGetSpeed(playerid);
  2286.     #endif
  2287. }
  2288.  
  2289. stock AntiCheatGetAnimationIndex(playerid)
  2290. {
  2291.     if(!IsPlayerConnected(playerid)) return 0;
  2292.     #if defined FILTERSCRIPT
  2293.         return CallRemoteFunction("ac_AntiCheatGetAnimationIndex", "i", playerid);
  2294.     #else
  2295.         return ac_AntiCheatGetAnimationIndex(playerid);
  2296.     #endif
  2297. }
  2298.  
  2299. stock AntiCheatGetDialog(playerid)
  2300. {
  2301.     if(!IsPlayerConnected(playerid)) return 0;
  2302.     #if defined FILTERSCRIPT
  2303.         return CallRemoteFunction("ac_AntiCheatGetDialog", "i", playerid);
  2304.     #else
  2305.         return ac_AntiCheatGetDialog(playerid);
  2306.     #endif
  2307. }
  2308.  
  2309. stock AntiCheatGetMoney(playerid)
  2310. {
  2311.     if(!IsPlayerConnected(playerid)) return 0;
  2312.     #if defined FILTERSCRIPT
  2313.         return CallRemoteFunction("ac_AntiCheatGetMoney", "i", playerid);
  2314.     #else
  2315.         return ac_AntiCheatGetMoney(playerid);
  2316.     #endif
  2317. }
  2318.  
  2319. stock AntiCheatGetClass(playerid)
  2320. {
  2321.     if(!IsPlayerConnected(playerid)) return 0;
  2322.     #if defined FILTERSCRIPT
  2323.         return CallRemoteFunction("ac_AntiCheatGetClass", "i", playerid);
  2324.     #else
  2325.         return ac_AntiCheatGetClass(playerid);
  2326.     #endif
  2327. }
  2328.  
  2329. stock AntiCheatGetEnterVehicle(playerid)
  2330. {
  2331.     if(!IsPlayerConnected(playerid)) return 0;
  2332.     #if defined FILTERSCRIPT
  2333.         return CallRemoteFunction("ac_AntiCheatGetEnterVehicle", "i", playerid);
  2334.     #else
  2335.         return ac_AntiCheatGetEnterVehicle(playerid);
  2336.     #endif
  2337. }
  2338.  
  2339. stock AntiCheatGetVehicleID(playerid)
  2340. {
  2341.     if(!IsPlayerConnected(playerid)) return 0;
  2342.     #if defined FILTERSCRIPT
  2343.         return CallRemoteFunction("ac_AntiCheatGetVehicleID", "i", playerid);
  2344.     #else
  2345.         return ac_AntiCheatGetVehicleID(playerid);
  2346.     #endif
  2347. }
  2348.  
  2349. stock AntiCheatGetWeapon(playerid)
  2350. {
  2351.     if(!IsPlayerConnected(playerid)) return -1;
  2352.     #if defined FILTERSCRIPT
  2353.         return CallRemoteFunction("ac_AntiCheatGetWeapon", "i", playerid);
  2354.     #else
  2355.         return ac_AntiCheatGetWeapon(playerid);
  2356.     #endif
  2357. }
  2358.  
  2359. stock AntiCheatGetVehicleSeat(playerid)
  2360. {
  2361.     if(!IsPlayerConnected(playerid)) return -1;
  2362.     #if defined FILTERSCRIPT
  2363.         return CallRemoteFunction("ac_AntiCheatGetVehicleSeat", "i", playerid);
  2364.     #else
  2365.         return ac_AntiCheatGetVehicleSeat(playerid);
  2366.     #endif
  2367. }
  2368.  
  2369. stock AntiCheatGetSpecialAction(playerid)
  2370. {
  2371.     if(!IsPlayerConnected(playerid)) return 0;
  2372.     #if defined FILTERSCRIPT
  2373.         return CallRemoteFunction("ac_AntiCheatGetSpecialAction", "i", playerid);
  2374.     #else
  2375.         return ac_AntiCheatGetSpecialAction(playerid);
  2376.     #endif
  2377. }
  2378.  
  2379. stock AntiCheatGetLastSpecialAction(playerid)
  2380. {
  2381.     if(!IsPlayerConnected(playerid)) return 0;
  2382.     #if defined FILTERSCRIPT
  2383.         return CallRemoteFunction("ac_AntiCheatGetLastSpecialActio", "i", playerid);
  2384.     #else
  2385.         return ac_AntiCheatGetLastSpecialActio(playerid);
  2386.     #endif
  2387. }
  2388.  
  2389. stock AntiCheatGetLastShotWeapon(playerid)
  2390. {
  2391.     if(!IsPlayerConnected(playerid)) return -1;
  2392.     #if defined FILTERSCRIPT
  2393.         return CallRemoteFunction("ac_AntiCheatGetLastShotWeapon", "i", playerid);
  2394.     #else
  2395.         return ac_AntiCheatGetLastShotWeapon(playerid);
  2396.     #endif
  2397. }
  2398.  
  2399. stock AntiCheatGetLastPickup(playerid)
  2400. {
  2401.     if(!IsPlayerConnected(playerid)) return -1;
  2402.     #if defined FILTERSCRIPT
  2403.         return CallRemoteFunction("ac_AntiCheatGetLastPickup", "i", playerid);
  2404.     #else
  2405.         return ac_AntiCheatGetLastPickup(playerid);
  2406.     #endif
  2407. }
  2408.  
  2409. stock AntiCheatGetLastUpdateTime(playerid)
  2410. {
  2411.     if(!IsPlayerConnected(playerid)) return 0;
  2412.     #if defined FILTERSCRIPT
  2413.         return CallRemoteFunction("ac_AntiCheatGetLastUpdateTime", "i", playerid);
  2414.     #else
  2415.         return ac_AntiCheatGetLastUpdateTime(playerid);
  2416.     #endif
  2417. }
  2418.  
  2419. stock AntiCheatGetLastReloadTime(playerid)
  2420. {
  2421.     if(!IsPlayerConnected(playerid)) return 0;
  2422.     #if defined FILTERSCRIPT
  2423.         return CallRemoteFunction("ac_AntiCheatGetLastReloadTime", "i", playerid);
  2424.     #else
  2425.         return ac_AntiCheatGetLastReloadTime(playerid);
  2426.     #endif
  2427. }
  2428.  
  2429. stock AntiCheatGetLastEnteredVehTime(playerid)
  2430. {
  2431.     if(!IsPlayerConnected(playerid)) return 0;
  2432.     #if defined FILTERSCRIPT
  2433.         return CallRemoteFunction("ac_AntiCheatGetLastEnteredVehTi", "i", playerid);
  2434.     #else
  2435.         return ac_AntiCheatGetLastEnteredVehTi(playerid);
  2436.     #endif
  2437. }
  2438.  
  2439. stock AntiCheatGetLastShotTime(playerid)
  2440. {
  2441.     if(!IsPlayerConnected(playerid)) return 0;
  2442.     #if defined FILTERSCRIPT
  2443.         return CallRemoteFunction("ac_AntiCheatGetLastShotTime", "i", playerid);
  2444.     #else
  2445.         return ac_AntiCheatGetLastShotTime(playerid);
  2446.     #endif
  2447. }
  2448.  
  2449. stock AntiCheatGetLastSpawnTime(playerid)
  2450. {
  2451.     if(!IsPlayerConnected(playerid)) return 0;
  2452.     #if defined FILTERSCRIPT
  2453.         return CallRemoteFunction("ac_AntiCheatGetLastSpawnTime", "i", playerid);
  2454.     #else
  2455.         return ac_AntiCheatGetLastSpawnTime(playerid);
  2456.     #endif
  2457. }
  2458.  
  2459. stock AntiCheatIntEnterExitsIsEnabled(playerid)
  2460. {
  2461.     if(!IsPlayerConnected(playerid)) return 0;
  2462.     #if defined FILTERSCRIPT
  2463.         return CallRemoteFunction("ac_AntiCheatIntEnterExitsIsEnab", "i", playerid);
  2464.     #else
  2465.         return ac_AntiCheatIntEnterExitsIsEnab(playerid);
  2466.     #endif
  2467. }
  2468.  
  2469. stock AntiCheatStuntBonusIsEnabled(playerid)
  2470. {
  2471.     if(!IsPlayerConnected(playerid)) return 0;
  2472.     #if defined FILTERSCRIPT
  2473.         return CallRemoteFunction("ac_AntiCheatStuntBonusIsEnabled", "i", playerid);
  2474.     #else
  2475.         return ac_AntiCheatStuntBonusIsEnabled(playerid);
  2476.     #endif
  2477. }
  2478.  
  2479. stock AntiCheatIsInModShop(playerid)
  2480. {
  2481.     if(!IsPlayerConnected(playerid)) return 0;
  2482.     #if defined FILTERSCRIPT
  2483.         return CallRemoteFunction("ac_AntiCheatIsInModShop", "i", playerid);
  2484.     #else
  2485.         return ac_AntiCheatIsInModShop(playerid);
  2486.     #endif
  2487. }
  2488.  
  2489. stock AntiCheatIsFrozen(playerid)
  2490. {
  2491.     if(!IsPlayerConnected(playerid)) return 0;
  2492.     #if defined FILTERSCRIPT
  2493.         return CallRemoteFunction("ac_AntiCheatIsFrozen", "i", playerid);
  2494.     #else
  2495.         return ac_AntiCheatIsFrozen(playerid);
  2496.     #endif
  2497. }
  2498.  
  2499. stock AntiCheatIsDead(playerid)
  2500. {
  2501.     if(!IsPlayerConnected(playerid)) return 0;
  2502.     #if defined FILTERSCRIPT
  2503.         return CallRemoteFunction("ac_AntiCheatIsDead", "i", playerid);
  2504.     #else
  2505.         return ac_AntiCheatIsDead(playerid);
  2506.     #endif
  2507. }
  2508.  
  2509. stock AntiCheatIsConnected(playerid)
  2510. {
  2511.     if(!IsPlayerConnected(playerid)) return 0;
  2512.     #if defined FILTERSCRIPT
  2513.         return CallRemoteFunction("ac_AntiCheatIsConnected", "i", playerid);
  2514.     #else
  2515.         return ac_AntiCheatIsConnected(playerid);
  2516.     #endif
  2517. }
  2518.  
  2519. #if defined _inc_y_hooks || defined _INC_y_hooks
  2520.     DEFINE_HOOK_REPLACEMENT(SirenState, Siren);
  2521.     DEFINE_HOOK_REPLACEMENT(Vehicle, Veh);
  2522. #endif
  2523.  
  2524. #if defined FILTERSCRIPT
  2525.  
  2526. static fs_AntiCheatGetNextDialog(playerid)
  2527. {
  2528.     if(!IsPlayerConnected(playerid)) return 0;
  2529.     return CallRemoteFunction("ac_AntiCheatGetNextDialog", "i", playerid);
  2530. }
  2531.  
  2532. static fs_AntiCheatSetDialog(playerid, dialogid)
  2533. {
  2534.     if(!IsPlayerConnected(playerid)) return 0;
  2535.     return CallRemoteFunction("ac_ShowPlayerDialog", "id", playerid, dialogid);
  2536. }
  2537.  
  2538. static fs_AntiCheatSetNextDialog(playerid, dialogid)
  2539. {
  2540.     if(!IsPlayerConnected(playerid)) return 0;
  2541.     return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
  2542. }
  2543.  
  2544. #else
  2545.  
  2546. #if defined _inc_y_hooks || defined _INC_y_hooks
  2547.     hook OnGameModeInit()
  2548. #else
  2549.     public OnGameModeInit()
  2550. #endif
  2551. {
  2552.     if(!ac_LoadCfg()) printf(CFG_OPENING_ERROR, AC_CONFIG_FILE);
  2553.     if(ac_ACAllow[42])
  2554.     {
  2555.         #if !AC_USE_QUERY
  2556.             ac_QueryEnable = !!GetConsoleVarAsBool("query");
  2557.             SendRconCommand("query 0");
  2558.         #endif
  2559.         #undef AC_USE_QUERY
  2560.         ac_RconEnable = !!GetConsoleVarAsBool("rcon");
  2561.         SendRconCommand("rcon 0");
  2562.     }
  2563.     #if AC_MAX_CONNECTS_FROM_IP > 1
  2564.         ac_ACAllow[37] = false;
  2565.     #endif
  2566.     ac_LagCompMode = !!GetConsoleVarAsInt("lagcompmode");
  2567.     print(" ");
  2568.     print("--------------------------------------");
  2569.     print(LOADED_MSG_1);
  2570.     printf(LOADED_MSG_2, NEX_AC_VERSION);
  2571.     print(LOADED_MSG_3);
  2572.     print("--------------------------------------\n");
  2573.     new ac_a = 1;
  2574.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2575.         && defined ac_OnGameModeInit
  2576.         ac_a = ac_OnGameModeInit();
  2577.     #endif
  2578.     static ac_strtmp[10];
  2579.     GetConsoleVarAsString("version", ac_strtmp, sizeof ac_strtmp);
  2580.     if(strcmp(ac_strtmp, AC_SERVER_VERSION)) print(VERSION_WARNING);
  2581.     #undef AC_SERVER_VERSION
  2582.     return ac_a;
  2583. }
  2584.  
  2585. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2586.     #if defined _ALS_OnGameModeInit
  2587.         #undef OnGameModeInit
  2588.     #else
  2589.         #define _ALS_OnGameModeInit
  2590.     #endif
  2591.     #define OnGameModeInit ac_OnGameModeInit
  2592.     #if defined ac_OnGameModeInit
  2593.         forward ac_OnGameModeInit();
  2594.     #endif
  2595. #endif
  2596.  
  2597. #if defined _inc_y_hooks || defined _INC_y_hooks
  2598.     hook OnGameModeExit()
  2599. #else
  2600.     public OnGameModeExit()
  2601. #endif
  2602. {
  2603.     new ac_a = 1;
  2604.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2605.         && defined ac_OnGameModeExit
  2606.         ac_a = ac_OnGameModeExit();
  2607.     #endif
  2608.     print(" ");
  2609.     print("--------------------------------------");
  2610.     print(STATS_STRING_1);
  2611.     print(STATS_STRING_2);
  2612.     printf(STATS_STRING_3, ac_sInfo[0]);
  2613.     printf(STATS_STRING_4, ac_sInfo[1]);
  2614.     printf(STATS_STRING_5, ac_sInfo[2]);
  2615.     printf(STATS_STRING_6, ac_sInfo[3]);
  2616.     printf(STATS_STRING_7, ac_sInfo[4]);
  2617.     printf(STATS_STRING_8, ac_sInfo[5]);
  2618.     print("--------------------------------------\n");
  2619.     return ac_a;
  2620. }
  2621.  
  2622. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2623.     #if defined _ALS_OnGameModeExit
  2624.         #undef OnGameModeExit
  2625.     #else
  2626.         #define _ALS_OnGameModeExit
  2627.     #endif
  2628.     #define OnGameModeExit ac_OnGameModeExit
  2629.     #if defined ac_OnGameModeExit
  2630.         forward ac_OnGameModeExit();
  2631.     #endif
  2632. #endif
  2633.  
  2634. #if defined _inc_y_hooks || defined _INC_y_hooks
  2635.     hook OnPlayerConnect(playerid)
  2636. #else
  2637.     public OnPlayerConnect(playerid)
  2638. #endif
  2639. {
  2640.     GetPlayerIp(playerid, ACInfo[playerid][acIp], 16);
  2641.     if(IsPlayerNPC(playerid))
  2642.     {
  2643.         if(ac_ACAllow[36] && strcmp(ACInfo[playerid][acIp], "127.0.0.1")) ac_KickWithCode(playerid, "", 0, 36);
  2644.         ACInfo[playerid][acTimerID] = 0;
  2645.     }
  2646.     else
  2647.     {
  2648.         if(ac_ACAllow[48] && ACInfo[playerid][acOnline]) ac_KickWithCode(playerid, "", 0, 48, 1);
  2649.         if(ac_ACAllow[41])
  2650.         {
  2651.             static ac_ver[9];
  2652.             GetPlayerVersion(playerid, ac_ver, sizeof ac_ver);
  2653.             if(!strcmp(ac_ver, "unknown", true))
  2654.             {
  2655.                 #if defined DEBUG
  2656.                     printf(DEBUG_CODE_2, playerid, ac_ver);
  2657.                 #endif
  2658.                 ac_KickWithCode(playerid, "", 0, 41);
  2659.             }
  2660.         }
  2661.         new ac_i = AC_MAX_CONNECTS_FROM_IP;
  2662.         if(ac_ACAllow[40])
  2663.         {
  2664.             #if defined foreach
  2665.                 foreach(new ac_f : Player)
  2666.                 {
  2667.                     if(ac_f != playerid && !IsPlayerNPC(ac_f) && !strcmp(ACInfo[playerid][acIp], ACInfo[ac_f][acIp], false))
  2668.             #else
  2669.                 for(new ac_f = GetPlayerPoolSize(); ac_f >= 0; --ac_f)
  2670.                 {
  2671.                     if(ac_f != playerid && IsPlayerConnected(ac_f) && !IsPlayerNPC(ac_f) &&
  2672.                     !strcmp(ACInfo[playerid][acIp], ACInfo[ac_f][acIp], false))
  2673.             #endif
  2674.                 {
  2675.                     ac_i--;
  2676.                     if(ac_i < 1)
  2677.                     {
  2678.                         #if defined DEBUG
  2679.                             printf(DEBUG_CODE_3, playerid, AC_MAX_CONNECTS_FROM_IP);
  2680.                         #endif
  2681.                         #undef AC_MAX_CONNECTS_FROM_IP
  2682.                         ac_KickWithCode(playerid, "", 0, 40);
  2683.                         break;
  2684.                     }
  2685.                 }
  2686.             }
  2687.         }
  2688.         ACInfo[playerid][acSpec] =
  2689.         ACInfo[playerid][acDeathRes] = false;
  2690.         ACInfo[playerid][acDead] = true;
  2691.         ACInfo[playerid][acIntEnterExits] = ac_IntEnterExits;
  2692.         ACInfo[playerid][acStuntBonus] = ac_StuntBonus;
  2693.         ACInfo[playerid][acCheatCount][0] =
  2694.         ACInfo[playerid][acLastWeapon] =
  2695.         ACInfo[playerid][acSpawnRes] =
  2696.         ACInfo[playerid][acLogged] =
  2697.         ACInfo[playerid][acKicked] =
  2698.         ACInfo[playerid][acMoney] =
  2699.         ACInfo[playerid][acInt] = 0;
  2700.         ACInfo[playerid][acSet][12] =
  2701.         ACInfo[playerid][acSet][10] =
  2702.         ACInfo[playerid][acSet][0] =
  2703.         ACInfo[playerid][acNextDialog] =
  2704.         ACInfo[playerid][acDialog] = -1;
  2705.         ACInfo[playerid][acAnim] = -2;
  2706.         for(ac_i = 12; ac_i >= 0; --ac_i)
  2707.         {
  2708.             ACInfo[playerid][acSetWeapon][ac_i] = -1;
  2709.             ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  2710.         }
  2711.         for(ac_i = 27; ac_i >= 0; --ac_i) ACInfo[playerid][acFloodCount][ac_i] = 0;
  2712.         ACInfo[playerid][acDropJpX] = ACInfo[playerid][acDropJpY] = ACInfo[playerid][acDropJpZ] = 20000.0;
  2713.         memcpy(ACInfo[playerid][acACAllow], ac_ACAllow, 0, sizeof(ac_ACAllow) * 4, sizeof ac_ACAllow);
  2714.         #if defined SetPlayerTimerEx_
  2715.             ACInfo[playerid][acTimerID] = SetPlayerTimerEx_(playerid, "ac_Timer", 0, 1000, 1, "i", playerid);
  2716.         #else
  2717.             ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
  2718.         #endif
  2719.     }
  2720.     ACInfo[playerid][acOnline] = true;
  2721.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2722.         && defined ac_OnPlayerConnect
  2723.         return ac_OnPlayerConnect(playerid);
  2724.     #else
  2725.         return 1;
  2726.     #endif
  2727. }
  2728.  
  2729. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2730.     #if defined _ALS_OnPlayerConnect
  2731.         #undef OnPlayerConnect
  2732.     #else
  2733.         #define _ALS_OnPlayerConnect
  2734.     #endif
  2735.     #define OnPlayerConnect ac_OnPlayerConnect
  2736.     #if defined ac_OnPlayerConnect
  2737.         forward ac_OnPlayerConnect(playerid);
  2738.     #endif
  2739. #endif
  2740.  
  2741. #if defined _inc_y_hooks || defined _INC_y_hooks
  2742.     hook OnPlayerDisconnect(playerid, reason)
  2743. #else
  2744.     public OnPlayerDisconnect(playerid, reason)
  2745. #endif
  2746. {
  2747.     ACInfo[playerid][acOnline] = false;
  2748.     if(!IsPlayerNPC(playerid))
  2749.     {
  2750.         #if defined KillPlayerTimer
  2751.             KillPlayerTimer(ACInfo[playerid][acTimerID]);
  2752.         #else
  2753.             KillTimer(ACInfo[playerid][acTimerID]);
  2754.         #endif
  2755.         if(ACInfo[playerid][acACAllow][37]) BlockIpAddress(ACInfo[playerid][acIp],
  2756.         (AC_MIN_TIME_RECONNECT * 1000) - (reason > 0 ? 0 : GetConsoleVarAsInt("playertimeout")));
  2757.         #undef AC_MIN_TIME_RECONNECT
  2758.     }
  2759.     #if defined KillPlayerTimer
  2760.         KillPlayerTimer(ACInfo[playerid][acKickTimerID]);
  2761.     #else
  2762.         KillTimer(ACInfo[playerid][acKickTimerID]);
  2763.     #endif
  2764.     new ac_veh = ACInfo[playerid][acLastVeh];
  2765.     if(ac_veh > 0 && ACVehInfo[ac_veh][acDriver] == playerid)
  2766.     {
  2767.         ACVehInfo[ac_veh][acDriver] = INVALID_PLAYER_ID;
  2768.         if(ACInfo[playerid][acKicked] == 2)
  2769.         {
  2770.             LinkVehicleToInterior(ac_veh, ACVehInfo[ac_veh][acInt]);
  2771.             SetVehicleZAngle(ac_veh, ACVehInfo[ac_veh][acZAngle]);
  2772.             SetVehicleHealth(ac_veh, ACVehInfo[ac_veh][acHealth]);
  2773.             ChangeVehiclePaintjob(ac_veh, ACVehInfo[ac_veh][acPaintJob]);
  2774.         }
  2775.     }
  2776.     if((ac_veh = ACInfo[playerid][acVeh]) > 0 && ACVehInfo[ac_veh][acDriver] == playerid)
  2777.     {
  2778.         ACVehInfo[ac_veh][acDriver] = INVALID_PLAYER_ID;
  2779.         if(ACInfo[playerid][acKicked] == 2)
  2780.         {
  2781.             LinkVehicleToInterior(ac_veh, ACVehInfo[ac_veh][acInt]);
  2782.             SetVehicleZAngle(ac_veh, ACVehInfo[ac_veh][acZAngle]);
  2783.             SetVehiclePos(ac_veh, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  2784.             SetVehicleHealth(ac_veh, ACVehInfo[ac_veh][acHealth]);
  2785.             ChangeVehiclePaintjob(ac_veh, ACVehInfo[ac_veh][acPaintJob]);
  2786.         }
  2787.     }
  2788.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2789.         && defined ac_OnPlayerDisconnect
  2790.         return ac_OnPlayerDisconnect(playerid, reason);
  2791.     #else
  2792.         return 1;
  2793.     #endif
  2794. }
  2795.  
  2796. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2797.     #if defined _ALS_OnPlayerDisconnect
  2798.         #undef OnPlayerDisconnect
  2799.     #else
  2800.         #define _ALS_OnPlayerDisconnect
  2801.     #endif
  2802.     #define OnPlayerDisconnect ac_OnPlayerDisconnect
  2803.     #if defined ac_OnPlayerDisconnect
  2804.         forward ac_OnPlayerDisconnect(playerid, reason);
  2805.     #endif
  2806. #endif
  2807.  
  2808. #if defined _inc_y_hooks || defined _INC_y_hooks
  2809.     hook OnPlayerSpawn(playerid)
  2810. #else
  2811.     public OnPlayerSpawn(playerid)
  2812. #endif
  2813. {
  2814.     if(ACInfo[playerid][acKicked]) return 0;
  2815.     if(!IsPlayerNPC(playerid))
  2816.     {
  2817.         new ac_i, ac_gtc = GetTickCount();
  2818.         if(ACInfo[playerid][acSpec] && ACInfo[playerid][acSet][7] < 2)
  2819.         {
  2820.             ACInfo[playerid][acSet][3] =
  2821.             ACInfo[playerid][acSet][4] =
  2822.             ACInfo[playerid][acSet][5] =
  2823.             ACInfo[playerid][acSet][8] =
  2824.             ACInfo[playerid][acSet][9] = -1;
  2825.             ACInfo[playerid][acSpec] = false;
  2826.         }
  2827.         else
  2828.         {
  2829.             if(ACInfo[playerid][acACAllow][27] &&
  2830.             (ACInfo[playerid][acSpawnRes] < 1 || ac_gtc < ACInfo[playerid][acSpawnTime] + 1000))
  2831.             {
  2832.                 #if defined DEBUG
  2833.                     printf("[Ricardo debug] Spawn res: %d, Respawn time: %d",
  2834.                     ACInfo[playerid][acSpawnRes], ac_gtc - ACInfo[playerid][acSpawnTime]);
  2835.                 #endif
  2836.                 ac_KickWithCode(playerid, "", 0, 27);
  2837.                 #if defined OnCheatDetected
  2838.                     ACInfo[playerid][acSpawnRes] = 1;
  2839.                 #endif
  2840.             }
  2841.             ACInfo[playerid][acSpawnRes]--;
  2842.             if(!(1 <= ACInfo[playerid][acSet][7] <= 2))
  2843.             {
  2844.                 for(ac_i = 11; ac_i >= 0; --ac_i) ACInfo[playerid][acSet][ac_i] = -1;
  2845.                 SetPlayerHealth(playerid, 100.0);
  2846.                 SetPlayerArmour(playerid, 0.0);
  2847.                 SetPlayerInterior(playerid, 0);
  2848.                 ACInfo[playerid][acHealth] = 100;
  2849.                 ACInfo[playerid][acArmour] =
  2850.                 ACInfo[playerid][acInt] = 0;
  2851.             }
  2852.         }
  2853.         if(!(1 <= ACInfo[playerid][acSet][7] <= 2))
  2854.         {
  2855.             for(ac_i = 12; ac_i >= 0; --ac_i)
  2856.             {
  2857.                 ACInfo[playerid][acSetWeapon][ac_i] = -1;
  2858.                 ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  2859.             }
  2860.             ACInfo[playerid][acNextSpecAct] = -1;
  2861.             ACInfo[playerid][acTpToZ] = false;
  2862.             ACInfo[playerid][acUnFrozen] = true;
  2863.         }
  2864.         for(ac_i = 12; ac_i >= 0; --ac_i) ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acAmmo][ac_i] = 0;
  2865.         ACInfo[playerid][acParachute] =
  2866.         ACInfo[playerid][acModShop] =
  2867.         ACInfo[playerid][acDead] = false;
  2868.         ACInfo[playerid][acLastPickup] =
  2869.         ACInfo[playerid][acSet][7] =
  2870.         ACInfo[playerid][acSeat] = -1;
  2871.         ACInfo[playerid][acCheatCount][14] =
  2872.         ACInfo[playerid][acCheatCount][9] =
  2873.         ACInfo[playerid][acLastSpecAct] =
  2874.         ACInfo[playerid][acLastShot] =
  2875.         ACInfo[playerid][acLastVeh] =
  2876.         ACInfo[playerid][acSpecAct] =
  2877.         ACInfo[playerid][acDmgRes] =
  2878.         ACInfo[playerid][acSpeed] =
  2879.         ACInfo[playerid][acVeh] = 0;
  2880.         ACInfo[playerid][acLogged] = 2;
  2881.         ACInfo[playerid][acSpawnTime] = ac_gtc + 150;
  2882.         if(ACInfo[playerid][acSpawnWeapon1] != -1)
  2883.         {
  2884.             ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon1]];
  2885.             ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon1];
  2886.             ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo1];
  2887.         }
  2888.         if(ACInfo[playerid][acSpawnWeapon2] != -1)
  2889.         {
  2890.             ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon2]];
  2891.             ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon2];
  2892.             ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo2];
  2893.         }
  2894.         if(ACInfo[playerid][acSpawnWeapon3] != -1)
  2895.         {
  2896.             ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon3]];
  2897.             ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon3];
  2898.             ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo3];
  2899.         }
  2900.     }
  2901.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2902.         && defined ac_OnPlayerSpawn
  2903.         return ac_OnPlayerSpawn(playerid);
  2904.     #else
  2905.         return 1;
  2906.     #endif
  2907. }
  2908.  
  2909. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2910.     #if defined _ALS_OnPlayerSpawn
  2911.         #undef OnPlayerSpawn
  2912.     #else
  2913.         #define _ALS_OnPlayerSpawn
  2914.     #endif
  2915.     #define OnPlayerSpawn ac_OnPlayerSpawn
  2916.     #if defined ac_OnPlayerSpawn
  2917.         forward ac_OnPlayerSpawn(playerid);
  2918.     #endif
  2919. #endif
  2920.  
  2921. #if defined _inc_y_hooks || defined _INC_y_hooks
  2922.     hook OnPlayerDeath(playerid, killerid, reason)
  2923. #else
  2924.     public OnPlayerDeath(playerid, killerid, reason)
  2925. #endif
  2926. {
  2927.     if(ACInfo[playerid][acKicked]) return 0;
  2928.     if(ACInfo[playerid][acACAllow][28] &&
  2929.     (ACInfo[playerid][acDead] || !ACInfo[playerid][acDeathRes] &&
  2930.     reason != 255 && (reason != WEAPON_COLLISION || killerid != INVALID_PLAYER_ID)))
  2931.     {
  2932.         #if defined DEBUG
  2933.             printf("[Ricardo] Is dead: %d, Death res: %d, killerid: %d, reason: %d",
  2934.             ACInfo[playerid][acDead], ACInfo[playerid][acDeathRes], killerid, reason);
  2935.         #endif
  2936.         ac_KickWithCode(playerid, "", 0, 28);
  2937.     }
  2938.     ACInfo[playerid][acDead] = true;
  2939.     ACInfo[playerid][acSpawnRes] = 1;
  2940.     ACInfo[playerid][acDeathRes] = false;
  2941.     ACInfo[playerid][acSpawnTime] = GetTickCount();
  2942.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2943.         && defined ac_OnPlayerDeath
  2944.         return ac_OnPlayerDeath(playerid, killerid, reason);
  2945.     #else
  2946.         return 1;
  2947.     #endif
  2948. }
  2949.  
  2950. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2951.     #if defined _ALS_OnPlayerDeath
  2952.         #undef OnPlayerDeath
  2953.     #else
  2954.         #define _ALS_OnPlayerDeath
  2955.     #endif
  2956.     #define OnPlayerDeath ac_OnPlayerDeath
  2957.     #if defined ac_OnPlayerDeath
  2958.         forward ac_OnPlayerDeath(playerid, killerid, reason);
  2959.     #endif
  2960. #endif
  2961.  
  2962. #if defined _inc_y_hooks || defined _INC_y_hooks
  2963.     hook OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  2964. #else
  2965.     public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  2966. #endif
  2967. {
  2968.     if(ACInfo[playerid][acKicked]) return 1;
  2969.     ACInfo[playerid][acDeathRes] = true;
  2970.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2971.         && defined ac_OnPlayerTakeDamage
  2972.         return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid, bodypart);
  2973.     #else
  2974.         return 0;
  2975.     #endif
  2976. }
  2977.  
  2978. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2979.     #if defined _ALS_OnPlayerTakeDamage
  2980.         #undef OnPlayerTakeDamage
  2981.     #else
  2982.         #define _ALS_OnPlayerTakeDamage
  2983.     #endif
  2984.     #define OnPlayerTakeDamage ac_OnPlayerTakeDamage
  2985.     #if defined ac_OnPlayerTakeDamage
  2986.         forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  2987.     #endif
  2988. #endif
  2989.  
  2990. #if defined _inc_y_hooks || defined _INC_y_hooks
  2991.     hook OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  2992. #else
  2993.     public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  2994. #endif
  2995. {
  2996.     if(ACInfo[playerid][acKicked]) return 1;
  2997.     if(ACInfo[playerid][acACAllow][47] && !(3 <= bodypart <= 9))
  2998.     {
  2999.         #if defined DEBUG
  3000.             printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d, bodypart: %d", damagedid, amount, weaponid, bodypart);
  3001.         #endif
  3002.         ac_KickWithCode(playerid, "", 0, 47, 3);
  3003.         return 1;
  3004.     }
  3005.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3006.         && defined ac_OnPlayerGiveDamage
  3007.         return ac_OnPlayerGiveDamage(playerid, damagedid, amount, weaponid, bodypart);
  3008.     #else
  3009.         return 0;
  3010.     #endif
  3011. }
  3012.  
  3013. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3014.     #if defined _ALS_OnPlayerGiveDamage
  3015.         #undef OnPlayerGiveDamage
  3016.     #else
  3017.         #define _ALS_OnPlayerGiveDamage
  3018.     #endif
  3019.     #define OnPlayerGiveDamage ac_OnPlayerGiveDamage
  3020.     #if defined ac_OnPlayerGiveDamage
  3021.         forward ac_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart);
  3022.     #endif
  3023. #endif
  3024.  
  3025. #endif
  3026.  
  3027. #if defined FILTERSCRIPT
  3028.  
  3029. #if defined _inc_y_hooks || defined _INC_y_hooks
  3030.     hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3031. #else
  3032.     public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3033. #endif
  3034. {
  3035.     if(dialogid != AntiCheatGetDialog(playerid))
  3036.     {
  3037.         new ac_nd = fs_AntiCheatGetNextDialog(playerid);
  3038.         if(dialogid == ac_nd) fs_AntiCheatSetDialog(playerid, ac_nd);
  3039.     }
  3040.     fs_AntiCheatSetNextDialog(playerid, -1);
  3041.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3042.         && defined ac_fs_OnDialogResponse
  3043.         return ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  3044.     #else
  3045.         return 0;
  3046.     #endif
  3047. }
  3048.  
  3049. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3050.     #if defined _ALS_OnDialogResponse
  3051.         #undef OnDialogResponse
  3052.     #else
  3053.         #define _ALS_OnDialogResponse
  3054.     #endif
  3055.     #define OnDialogResponse ac_fs_OnDialogResponse
  3056.     #if defined ac_fs_OnDialogResponse
  3057.         forward ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  3058.     #endif
  3059. #endif
  3060.  
  3061. #else
  3062.  
  3063. #if defined _inc_y_hooks || defined _INC_y_hooks
  3064.     hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3065. #else
  3066.     public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3067. #endif
  3068. {
  3069.     if(ACInfo[playerid][acKicked]) return 1;
  3070.     new ac_i = GetTickCount();
  3071.     if(ACInfo[playerid][acACAllow][49])
  3072.     {
  3073.         if(ac_i < ACInfo[playerid][acCall][0] + ac_Mtfc[0][0]) ac_FloodDetect(playerid, 0);
  3074.         else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  3075.         else ACInfo[playerid][acFloodCount][0] = ACInfo[playerid][acFloodCount][27] = 0;
  3076.     }
  3077.     if(ACInfo[playerid][acACAllow][39] && (dialogid != ACInfo[playerid][acDialog] || listitem < -1))
  3078.     {
  3079.         #if defined DEBUG
  3080.             printf("[Nex-AC debug] AC dialog: %d, dialogid: %d, listitem: %d", ACInfo[playerid][acDialog], dialogid, listitem);
  3081.         #endif
  3082.         #if defined OnCheatDetected
  3083.             ac_KickWithCode(playerid, "", 0, 39);
  3084.         #else
  3085.             ac_KickWithCode(playerid, "", 0, 39);
  3086.             return 1;
  3087.         #endif
  3088.     }
  3089.     ACInfo[playerid][acDialog] = -1;
  3090.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][0] = ac_i;
  3091.     if(ACInfo[playerid][acACAllow][45])
  3092.     {
  3093.         for(ac_i = strlen(inputtext) - 1; ac_i >= 0; --ac_i)
  3094.         {
  3095.             if(inputtext[ac_i] == '%') strdel(inputtext, ac_i, ac_i + 1);
  3096.         }
  3097.     }
  3098.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3099.         && defined ac_OnDialogResponse
  3100.         return ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  3101.     #else
  3102.         return 0;
  3103.     #endif
  3104. }
  3105.  
  3106. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3107.     #if defined _ALS_OnDialogResponse
  3108.         #undef OnDialogResponse
  3109.     #else
  3110.         #define _ALS_OnDialogResponse
  3111.     #endif
  3112.     #define OnDialogResponse ac_OnDialogResponse
  3113.     #if defined ac_OnDialogResponse
  3114.         forward ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  3115.     #endif
  3116. #endif
  3117.  
  3118. #if defined _inc_y_hooks || defined _INC_y_hooks
  3119.     hook OnEnterExitModShop(playerid, enterexit, interiorid)
  3120. #else
  3121.     public OnEnterExitModShop(playerid, enterexit, interiorid)
  3122. #endif
  3123. {
  3124.     if(ACInfo[playerid][acKicked]) return 0;
  3125.     #if !AC_USE_TUNING_GARAGES && !defined OnCheatDetected
  3126.         if(ACInfo[playerid][acACAllow][23]) return ac_KickWithCode(playerid, "", 0, 23, 1);
  3127.         #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3128.             && defined ac_OnEnterExitModShop
  3129.             return ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  3130.         #else
  3131.             return 1;
  3132.         #endif
  3133.     #else
  3134.         #if !AC_USE_TUNING_GARAGES
  3135.             if(ACInfo[playerid][acACAllow][23]) ac_KickWithCode(playerid, "", 0, 23, 1);
  3136.         #endif
  3137.         new ac_gtc = GetTickCount();
  3138.         if(ACInfo[playerid][acACAllow][49])
  3139.         {
  3140.             if(ac_gtc < ACInfo[playerid][acCall][1] + ac_Mtfc[1][0]) ac_FloodDetect(playerid, 1);
  3141.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  3142.             else ACInfo[playerid][acFloodCount][1] = ACInfo[playerid][acFloodCount][27] = 0;
  3143.         }
  3144.         ACInfo[playerid][acModShop] = !!enterexit;
  3145.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][1] = ac_gtc;
  3146.         ACInfo[playerid][acGtc][11] = ac_gtc + 2650;
  3147.         #if defined foreach
  3148.             foreach(new ac_i : Player)
  3149.             {
  3150.                 if(ACInfo[ac_i][acVeh] == ACInfo[playerid][acVeh]) ACInfo[ac_i][acInt] = interiorid;
  3151.             }
  3152.         #else
  3153.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  3154.             {
  3155.                 if(IsPlayerInVehicle(ac_i, ACInfo[playerid][acVeh])) ACInfo[ac_i][acInt] = interiorid;
  3156.             }
  3157.         #endif
  3158.         #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3159.             && defined ac_OnEnterExitModShop
  3160.             return ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  3161.         #else
  3162.             return 1;
  3163.         #endif
  3164.     #endif
  3165. }
  3166.  
  3167. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3168.     #if defined _ALS_OnEnterExitModShop
  3169.         #undef OnEnterExitModShop
  3170.     #else
  3171.         #define _ALS_OnEnterExitModShop
  3172.     #endif
  3173.     #define OnEnterExitModShop ac_OnEnterExitModShop
  3174.     #if defined ac_OnEnterExitModShop
  3175.         forward ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  3176.     #endif
  3177. #endif
  3178.  
  3179. #if defined _inc_y_hooks || defined _INC_y_hooks
  3180.     hook OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  3181. #else
  3182.     public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  3183. #endif
  3184. {
  3185.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked]) return 0;
  3186.     new ac_vehid = GetPlayerVehicleID(playerid);
  3187.     if(newinteriorid != ACInfo[playerid][acSet][0])
  3188.     {
  3189.         if(ACInfo[playerid][acSet][0] == -1)
  3190.         {
  3191.             if(ac_vehid > 0)
  3192.             {
  3193.                 if(ACInfo[playerid][acACAllow][3] && newinteriorid != ACInfo[playerid][acInt])
  3194.                 {
  3195.                     #if defined DEBUG
  3196.                         printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d, vehicleid: %d",
  3197.                         ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid, ac_vehid);
  3198.                     #endif
  3199.                     ac_KickWithCode(playerid, "", 0, 3, 1);
  3200.                 }
  3201.             }
  3202.             else if(ACInfo[playerid][acIntEnterExits])
  3203.             {
  3204.                 GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  3205.                 ACInfo[playerid][acGtc][11] = GetTickCount() + 2650;
  3206.             }
  3207.             else if(ACInfo[playerid][acACAllow][2] && newinteriorid != ACInfo[playerid][acInt])
  3208.             {
  3209.                 #if defined DEBUG
  3210.                     printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d",
  3211.                     ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid);
  3212.                 #endif
  3213.                 ac_KickWithCode(playerid, "", 0, 2, 1);
  3214.             }
  3215.         }
  3216.     }
  3217.     else ACInfo[playerid][acSet][0] = -1;
  3218.     ACInfo[playerid][acInt] = newinteriorid;
  3219.     if(!ACInfo[playerid][acKicked] && ac_vehid > 0) ACVehInfo[ac_vehid][acInt] = newinteriorid;
  3220.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3221.         && defined ac_OnPlayerInteriorChange
  3222.         return ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  3223.     #else
  3224.         return 1;
  3225.     #endif
  3226. }
  3227.  
  3228. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3229.     #if defined _ALS_OnPlayerInteriorChange
  3230.         #undef OnPlayerInteriorChange
  3231.     #else
  3232.         #define _ALS_OnPlayerInteriorChange
  3233.     #endif
  3234.     #define OnPlayerInteriorChange ac_OnPlayerInteriorChange
  3235.     #if defined ac_OnPlayerInteriorChange
  3236.         forward ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  3237.     #endif
  3238. #endif
  3239.  
  3240. #if defined _inc_y_hooks || defined _INC_y_hooks
  3241.     hook OnRconLoginAttempt(ip[], password[], success)
  3242. #else
  3243.     public OnRconLoginAttempt(ip[], password[], success)
  3244. #endif
  3245. {
  3246.     if(ac_ACAllow[42])
  3247.     {
  3248.         static ac_ipTables[MAX_PLAYERS][2], ac_ip_index;
  3249.         new ac_i, ac_current_ip = ac_IpToInt(ip);
  3250.         for(; ac_i < ac_ip_index && ac_i < sizeof ac_ipTables; ++ac_i)
  3251.         {
  3252.             if(ac_ipTables[ac_i][0] == ac_current_ip)
  3253.             {
  3254.                 if(success) ac_ipTables[ac_i][1] = 0;
  3255.                 else if(++ac_ipTables[ac_i][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
  3256.                 {
  3257.                     #if defined DEBUG
  3258.                         printf(DEBUG_CODE_4, ip, password);
  3259.                     #endif
  3260.                     ac_ipTables[ac_i][1] = 0;
  3261.                     ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 1);
  3262.                 }
  3263.                 ac_i = -1;
  3264.                 break;
  3265.             }
  3266.         }
  3267.         if(ac_i != -1 && !success)
  3268.         {
  3269.             ac_ipTables[ac_ip_index][0] = ac_current_ip;
  3270.             if(++ac_ipTables[ac_ip_index][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
  3271.             {
  3272.                 #undef AC_MAX_RCON_LOGIN_ATTEMPT
  3273.                 #if defined DEBUG
  3274.                     printf(DEBUG_CODE_4, ip, password, ac_ipTables[ac_ip_index][1]);
  3275.                 #endif
  3276.                 ac_ipTables[ac_ip_index][1] = 0;
  3277.                 ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 2);
  3278.             }
  3279.             if(++ac_ip_index >= sizeof ac_ipTables) ac_ip_index = 0;
  3280.             ac_ipTables[ac_ip_index][1] = 0;
  3281.         }
  3282.     }
  3283.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3284.         && defined ac_OnRconLoginAttempt
  3285.         return ac_OnRconLoginAttempt(ip, password, success);
  3286.     #else
  3287.         return 1;
  3288.     #endif
  3289. }
  3290.  
  3291. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3292.     #if defined _ALS_OnRconLoginAttempt
  3293.         #undef OnRconLoginAttempt
  3294.     #else
  3295.         #define _ALS_OnRconLoginAttempt
  3296.     #endif
  3297.     #define OnRconLoginAttempt ac_OnRconLoginAttempt
  3298.     #if defined ac_OnRconLoginAttempt
  3299.         forward ac_OnRconLoginAttempt(ip[], password[], success);
  3300.     #endif
  3301. #endif
  3302.  
  3303. #if defined _inc_y_hooks || defined _INC_y_hooks
  3304.     hook OnPlayerUpdate(playerid)
  3305. #else
  3306.     public OnPlayerUpdate(playerid)
  3307. #endif
  3308. {
  3309.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked]) return 0;
  3310.     new ac_gtc = GetTickCount(), ac_gpp;
  3311.     if(!IsPlayerNPC(playerid))
  3312.     {
  3313.         new ac_sa = GetPlayerState(playerid);
  3314.         if(ac_sa != PLAYER_STATE_SPECTATING)
  3315.         {
  3316.             ac_gpp = GetPlayerPing(playerid);
  3317.             new ac_w = GetPlayerWeapon(playerid), ac_a = GetPlayerAmmo(playerid), ac_s = ac_wSlot[ac_w];
  3318.             if(ACInfo[playerid][acSet][3] != -1)
  3319.             {
  3320.                 if(ACInfo[playerid][acSet][3] == ac_w)
  3321.                 {
  3322.                     ACInfo[playerid][acSet][3] =
  3323.                     ACInfo[playerid][acSetWeapon][ac_s] = -1;
  3324.                     ACInfo[playerid][acWeapon][ac_s] = ac_w;
  3325.                 }
  3326.                 else if(ACInfo[playerid][acGiveAmmo][ac_wSlot[ACInfo[playerid][acSet][3]]] == 0) ACInfo[playerid][acSet][3] = -1;
  3327.                 else if(ACInfo[playerid][acACAllow][52] && !(PLAYER_STATE_DRIVER <= ac_sa <= PLAYER_STATE_PASSENGER) &&
  3328.                 (ac_wSlot[ACInfo[playerid][acSet][3]] == ac_s || ACInfo[playerid][acSetWeapon][ac_wSlot[ACInfo[playerid][acSet][3]]] == -1) &&
  3329.                 ac_gtc > ACInfo[playerid][acGtc][2] + ac_gpp && ++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
  3330.                 {
  3331.                     #if defined DEBUG
  3332.                         printf(DEBUG_CODE_5, playerid, "SetPlayerArmedWeapon");
  3333.                         printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSet][3], ac_w);
  3334.                     #endif
  3335.                     #if defined OnCheatDetected
  3336.                         ac_KickWithCode(playerid, "", 0, 52, 1);
  3337.                         ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = -1;
  3338.                     #else
  3339.                         return ac_KickWithCode(playerid, "", 0, 52, 1);
  3340.                     #endif
  3341.                 }
  3342.             }
  3343.             if(ACInfo[playerid][acGiveAmmo][ac_s] != -65535)
  3344.             {
  3345.                 if(ACInfo[playerid][acGiveAmmo][ac_s] == ac_a ||
  3346.                 ACInfo[playerid][acGiveAmmo][ac_s] > ac_a && ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_s] + ac_gpp)
  3347.                 {
  3348.                     ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  3349.                     ACInfo[playerid][acAmmo][ac_s] = ac_a;
  3350.                 }
  3351.                 else if(ACInfo[playerid][acACAllow][52] &&
  3352.                 ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_s] + ac_gpp &&
  3353.                 ++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS)
  3354.                 {
  3355.                     #if defined DEBUG
  3356.                         printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  3357.                         printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  3358.                         ACInfo[playerid][acGiveAmmo][ac_s], ac_a, ac_w);
  3359.                     #endif
  3360.                     #if defined OnCheatDetected
  3361.                         ac_KickWithCode(playerid, "", 0, 52, 2);
  3362.                         ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  3363.                     #else
  3364.                         return ac_KickWithCode(playerid, "", 0, 52, 2);
  3365.                     #endif
  3366.                 }
  3367.             }
  3368.             #if AC_USE_AMMUNATIONS || AC_USE_TUNING_GARAGES
  3369.                 new ac_money = bad_GetPlayerMoney(playerid);
  3370.             #endif
  3371.             #if AC_USE_AMMUNATIONS
  3372.                 if(ACInfo[playerid][acSet][10] != -1)
  3373.                 {
  3374.                     if(ac_money < ACInfo[playerid][acMoney] &&
  3375.                     ACInfo[playerid][acSet][10] <= ACInfo[playerid][acMoney] - ac_money) ACInfo[playerid][acSet][10] = -1;
  3376.                     else if(ACInfo[playerid][acACAllow][15] && ac_gtc > ACInfo[playerid][acGtc][15] + ac_gpp &&
  3377.                     ++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_WARNINGS)
  3378.                     {
  3379.                         #if defined DEBUG
  3380.                             printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
  3381.                             ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
  3382.                         #endif
  3383.                         #if defined OnCheatDetected
  3384.                             ac_KickWithCode(playerid, "", 0, 15, 3);
  3385.                             ACInfo[playerid][acSet][10] = -1;
  3386.                         #else
  3387.                             return ac_KickWithCode(playerid, "", 0, 15, 3);
  3388.                         #endif
  3389.                     }
  3390.                 }
  3391.             #endif
  3392.             new ac_i = GetPlayerInterior(playerid), Float:ac_X, Float:ac_Y, Float:ac_Z, Float:ac_tmp;
  3393.             GetPlayerPos(playerid, ac_X, ac_Y, ac_Z);
  3394.             if(ACInfo[playerid][acLastWeapon] != ac_w)
  3395.             {
  3396.                 if(ACInfo[playerid][acWeapon][ac_s] != ac_w && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  3397.                 {
  3398.                     #if defined Streamer_GetDistanceToItem\
  3399.                         && defined Streamer_GetIntData
  3400.                     if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS) Streamer_GetDistanceToItem(ac_X, ac_Y, ac_Z, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_tmp);
  3401.                     if((ac_w == 40 || ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute]) ||
  3402.                     0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  3403.                     ac_a <= (3 <= ac_s <= 5 ? ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  3404.                     IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  3405.                     ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) ||
  3406.                     ACInfo[playerid][acLastPickup] > MAX_PICKUPS &&
  3407.                     Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) == ac_w + 100 &&
  3408.                     ac_a <= (3 <= ac_s <= 5 ? ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) && floatcmp(ac_tmp, 8.0) <= 0)
  3409.                     {
  3410.                         ACInfo[playerid][acWeapon][ac_s] = ac_w;
  3411.                         ACInfo[playerid][acAmmo][ac_s] = ac_a;
  3412.                     }
  3413.                     #else
  3414.                     if((ac_w == 40 || ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute]) ||
  3415.                     0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  3416.                     ac_a <= (3 <= ac_s <= 5 ? ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  3417.                     IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  3418.                     ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
  3419.                     {
  3420.                         ACInfo[playerid][acWeapon][ac_s] = ac_w;
  3421.                         ACInfo[playerid][acAmmo][ac_s] = ac_a;
  3422.                     }
  3423.                     #endif
  3424.                     #if AC_USE_AMMUNATIONS
  3425.                     else if(16 <= ac_w <= 39 && ac_InAmmuNation(playerid, ac_i))
  3426.                     {
  3427.                         ACInfo[playerid][acCheatCount][10] = 0;
  3428.                         if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 16][0];
  3429.                         else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 16][0];
  3430.                         if(3 <= ac_s <= 5) ACInfo[playerid][acAmmo][ac_s] += ac_AmmuNationInfo[ac_w - 16][1];
  3431.                         else ACInfo[playerid][acAmmo][ac_s] = ac_AmmuNationInfo[ac_w - 16][1];
  3432.                         ACInfo[playerid][acWeapon][ac_s] = ac_w;
  3433.                         ACInfo[playerid][acGtc][15] = ac_gtc + 1650;
  3434.                     }
  3435.                     #endif
  3436.                     else if(ACInfo[playerid][acACAllow][15] && ACInfo[playerid][acSetWeapon][ac_s] == -1)
  3437.                     {
  3438.                         #if defined DEBUG
  3439.                             printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
  3440.                             ACInfo[playerid][acWeapon][ac_s], ACInfo[playerid][acAmmo][ac_s], ac_w, ac_a);
  3441.                         #endif
  3442.                         #if defined OnCheatDetected
  3443.                             ac_KickWithCode(playerid, "", 0, 15, 1);
  3444.                             ACInfo[playerid][acWeapon][ac_s] = ac_w;
  3445.                             ACInfo[playerid][acAmmo][ac_s] = ac_a;
  3446.                         #else
  3447.                             return ac_KickWithCode(playerid, "", 0, 15, 1);
  3448.                         #endif
  3449.                     }
  3450.                 }
  3451.             }
  3452.             else if(ACInfo[playerid][acAmmo][ac_s] != ac_a)
  3453.             {
  3454.                 switch(ac_w)
  3455.                 {
  3456.                     case 16..18, 35, 36, 39, 43:
  3457.                     {
  3458.                         if(ac_sa != PLAYER_STATE_DRIVER && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  3459.                         {
  3460.                             if(ACInfo[playerid][acACAllow][16] &&
  3461.                             (ACInfo[playerid][acAmmo][ac_s] == 0 || ac_a > ACInfo[playerid][acAmmo][ac_s] ||
  3462.                             ac_a < 0 < ACInfo[playerid][acAmmo][ac_s]))
  3463.                             {
  3464.                                 #if defined DEBUG
  3465.                                     printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  3466.                                     ACInfo[playerid][acAmmo][ac_s], ac_a, ac_w);
  3467.                                 #endif
  3468.                                 #if defined OnCheatDetected
  3469.                                     ac_KickWithCode(playerid, "", 0, 16, 1);
  3470.                                 #else
  3471.                                     return ac_KickWithCode(playerid, "", 0, 16, 1);
  3472.                                 #endif
  3473.                             }
  3474.                             ACInfo[playerid][acAmmo][ac_s] = ac_a;
  3475.                         }
  3476.                     }
  3477.                 }
  3478.             }
  3479.             GetPlayerHealth(playerid, ac_tmp);
  3480.             new ac_health = floatround(ac_tmp, floatround_tozero);
  3481.             if(ACInfo[playerid][acSet][1] != -1)
  3482.             {
  3483.                 if(ACInfo[playerid][acSet][1] > 255)
  3484.                 {
  3485.                     while(ac_health < ACInfo[playerid][acSet][1]) ac_health += 256;
  3486.                 }
  3487.                 if(ACInfo[playerid][acSet][1] == ac_health || ACInfo[playerid][acDmgRes] ||
  3488.                 ACInfo[playerid][acSet][1] > ac_health && ac_gtc > ACInfo[playerid][acGtc][3] + ac_gpp)
  3489.                 {
  3490.                     ACInfo[playerid][acSet][1] = -1;
  3491.                     ACInfo[playerid][acDmgRes] = 0;
  3492.                 }
  3493.                 else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][3] + ac_gpp &&
  3494.                 ++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS)
  3495.                 {
  3496.                     #if defined DEBUG
  3497.                         printf(DEBUG_CODE_5, playerid, "SetPlayerHealth");
  3498.                         printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acSet][1], ac_health);
  3499.                     #endif
  3500.                     #if defined OnCheatDetected
  3501.                         ac_KickWithCode(playerid, "", 0, 52, 3);
  3502.                         ACInfo[playerid][acSet][1] = -1;
  3503.                     #else
  3504.                         return ac_KickWithCode(playerid, "", 0, 52, 3);
  3505.                     #endif
  3506.                 }
  3507.             }
  3508.             else if(ACInfo[playerid][acACAllow][12])
  3509.             {
  3510.                 while(ACInfo[playerid][acHealth] > ac_health + 255) ac_health += 256;
  3511.                 if(ac_health > ACInfo[playerid][acHealth])
  3512.                 {
  3513.                     #if AC_USE_RESTAURANTS
  3514.                         if(ac_health > ACInfo[playerid][acHealth] + 70 || !ac_InRestaurant(playerid, ac_i))
  3515.                         {
  3516.                     #endif
  3517.                         #if AC_USE_VENDING_MACHINES
  3518.                             if(ac_health > ACInfo[playerid][acHealth] + 35 || !ac_NearVendingMachine(playerid, ac_i))
  3519.                             {
  3520.                         #endif
  3521.                             #if defined DEBUG
  3522.                                 printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acHealth], ac_health);
  3523.                             #endif
  3524.                             #if defined OnCheatDetected
  3525.                                 ac_KickWithCode(playerid, "", 0, 12);
  3526.                             #else
  3527.                                 return ac_KickWithCode(playerid, "", 0, 12);
  3528.                             #endif
  3529.                         #if AC_USE_VENDING_MACHINES
  3530.                             }
  3531.                         #endif
  3532.                     #if AC_USE_RESTAURANTS
  3533.                         }
  3534.                     #endif
  3535.                 }
  3536.             }
  3537.             GetPlayerArmour(playerid, ac_tmp);
  3538.             new ac_armour = floatround(ac_tmp, floatround_tozero);
  3539.             if(ACInfo[playerid][acSet][2] != -1)
  3540.             {
  3541.                 if(ACInfo[playerid][acSet][2] > 255)
  3542.                 {
  3543.                     while(ac_armour < ACInfo[playerid][acSet][2]) ac_armour += 256;
  3544.                 }
  3545.                 if(ACInfo[playerid][acSet][2] == ac_armour || ACInfo[playerid][acDmgRes] ||
  3546.                 ACInfo[playerid][acSet][2] > ac_armour && ac_gtc > ACInfo[playerid][acGtc][5] + ac_gpp)
  3547.                 {
  3548.                     ACInfo[playerid][acSet][2] = -1;
  3549.                     ACInfo[playerid][acDmgRes] = 0;
  3550.                 }
  3551.                 else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][5] + ac_gpp &&
  3552.                 ++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS)
  3553.                 {
  3554.                     #if defined DEBUG
  3555.                         printf(DEBUG_CODE_5, playerid, "SetPlayerArmour");
  3556.                         printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acSet][2], ac_armour);
  3557.                     #endif
  3558.                     #if defined OnCheatDetected
  3559.                         ac_KickWithCode(playerid, "", 0, 52, 4);
  3560.                         ACInfo[playerid][acSet][2] = -1;
  3561.                     #else
  3562.                         return ac_KickWithCode(playerid, "", 0, 52, 4);
  3563.                     #endif
  3564.                 }
  3565.             }
  3566.             else if(ACInfo[playerid][acACAllow][13])
  3567.             {
  3568.                 while(ACInfo[playerid][acArmour] > ac_armour + 255) ac_armour += 256;
  3569.                 if(ac_armour > ACInfo[playerid][acArmour])
  3570.                 {
  3571.                     #if AC_USE_AMMUNATIONS
  3572.                         if(ac_InAmmuNation(playerid, ac_i))
  3573.                         {
  3574.                             ACInfo[playerid][acCheatCount][10] = 0;
  3575.                             if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += 200;
  3576.                             else ACInfo[playerid][acSet][10] = 200;
  3577.                             ACInfo[playerid][acGtc][15] = ac_gtc + 1650;
  3578.                         }
  3579.                         else
  3580.                         {
  3581.                     #endif
  3582.                         #if defined DEBUG
  3583.                             printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acArmour], ac_armour);
  3584.                         #endif
  3585.                         #if defined OnCheatDetected
  3586.                             ac_KickWithCode(playerid, "", 0, 13);
  3587.                         #else
  3588.                             return ac_KickWithCode(playerid, "", 0, 13);
  3589.                         #endif
  3590.                     #if AC_USE_AMMUNATIONS
  3591.                         }
  3592.                     #endif
  3593.                 }
  3594.             }
  3595.             if(ac_health < ACInfo[playerid][acHealth] || ac_armour < ACInfo[playerid][acArmour])
  3596.             {
  3597.                 ACInfo[playerid][acVehDmgRes] = false;
  3598.                 ACInfo[playerid][acCheatCount][9] = ACInfo[playerid][acDmgRes] = 0;
  3599.             }
  3600.             else if(ACInfo[playerid][acACAllow][19] &&
  3601.             ACInfo[playerid][acDmgRes] && ac_gtc > ACInfo[playerid][acGtc][14] + ac_gpp)
  3602.             {
  3603.                 ACInfo[playerid][acDmgRes] = 0;
  3604.                 ACInfo[playerid][acVehDmgRes] = false;
  3605.                 if(++ACInfo[playerid][acCheatCount][9] > AC_MAX_GODMODE_WARNINGS)
  3606.                 {
  3607.                     #undef AC_MAX_GODMODE_WARNINGS
  3608.                     #if defined DEBUG
  3609.                         printf("[Nex-AC debug] AC health: %d, health: %d, AC armour: %d, armour: %d",
  3610.                         ACInfo[playerid][acHealth], ac_health, ACInfo[playerid][acArmour], ac_armour);
  3611.                     #endif
  3612.                     #if defined OnCheatDetected
  3613.                         ac_KickWithCode(playerid, "", 0, 19);
  3614.                         ACInfo[playerid][acCheatCount][9] = 0;
  3615.                     #else
  3616.                         return ac_KickWithCode(playerid, "", 0, 19);
  3617.                     #endif
  3618.                 }
  3619.             }
  3620.             #if AC_USE_TUNING_GARAGES
  3621.             if(ACInfo[playerid][acSet][12] != -1)
  3622.             {
  3623.                 if(ac_money < ACInfo[playerid][acMoney] &&
  3624.                 ACInfo[playerid][acSet][12] <= ACInfo[playerid][acMoney] - ac_money) ACInfo[playerid][acSet][12] = -1;
  3625.                 else if(ACInfo[playerid][acACAllow][23] && ac_gtc > ACInfo[playerid][acGtc][17] + ac_gpp &&
  3626.                 ++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_WARNINGS)
  3627.                 {
  3628.                     #if defined DEBUG
  3629.                         printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
  3630.                         ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][12]);
  3631.                     #endif
  3632.                     #if defined OnCheatDetected
  3633.                         ac_KickWithCode(playerid, "", 0, 23, 3);
  3634.                         ACInfo[playerid][acSet][12] = -1;
  3635.                     #else
  3636.                         return ac_KickWithCode(playerid, "", 0, 23, 3);
  3637.                     #endif
  3638.                 }
  3639.             }
  3640.             #endif
  3641.             new ac_vehid = GetPlayerVehicleID(playerid);
  3642.             if(ACInfo[playerid][acACAllow][52])
  3643.             {
  3644.                 if(ACInfo[playerid][acSet][0] != -1 && ac_gtc > ACInfo[playerid][acGtc][0] + ac_gpp)
  3645.                 {
  3646.                     if(ACInfo[playerid][acSet][0] == ac_i) ACInfo[playerid][acSet][0] = -1;
  3647.                     else if(++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS)
  3648.                     {
  3649.                         #if defined DEBUG
  3650.                             printf(DEBUG_CODE_5, playerid, "SetPlayerInterior");
  3651.                             printf("[Nex-AC debug] AC interior: %d, interiorid: %d", ACInfo[playerid][acSet][0], ac_i);
  3652.                         #endif
  3653.                         #if defined OnCheatDetected
  3654.                             ac_KickWithCode(playerid, "", 0, 52, 5);
  3655.                             ACInfo[playerid][acSet][0] = -1;
  3656.                         #else
  3657.                             return ac_KickWithCode(playerid, "", 0, 52, 5);
  3658.                         #endif
  3659.                     }
  3660.                 }
  3661.                 if(ACInfo[playerid][acSet][6] != -1 && ac_gtc > ACInfo[playerid][acGtc][12] + ac_gpp &&
  3662.                 ++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS)
  3663.                 {
  3664.                     #if defined DEBUG
  3665.                         printf(DEBUG_CODE_5, playerid, "TogglePlayerSpectating");
  3666.                     #endif
  3667.                     #if defined OnCheatDetected
  3668.                         ac_KickWithCode(playerid, "", 0, 52, 6);
  3669.                         ACInfo[playerid][acSet][6] = -1;
  3670.                     #else
  3671.                         return ac_KickWithCode(playerid, "", 0, 52, 6);
  3672.                     #endif
  3673.                 }
  3674.                 if(ACInfo[playerid][acSet][7] != -1 && ac_gtc > ACInfo[playerid][acGtc][13] + ac_gpp &&
  3675.                 ++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS)
  3676.                 {
  3677.                     #if defined DEBUG
  3678.                         printf(DEBUG_CODE_5, playerid, "SpawnPlayer");
  3679.                         printf("[Nex-AC debug] acSet[7]: %d", ACInfo[playerid][acSet][7]);
  3680.                     #endif
  3681.                     #if defined OnCheatDetected
  3682.                         ac_KickWithCode(playerid, "", 0, 52, 7);
  3683.                         ACInfo[playerid][acSet][7] = -1;
  3684.                     #else
  3685.                         return ac_KickWithCode(playerid, "", 0, 52, 7);
  3686.                     #endif
  3687.                 }
  3688.                 if(ACInfo[playerid][acSet][11] != -1 && ac_vehid > 0 && ac_gtc > ACInfo[playerid][acGtc][8] + ac_gpp)
  3689.                 {
  3690.                     #if defined DEBUG
  3691.                         printf(DEBUG_CODE_5, playerid, "RemovePlayerFromVehicle");
  3692.                         printf("[Nex-AC debug] Veh model: %d", GetVehicleModel(ac_vehid));
  3693.                     #endif
  3694.                     #if defined OnCheatDetected
  3695.                         ac_KickWithCode(playerid, "", 0, 52, 8);
  3696.                         ACInfo[playerid][acSet][11] = -1;
  3697.                     #else
  3698.                         return ac_KickWithCode(playerid, "", 0, 52, 8);
  3699.                     #endif
  3700.                 }
  3701.             }
  3702.             ac_s = GetPlayerVehicleSeat(playerid);
  3703.             if(ACInfo[playerid][acSet][9] != -1)
  3704.             {
  3705.                 if(ACInfo[playerid][acSet][9] == ac_vehid &&
  3706.                 (ACInfo[playerid][acSet][5] == ac_s || ACInfo[playerid][acSet][5] == -1))
  3707.                 {
  3708.                     if(ACInfo[playerid][acVeh] > 0 &&
  3709.                     ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = INVALID_PLAYER_ID;
  3710.                     if(ac_s == 0)
  3711.                     {
  3712.                         ACVehInfo[ac_vehid][acDriver] = playerid;
  3713.                         GetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
  3714.                         ACInfo[playerid][acSetVehHealth] = -1.0;
  3715.                     }
  3716.                     ACInfo[playerid][acCheatCount][11] = 0;
  3717.                     ACInfo[playerid][acVehDmgRes] = false;
  3718.                     ACInfo[playerid][acSet][11] =
  3719.                     ACInfo[playerid][acSet][9] =
  3720.                     ACInfo[playerid][acSet][8] =
  3721.                     ACInfo[playerid][acSet][5] = -1;
  3722.                     ACInfo[playerid][acSeat] = ac_s;
  3723.                 }
  3724.                 else if(!GetVehicleModel(ACInfo[playerid][acSet][9]) ||
  3725.                 !ACVehInfo[ACInfo[playerid][acSet][9]][acSpawned])
  3726.                 {
  3727.                     ACInfo[playerid][acSet][9] =
  3728.                     ACInfo[playerid][acSet][5] = -1;
  3729.                 }
  3730.                 else if(ac_gtc > ACInfo[playerid][acGtc][1] + ac_gpp)
  3731.                 {
  3732.                     if(ACInfo[playerid][acSet][5] == -1) ACInfo[playerid][acSet][9] = -1;
  3733.                     else if(ACInfo[playerid][acACAllow][52] && ++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS)
  3734.                     {
  3735.                         #if defined DEBUG
  3736.                             printf(DEBUG_CODE_5, playerid, "PutPlayerInVehicle");
  3737.                             printf("[Nex-AC debug] AC vehicle: %d, vehicleid: %d, AC seat: %d, seatid: %d",
  3738.                             ACInfo[playerid][acSet][9], ac_vehid, ACInfo[playerid][acSet][5], ac_s);
  3739.                         #endif
  3740.                         #if defined OnCheatDetected
  3741.                             ac_KickWithCode(playerid, "", 0, 52, 9);
  3742.                             ACInfo[playerid][acSet][9] = -1;
  3743.                         #else
  3744.                             return ac_KickWithCode(playerid, "", 0, 52, 9);
  3745.                         #endif
  3746.                     }
  3747.                 }
  3748.             }
  3749.             else
  3750.             {
  3751.                 if(ACInfo[playerid][acSet][8] != -1)
  3752.                 {
  3753.                     if(IsPlayerInRangeOfPoint(playerid, 8.0, ACInfo[playerid][acSetPosX],
  3754.                     ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_Z : ACInfo[playerid][acSetPosZ])))
  3755.                     {
  3756.                         ACInfo[playerid][acSet][8] = -1;
  3757.                         ACInfo[playerid][acGtc][11] = 0;
  3758.                         ACInfo[playerid][acTpToZ] = false;
  3759.                         ACInfo[playerid][acPosX] = ac_X;
  3760.                         ACInfo[playerid][acPosY] = ac_Y;
  3761.                         ACInfo[playerid][acPosZ] = ac_Z;
  3762.                     }
  3763.                     else if(ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  3764.                     {
  3765.                         if(ACInfo[playerid][acACAllow][52] && ++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS)
  3766.                         {
  3767.                             #if defined DEBUG
  3768.                                 printf(DEBUG_CODE_5, playerid, "SetPlayerPos");
  3769.                                 printf("[Nex-AC debug] Distance: %f, acSet[8]: %d", GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX],
  3770.                                 ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_Z : ACInfo[playerid][acSetPosZ])), ACInfo[playerid][acSet][8]);
  3771.                             #endif
  3772.                             #if defined OnCheatDetected
  3773.                                 ac_KickWithCode(playerid, "", 0, 52, 10);
  3774.                                 ACInfo[playerid][acSet][8] = -1;
  3775.                             #else
  3776.                                 return ac_KickWithCode(playerid, "", 0, 52, 10);
  3777.                             #endif
  3778.                         }
  3779.                         ACInfo[playerid][acTpToZ] = false;
  3780.                     }
  3781.                 }
  3782.                 new Float:ac_vX, Float:ac_vY, Float:ac_vZ, ac_specact = GetPlayerSpecialAction(playerid),
  3783.                 Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]),
  3784.                 Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_Z : ACInfo[playerid][acSetPosZ]));
  3785.                 if(ac_vehid > 0)
  3786.                 {
  3787.                     if(ACInfo[playerid][acVeh] == 0)
  3788.                     {
  3789.                         if(ACInfo[playerid][acACAllow][4] &&
  3790.                         (ACInfo[playerid][acEnterVeh] != ac_vehid || ac_gtc < ACInfo[playerid][acEnterVehTime] + 600))
  3791.                         {
  3792.                             #if defined DEBUG
  3793.                                 printf("[Nex-AC debug] Entered vehicle: %d, vehicleid: %d, Enter time: %d",
  3794.                                 ACInfo[playerid][acEnterVeh], ac_vehid, ac_gtc - ACInfo[playerid][acEnterVehTime]);
  3795.                             #endif
  3796.                             #if defined OnCheatDetected
  3797.                                 ac_KickWithCode(playerid, "", 0, 4, 1);
  3798.                             #else
  3799.                                 return ac_KickWithCode(playerid, "", 0, 4, 1);
  3800.                             #endif
  3801.                         }
  3802.                     }
  3803.                     else if(ACInfo[playerid][acVeh] != ac_vehid)
  3804.                     {
  3805.                         if(ACInfo[playerid][acACAllow][4])
  3806.                         {
  3807.                             #if defined DEBUG
  3808.                                 printf("[Nex-AC debug] AC vehicle: %d, vehicleid: %d", ACInfo[playerid][acVeh], ac_vehid);
  3809.                             #endif
  3810.                             #if defined OnCheatDetected
  3811.                                 ac_KickWithCode(playerid, "", 0, 4, 2);
  3812.                             #else
  3813.                                 return ac_KickWithCode(playerid, "", 0, 4, 2);
  3814.                             #endif
  3815.                         }
  3816.                     }
  3817.                     else if(ACInfo[playerid][acACAllow][50] && ACInfo[playerid][acSeat] != ac_s)
  3818.                     {
  3819.                         #if defined DEBUG
  3820.                             printf("[Nex-AC debug] AC seat: %d, seatid: %d, vehicleid: %d", ACInfo[playerid][acSeat], ac_s, ac_vehid);
  3821.                         #endif
  3822.                         #if defined OnCheatDetected
  3823.                             ac_KickWithCode(playerid, "", 0, 50, 1);
  3824.                         #else
  3825.                             return ac_KickWithCode(playerid, "", 0, 50, 1);
  3826.                         #endif
  3827.                     }
  3828.                     if(ac_sa == PLAYER_STATE_DRIVER)
  3829.                     {
  3830.                         if(ACInfo[playerid][acACAllow][32] &&
  3831.                         ACVehInfo[ac_vehid][acDriver] != INVALID_PLAYER_ID && ACVehInfo[ac_vehid][acDriver] != playerid)
  3832.                         {
  3833.                             #if defined DEBUG
  3834.                                 printf("[Nex-AC debug] AC driver: %d, driver: %d, vehicleid: %d",
  3835.                                 ACVehInfo[ac_vehid][acDriver], playerid, ac_vehid);
  3836.                             #endif
  3837.                             #if defined OnCheatDetected
  3838.                                 ac_KickWithCode(playerid, "", 0, 32);
  3839.                             #else
  3840.                                 return SetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  3841.                             #endif
  3842.                         }
  3843.                         if(ACInfo[playerid][acACAllow][35] && GetPlayerCameraMode(playerid) == 55)
  3844.                         {
  3845.                             #if defined OnCheatDetected
  3846.                                 ac_KickWithCode(playerid, "", 0, 35);
  3847.                             #else
  3848.                                 return ac_KickWithCode(playerid, "", 0, 35);
  3849.                             #endif
  3850.                         }
  3851.                         new Float:ac_vHealth;
  3852.                         GetVehicleHealth(ac_vehid, ac_vHealth);
  3853.                         if(floatcmp(ACInfo[playerid][acSetVehHealth], -1.0) != 0)
  3854.                         {
  3855.                             if(floatcmp(ACInfo[playerid][acSetVehHealth], ac_vHealth) == 0 ||
  3856.                             floatcmp(ACInfo[playerid][acSetVehHealth], ac_vHealth) == 1 &&
  3857.                             ac_gtc > ACInfo[playerid][acGtc][4] + ac_gpp)
  3858.                             {
  3859.                                 ACInfo[playerid][acSetVehHealth] = -1.0;
  3860.                                 ACInfo[playerid][acVehDmgRes] = false;
  3861.                             }
  3862.                             else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][4] + ac_gpp &&
  3863.                             ++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS)
  3864.                             {
  3865.                                 #if defined DEBUG
  3866.                                     printf(DEBUG_CODE_5, playerid, "SetVehicleHealth");
  3867.                                     printf("[Nex-AC debug] AC veh health: %f, veh health: %f, vehicleid: %d",
  3868.                                     ACInfo[playerid][acSetVehHealth], ac_vHealth, ac_vehid);
  3869.                                 #endif
  3870.                                 #if defined OnCheatDetected
  3871.                                     ac_KickWithCode(playerid, "", 0, 52, 11);
  3872.                                     ACInfo[playerid][acSetVehHealth] = -1.0;
  3873.                                 #else
  3874.                                     return ac_KickWithCode(playerid, "", 0, 52, 11);
  3875.                                 #endif
  3876.                             }
  3877.                         }
  3878.                         else if(ACInfo[playerid][acACAllow][11] &&
  3879.                         floatcmp(ac_vHealth, ACVehInfo[ac_vehid][acHealth]) == 1 &&
  3880.                         !ACInfo[playerid][acModShop] && ac_vHealth)
  3881.                         {
  3882.                             #if AC_USE_PAYNSPRAY
  3883.                                 if(!ac_InPayNSpray(playerid, ac_i))
  3884.                                 {
  3885.                             #endif
  3886.                                 #if defined DEBUG
  3887.                                     printf("[Nex-AC debug] AC veh health: %f, veh health: %f, vehicleid: %d, playerid: %d",
  3888.                                     ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid, playerid);
  3889.                                 #endif
  3890.                                 #if defined OnCheatDetected
  3891.                                     ac_KickWithCode(playerid, "", 0, 11);
  3892.                                 #endif
  3893.                                 SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
  3894.                             #if AC_USE_PAYNSPRAY
  3895.                                 }
  3896.                             #endif
  3897.                         }
  3898.                         if(ACInfo[playerid][acVehDmgRes])
  3899.                         {
  3900.                             if(floatcmp(ac_vHealth, ACVehInfo[ac_vehid][acHealth]) == -1)
  3901.                             {
  3902.                                 ACInfo[playerid][acVehDmgRes] = false;
  3903.                                 ACInfo[playerid][acCheatCount][11] = ACInfo[playerid][acDmgRes] = 0;
  3904.                             }
  3905.                             else if(ACInfo[playerid][acACAllow][20] && ac_gtc > ACInfo[playerid][acGtc][16] + ac_gpp)
  3906.                             {
  3907.                                 ACInfo[playerid][acDmgRes] = 0;
  3908.                                 ACInfo[playerid][acVehDmgRes] = false;
  3909.                                 if(++ACInfo[playerid][acCheatCount][11] > AC_MAX_GODMODE_VEH_WARNINGS)
  3910.                                 {
  3911.                                     #undef AC_MAX_GODMODE_VEH_WARNINGS
  3912.                                     #if defined DEBUG
  3913.                                         printf("[Nex-AC debug] AC veh health: %f, veh health: %f, vehicleid: %d",
  3914.                                         ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid);
  3915.                                     #endif
  3916.                                     #if defined OnCheatDetected
  3917.                                         ac_KickWithCode(playerid, "", 0, 20);
  3918.                                         ACInfo[playerid][acCheatCount][11] = 0;
  3919.                                     #else
  3920.                                         return ac_KickWithCode(playerid, "", 0, 20);
  3921.                                     #endif
  3922.                                 }
  3923.                             }
  3924.                         }
  3925.                         GetVehicleVelocity(ac_vehid, ac_vX, ac_vY, ac_vZ);
  3926.                         new Float:ac_zAngle, ac_vsp = ac_GetSpeed3D(ac_vX, ac_vY, ac_vZ);
  3927.                         GetVehicleZAngle(ac_vehid, ac_zAngle);
  3928.                         ac_zAngle = ac_AbsoluteAngle(ac_zAngle);
  3929.                         #undef ac_AbsoluteAngle
  3930.                         if(floatcmp(ac_dist, 0.8) == 1 &&
  3931.                         (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_dist_set, 0.8) == 1) &&
  3932.                         ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  3933.                         {
  3934.                             if(floatcmp(ac_dist, 25.0) == 1 &&
  3935.                             floatcmp(ac_dist, floatadd(ACVehInfo[ac_vehid][acPosDiff], floatmul(floatdiv(ac_dist, 2.6), 1.8))) == 1 &&
  3936.                             (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_dist_set, 25.0) == 1 &&
  3937.                             floatcmp(ac_dist_set, floatadd(ACVehInfo[ac_vehid][acPosDiff], floatmul(floatdiv(ac_dist_set, 2.6), 1.8))) == 1))
  3938.                             {
  3939.                                 if(ACInfo[playerid][acACAllow][3] && floatcmp(ACInfo[playerid][acPosZ], -95.0) == 1)
  3940.                                 {
  3941.                                     #if defined DEBUG
  3942.                                         printf("[Nex-AC debug] Distance: %f, distance set: %f, old pos diff: %f, speed: %d, vehicleid: %d",
  3943.                                         ac_dist, ac_dist_set, ACVehInfo[ac_vehid][acPosDiff], ac_vsp, ac_vehid);
  3944.                                     #endif
  3945.                                     #if defined OnCheatDetected
  3946.                                         ac_KickWithCode(playerid, "", 0, 3, 2);
  3947.                                     #else
  3948.                                         return ac_KickWithCode(playerid, "", 0, 3, 2);
  3949.                                     #endif
  3950.                                 }
  3951.                             }
  3952.                             else if(ACInfo[playerid][acACAllow][1] && ac_vsp < 16 &&
  3953.                             ++ACInfo[playerid][acCheatCount][2] > AC_MAX_AIR_VEH_WARNINGS)
  3954.                             {
  3955.                                 #undef AC_MAX_AIR_VEH_WARNINGS
  3956.                                 #if defined DEBUG
  3957.                                     printf("[Nex-AC debug] Speed: %d, distance: %f, distance set: %f, vehicleid: %d",
  3958.                                     ac_vsp, ac_dist, ac_dist_set, ac_vehid);
  3959.                                 #endif
  3960.                                 #if defined OnCheatDetected
  3961.                                     ac_KickWithCode(playerid, "", 0, 1);
  3962.                                     ACInfo[playerid][acCheatCount][2] = 0;
  3963.                                 #else
  3964.                                     return ac_KickWithCode(playerid, "", 0, 1);
  3965.                                 #endif
  3966.                             }
  3967.                         }
  3968.                         if(ac_gtc > ACInfo[playerid][acGtc][9] + ac_gpp)
  3969.                         {
  3970.                             ac_i = GetVehicleModel(ac_vehid) - 400;
  3971.                             new ac_spDiff = ac_vsp - ac_GetSpeed3D(ACVehInfo[ac_vehid][acVelX], ACVehInfo[ac_vehid][acVelY], ACVehInfo[ac_vehid][acVelZ]);
  3972.                             if(ACInfo[playerid][acACAllow][10])
  3973.                             {
  3974.                                 if(ac_spDiff > 270)
  3975.                                 {
  3976.                                     #if defined DEBUG
  3977.                                         printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d",
  3978.                                         ac_vsp, ac_vsp - ac_spDiff, ac_i + 400);
  3979.                                     #endif
  3980.                                     #if defined OnCheatDetected
  3981.                                         ac_KickWithCode(playerid, "", 0, 10, 3);
  3982.                                     #else
  3983.                                         return ac_KickWithCode(playerid, "", 0, 10, 3);
  3984.                                     #endif
  3985.                                 }
  3986.                                 else if(ac_spDiff >= 20 &&
  3987.                                 ACVehInfo[ac_vehid][acSpeedDiff] <= ac_spDiff && floatcmp(ACVehInfo[ac_vehid][acHealth], ac_vHealth) == 0 &&
  3988.                                 !((ac_i == 32 || ac_i == 49 || 137 <= ac_i <= 138) && ac_spDiff < 65 ||
  3989.                                 (ac_i == 81 || 109 <= ac_i <= 110) && floatcmp(floatabs(ac_vX), 0.3) <= 0 && floatcmp(floatabs(ac_vY), 0.3) <= 0 && floatcmp(floatabs(ac_vZ), 0.3) <= 0 ||
  3990.                                 !(ac_i == 49 || ac_i == 81 || 109 <= ac_i <= 110 || 137 <= ac_i <= 138) && floatcmp(ACVehInfo[ac_vehid][acHealth], 250.0) == -1))
  3991.                                 {
  3992.                                     ACInfo[playerid][acCheatCount][16] += 3;
  3993.                                     if(ACInfo[playerid][acCheatCount][16] > AC_MAX_SPEEDHACK_WARNINGS * 3)
  3994.                                     {
  3995.                                         #undef AC_MAX_SPEEDHACK_WARNINGS
  3996.                                         #if defined DEBUG
  3997.                                             printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d",
  3998.                                             ac_vsp, ac_vsp - ac_spDiff, ac_i + 400);
  3999.                                         #endif
  4000.                                         #if defined OnCheatDetected
  4001.                                             ac_KickWithCode(playerid, "", 0, 10, 1);
  4002.                                         #else
  4003.                                             return ac_KickWithCode(playerid, "", 0, 10, 1);
  4004.                                         #endif
  4005.                                     }
  4006.                                 }
  4007.                             }
  4008.                             if(ACInfo[playerid][acACAllow][25] &&
  4009.                             ac_vsp > 15 && ac_abs(ac_spDiff) < 25 &&
  4010.                             floatround(floatabs(floatsub(ac_zAngle, ACVehInfo[ac_vehid][acZAngle]))) == 180 &&
  4011.                             (floatcmp(ac_vX, 0.0) == -1) != (floatcmp(ACVehInfo[ac_vehid][acVelX], 0.0) == -1) &&
  4012.                             (floatcmp(ac_vY, 0.0) == -1) != (floatcmp(ACVehInfo[ac_vehid][acVelY], 0.0) == -1) &&
  4013.                             (floatcmp(ac_vZ, 0.0) == -1) != (floatcmp(ACVehInfo[ac_vehid][acVelZ], 0.0) == -1))
  4014.                             {
  4015.                                 #if defined DEBUG
  4016.                                     printf("[Nex-AC debug] Speed: %d, speed diff: %d, z angle: %f, old z angle: %f, vehicleid: %d",
  4017.                                     ac_vsp, ac_spDiff, ac_zAngle, ACVehInfo[ac_vehid][acZAngle], ac_vehid);
  4018.                                 #endif
  4019.                                 #if defined OnCheatDetected
  4020.                                     ac_KickWithCode(playerid, "", 0, 25);
  4021.                                 #else
  4022.                                     return ac_KickWithCode(playerid, "", 0, 25);
  4023.                                 #endif
  4024.                             }
  4025.                             if(17 <= ac_i <= 193 && 1 <= ac_vType[ac_i] <= 2)
  4026.                             {
  4027.                                 if(ACInfo[playerid][acACAllow][10] && (ac_vsp = ac_GetSpeed2D(ac_vX, ac_vY)) > 270)
  4028.                                 {
  4029.                                     #if defined DEBUG
  4030.                                         printf("[Nex-AC debug] Speed (x, y): %d, veh model: %d", ac_vsp, ac_i + 400);
  4031.                                     #endif
  4032.                                     #if defined OnCheatDetected
  4033.                                         ac_KickWithCode(playerid, "", 0, 10, 2);
  4034.                                     #else
  4035.                                         return ac_KickWithCode(playerid, "", 0, 10, 2);
  4036.                                     #endif
  4037.                                 }
  4038.                             }
  4039.                             else if(ACInfo[playerid][acACAllow][8])
  4040.                             {
  4041.                                 new Float:ac_zDiff = floatsub(ac_Z, ACInfo[playerid][acPosZ]);
  4042.                                 if(floatcmp(ac_vZ, 0.1) >= 0 && floatcmp(ac_vZ, ACVehInfo[ac_vehid][acVelZ]) == 1 &&
  4043.                                 floatcmp(floatabs(floatsub(ACInfo[playerid][acPosX], ac_X)), floatdiv(ac_zDiff, 2.0)) == -1 &&
  4044.                                 floatcmp(floatabs(floatsub(ACInfo[playerid][acPosY], ac_Y)), floatdiv(ac_zDiff, 2.0)) == -1)
  4045.                                 {
  4046.                                     if(++ACInfo[playerid][acCheatCount][3] > (81 <= ac_i <= 110 &&
  4047.                                     ac_vType[ac_i] == 4 ? AC_MAX_FLYHACK_B_WARNINGS : AC_MAX_FLYHACK_VEH_WARNINGS))
  4048.                                     {
  4049.                                         #undef AC_MAX_FLYHACK_B_WARNINGS
  4050.                                         #if defined DEBUG
  4051.                                             printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, vehicleid: %d",
  4052.                                             ac_vZ, ACVehInfo[ac_vehid][acVelZ], floatsub(ACInfo[playerid][acPosX], ac_X), floatsub(ACInfo[playerid][acPosY], ac_Y), ac_zDiff, ac_vehid);
  4053.                                         #endif
  4054.                                         #if defined OnCheatDetected
  4055.                                             ac_KickWithCode(playerid, "", 0, 8, 1);
  4056.                                             ACInfo[playerid][acCheatCount][3] = 0;
  4057.                                         #else
  4058.                                             return ac_KickWithCode(playerid, "", 0, 8, 1);
  4059.                                         #endif
  4060.                                     }
  4061.                                 }
  4062.                                 else ACInfo[playerid][acCheatCount][3] = 0;
  4063.                             }
  4064.                             ACVehInfo[ac_vehid][acSpeedDiff] = ac_spDiff;
  4065.                         }
  4066.                         ACVehInfo[ac_vehid][acVelX] = ac_vX;
  4067.                         ACVehInfo[ac_vehid][acVelY] = ac_vY;
  4068.                         ACVehInfo[ac_vehid][acVelZ] = ac_vZ;
  4069.                         ACVehInfo[ac_vehid][acPosDiff] = ac_dist;
  4070.                         ACVehInfo[ac_vehid][acHealth] = ac_vHealth;
  4071.                         ACVehInfo[ac_vehid][acZAngle] = ac_zAngle;
  4072.                     }
  4073.                     ACInfo[playerid][acSeat] = ac_s;
  4074.                 }
  4075.                 else
  4076.                 {
  4077.                     GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  4078.                     ac_s = ac_GetSpeed3D(ac_vX, ac_vY, ac_vZ);
  4079.                     if(ACInfo[playerid][acAnim] != (ac_sa = GetPlayerAnimationIndex(playerid)))
  4080.                     {
  4081.                         switch(ac_sa)
  4082.                         {
  4083.                             case -1:
  4084.                             {
  4085.                                 if(ACInfo[playerid][acACAllow][24])
  4086.                                 {
  4087.                                     #if defined OnCheatDetected
  4088.                                         ac_KickWithCode(playerid, "", 0, 24);
  4089.                                     #else
  4090.                                         return ac_KickWithCode(playerid, "", 0, 24);
  4091.                                     #endif
  4092.                                 }
  4093.                             }
  4094.                             case 157, 159, 161, 1058:
  4095.                             {
  4096.                                 if(ACInfo[playerid][acACAllow][7])
  4097.                                 {
  4098.                                     #if defined DEBUG
  4099.                                         printf("[Nex-AC debug] Anim: %d, old anim: %d, old vehicleid: %d",
  4100.                                         ac_sa, ACInfo[playerid][acAnim], ACInfo[playerid][acVeh]);
  4101.                                     #endif
  4102.                                     #if defined OnCheatDetected
  4103.                                         ac_KickWithCode(playerid, "", 0, 7, 2);
  4104.                                     #else
  4105.                                         return ac_KickWithCode(playerid, "", 0, 7, 2);
  4106.                                     #endif
  4107.                                 }
  4108.                             }
  4109.                             case 1231:
  4110.                             {
  4111.                                 if(ACInfo[playerid][acACAllow][30])
  4112.                                 {
  4113.                                     ac_i = GetPlayerSkin(playerid);
  4114.                                     if(!ac_PedAnims && (1 <= ac_i <= 73 || 75 <= ac_i <= 311) && ac_w != 46)
  4115.                                     {
  4116.                                         #if defined DEBUG
  4117.                                             printf("[Nex-AC debug] Skin: %d, old anim: %d, weaponid: %d",
  4118.                                             ac_i, ACInfo[playerid][acAnim], ac_w);
  4119.                                         #endif
  4120.                                         #if defined OnCheatDetected
  4121.                                             ac_KickWithCode(playerid, "", 0, 30);
  4122.                                         #else
  4123.                                             return ac_KickWithCode(playerid, "", 0, 30);
  4124.                                         #endif
  4125.                                     }
  4126.                                 }
  4127.                             }
  4128.                         }
  4129.                     }
  4130.                     else if(ACInfo[playerid][acACAllow][7])
  4131.                     {
  4132.                         if(1538 <= ac_sa <= 1544 && ac_s > 36 && ACInfo[playerid][acSpeed] < ac_s)
  4133.                         {
  4134.                             if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
  4135.                             {
  4136.                                 #if defined DEBUG
  4137.                                     printf("[Nex-AC debug] Speed: %d, old speed: %d, anim: %d",
  4138.                                     ac_s, ACInfo[playerid][acSpeed], ac_sa);
  4139.                                 #endif
  4140.                                 #if defined OnCheatDetected
  4141.                                     ac_KickWithCode(playerid, "", 0, 7, 3);
  4142.                                     ACInfo[playerid][acCheatCount][15] = 0;
  4143.                                 #else
  4144.                                     return ac_KickWithCode(playerid, "", 0, 7, 3);
  4145.                                 #endif
  4146.                             }
  4147.                         }
  4148.                         else if(ac_w != 46 && 958 <= ac_sa <= 979 &&
  4149.                         !(SPECIAL_ACTION_DRINK_BEER <= ac_specact <= SPECIAL_ACTION_DRINK_SPRUNK))
  4150.                         {
  4151.                             if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
  4152.                             {
  4153.                                 #undef AC_MAX_FLYHACK_WARNINGS
  4154.                                 #if defined DEBUG
  4155.                                     printf("[Nex-AC debug] Anim: %d, old anim: %d, weaponid: %d, spec act: %d",
  4156.                                     ac_sa, ACInfo[playerid][acAnim], ac_w, ac_specact);
  4157.                                 #endif
  4158.                                 #if defined OnCheatDetected
  4159.                                     ac_KickWithCode(playerid, "", 0, 7, 1);
  4160.                                     ACInfo[playerid][acCheatCount][15] = 0;
  4161.                                 #else
  4162.                                     return ac_KickWithCode(playerid, "", 0, 7, 1);
  4163.                                 #endif
  4164.                             }
  4165.                         }
  4166.                         else ACInfo[playerid][acCheatCount][15] = 0;
  4167.                     }
  4168.                     if(ACInfo[playerid][acSet][4] != -1)
  4169.                     {
  4170.                         if(ac_specact == ACInfo[playerid][acSet][4]) ACInfo[playerid][acSet][4] = -1;
  4171.                         else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][6] + ac_gpp &&
  4172.                         ++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS)
  4173.                         {
  4174.                             #if defined DEBUG
  4175.                                 printf(DEBUG_CODE_5, playerid, "SetPlayerSpecialAction");
  4176.                                 printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSet][4], ac_specact);
  4177.                             #endif
  4178.                             #if defined OnCheatDetected
  4179.                                 ac_KickWithCode(playerid, "", 0, 52, 12);
  4180.                                 ACInfo[playerid][acSet][4] = -1;
  4181.                             #else
  4182.                                 return ac_KickWithCode(playerid, "", 0, 52, 12);
  4183.                             #endif
  4184.                         }
  4185.                     }
  4186.                     else if(ac_specact != ACInfo[playerid][acSpecAct])
  4187.                     {
  4188.                         if(ac_specact == ACInfo[playerid][acNextSpecAct]) ACInfo[playerid][acNextSpecAct] = -1;
  4189.                         else if(ACInfo[playerid][acACAllow][18])
  4190.                         {
  4191.                             switch(ac_specact)
  4192.                             {
  4193.                                 case SPECIAL_ACTION_NONE:
  4194.                                 {
  4195.                                     switch(ACInfo[playerid][acSpecAct])
  4196.                                     {
  4197.                                         case SPECIAL_ACTION_USECELLPHONE, SPECIAL_ACTION_CUFFED, SPECIAL_ACTION_CARRY:
  4198.                                         {
  4199.                                             #if defined OnCheatDetected
  4200.                                                 ac_KickWithCode(playerid, "", 0, 18, 1);
  4201.                                             #else
  4202.                                                 return ac_KickWithCode(playerid, "", 0, 18, 1);
  4203.                                             #endif
  4204.                                         }
  4205.                                     }
  4206.                                 }
  4207.                                 case SPECIAL_ACTION_DUCK:
  4208.                                 {
  4209.                                     if(ACInfo[playerid][acSpecAct] > SPECIAL_ACTION_NONE &&
  4210.                                     !(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_CUFFED))
  4211.                                     {
  4212.                                         #if defined OnCheatDetected
  4213.                                             ac_KickWithCode(playerid, "", 0, 18, 2);
  4214.                                         #else
  4215.                                             return ac_KickWithCode(playerid, "", 0, 18, 2);
  4216.                                         #endif
  4217.                                     }
  4218.                                 }
  4219.                                 case SPECIAL_ACTION_USEJETPACK:
  4220.                                 {
  4221.                                     if(!IsPlayerInRangeOfPoint(playerid, 8.0, ACInfo[playerid][acDropJpX],
  4222.                                     ACInfo[playerid][acDropJpY], ACInfo[playerid][acDropJpZ]))
  4223.                                     {
  4224.                                         #if defined DEBUG
  4225.                                             printf("[Nex-AC debug] AC spec act: %d, spec act: %d, distance: %f",
  4226.                                             ACInfo[playerid][acSpecAct], ac_specact, GetPlayerDistanceFromPoint(playerid,
  4227.                                             ACInfo[playerid][acDropJpX], ACInfo[playerid][acDropJpY], ACInfo[playerid][acDropJpZ]));
  4228.                                         #endif
  4229.                                         #if defined OnCheatDetected
  4230.                                             ac_KickWithCode(playerid, "", 0, 18, 3);
  4231.                                         #else
  4232.                                             return ac_KickWithCode(playerid, "", 0, 18, 3);
  4233.                                         #endif
  4234.                                     }
  4235.                                     ACInfo[playerid][acDropJpX] = ACInfo[playerid][acDropJpY] =
  4236.                                     ACInfo[playerid][acDropJpZ] = 20000.0;
  4237.                                 }
  4238.                                 case SPECIAL_ACTION_ENTER_VEHICLE:
  4239.                                 {
  4240.                                     switch(ACInfo[playerid][acSpecAct])
  4241.                                     {
  4242.                                         case SPECIAL_ACTION_DANCE1, SPECIAL_ACTION_DANCE2, SPECIAL_ACTION_DANCE3, SPECIAL_ACTION_DANCE4, SPECIAL_ACTION_USECELLPHONE, 68:
  4243.                                         {
  4244.                                             #if defined OnCheatDetected
  4245.                                                 ac_KickWithCode(playerid, "", 0, 18, 4);
  4246.                                             #else
  4247.                                                 return ac_KickWithCode(playerid, "", 0, 18, 4);
  4248.                                             #endif
  4249.                                         }
  4250.                                     }
  4251.                                 }
  4252.                                 default:
  4253.                                 {
  4254.                                     if(!((SPECIAL_ACTION_DRINK_BEER <= ac_specact <= SPECIAL_ACTION_CUFFED &&
  4255.                                     ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK ||
  4256.                                     ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) &&
  4257.                                     ac_specact == ACInfo[playerid][acLastSpecAct]) &&
  4258.                                     (ACInfo[playerid][acVeh] == 0 || ac_specact != SPECIAL_ACTION_EXIT_VEHICLE &&
  4259.                                     ac_specact != SPECIAL_ACTION_USECELLPHONE))
  4260.                                     {
  4261.                                         #if defined DEBUG
  4262.                                             printf("[Nex-AC debug] AC spec act: %d, spec act: %d, Last spec act: %d, old vehicleid: %d",
  4263.                                             ACInfo[playerid][acSpecAct], ac_specact, ACInfo[playerid][acLastSpecAct], ACInfo[playerid][acVeh]);
  4264.                                         #endif
  4265.                                         #if defined OnCheatDetected
  4266.                                             ac_KickWithCode(playerid, "", 0, 18, 5);
  4267.                                         #else
  4268.                                             return ac_KickWithCode(playerid, "", 0, 18, 5);
  4269.                                         #endif
  4270.                                     }
  4271.                                 }
  4272.                             }
  4273.                         }
  4274.                         ACInfo[playerid][acLastSpecAct] = ACInfo[playerid][acSpecAct];
  4275.                     }
  4276.                     if(GetPlayerSurfingVehicleID(playerid) == INVALID_VEHICLE_ID &&
  4277.                     GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
  4278.                     {
  4279.                         if(floatcmp(ac_dist, 0.7) == 1 &&
  4280.                         (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_dist_set, 0.7) == 1) &&
  4281.                         ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  4282.                         {
  4283.                             if(floatcmp(ac_dist, 30.0) == 1 &&
  4284.                             (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_dist_set, 30.0) == 1))
  4285.                             {
  4286.                                 if(ACInfo[playerid][acACAllow][2] &&
  4287.                                 !ACInfo[playerid][acIntEnterExits] && floatcmp(ACInfo[playerid][acPosZ], -95.0) == 1)
  4288.                                 {
  4289.                                     #if defined DEBUG
  4290.                                         printf("[Nex-AC debug] Distance: %f, distance set: %f, speed: %d, pos x, y, z: %f, %f, %f",
  4291.                                         ac_dist, ac_dist_set, ac_s, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  4292.                                     #endif
  4293.                                     #if defined OnCheatDetected
  4294.                                         ac_KickWithCode(playerid, "", 0, 2, 2);
  4295.                                     #else
  4296.                                         return ac_KickWithCode(playerid, "", 0, 2, 2);
  4297.                                     #endif
  4298.                                 }
  4299.                             }
  4300.                             else if(floatcmp(ac_s, floatmul(ac_dist, (floatcmp(ac_dist, 1.0) == -1 ? 20.0 : 5.0))) <= 0 &&
  4301.                             (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_s, floatmul(ac_dist_set, (floatcmp(ac_dist_set, 1.0) == -1 ? 20.0 : 5.0))) <= 0))
  4302.                             {
  4303.                                 if(ac_s < 3 && floatcmp(ac_dist, 8.0) == 1 &&
  4304.                                 (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_dist_set, 8.0) == 1))
  4305.                                 {
  4306.                                     if(ACInfo[playerid][acACAllow][2])
  4307.                                     {
  4308.                                         #if defined DEBUG
  4309.                                             printf("[Nex-AC debug] Speed: %d, distance: %f, distance set: %f",
  4310.                                             ac_s, ac_dist, ac_dist_set);
  4311.                                         #endif
  4312.                                         #if defined OnCheatDetected
  4313.                                             ac_KickWithCode(playerid, "", 0, 2, 3);
  4314.                                         #else
  4315.                                             return ac_KickWithCode(playerid, "", 0, 2, 3);
  4316.                                         #endif
  4317.                                     }
  4318.                                 }
  4319.                                 else if(ACInfo[playerid][acACAllow][0] && ac_s &&
  4320.                                 ++ACInfo[playerid][acCheatCount][1] > AC_MAX_AIR_WARNINGS)
  4321.                                 {
  4322.                                     #undef AC_MAX_AIR_WARNINGS
  4323.                                     #if defined DEBUG
  4324.                                         printf("[Nex-AC debug] Speed: %d, distance: %f, distance set: %f", ac_s, ac_dist, ac_dist_set);
  4325.                                     #endif
  4326.                                     #if defined OnCheatDetected
  4327.                                         ac_KickWithCode(playerid, "", 0, 0);
  4328.                                         ACInfo[playerid][acCheatCount][1] = 0;
  4329.                                     #else
  4330.                                         return ac_KickWithCode(playerid, "", 0, 0);
  4331.                                     #endif
  4332.                                 }
  4333.                             }
  4334.                         }
  4335.                         if(ac_gtc > ACInfo[playerid][acGtc][10] + ac_gpp)
  4336.                         {
  4337.                             if(ACInfo[playerid][acACAllow][9] && ac_s > 257 && ACInfo[playerid][acSpeed] < ac_s)
  4338.                             {
  4339.                                 #if defined DEBUG
  4340.                                     printf("[Nex-AC debug] Speed: %d, old speed: %d", ac_s, ACInfo[playerid][acSpeed]);
  4341.                                 #endif
  4342.                                 #if defined OnCheatDetected
  4343.                                     ac_KickWithCode(playerid, "", 0, 9);
  4344.                                 #else
  4345.                                     return ac_KickWithCode(playerid, "", 0, 9);
  4346.                                 #endif
  4347.                             }
  4348.                             ACInfo[playerid][acSpeed] = ac_s;
  4349.                         }
  4350.                     }
  4351.                     else ACInfo[playerid][acSpeed] = ac_s;
  4352.                     ACInfo[playerid][acAnim] = ac_sa;
  4353.                 }
  4354.                 ACInfo[playerid][acSpecAct] = ac_specact;
  4355.                 ACInfo[playerid][acHealth] = ac_health;
  4356.                 ACInfo[playerid][acArmour] = ac_armour;
  4357.             }
  4358.             ACInfo[playerid][acVeh] = ac_vehid;
  4359.             if(ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp) ACInfo[playerid][acLastWeapon] = ac_w;
  4360.             ACInfo[playerid][acPosX] = ac_X;
  4361.             ACInfo[playerid][acPosY] = ac_Y;
  4362.             ACInfo[playerid][acPosZ] = ac_Z;
  4363.         }
  4364.     }
  4365.     ac_gpp = 1;
  4366.     ACInfo[playerid][acUpdateTime] = ac_gtc;
  4367.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4368.         && defined ac_OnPlayerUpdate
  4369.         ac_gpp = ac_OnPlayerUpdate(playerid);
  4370.     #endif
  4371.     if(ACInfo[playerid][acACAllow][33] && ac_gpp) return ACInfo[playerid][acUnFrozen];
  4372.     return ac_gpp;
  4373. }
  4374.  
  4375. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4376.     #if defined _ALS_OnPlayerUpdate
  4377.         #undef OnPlayerUpdate
  4378.     #else
  4379.         #define _ALS_OnPlayerUpdate
  4380.     #endif
  4381.     #define OnPlayerUpdate ac_OnPlayerUpdate
  4382.     #if defined ac_OnPlayerUpdate
  4383.         forward ac_OnPlayerUpdate(playerid);
  4384.     #endif
  4385. #endif
  4386.  
  4387. #if defined _inc_y_hooks || defined _INC_y_hooks
  4388.     hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  4389. #else
  4390.     public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  4391. #endif
  4392. {
  4393.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked]) return 0;
  4394.     if(!IsPlayerNPC(playerid))
  4395.     {
  4396.         if((newkeys & KEY_SECONDARY_ATTACK) && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USEJETPACK &&
  4397.         GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_USEJETPACK)
  4398.         {
  4399.             ACInfo[playerid][acDropJpX] = ACInfo[playerid][acPosX];
  4400.             ACInfo[playerid][acDropJpY] = ACInfo[playerid][acPosY];
  4401.             ACInfo[playerid][acDropJpZ] = ACInfo[playerid][acPosZ];
  4402.         }
  4403.         if((newkeys & KEY_CROUCH) && 24 <= GetPlayerWeapon(playerid) <= 25) ACInfo[playerid][acCheatCount][14] = 0;
  4404.     }
  4405.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4406.         && defined ac_OnPlayerKeyStateChange
  4407.         return ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  4408.     #else
  4409.         return 1;
  4410.     #endif
  4411. }
  4412.  
  4413. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4414.     #if defined _ALS_OnPlayerKeyStateChange
  4415.         #undef OnPlayerKeyStateChange
  4416.     #else
  4417.         #define _ALS_OnPlayerKeyStateChange
  4418.     #endif
  4419.     #define OnPlayerKeyStateChange ac_OnPlayerKeyStateChange
  4420.     #if defined ac_OnPlayerKeyStateChange
  4421.         forward ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  4422.     #endif
  4423. #endif
  4424.  
  4425. #if defined _inc_y_hooks || defined _INC_y_hooks
  4426.     hook OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  4427. #else
  4428.     public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  4429. #endif
  4430. {
  4431.     if(ACInfo[playerid][acKicked]) return 1;
  4432.     new ac_gtc = GetTickCount();
  4433.     if(ACInfo[playerid][acACAllow][49])
  4434.     {
  4435.         if(ac_gtc < ACInfo[playerid][acCall][2] + ac_Mtfc[2][0])
  4436.         {
  4437.             ac_FloodDetect(playerid, 2);
  4438.             return 1;
  4439.         }
  4440.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4441.         else ACInfo[playerid][acFloodCount][2] = ACInfo[playerid][acFloodCount][27] = 0;
  4442.     }
  4443.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][2] = ac_gtc;
  4444.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4445.         && defined ac_OnPlayerClickMap
  4446.         return ac_OnPlayerClickMap(playerid, fX, fY, fZ);
  4447.     #else
  4448.         return 0;
  4449.     #endif
  4450. }
  4451.  
  4452. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4453.     #if defined _ALS_OnPlayerClickMap
  4454.         #undef OnPlayerClickMap
  4455.     #else
  4456.         #define _ALS_OnPlayerClickMap
  4457.     #endif
  4458.     #define OnPlayerClickMap ac_OnPlayerClickMap
  4459.     #if defined ac_OnPlayerClickMap
  4460.         forward ac_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
  4461.     #endif
  4462. #endif
  4463.  
  4464. #if defined _inc_y_hooks || defined _INC_y_hooks
  4465.     hook OnPlayerClickPlayer(playerid, clickedplayerid, source)
  4466. #else
  4467.     public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  4468. #endif
  4469. {
  4470.     if(ACInfo[playerid][acKicked]) return 1;
  4471.     new ac_gtc = GetTickCount();
  4472.     if(ACInfo[playerid][acACAllow][49])
  4473.     {
  4474.         if(ac_gtc < ACInfo[playerid][acCall][3] + ac_Mtfc[3][0])
  4475.         {
  4476.             ac_FloodDetect(playerid, 3);
  4477.             return 1;
  4478.         }
  4479.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4480.         else ACInfo[playerid][acFloodCount][3] = ACInfo[playerid][acFloodCount][27] = 0;
  4481.     }
  4482.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][3] = ac_gtc;
  4483.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4484.         && defined ac_OnPlayerClickPlayer
  4485.         return ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  4486.     #else
  4487.         return 0;
  4488.     #endif
  4489. }
  4490.  
  4491. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4492.     #if defined _ALS_OnPlayerClickPlayer
  4493.         #undef OnPlayerClickPlayer
  4494.     #else
  4495.         #define _ALS_OnPlayerClickPlayer
  4496.     #endif
  4497.     #define OnPlayerClickPlayer ac_OnPlayerClickPlayer
  4498.     #if defined ac_OnPlayerClickPlayer
  4499.         forward ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  4500.     #endif
  4501. #endif
  4502.  
  4503. #if defined _inc_y_hooks || defined _INC_y_hooks
  4504.     hook OnPlayerClickTextDraw(playerid, Text:clickedid)
  4505. #else
  4506.     public OnPlayerClickTextDraw(playerid, Text:clickedid)
  4507. #endif
  4508. {
  4509.     if(ACInfo[playerid][acKicked]) return 1;
  4510.     new ac_gtc = GetTickCount();
  4511.     if(ACInfo[playerid][acACAllow][49])
  4512.     {
  4513.         if(ac_gtc < ACInfo[playerid][acCall][4] + ac_Mtfc[4][0])
  4514.         {
  4515.             ac_FloodDetect(playerid, 4);
  4516.             return 1;
  4517.         }
  4518.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4519.         else ACInfo[playerid][acFloodCount][4] = ACInfo[playerid][acFloodCount][27] = 0;
  4520.     }
  4521.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][4] = ac_gtc;
  4522.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4523.         && defined ac_OnPlayerClickTextDraw
  4524.         return ac_OnPlayerClickTextDraw(playerid, clickedid);
  4525.     #else
  4526.         return 0;
  4527.     #endif
  4528. }
  4529.  
  4530. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4531.     #if defined _ALS_OnPlayerClickTextDraw
  4532.         #undef OnPlayerClickTextDraw
  4533.     #else
  4534.         #define _ALS_OnPlayerClickTextDraw
  4535.     #endif
  4536.     #define OnPlayerClickTextDraw ac_OnPlayerClickTextDraw
  4537.     #if defined ac_OnPlayerClickTextDraw
  4538.         forward ac_OnPlayerClickTextDraw(playerid, Text:clickedid);
  4539.     #endif
  4540. #endif
  4541.  
  4542. #if defined _inc_y_hooks || defined _INC_y_hooks
  4543.     hook OnPlayerCommandText(playerid, cmdtext[])
  4544. #else
  4545.     public OnPlayerCommandText(playerid, cmdtext[])
  4546. #endif
  4547. {
  4548.     if(ACInfo[playerid][acKicked]) return 1;
  4549.     if(!IsPlayerNPC(playerid))
  4550.     {
  4551.         new ac_gtc = GetTickCount();
  4552.         if(ACInfo[playerid][acACAllow][49])
  4553.         {
  4554.             if(ac_gtc < ACInfo[playerid][acCall][5] + ac_Mtfc[5][0])
  4555.             {
  4556.                 ac_FloodDetect(playerid, 5);
  4557.                 return 1;
  4558.             }
  4559.             if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4560.             else ACInfo[playerid][acFloodCount][5] = ACInfo[playerid][acFloodCount][27] = 0;
  4561.         }
  4562.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][5] = ac_gtc;
  4563.     }
  4564.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4565.         && defined ac_OnPlayerCommandText
  4566.         return ac_OnPlayerCommandText(playerid, cmdtext);
  4567.     #else
  4568.         return 0;
  4569.     #endif
  4570. }
  4571.  
  4572. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4573.     #if defined _ALS_OnPlayerCommandText
  4574.         #undef OnPlayerCommandText
  4575.     #else
  4576.         #define _ALS_OnPlayerCommandText
  4577.     #endif
  4578.     #define OnPlayerCommandText ac_OnPlayerCommandText
  4579.     #if defined ac_OnPlayerCommandText
  4580.         forward ac_OnPlayerCommandText(playerid, cmdtext[]);
  4581.     #endif
  4582. #endif
  4583.  
  4584. #if defined _inc_y_hooks || defined _INC_y_hooks
  4585.     hook OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  4586. #else
  4587.     public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  4588. #endif
  4589. {
  4590.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked]) return 0;
  4591.     new ac_gtc = GetTickCount();
  4592.     if(ACInfo[playerid][acACAllow][49])
  4593.     {
  4594.         if(ac_gtc < ACInfo[playerid][acCall][6] + ac_Mtfc[6][0]) ac_FloodDetect(playerid, 6);
  4595.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4596.         else ACInfo[playerid][acFloodCount][6] = ACInfo[playerid][acFloodCount][27] = 0;
  4597.     }
  4598.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][6] = ac_gtc;
  4599.     new ac_model = GetVehicleModel(vehicleid) - 400;
  4600.     if(ACInfo[playerid][acACAllow][44] && ac_model < 0) return ac_KickWithCode(playerid, "", 0, 44, 1);
  4601.     if(ACInfo[playerid][acEnterVeh] != vehicleid)
  4602.     {
  4603.         new ac_tmpPrm1, ac_tmpPrm2;
  4604.         GetVehicleParamsEx(vehicleid, ac_tmpPrm2, ac_tmpPrm2, ac_tmpPrm2, ac_tmpPrm1, ac_tmpPrm2, ac_tmpPrm2, ac_tmpPrm2);
  4605.         if(ispassenger || ac_tmpPrm1 != VEHICLE_PARAMS_ON)
  4606.         {
  4607.             ACInfo[playerid][acEnterVeh] = vehicleid;
  4608.             if(ac_model == 170 || 30 <= ac_model <= 195 && ac_vType[ac_model] == 3) ACInfo[playerid][acEnterVehTime] = 0;
  4609.             else ACInfo[playerid][acEnterVehTime] = ac_gtc;
  4610.         }
  4611.     }
  4612.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4613.         && defined ac_OnPlayerEnterVehicle
  4614.         return ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  4615.     #else
  4616.         return 1;
  4617.     #endif
  4618. }
  4619.  
  4620. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4621.     #if defined _ALS_OnPlayerEnterVehicle
  4622.         #undef OnPlayerEnterVehicle
  4623.     #else
  4624.         #define _ALS_OnPlayerEnterVehicle
  4625.     #endif
  4626.     #define OnPlayerEnterVehicle ac_OnPlayerEnterVehicle
  4627.     #if defined ac_OnPlayerEnterVehicle
  4628.         forward ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  4629.     #endif
  4630. #endif
  4631.  
  4632. #if defined _inc_y_hooks || defined _INC_y_hooks
  4633.     hook OnPlayerExitVehicle(playerid, vehicleid)
  4634. #else
  4635.     public OnPlayerExitVehicle(playerid, vehicleid)
  4636. #endif
  4637. {
  4638.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked]) return 0;
  4639.     new ac_i = GetTickCount();
  4640.     if(ACInfo[playerid][acACAllow][49])
  4641.     {
  4642.         if(ac_i < ACInfo[playerid][acCall][7] + ac_Mtfc[7][0]) ac_FloodDetect(playerid, 7);
  4643.         if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4644.         else ACInfo[playerid][acFloodCount][7] = ACInfo[playerid][acFloodCount][27] = 0;
  4645.     }
  4646.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][7] = ac_i;
  4647.     ac_i = GetVehicleModel(ACInfo[playerid][acVeh]) - 400;
  4648.     if(17 <= ac_i <= 193 && 1 <= ac_vType[ac_i] <= 2) ACInfo[playerid][acParachute] = true;
  4649.     else ACInfo[playerid][acParachute] = false;
  4650.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4651.         && defined ac_OnPlayerExitVehicle
  4652.         return ac_OnPlayerExitVehicle(playerid, vehicleid);
  4653.     #else
  4654.         return 1;
  4655.     #endif
  4656. }
  4657.  
  4658. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4659.     #if defined _ALS_OnPlayerExitVehicle
  4660.         #undef OnPlayerExitVehicle
  4661.     #else
  4662.         #define _ALS_OnPlayerExitVehicle
  4663.     #endif
  4664.     #define OnPlayerExitVehicle ac_OnPlayerExitVehicle
  4665.     #if defined ac_OnPlayerExitVehicle
  4666.         forward ac_OnPlayerExitVehicle(playerid, vehicleid);
  4667.     #endif
  4668. #endif
  4669.  
  4670. #if defined OnPlayerPickUpDynamicPickup\
  4671.     && defined Streamer_GetDistanceToItem\
  4672.     && defined Streamer_GetIntData
  4673.     #if defined _inc_y_hooks || defined _INC_y_hooks
  4674.         #if defined STREAMER_ENABLE_TAGS
  4675.             hook OnPlayerPickUpDynPickup(playerid, STREAMER_TAG_PICKUP pickupid)
  4676.         #else
  4677.             hook OnPlayerPickUpDynPickup(playerid, pickupid)
  4678.         #endif
  4679.     #else
  4680.         #if defined STREAMER_ENABLE_TAGS
  4681.             public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid)
  4682.         #else
  4683.             public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  4684.         #endif
  4685.     #endif
  4686.     {
  4687.         if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked]) return 0;
  4688.         new ac_i = GetTickCount();
  4689.         if(ACInfo[playerid][acACAllow][49])
  4690.         {
  4691.             if(ac_i < ACInfo[playerid][acCall][8] + ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
  4692.             else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4693.             else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
  4694.         }
  4695.         if(ACInfo[playerid][acACAllow][6])
  4696.         {
  4697.             new Float:ac_X, Float:ac_Y, Float:ac_Z, Float:ac_tmp, Float:ac_tmp2;
  4698.             GetPlayerPos(playerid, ac_X, ac_Y, ac_Z);
  4699.             Streamer_GetDistanceToItem(ac_X, ac_Y, ac_Z, STREAMER_TYPE_PICKUP, pickupid, ac_tmp);
  4700.             Streamer_GetDistanceToItem(ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_Z : ACInfo[playerid][acSetPosZ]), STREAMER_TYPE_PICKUP, pickupid, ac_tmp2);
  4701.             if(floatcmp(ac_tmp, 8.0) == 1 && (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_tmp2, 8.0) == 1))
  4702.             {
  4703.                 #if defined DEBUG
  4704.                     printf("[Nex-AC debug] Pickupid: %d, distance: %f, distance 2: %f, acSet[8]: %d",
  4705.                     _:pickupid, ac_tmp, ac_tmp2, ACInfo[playerid][acSet][8]);
  4706.                 #endif
  4707.                 #if defined OnCheatDetected
  4708.                     ac_KickWithCode(playerid, "", 0, 6, 2);
  4709.                 #else
  4710.                     return ac_KickWithCode(playerid, "", 0, 6, 2);
  4711.                 #endif
  4712.             }
  4713.         }
  4714.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
  4715.         switch((ac_i = Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID)))
  4716.         {
  4717.             case 2: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK;
  4718.             case 3: ACInfo[playerid][acHealth] = 100;
  4719.             case 4: ACInfo[playerid][acArmour] = 100;
  4720.             default:
  4721.             {
  4722.                 if(ac_i > 100)
  4723.                 {
  4724.                     ac_i -= 100;
  4725.                     new ac_s = ac_wSlot[ac_i];
  4726.                     if(ACInfo[playerid][acWeapon][ac_s] == ac_i ||
  4727.                     3 <= ac_s <= 5 && ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i];
  4728.                 }
  4729.             }
  4730.         }
  4731.         ACInfo[playerid][acLastPickup] = _:pickupid + MAX_PICKUPS;
  4732.         #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4733.             && defined ac_OnPlayerPickUpDynamicPickup
  4734.             return ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  4735.         #else
  4736.             return 1;
  4737.         #endif
  4738.     }
  4739.  
  4740.     #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4741.         #if defined _ALS_OnPlayerPickUpDynamicPicku\
  4742.             || defined _ALS_OnPlayerPickUpDynPickup\
  4743.             || defined _ALS_OnPlayerPickUpDynamicPick || defined _ALS_OnPlayerPickUpDynamicPUp
  4744.             #undef OnPlayerPickUpDynamicPickup
  4745.         #else
  4746.             #define _ALS_OnPlayerPickUpDynPickup
  4747.         #endif
  4748.         #define OnPlayerPickUpDynamicPickup ac_OnPlayerPickUpDynamicPickup
  4749.         #if defined ac_OnPlayerPickUpDynamicPickup
  4750.             #if defined STREAMER_ENABLE_TAGS
  4751.                 forward ac_OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid);
  4752.             #else
  4753.                 forward ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  4754.             #endif
  4755.         #endif
  4756.     #endif
  4757. #endif
  4758.  
  4759. #if defined _inc_y_hooks || defined _INC_y_hooks
  4760.     hook OnPlayerPickUpPickup(playerid, pickupid)
  4761. #else
  4762.     public OnPlayerPickUpPickup(playerid, pickupid)
  4763. #endif
  4764. {
  4765.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] || !(0 <= pickupid < MAX_PICKUPS)) return 0;
  4766.     #if defined Streamer_GetItemStreamerID\
  4767.         && defined IsValidDynamicPickup
  4768.         #if defined STREAMER_ENABLE_TAGS
  4769.             new STREAMER_TAG_PICKUP streamerid = STREAMER_TAG_PICKUP Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
  4770.         #else
  4771.             new streamerid = Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
  4772.         #endif
  4773.         if(!IsValidDynamicPickup(streamerid))
  4774.         {
  4775.     #endif
  4776.         new ac_i = GetTickCount();
  4777.         if(ACInfo[playerid][acACAllow][49])
  4778.         {
  4779.             if(ac_i < ACInfo[playerid][acCall][8] + ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
  4780.             else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4781.             else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
  4782.         }
  4783.         if(ACInfo[playerid][acACAllow][6] &&
  4784.         !IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]) &&
  4785.         (ACInfo[playerid][acSet][8] == -1 || floatcmp(VectorSize(floatsub(ACInfo[playerid][acSetPosX], ACPickInfo[pickupid][acPosX]), floatsub(ACInfo[playerid][acSetPosY], ACPickInfo[pickupid][acPosY]), floatsub((ACInfo[playerid][acTpToZ] ? ACPickInfo[pickupid][acPosZ] : ACInfo[playerid][acSetPosZ]), ACPickInfo[pickupid][acPosZ])), 8.0) == 1))
  4786.         {
  4787.             #if defined DEBUG
  4788.                 printf("[Nex-AC debug] Pickupid: %d, distance: %f",
  4789.                 pickupid, GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX],
  4790.                 ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]));
  4791.             #endif
  4792.             #if defined OnCheatDetected
  4793.                 ac_KickWithCode(playerid, "", 0, 6, 1);
  4794.             #else
  4795.                 return ac_KickWithCode(playerid, "", 0, 6, 1);
  4796.             #endif
  4797.         }
  4798.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
  4799.         switch(ACPickInfo[pickupid][acType])
  4800.         {
  4801.             case 1:
  4802.             {
  4803.                 ac_i = ACPickInfo[pickupid][acWeapon];
  4804.                 new ac_s = ac_wSlot[ac_i];
  4805.                 if(ACInfo[playerid][acWeapon][ac_s] == ac_i ||
  4806.                 3 <= ac_s <= 5 && ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i];
  4807.             }
  4808.             case 2: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK;
  4809.             case 3: ACInfo[playerid][acHealth] = 100;
  4810.             case 4: ACInfo[playerid][acArmour] = 100;
  4811.         }
  4812.         ACInfo[playerid][acLastPickup] = pickupid;
  4813.     #if defined Streamer_GetItemStreamerID\
  4814.         && defined IsValidDynamicPickup
  4815.         }
  4816.     #endif
  4817.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4818.         && defined ac_OnPlayerPickUpPickup
  4819.         #if defined Streamer_GetItemStreamerID\
  4820.             && defined IsValidDynamicPickup
  4821.             if(IsValidDynamicPickup(streamerid) ||
  4822.             !ACPickInfo[pickupid][acIsStatic]) return ac_OnPlayerPickUpPickup(playerid, pickupid);
  4823.         #else
  4824.             if(!ACPickInfo[pickupid][acIsStatic]) return ac_OnPlayerPickUpPickup(playerid, pickupid);
  4825.         #endif
  4826.         return 1;
  4827.     #else
  4828.         return 1;
  4829.     #endif
  4830. }
  4831.  
  4832. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4833.     #if defined _ALS_OnPlayerPickUpPickup
  4834.         #undef OnPlayerPickUpPickup
  4835.     #else
  4836.         #define _ALS_OnPlayerPickUpPickup
  4837.     #endif
  4838.     #define OnPlayerPickUpPickup ac_OnPlayerPickUpPickup
  4839.     #if defined ac_OnPlayerPickUpPickup
  4840.         forward ac_OnPlayerPickUpPickup(playerid, pickupid);
  4841.     #endif
  4842. #endif
  4843.  
  4844. #if defined _inc_y_hooks || defined _INC_y_hooks
  4845.     hook OnPlayerRequestClass(playerid, classid)
  4846. #else
  4847.     public OnPlayerRequestClass(playerid, classid)
  4848. #endif
  4849. {
  4850.     if(ACInfo[playerid][acKicked]) return 0;
  4851.     if(!IsPlayerNPC(playerid))
  4852.     {
  4853.         new ac_gtc = GetTickCount();
  4854.         if(ACInfo[playerid][acACAllow][49])
  4855.         {
  4856.             if(ac_gtc < ACInfo[playerid][acCall][9] + ac_Mtfc[9][0]) return ac_FloodDetect(playerid, 9);
  4857.             if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4858.             else ACInfo[playerid][acFloodCount][9] = ACInfo[playerid][acFloodCount][27] = 0;
  4859.         }
  4860.         ACInfo[playerid][acLogged] = 1;
  4861.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][9] = ac_gtc;
  4862.         ACInfo[playerid][acSpawnWeapon1] = ac_Class[classid][0][0];
  4863.         ACInfo[playerid][acSpawnAmmo1] = ac_Class[classid][0][1];
  4864.         ACInfo[playerid][acSpawnWeapon2] = ac_Class[classid][1][0];
  4865.         ACInfo[playerid][acSpawnAmmo2] = ac_Class[classid][1][1];
  4866.         ACInfo[playerid][acSpawnWeapon3] = ac_Class[classid][2][0];
  4867.         ACInfo[playerid][acSpawnAmmo3] = ac_Class[classid][2][1];
  4868.     }
  4869.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4870.         && defined ac_OnPlayerRequestClass
  4871.         return ac_OnPlayerRequestClass(playerid, classid);
  4872.     #else
  4873.         return 1;
  4874.     #endif
  4875. }
  4876.  
  4877. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4878.     #if defined _ALS_OnPlayerRequestClass
  4879.         #undef OnPlayerRequestClass
  4880.     #else
  4881.         #define _ALS_OnPlayerRequestClass
  4882.     #endif
  4883.     #define OnPlayerRequestClass ac_OnPlayerRequestClass
  4884.     #if defined ac_OnPlayerRequestClass
  4885.         forward ac_OnPlayerRequestClass(playerid, classid);
  4886.     #endif
  4887. #endif
  4888.  
  4889. #if defined _inc_y_hooks || defined _INC_y_hooks
  4890.     hook OnPlayerSelectedMenuRow(playerid, row)
  4891. #else
  4892.     public OnPlayerSelectedMenuRow(playerid, row)
  4893. #endif
  4894. {
  4895.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked]) return 0;
  4896.     new ac_gtc = GetTickCount();
  4897.     if(ACInfo[playerid][acACAllow][49])
  4898.     {
  4899.         if(ac_gtc < ACInfo[playerid][acCall][10] + ac_Mtfc[10][0]) ac_FloodDetect(playerid, 10);
  4900.         else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4901.         else ACInfo[playerid][acFloodCount][10] = ACInfo[playerid][acFloodCount][27] = 0;
  4902.     }
  4903.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][10] = ac_gtc;
  4904.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4905.         && defined ac_OnPlayerSelectedMenuRow
  4906.         return ac_OnPlayerSelectedMenuRow(playerid, row);
  4907.     #else
  4908.         return 1;
  4909.     #endif
  4910. }
  4911.  
  4912. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4913.     #if defined _ALS_OnPlayerSelectedMenuRow
  4914.         #undef OnPlayerSelectedMenuRow
  4915.     #else
  4916.         #define _ALS_OnPlayerSelectedMenuRow
  4917.     #endif
  4918.     #define OnPlayerSelectedMenuRow ac_OnPlayerSelectedMenuRow
  4919.     #if defined ac_OnPlayerSelectedMenuRow
  4920.         forward ac_OnPlayerSelectedMenuRow(playerid, row);
  4921.     #endif
  4922. #endif
  4923.  
  4924. #if defined _inc_y_hooks || defined _INC_y_hooks
  4925.     hook OnPlayerStateChange(playerid, newstate, oldstate)
  4926. #else
  4927.     public OnPlayerStateChange(playerid, newstate, oldstate)
  4928. #endif
  4929. {
  4930.     if(ACInfo[playerid][acKicked]) return 0;
  4931.     if(!IsPlayerNPC(playerid))
  4932.     {
  4933.         new ac_i = GetTickCount();
  4934.         if(ACInfo[playerid][acACAllow][49])
  4935.         {
  4936.             if(ac_i < ACInfo[playerid][acCall][11] + ac_Mtfc[11][0])
  4937.             {
  4938.                 if(newstate != PLAYER_STATE_ONFOOT || oldstate != PLAYER_STATE_SPAWNED)
  4939.                 {
  4940.                     new ac_model;
  4941.                     if(oldstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(ACInfo[playerid][acVeh]) - 400;
  4942.                     else if(newstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(GetPlayerVehicleID(playerid)) - 400;
  4943.                     if(!(30 <= ac_model <= 195 && ac_vType[ac_model] == 3)) ac_FloodDetect(playerid, 11);
  4944.                 }
  4945.             }
  4946.             else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4947.             else ACInfo[playerid][acFloodCount][11] = ACInfo[playerid][acFloodCount][27] = 0;
  4948.         }
  4949.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][11] = ac_i;
  4950.         switch(oldstate)
  4951.         {
  4952.             case PLAYER_STATE_NONE:
  4953.             {
  4954.                 if(ACInfo[playerid][acACAllow][48] &&
  4955.                 !(PLAYER_STATE_SPAWNED <= newstate <= PLAYER_STATE_SPECTATING) && !ACInfo[playerid][acLogged])
  4956.                 {
  4957.                     #if defined DEBUG
  4958.                         printf("[Nex-AC debug] Newstate: %d", newstate);
  4959.                     #endif
  4960.                     ac_KickWithCode(playerid, "", 0, 48, 2);
  4961.                 }
  4962.             }
  4963.             case PLAYER_STATE_DRIVER:
  4964.             {
  4965.                 new ac_t;
  4966.                 if(ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = INVALID_PLAYER_ID;
  4967.                 GetPlayerWeaponData(playerid, 4, ac_t, ac_t);
  4968.                 if(ac_t < ACInfo[playerid][acAmmo][4] &&
  4969.                 !(ac_t < 0 <= ACInfo[playerid][acAmmo][4])) ACInfo[playerid][acAmmo][4] = ac_t;
  4970.                 ac_t = GetVehicleModel(ACInfo[playerid][acVeh]) - 400;
  4971.                 if(1 <= ACInfo[playerid][acHealth] < 5 && 48 <= ac_t <= 186 && 4 <= ac_vType[ac_t] <= 5) ACInfo[playerid][acHealth] = 5;
  4972.                 new Float:ac_vX, Float:ac_vY, Float:ac_vZ = ACInfo[playerid][acPosZ];
  4973.                 if(ACInfo[playerid][acACAllow][2] && newstate == PLAYER_STATE_ONFOOT &&
  4974.                 ACInfo[playerid][acSet][8] == -1 && floatcmp(ACInfo[playerid][acPosZ], -95.0) == 1)
  4975.                 {
  4976.                     if(17 <= ac_t <= 193 && 1 <= ac_vType[ac_t] <= 2) GetPlayerPos(playerid, ac_vX, ac_vY, ac_vZ);
  4977.                     if(floatcmp((ac_vX = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ac_vZ)), 30.0) == 1)
  4978.                     {
  4979.                         #if defined DEBUG
  4980.                             printf("[Nex-AC debug] Distance: %f", ac_vX);
  4981.                         #endif
  4982.                         ac_KickWithCode(playerid, "", 0, 2, 4);
  4983.                     }
  4984.                 }
  4985.                 GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  4986.                 ACInfo[playerid][acSpeed] = ac_GetSpeed3D(ac_vX, ac_vY, ac_vZ);
  4987.                 ACInfo[playerid][acGtc][10] = ac_i + 300;
  4988.             }
  4989.             case PLAYER_STATE_PASSENGER:
  4990.             {
  4991.                 new Float:ac_vX, Float:ac_vY, Float:ac_vZ;
  4992.                 if(ACInfo[playerid][acACAllow][2] && newstate == PLAYER_STATE_ONFOOT && ACInfo[playerid][acSet][8] == -1)
  4993.                 {
  4994.                     new ac_driver = ACVehInfo[ACInfo[playerid][acVeh]][acDriver];
  4995.                     if(ac_driver == INVALID_PLAYER_ID || ac_i < ACInfo[ac_driver][acUpdateTime] + 2000)
  4996.                     {
  4997.                         new ac_model = GetVehicleModel(ACInfo[playerid][acVeh]);
  4998.                         ac_vX = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  4999.                         if(!(ac_model == 449 || 537 <= ac_model <= 538 || 569 <= ac_model <= 570) && floatcmp(ac_vX, 30.0) == 1)
  5000.                         {
  5001.                             #if defined DEBUG
  5002.                                 if(ac_driver == INVALID_PLAYER_ID) printf("[Nex-AC debug] Veh model: %d, distance: %f", ac_model, ac_vX);
  5003.                                 else printf("[Nex-AC debug] Veh model: %d, driver AFK time: %d, distance: %f", ac_model, ac_i - ACInfo[ac_driver][acUpdateTime], ac_vX);
  5004.                             #endif
  5005.                             ac_KickWithCode(playerid, "", 0, 2, 5);
  5006.                         }
  5007.                     }
  5008.                 }
  5009.                 GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  5010.                 ACInfo[playerid][acSpeed] = ac_GetSpeed3D(ac_vX, ac_vY, ac_vZ);
  5011.                 ACInfo[playerid][acGtc][10] = ac_i + 300;
  5012.             }
  5013.         }
  5014.         switch(newstate)
  5015.         {
  5016.             case PLAYER_STATE_ONFOOT:
  5017.             {
  5018.                 ACInfo[playerid][acSet][11] = -1;
  5019.                 ACInfo[playerid][acEnterVeh] = 0;
  5020.                 GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5021.             }
  5022.             case PLAYER_STATE_DRIVER:
  5023.             {
  5024.                 ACInfo[playerid][acSet][11] = -1;
  5025.                 ac_i = GetPlayerVehicleID(playerid);
  5026.                 if(ACInfo[playerid][acACAllow][44])
  5027.                 {
  5028.                     new ac_seatid = GetPlayerVehicleSeat(playerid);
  5029.                     if(ac_seatid != 128)
  5030.                     {
  5031.                         new ac_model = GetVehicleModel(ac_i) - 400;
  5032.                         if(ac_seatid || ac_model < 0 || ac_MaxPassengers[ac_model >>> 3] >>> ((ac_model & 7) << 2) & 0xF == 15 &&
  5033.                         ACInfo[playerid][acSet][9] == -1)
  5034.                         {
  5035.                             #if defined DEBUG
  5036.                                 printf("[Nex-AC debug] Veh model: %d, seatid: %d", ac_model + 400, ac_seatid);
  5037.                             #endif
  5038.                             ac_KickWithCode(playerid, "", 0, 44, 2);
  5039.                         }
  5040.                     }
  5041.                 }
  5042.                 if(ACInfo[playerid][acSet][9] == -1)
  5043.                 {
  5044.                     ACVehInfo[ac_i][acDriver] = playerid;
  5045.                     if(ACInfo[playerid][acACAllow][4])
  5046.                     {
  5047.                         ac_i = GetVehicleModel(ac_i);
  5048.                         new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5049.                         if(floatcmp(ac_dist, 25.0) == 1 || ac_i != 577 && ac_i != 592 && floatcmp(ac_dist, 15.0) == 1)
  5050.                         {
  5051.                             #if defined DEBUG
  5052.                                 printf("[Nex-AC debug] Veh model: %d, distance: %f", ac_i, ac_dist);
  5053.                             #endif
  5054.                             ac_KickWithCode(playerid, "", 0, 4, 3);
  5055.                         }
  5056.                     }
  5057.                     GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5058.                     ACInfo[playerid][acCheatCount][11] = 0;
  5059.                     ACInfo[playerid][acVehDmgRes] = false;
  5060.                     ACInfo[playerid][acSetVehHealth] = -1.0;
  5061.                 }
  5062.             }
  5063.             case PLAYER_STATE_PASSENGER:
  5064.             {
  5065.                 ACInfo[playerid][acSet][11] = -1;
  5066.                 ACInfo[playerid][acCheatCount][4] = 0;
  5067.                 new ac_seatid, ac_model = GetVehicleModel(GetPlayerVehicleID(playerid)) - 400;
  5068.                 if(ACInfo[playerid][acACAllow][44] && (ac_seatid = GetPlayerVehicleSeat(playerid)) != 128)
  5069.                 {
  5070.                     if(ac_model < 0)
  5071.                     {
  5072.                         #if defined DEBUG
  5073.                             printf("[Nex-AC debug] Veh model: %d, seatid: %d", ac_model + 400, ac_seatid);
  5074.                         #endif
  5075.                         ac_KickWithCode(playerid, "", 0, 44, 3);
  5076.                     }
  5077.                     else
  5078.                     {
  5079.                         new ac_maxseats = (ac_MaxPassengers[ac_model >>> 3] >>> ((ac_model & 7) << 2)) & 0xF;
  5080.                         if(ac_seatid < 1 || (ac_maxseats == 15 || ac_seatid > ac_maxseats) && ACInfo[playerid][acSet][9] == -1)
  5081.                         {
  5082.                             #if defined DEBUG
  5083.                                 printf("[Nex-AC debug] Veh model: %d, max seats: %d, seatid: %d", ac_model + 400, ac_maxseats, ac_seatid);
  5084.                             #endif
  5085.                             ac_KickWithCode(playerid, "", 0, 44, 4);
  5086.                         }
  5087.                     }
  5088.                 }
  5089.                 if(ACInfo[playerid][acACAllow][4] && ACInfo[playerid][acSet][9] == -1 &&
  5090.                 !(ac_model == 49 || 137 <= ac_model <= 138 || 169 <= ac_model <= 170))
  5091.                 {
  5092.                     new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5093.                     if(floatcmp(ac_dist, 80.0) == 1 || ac_i >= ACInfo[playerid][acUpdateTime] + 1500 && floatcmp(ac_dist, 15.0) == 1)
  5094.                     {
  5095.                         #if defined DEBUG
  5096.                             printf("[Nex-AC debug] Veh model: %d, AFK time: %d, distance: %f", ac_model + 400, ac_i - ACInfo[playerid][acUpdateTime], ac_dist);
  5097.                         #endif
  5098.                         ac_KickWithCode(playerid, "", 0, 4, 4);
  5099.                     }
  5100.                 }
  5101.             }
  5102.             case PLAYER_STATE_SPAWNED: GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5103.             case PLAYER_STATE_SPECTATING:
  5104.             {
  5105.                 if(ACInfo[playerid][acACAllow][21] && !ACInfo[playerid][acSpec] &&
  5106.                 ACInfo[playerid][acSet][6] == -1) ac_KickWithCode(playerid, "", 0, 21);
  5107.                 ACInfo[playerid][acHealth] = 100;
  5108.                 ACInfo[playerid][acSet][6] = -1;
  5109.                 ACInfo[playerid][acSpec] = true;
  5110.             }
  5111.         }
  5112.     }
  5113.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5114.         && defined ac_OnPlayerStateChange
  5115.         return ac_OnPlayerStateChange(playerid, newstate, oldstate);
  5116.     #else
  5117.         return 1;
  5118.     #endif
  5119. }
  5120.  
  5121. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5122.     #if defined _ALS_OnPlayerStateChange
  5123.         #undef OnPlayerStateChange
  5124.     #else
  5125.         #define _ALS_OnPlayerStateChange
  5126.     #endif
  5127.     #define OnPlayerStateChange ac_OnPlayerStateChange
  5128.     #if defined ac_OnPlayerStateChange
  5129.         forward ac_OnPlayerStateChange(playerid, newstate, oldstate);
  5130.     #endif
  5131. #endif
  5132.  
  5133. #if defined _inc_y_hooks || defined _INC_y_hooks
  5134.     hook OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  5135. #else
  5136.     public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  5137. #endif
  5138. {
  5139.     if(ACInfo[playerid][acKicked]) return 0;
  5140.     if(ACInfo[playerid][acACAllow][22] && !ac_LagCompMode) return ac_KickWithCode(playerid, "", 0, 22);
  5141.     if(ACInfo[playerid][acACAllow][47] &&
  5142.     (!(BULLET_HIT_TYPE_NONE <= hittype <= BULLET_HIT_TYPE_PLAYER_OBJECT) ||
  5143.     hittype == BULLET_HIT_TYPE_PLAYER && !(0 <= hitid < MAX_PLAYERS) ||
  5144.     hittype == BULLET_HIT_TYPE_VEHICLE && !(1 <= hitid < MAX_VEHICLES) ||
  5145.     hittype == BULLET_HIT_TYPE_OBJECT && !(1 <= hitid < MAX_OBJECTS) ||
  5146.     hittype == BULLET_HIT_TYPE_PLAYER_OBJECT && !(1 <= hitid < MAX_OBJECTS) ||
  5147.     weaponid != 38 && !(22 <= weaponid <= 34)))
  5148.     {
  5149.         #if defined DEBUG
  5150.             printf("[Nex-AC debug] Hittype: %d, hitid: %d, weaponid: %d", hittype, hitid, weaponid);
  5151.         #endif
  5152.         return ac_KickWithCode(playerid, "", 0, 47, 1);
  5153.     }
  5154.     new Float:ac_oX, Float:ac_oY, Float:ac_oZ, Float:ac_X, Float:ac_Y, Float:ac_Z;
  5155.     GetPlayerLastShotVectors(playerid, ac_oX, ac_oY, ac_oZ, ac_X, ac_Y, ac_Z);
  5156.     if(ACInfo[playerid][acACAllow][34])
  5157.     {
  5158.         if(!IsPlayerInRangeOfPoint(playerid, 8.0, ac_oX, ac_oY, ac_oZ))
  5159.         {
  5160.             if(++ACInfo[playerid][acCheatCount][5] > AC_MAX_AFK_GHOST_WARNINGS)
  5161.             {
  5162.                 #undef AC_MAX_AFK_GHOST_WARNINGS
  5163.                 #if defined DEBUG
  5164.                     printf("[Nex-AC debug] Distance: %f", GetPlayerDistanceFromPoint(playerid, ac_oX, ac_oY, ac_oZ));
  5165.                 #endif
  5166.                 #if defined OnCheatDetected
  5167.                     ac_KickWithCode(playerid, "", 0, 34);
  5168.                     ACInfo[playerid][acCheatCount][5] = 0;
  5169.                 #else
  5170.                     return ac_KickWithCode(playerid, "", 0, 34);
  5171.                 #endif
  5172.             }
  5173.         }
  5174.         else ACInfo[playerid][acCheatCount][5] = 0;
  5175.     }
  5176.     new ac_gtc = GetTickCount(), ac_gpp = GetPlayerPing(playerid);
  5177.     if(ACInfo[playerid][acACAllow][29])
  5178.     {
  5179.         if(hittype > BULLET_HIT_TYPE_NONE && !fX && !fY && !fZ)
  5180.         {
  5181.             if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_SILENT_AIM_WARNINGS)
  5182.             {
  5183.                 #undef AC_MAX_SILENT_AIM_WARNINGS
  5184.                 #if defined DEBUG
  5185.                     printf("[Nex-AC debug] Hittype: %d, weaponid: %d", hittype, weaponid);
  5186.                 #endif
  5187.                 #if defined OnCheatDetected
  5188.                     ac_KickWithCode(playerid, "", 0, 29, 1);
  5189.                     ACInfo[playerid][acCheatCount][13] = 0;
  5190.                 #else
  5191.                     return ac_KickWithCode(playerid, "", 0, 29, 1);
  5192.                 #endif
  5193.             }
  5194.         }
  5195.         else
  5196.         {
  5197.             ACInfo[playerid][acCheatCount][13] = 0;
  5198.             if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID &&
  5199.             !ACInfo[hitid][acDead] && ac_gtc > ACInfo[hitid][acSpawnTime] + ac_gpp &&
  5200.             ac_gtc < ACInfo[hitid][acUpdateTime] + 1500 && !IsPlayerInAnyVehicle(hitid) &&
  5201.             GetPlayerSurfingVehicleID(hitid) == INVALID_VEHICLE_ID && GetPlayerSurfingObjectID(hitid) == INVALID_OBJECT_ID)
  5202.             {
  5203.                 if(!IsPlayerInRangeOfPoint(hitid, 8.0, ac_X, ac_Y, ac_Z))
  5204.                 {
  5205.                     if(++ACInfo[playerid][acCheatCount][6] > AC_MAX_PRO_AIM_WARNINGS)
  5206.                     {
  5207.                         #undef AC_MAX_PRO_AIM_WARNINGS
  5208.                         #if defined DEBUG
  5209.                             printf("[Nex-AC debug] Distance: %f", GetPlayerDistanceFromPoint(hitid, ac_X, ac_Y, ac_Z));
  5210.                         #endif
  5211.                         #if defined OnCheatDetected
  5212.                             ac_KickWithCode(playerid, "", 0, 29, 2);
  5213.                             ACInfo[playerid][acCheatCount][6] = 0;
  5214.                         #else
  5215.                             return ac_KickWithCode(playerid, "", 0, 29, 2);
  5216.                         #endif
  5217.                     }
  5218.                 }
  5219.                 else ACInfo[playerid][acCheatCount][6] = 0;
  5220.             }
  5221.         }
  5222.     }
  5223.     new ac_i, ac_t, bool:ac_ur, bool:ac_ur2;
  5224.     switch(hittype)
  5225.     {
  5226.         case BULLET_HIT_TYPE_PLAYER:
  5227.         {
  5228.             if(hitid != INVALID_PLAYER_ID && ACInfo[hitid][acACAllow][19] &&
  5229.             ACInfo[hitid][acUnFrozen] && !ACInfo[hitid][acDead] && ac_gtc > ACInfo[hitid][acSpawnTime] + ac_gpp &&
  5230.             IsPlayerInRangeOfPoint(hitid, ac_wRange[weaponid - 22], ac_oX, ac_oY, ac_oZ) &&
  5231.             !(SPECIAL_ACTION_ENTER_VEHICLE <= GetPlayerSpecialAction(hitid) <= SPECIAL_ACTION_EXIT_VEHICLE))
  5232.             {
  5233.                 ac_t = GetPlayerTeam(playerid);
  5234.                 if(ac_t == 0 || ac_t == NO_TEAM || ac_t != GetPlayerTeam(hitid))
  5235.                 {
  5236.                     ac_i = GetPlayerInterior(hitid);
  5237.                     #if AC_USE_RESTAURANTS
  5238.                         if(!ac_InRestaurant(hitid, ac_i))
  5239.                         {
  5240.                     #endif
  5241.                         #if AC_USE_AMMUNATIONS
  5242.                             if(!ac_InAmmuNation(hitid, ac_i))
  5243.                             {
  5244.                         #endif
  5245.                             #if AC_USE_CASINOS
  5246.                                 if(!ac_InCasino(hitid, ac_i))
  5247.                                 {
  5248.                             #endif
  5249.                                 ac_ur = true;
  5250.                             #if AC_USE_CASINOS
  5251.                                 }
  5252.                             #endif
  5253.                         #if AC_USE_AMMUNATIONS
  5254.                             }
  5255.                         #endif
  5256.                     #if AC_USE_RESTAURANTS
  5257.                         }
  5258.                     #endif
  5259.                 }
  5260.             }
  5261.         }
  5262.         case BULLET_HIT_TYPE_VEHICLE:
  5263.         {
  5264.             if(hitid != INVALID_VEHICLE_ID)
  5265.             {
  5266.                 ac_i = ACVehInfo[hitid][acDriver];
  5267.                 if(ac_i != INVALID_PLAYER_ID && ACInfo[ac_i][acACAllow][20] &&
  5268.                 ACInfo[ac_i][acUnFrozen] && ac_gtc > ACInfo[ac_i][acSpawnTime] + ac_gpp &&
  5269.                 floatcmp(ACVehInfo[hitid][acHealth], 250.0) >= 0)
  5270.                 {
  5271.                     ac_t = GetPlayerTeam(playerid);
  5272.                     if(!ac_VehFriendlyFire || ac_t == 0 || ac_t == NO_TEAM || ac_t != GetPlayerTeam(ac_i))
  5273.                     {
  5274.                         ac_t = GetVehicleModel(hitid);
  5275.                         new Float:ac_wX, Float:ac_wY, Float:ac_wZ;
  5276.                         GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSFRONT, ac_X, ac_Y, ac_Z);
  5277.                         GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSREAR, ac_oX, ac_oY, ac_oZ);
  5278.                         GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSMID, ac_wX, ac_wY, ac_wZ);
  5279.                         if(floatcmp(VectorSize(floatsub(ac_X, fX), floatsub(ac_Y, fY), floatsub(ac_Z, fZ)), 1.2) == 1 &&
  5280.                         floatcmp(VectorSize(floatsub(-ac_X, fX), floatsub(ac_Y, fY), floatsub(ac_Z, fZ)), 1.2) == 1 &&
  5281.                         floatcmp(VectorSize(floatsub(ac_oX, fX), floatsub(ac_oY, fY), floatsub(ac_oZ, fZ)), 1.2) == 1 &&
  5282.                         floatcmp(VectorSize(floatsub(-ac_oX, fX), floatsub(ac_oY, fY), floatsub(ac_oZ, fZ)), 1.2) == 1 &&
  5283.                         (!ac_wX && !ac_wY && !ac_wZ || floatcmp(VectorSize(floatsub(ac_wX, fX), floatsub(ac_wY, fY), floatsub(ac_wZ, fZ)), 1.2) == 1 &&
  5284.                         floatcmp(VectorSize(floatsub(-ac_wX, fX), floatsub(ac_wY, fY), floatsub(ac_wZ, fZ)), 1.2) == 1)) ac_ur2 = true;
  5285.                     }
  5286.                 }
  5287.             }
  5288.         }
  5289.     }
  5290.     if((ac_t = GetPlayerState(playerid)) != PLAYER_STATE_DRIVER)
  5291.     {
  5292.         new ac_s = GetPlayerWeapon(playerid);
  5293.         if(ACInfo[playerid][acACAllow][47] && ac_t != PLAYER_STATE_PASSENGER && ac_s != weaponid)
  5294.         {
  5295.             #if defined DEBUG
  5296.                 printf("[Nex-AC debug] Armed weapon: %d, weaponid: %d, state: %d", ac_s, weaponid, ac_t);
  5297.             #endif
  5298.             return ac_KickWithCode(playerid, "", 0, 47, 2);
  5299.         }
  5300.         ac_s = ac_wSlot[weaponid];
  5301.         if(ACInfo[playerid][acACAllow][26])
  5302.         {
  5303.             ac_i = ac_gtc - ACInfo[playerid][acShotTime];
  5304.             if(ACInfo[playerid][acLastShot] == weaponid)
  5305.             {
  5306.                 if(weaponid != 38 && ac_t != PLAYER_STATE_PASSENGER)
  5307.                 {
  5308.                     if(ac_gtc < ACInfo[playerid][acReloadTime] + 500)
  5309.                     {
  5310.                         #if defined DEBUG
  5311.                             printf("[Nex-AC debug] Weaponid: %d, Reload time: %d, state: %d",
  5312.                             weaponid, ac_gtc - ACInfo[playerid][acReloadTime], ac_t);
  5313.                         #endif
  5314.                         #if defined OnCheatDetected
  5315.                             ac_KickWithCode(playerid, "", 0, 26, 4);
  5316.                             ACInfo[playerid][acReloadTime] = 0;
  5317.                         #else
  5318.                             return ac_KickWithCode(playerid, "", 0, 26, 4);
  5319.                         #endif
  5320.                     }
  5321.                     else if(ac_i < 30 || ac_i < 50 && weaponid != 32 &&
  5322.                     !(28 <= weaponid <= 29) || ac_i <= 385 && 33 <= weaponid <= 34)
  5323.                     {
  5324.                         if(++ACInfo[playerid][acCheatCount][8] > AC_MAX_RAPID_FIRE_WARNINGS)
  5325.                         {
  5326.                             #if defined DEBUG
  5327.                                 printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
  5328.                             #endif
  5329.                             #if defined OnCheatDetected
  5330.                                 ac_KickWithCode(playerid, "", 0, 26, 1);
  5331.                                 ACInfo[playerid][acCheatCount][8] = 0;
  5332.                             #else
  5333.                                 return ac_KickWithCode(playerid, "", 0, 26, 1);
  5334.                             #endif
  5335.                         }
  5336.                     }
  5337.                     else ACInfo[playerid][acCheatCount][8] = 0;
  5338.                     if((weaponid == 24 && ac_i < 600 || weaponid == 25 && ac_i < 800) &&
  5339.                     ++ACInfo[playerid][acCheatCount][14] > AC_MAX_RAPID_FIRE_WARNINGS)
  5340.                     {
  5341.                         #undef AC_MAX_RAPID_FIRE_WARNINGS
  5342.                         #if defined DEBUG
  5343.                             printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
  5344.                         #endif
  5345.                         #if defined OnCheatDetected
  5346.                             ac_KickWithCode(playerid, "", 0, 26, 2);
  5347.                             ACInfo[playerid][acCheatCount][14] = 0;
  5348.                         #else
  5349.                             return ac_KickWithCode(playerid, "", 0, 26, 2);
  5350.                         #endif
  5351.                     }
  5352.                 }
  5353.             }
  5354.             else if(ac_i < 30)
  5355.             {
  5356.                 #if defined DEBUG
  5357.                     printf("[Nex-AC debug] Fire rate: %d, weaponid: %d, last weapon: %d",
  5358.                     ac_i, weaponid, ACInfo[playerid][acLastShot]);
  5359.                 #endif
  5360.                 #if defined OnCheatDetected
  5361.                     ac_KickWithCode(playerid, "", 0, 26, 3);
  5362.                 #else
  5363.                     return ac_KickWithCode(playerid, "", 0, 26, 3);
  5364.                 #endif
  5365.             }
  5366.             if(GetPlayerWeaponState(playerid) == WEAPONSTATE_LAST_BULLET) ACInfo[playerid][acReloadTime] = ac_gtc;
  5367.         }
  5368.         if(ACInfo[playerid][acACAllow][17] && ac_t != PLAYER_STATE_PASSENGER && ACInfo[playerid][acGiveAmmo][ac_s] == -65535)
  5369.         {
  5370.             ac_t = GetPlayerAmmo(playerid);
  5371.             if(ACInfo[playerid][acAmmo][ac_s] == 0)
  5372.             {
  5373.                 if(ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  5374.                 {
  5375.                     #if defined DEBUG
  5376.                         printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  5377.                         weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  5378.                     #endif
  5379.                     #if defined OnCheatDetected
  5380.                         ac_KickWithCode(playerid, "", 0, 17, 1);
  5381.                         ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5382.                     #else
  5383.                         return ac_KickWithCode(playerid, "", 0, 17, 1);
  5384.                     #endif
  5385.                 }
  5386.             }
  5387.             if((ac_i = ac_abs(ACInfo[playerid][acAmmo][ac_s] - ac_t)))
  5388.             {
  5389.                 switch(weaponid)
  5390.                 {
  5391.                     case 23, 24, 25, 27:
  5392.                     {
  5393.                         if(ac_i > 2)
  5394.                         {
  5395.                             #if defined DEBUG
  5396.                                 printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  5397.                                 weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  5398.                             #endif
  5399.                             #if defined OnCheatDetected
  5400.                                 ac_KickWithCode(playerid, "", 0, 17, 2);
  5401.                                 ACInfo[playerid][acCheatCount][7] = 0;
  5402.                                 ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5403.                             #else
  5404.                                 return ac_KickWithCode(playerid, "", 0, 17, 2);
  5405.                             #endif
  5406.                         }
  5407.                     }
  5408.                     case 38:
  5409.                     {
  5410.                         if(ACInfo[playerid][acAmmo][ac_s] < ac_t && ++ACInfo[playerid][acCheatCount][7] > 8)
  5411.                         {
  5412.                             #if defined DEBUG
  5413.                                 printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d, acCheatCount[7]: %d",
  5414.                                 weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t, ACInfo[playerid][acCheatCount][7]);
  5415.                             #endif
  5416.                             #if defined OnCheatDetected
  5417.                                 ac_KickWithCode(playerid, "", 0, 17, 3);
  5418.                                 ACInfo[playerid][acCheatCount][7] = 0;
  5419.                                 ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5420.                             #else
  5421.                                 return ac_KickWithCode(playerid, "", 0, 17, 3);
  5422.                             #endif
  5423.                         }
  5424.                     }
  5425.                     default:
  5426.                     {
  5427.                         if(ac_i > 3 && ACInfo[playerid][acAmmo][ac_s] < ac_t)
  5428.                         {
  5429.                             #if defined DEBUG
  5430.                                 printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  5431.                                 weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  5432.                             #endif
  5433.                             #if defined OnCheatDetected
  5434.                                 ac_KickWithCode(playerid, "", 0, 17, 4);
  5435.                                 ACInfo[playerid][acCheatCount][7] = 0;
  5436.                                 ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5437.                             #else
  5438.                                 return ac_KickWithCode(playerid, "", 0, 17, 4);
  5439.                             #endif
  5440.                         }
  5441.                     }
  5442.                 }
  5443.             }
  5444.             else ACInfo[playerid][acCheatCount][7] = 0;
  5445.         }
  5446.         if(ACInfo[playerid][acAmmo][ac_s] != 0)
  5447.         {
  5448.             ACInfo[playerid][acAmmo][ac_s]--;
  5449.             if(ACInfo[playerid][acAmmo][ac_s] == 0 &&
  5450.             ACInfo[playerid][acSet][3] == weaponid) ACInfo[playerid][acSet][3] = ACInfo[playerid][acSetWeapon][ac_s] = -1;
  5451.         }
  5452.         if(ACInfo[playerid][acAmmo][ac_s] < -32768) ACInfo[playerid][acAmmo][ac_s] += 65536;
  5453.     }
  5454.     ACInfo[playerid][acLastShot] = weaponid;
  5455.     ACInfo[playerid][acShotTime] = ac_gtc;
  5456.     ac_i = 1;
  5457.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5458.         && defined ac_OnPlayerWeaponShot
  5459.         ac_i = ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
  5460.     #endif
  5461.     if(ac_i)
  5462.     {
  5463.         if(ac_ur)
  5464.         {
  5465.             if(ACInfo[hitid][acArmour] > 0) ACInfo[hitid][acDmgRes] = 2;
  5466.             else ACInfo[hitid][acDmgRes] = 1;
  5467.             ACInfo[hitid][acGtc][14] = ac_gtc + 150;
  5468.         }
  5469.         if(ac_ur2)
  5470.         {
  5471.             ACInfo[ACVehInfo[hitid][acDriver]][acVehDmgRes] = true;
  5472.             ACInfo[ACVehInfo[hitid][acDriver]][acGtc][16] = ac_gtc + 150;
  5473.         }
  5474.     }
  5475.     return ac_i;
  5476. }
  5477.  
  5478. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5479.     #if defined _ALS_OnPlayerWeaponShot
  5480.         #undef OnPlayerWeaponShot
  5481.     #else
  5482.         #define _ALS_OnPlayerWeaponShot
  5483.     #endif
  5484.     #define OnPlayerWeaponShot ac_OnPlayerWeaponShot
  5485.     #if defined ac_OnPlayerWeaponShot
  5486.         forward ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  5487.     #endif
  5488. #endif
  5489.  
  5490. #if defined _inc_y_hooks || defined _INC_y_hooks
  5491.     hook OnVehicleMod(playerid, vehicleid, componentid)
  5492. #else
  5493.     public OnVehicleMod(playerid, vehicleid, componentid)
  5494. #endif
  5495. {
  5496.     if(ACInfo[playerid][acKicked]) return 0;
  5497.     new ac_i = GetTickCount();
  5498.     if(ACInfo[playerid][acACAllow][49])
  5499.     {
  5500.         if(ac_i < ACInfo[playerid][acCall][12] + ac_Mtfc[12][0]) return ac_FloodDetect(playerid, 12);
  5501.         if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5502.         else ACInfo[playerid][acFloodCount][12] = ACInfo[playerid][acFloodCount][27] = 0;
  5503.     }
  5504.     if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop])
  5505.     {
  5506.         #if defined OnCheatDetected
  5507.             ac_KickWithCode(playerid, "", 0, 23, 2);
  5508.         #else
  5509.             return ac_KickWithCode(playerid, "", 0, 23, 2);
  5510.         #endif
  5511.     }
  5512.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][12] = ac_i;
  5513.     ACInfo[playerid][acGtc][17] = ac_i + 1650;
  5514.     if(ACInfo[playerid][acACAllow][43] && !ac_IsCompatible((ac_i = GetVehicleModel(vehicleid)), componentid))
  5515.     {
  5516.         #if defined DEBUG
  5517.             printf("[Nex-AC debug] Veh model: %d, componentid: %d", ac_i, componentid);
  5518.         #endif
  5519.         return ac_KickWithCode(playerid, "", 0, 43, 1);
  5520.     }
  5521.     #if AC_USE_TUNING_GARAGES
  5522.         ac_i = componentid - 1000;
  5523.         if(ACInfo[playerid][acSet][12] != -1) ACInfo[playerid][acSet][12] += ac_cPrice[ac_i];
  5524.         else ACInfo[playerid][acSet][12] = ac_cPrice[ac_i];
  5525.         ACInfo[playerid][acCheatCount][12] = 0;
  5526.     #endif
  5527.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5528.         && defined ac_OnVehicleMod
  5529.         return ac_OnVehicleMod(playerid, vehicleid, componentid);
  5530.     #else
  5531.         return 1;
  5532.     #endif
  5533. }
  5534.  
  5535. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5536.     #if defined _ALS_OnVehicleMod
  5537.         #undef OnVehicleMod
  5538.     #else
  5539.         #define _ALS_OnVehicleMod
  5540.     #endif
  5541.     #define OnVehicleMod ac_OnVehicleMod
  5542.     #if defined ac_OnVehicleMod
  5543.         forward ac_OnVehicleMod(playerid, vehicleid, componentid);
  5544.     #endif
  5545. #endif
  5546.  
  5547. #if defined _inc_y_hooks || defined _INC_y_hooks
  5548.     hook OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  5549. #else
  5550.     public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  5551. #endif
  5552. {
  5553.     if(ACInfo[playerid][acKicked]) return 0;
  5554.     new ac_gtc = GetTickCount();
  5555.     if(ACInfo[playerid][acACAllow][49])
  5556.     {
  5557.         if(ac_gtc < ACInfo[playerid][acCall][13] + ac_Mtfc[13][0]) ac_FloodDetect(playerid, 13);
  5558.         else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5559.         else ACInfo[playerid][acFloodCount][13] = ACInfo[playerid][acFloodCount][27] = 0;
  5560.     }
  5561.     if(ACInfo[playerid][acACAllow][43] && !(0 <= paintjobid <= 2) && paintjobid != 255)
  5562.     {
  5563.         #if defined DEBUG
  5564.             printf("[Nex-AC debug] Veh model: %d, paintjobid: %d", GetVehicleModel(vehicleid), paintjobid);
  5565.         #endif
  5566.         ac_KickWithCode(playerid, "", 0, 43, 2);
  5567.     }
  5568.     else if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop]) ac_KickWithCode(playerid, "", 0, 23, 4);
  5569.     else if(paintjobid == 255) ACVehInfo[vehicleid][acPaintJob] = 3;
  5570.     else ACVehInfo[vehicleid][acPaintJob] = paintjobid;
  5571.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][13] = ac_gtc;
  5572.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5573.         && defined ac_OnVehiclePaintjob
  5574.         return ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  5575.     #else
  5576.         return 1;
  5577.     #endif
  5578. }
  5579.  
  5580. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5581.     #if defined _ALS_OnVehiclePaintjob
  5582.         #undef OnVehiclePaintjob
  5583.     #else
  5584.         #define _ALS_OnVehiclePaintjob
  5585.     #endif
  5586.     #define OnVehiclePaintjob ac_OnVehiclePaintjob
  5587.     #if defined ac_OnVehiclePaintjob
  5588.         forward ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  5589.     #endif
  5590. #endif
  5591.  
  5592. #if defined _inc_y_hooks || defined _INC_y_hooks
  5593.     hook OnVehicleRespray(playerid, vehicleid, color1, color2)
  5594. #else
  5595.     public OnVehicleRespray(playerid, vehicleid, color1, color2)
  5596. #endif
  5597. {
  5598.     if(ACInfo[playerid][acKicked]) return 0;
  5599.     new ac_gtc = GetTickCount();
  5600.     if(ACInfo[playerid][acACAllow][49])
  5601.     {
  5602.         if(ac_gtc < ACInfo[playerid][acCall][14] + ac_Mtfc[14][0]) return ac_FloodDetect(playerid, 14);
  5603.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5604.         else ACInfo[playerid][acFloodCount][14] = ACInfo[playerid][acFloodCount][27] = 0;
  5605.     }
  5606.     #if !AC_USE_TUNING_GARAGES && !AC_USE_PAYNSPRAY
  5607.         if(ACInfo[playerid][acACAllow][23])
  5608.         {
  5609.             #if defined DEBUG
  5610.                 printf("[Nex-AC debug] Veh model: %d, color1: %d, color2: %d", GetVehicleModel(vehicleid), color1, color2);
  5611.             #endif
  5612.             #if defined OnCheatDetected
  5613.                 ac_KickWithCode(playerid, "", 0, 23, 5);
  5614.             #else
  5615.                 return ac_KickWithCode(playerid, "", 0, 23, 5);
  5616.             #endif
  5617.         }
  5618.     #endif
  5619.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][14] = ac_gtc;
  5620.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5621.         && defined ac_OnVehicleRespray
  5622.         return ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  5623.     #else
  5624.         return 1;
  5625.     #endif
  5626. }
  5627.  
  5628. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5629.     #if defined _ALS_OnVehicleRespray
  5630.         #undef OnVehicleRespray
  5631.     #else
  5632.         #define _ALS_OnVehicleRespray
  5633.     #endif
  5634.     #define OnVehicleRespray ac_OnVehicleRespray
  5635.     #if defined ac_OnVehicleRespray
  5636.         forward ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  5637.     #endif
  5638. #endif
  5639.  
  5640. #if defined _inc_y_hooks || defined _INC_y_hooks
  5641.     hook OnVehicleSpawn(vehicleid)
  5642. #else
  5643.     public OnVehicleSpawn(vehicleid)
  5644. #endif
  5645. {
  5646.     ACVehInfo[vehicleid][acPaintJob] = 3;
  5647.     ACVehInfo[vehicleid][acSpawned] = true;
  5648.     ACVehInfo[vehicleid][acHealth] = 1000.0;
  5649.     ACVehInfo[vehicleid][acSpeedDiff] = 0;
  5650.     ACVehInfo[vehicleid][acPosDiff] =
  5651.     ACVehInfo[vehicleid][acVelX] =
  5652.     ACVehInfo[vehicleid][acVelY] =
  5653.     ACVehInfo[vehicleid][acVelZ] = 0.0;
  5654.     ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  5655.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5656.         && defined ac_OnVehicleSpawn
  5657.         return ac_OnVehicleSpawn(vehicleid);
  5658.     #else
  5659.         return 1;
  5660.     #endif
  5661. }
  5662.  
  5663. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5664.     #if defined _ALS_OnVehicleSpawn
  5665.         #undef OnVehicleSpawn
  5666.     #else
  5667.         #define _ALS_OnVehicleSpawn
  5668.     #endif
  5669.     #define OnVehicleSpawn ac_OnVehicleSpawn
  5670.     #if defined ac_OnVehicleSpawn
  5671.         forward ac_OnVehicleSpawn(vehicleid);
  5672.     #endif
  5673. #endif
  5674.  
  5675. #if defined _inc_y_hooks || defined _INC_y_hooks
  5676.     hook OnVehicleDeath(vehicleid, killerid)
  5677. #else
  5678.     public OnVehicleDeath(vehicleid, killerid)
  5679. #endif
  5680. {
  5681.     if(killerid != INVALID_PLAYER_ID && !IsPlayerNPC(killerid))
  5682.     {
  5683.         new ac_gtc = GetTickCount();
  5684.         if(ACInfo[killerid][acACAllow][49])
  5685.         {
  5686.             if(ac_gtc < ACInfo[killerid][acCall][15] + ac_Mtfc[15][0]) ac_FloodDetect(killerid, 15);
  5687.             else if(ac_gtc < ACInfo[killerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(killerid, 27);
  5688.             else ACInfo[killerid][acFloodCount][15] = ACInfo[killerid][acFloodCount][27] = 0;
  5689.         }
  5690.         ACInfo[killerid][acCall][27] = ACInfo[killerid][acCall][15] = ac_gtc;
  5691.     }
  5692.     new Float:ac_vHealth;
  5693.     GetVehicleHealth(vehicleid, ac_vHealth);
  5694.     if(floatcmp(ac_vHealth, 250.0) == -1) ACVehInfo[vehicleid][acSpawned] = false;
  5695.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5696.         && defined ac_OnVehicleDeath
  5697.         return ac_OnVehicleDeath(vehicleid, killerid);
  5698.     #else
  5699.         return 1;
  5700.     #endif
  5701. }
  5702.  
  5703. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5704.     #if defined _ALS_OnVehicleDeath
  5705.         #undef OnVehicleDeath
  5706.     #else
  5707.         #define _ALS_OnVehicleDeath
  5708.     #endif
  5709.     #define OnVehicleDeath ac_OnVehicleDeath
  5710.     #if defined ac_OnVehicleDeath
  5711.         forward ac_OnVehicleDeath(vehicleid, killerid);
  5712.     #endif
  5713. #endif
  5714.  
  5715. #if defined _inc_y_hooks || defined _INC_y_hooks
  5716.     hook OnPlayerText(playerid, text[])
  5717. #else
  5718.     public OnPlayerText(playerid, text[])
  5719. #endif
  5720. {
  5721.     if(ACInfo[playerid][acKicked]) return 0;
  5722.     if(!IsPlayerNPC(playerid))
  5723.     {
  5724.         new ac_gtc = GetTickCount();
  5725.         if(ACInfo[playerid][acACAllow][49])
  5726.         {
  5727.             if(ac_gtc < ACInfo[playerid][acCall][16] + ac_Mtfc[16][0]) return ac_FloodDetect(playerid, 16);
  5728.             if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5729.             else ACInfo[playerid][acFloodCount][16] = ACInfo[playerid][acFloodCount][27] = 0;
  5730.         }
  5731.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][16] = ac_gtc;
  5732.     }
  5733.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5734.         && defined ac_OnPlayerText
  5735.         return ac_OnPlayerText(playerid, text);
  5736.     #else
  5737.         return 1;
  5738.     #endif
  5739. }
  5740.  
  5741. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5742.     #if defined _ALS_OnPlayerText
  5743.         #undef OnPlayerText
  5744.     #else
  5745.         #define _ALS_OnPlayerText
  5746.     #endif
  5747.     #define OnPlayerText ac_OnPlayerText
  5748.     #if defined ac_OnPlayerText
  5749.         forward ac_OnPlayerText(playerid, text[]);
  5750.     #endif
  5751. #endif
  5752.  
  5753. #if defined _inc_y_hooks || defined _INC_y_hooks
  5754.     hook OnPlayerEnterCheckpoint(playerid)
  5755. #else
  5756.     public OnPlayerEnterCheckpoint(playerid)
  5757. #endif
  5758. {
  5759.     if(ACInfo[playerid][acKicked]) return 0;
  5760.     if(!IsPlayerNPC(playerid))
  5761.     {
  5762.         new ac_gtc = GetTickCount();
  5763.         if(ACInfo[playerid][acACAllow][49])
  5764.         {
  5765.             if(ac_gtc < ACInfo[playerid][acCall][17] + ac_Mtfc[17][0]) ac_FloodDetect(playerid, 17);
  5766.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5767.             else ACInfo[playerid][acFloodCount][17] = ACInfo[playerid][acFloodCount][27] = 0;
  5768.         }
  5769.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][17] = ac_gtc;
  5770.     }
  5771.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5772.         && defined ac_OnPlayerEnterCheckpoint
  5773.         return ac_OnPlayerEnterCheckpoint(playerid);
  5774.     #else
  5775.         return 1;
  5776.     #endif
  5777. }
  5778.  
  5779. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5780.     #if defined _ALS_OnPlayerEnterCheckpoint
  5781.         #undef OnPlayerEnterCheckpoint
  5782.     #else
  5783.         #define _ALS_OnPlayerEnterCheckpoint
  5784.     #endif
  5785.     #define OnPlayerEnterCheckpoint ac_OnPlayerEnterCheckpoint
  5786.     #if defined ac_OnPlayerEnterCheckpoint
  5787.         forward ac_OnPlayerEnterCheckpoint(playerid);
  5788.     #endif
  5789. #endif
  5790.  
  5791. #if defined _inc_y_hooks || defined _INC_y_hooks
  5792.     hook OnPlayerLeaveCheckpoint(playerid)
  5793. #else
  5794.     public OnPlayerLeaveCheckpoint(playerid)
  5795. #endif
  5796. {
  5797.     if(ACInfo[playerid][acKicked]) return 0;
  5798.     if(!IsPlayerNPC(playerid))
  5799.     {
  5800.         new ac_gtc = GetTickCount();
  5801.         if(ACInfo[playerid][acACAllow][49])
  5802.         {
  5803.             if(ac_gtc < ACInfo[playerid][acCall][18] + ac_Mtfc[18][0]) ac_FloodDetect(playerid, 18);
  5804.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5805.             else ACInfo[playerid][acFloodCount][18] = ACInfo[playerid][acFloodCount][27] = 0;
  5806.         }
  5807.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][18] = ac_gtc;
  5808.     }
  5809.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5810.         && defined ac_OnPlayerLeaveCheckpoint
  5811.         return ac_OnPlayerLeaveCheckpoint(playerid);
  5812.     #else
  5813.         return 1;
  5814.     #endif
  5815. }
  5816.  
  5817. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5818.     #if defined _ALS_OnPlayerLeaveCheckpoint
  5819.         #undef OnPlayerLeaveCheckpoint
  5820.     #else
  5821.         #define _ALS_OnPlayerLeaveCheckpoint
  5822.     #endif
  5823.     #define OnPlayerLeaveCheckpoint ac_OnPlayerLeaveCheckpoint
  5824.     #if defined ac_OnPlayerLeaveCheckpoint
  5825.         forward ac_OnPlayerLeaveCheckpoint(playerid);
  5826.     #endif
  5827. #endif
  5828.  
  5829. #if defined _inc_y_hooks || defined _INC_y_hooks
  5830.     hook OnPlayerRequestSpawn(playerid)
  5831. #else
  5832.     public OnPlayerRequestSpawn(playerid)
  5833. #endif
  5834. {
  5835.     if(ACInfo[playerid][acKicked]) return 0;
  5836.     new ac_i;
  5837.     if(!IsPlayerNPC(playerid))
  5838.     {
  5839.         ac_i = GetTickCount();
  5840.         if(ACInfo[playerid][acACAllow][49])
  5841.         {
  5842.             if(ac_i < ACInfo[playerid][acCall][19] + ac_Mtfc[19][0]) return ac_FloodDetect(playerid, 19);
  5843.             if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5844.             else ACInfo[playerid][acFloodCount][19] = ACInfo[playerid][acFloodCount][27] = 0;
  5845.         }
  5846.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][19] = ac_i;
  5847.     }
  5848.     ac_i = 1;
  5849.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5850.         && defined ac_OnPlayerRequestSpawn
  5851.         ac_i = ac_OnPlayerRequestSpawn(playerid);
  5852.     #endif
  5853.     if(ac_i && ACInfo[playerid][acLogged] != 2)
  5854.     {
  5855.         ACInfo[playerid][acSet][7] = 3;
  5856.         ACInfo[playerid][acSpawnTime] =
  5857.         ACInfo[playerid][acNOPCount][9] = 0;
  5858.         ACInfo[playerid][acSpawnRes] = 1;
  5859.     }
  5860.     return ac_i;
  5861. }
  5862.  
  5863. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5864.     #if defined _ALS_OnPlayerRequestSpawn
  5865.         #undef OnPlayerRequestSpawn
  5866.     #else
  5867.         #define _ALS_OnPlayerRequestSpawn
  5868.     #endif
  5869.     #define OnPlayerRequestSpawn ac_OnPlayerRequestSpawn
  5870.     #if defined ac_OnPlayerRequestSpawn
  5871.         forward ac_OnPlayerRequestSpawn(playerid);
  5872.     #endif
  5873. #endif
  5874.  
  5875. #if defined _inc_y_hooks || defined _INC_y_hooks
  5876.     hook OnPlayerExitedMenu(playerid)
  5877. #else
  5878.     public OnPlayerExitedMenu(playerid)
  5879. #endif
  5880. {
  5881.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked]) return 0;
  5882.     new ac_gtc = GetTickCount();
  5883.     if(ACInfo[playerid][acACAllow][49])
  5884.     {
  5885.         if(ac_gtc < ACInfo[playerid][acCall][20] + ac_Mtfc[20][0]) ac_FloodDetect(playerid, 20);
  5886.         else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5887.         else ACInfo[playerid][acFloodCount][20] = ACInfo[playerid][acFloodCount][27] = 0;
  5888.     }
  5889.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][20] = ac_gtc;
  5890.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5891.         && defined ac_OnPlayerExitedMenu
  5892.         return ac_OnPlayerExitedMenu(playerid);
  5893.     #else
  5894.         return 1;
  5895.     #endif
  5896. }
  5897.  
  5898. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5899.     #if defined _ALS_OnPlayerExitedMenu
  5900.         #undef OnPlayerExitedMenu
  5901.     #else
  5902.         #define _ALS_OnPlayerExitedMenu
  5903.     #endif
  5904.     #define OnPlayerExitedMenu ac_OnPlayerExitedMenu
  5905.     #if defined ac_OnPlayerExitedMenu
  5906.         forward ac_OnPlayerExitedMenu(playerid);
  5907.     #endif
  5908. #endif
  5909.  
  5910. #if defined _inc_y_hooks || defined _INC_y_hooks
  5911.     hook OnPlayerEnterRaceCP(playerid)
  5912. #else
  5913.     public OnPlayerEnterRaceCheckpoint(playerid)
  5914. #endif
  5915. {
  5916.     if(ACInfo[playerid][acKicked]) return 0;
  5917.     if(!IsPlayerNPC(playerid))
  5918.     {
  5919.         new ac_gtc = GetTickCount();
  5920.         if(ACInfo[playerid][acACAllow][49])
  5921.         {
  5922.             if(ac_gtc < ACInfo[playerid][acCall][21] + ac_Mtfc[21][0]) ac_FloodDetect(playerid, 21);
  5923.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5924.             else ACInfo[playerid][acFloodCount][21] = ACInfo[playerid][acFloodCount][27] = 0;
  5925.         }
  5926.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][21] = ac_gtc;
  5927.     }
  5928.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5929.         && defined ac_OnPlayerEnterRaceCheckpoint
  5930.         return ac_OnPlayerEnterRaceCheckpoint(playerid);
  5931.     #else
  5932.         return 1;
  5933.     #endif
  5934. }
  5935.  
  5936. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5937.     #if defined _ALS_OnPlayerEnterRaceCheckpoin\
  5938.         || defined _ALS_OnPlayerEnterRaceCP
  5939.         #undef OnPlayerEnterRaceCheckpoint
  5940.     #else
  5941.         #define _ALS_OnPlayerEnterRaceCP
  5942.     #endif
  5943.     #define OnPlayerEnterRaceCheckpoint ac_OnPlayerEnterRaceCheckpoint
  5944.     #if defined ac_OnPlayerEnterRaceCheckpoint
  5945.         forward ac_OnPlayerEnterRaceCheckpoint(playerid);
  5946.     #endif
  5947. #endif
  5948.  
  5949. #if defined _inc_y_hooks || defined _INC_y_hooks
  5950.     hook OnPlayerLeaveRaceCP(playerid)
  5951. #else
  5952.     public OnPlayerLeaveRaceCheckpoint(playerid)
  5953. #endif
  5954. {
  5955.     if(ACInfo[playerid][acKicked]) return 0;
  5956.     if(!IsPlayerNPC(playerid))
  5957.     {
  5958.         new ac_gtc = GetTickCount();
  5959.         if(ACInfo[playerid][acACAllow][49])
  5960.         {
  5961.             if(ac_gtc < ACInfo[playerid][acCall][22] + ac_Mtfc[22][0]) ac_FloodDetect(playerid, 22);
  5962.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5963.             else ACInfo[playerid][acFloodCount][22] = ACInfo[playerid][acFloodCount][27] = 0;
  5964.         }
  5965.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][22] = ac_gtc;
  5966.     }
  5967.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5968.         && defined ac_OnPlayerLeaveRaceCheckpoint
  5969.         return ac_OnPlayerLeaveRaceCheckpoint(playerid);
  5970.     #else
  5971.         return 1;
  5972.     #endif
  5973. }
  5974.  
  5975. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5976.     #if defined _ALS_OnPlayerLeaveRaceCheckpoin\
  5977.         || defined _ALS_OnPlayerLeaveRaceCP
  5978.         #undef OnPlayerLeaveRaceCheckpoint
  5979.     #else
  5980.         #define _ALS_OnPlayerLeaveRaceCP
  5981.     #endif
  5982.     #define OnPlayerLeaveRaceCheckpoint ac_OnPlayerLeaveRaceCheckpoint
  5983.     #if defined ac_OnPlayerLeaveRaceCheckpoint
  5984.         forward ac_OnPlayerLeaveRaceCheckpoint(playerid);
  5985.     #endif
  5986. #endif
  5987.  
  5988. #if defined _inc_y_hooks || defined _INC_y_hooks
  5989.     hook OnPlayerClickPlayerTD(playerid, PlayerText:playertextid)
  5990. #else
  5991.     public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  5992. #endif
  5993. {
  5994.     if(ACInfo[playerid][acKicked]) return 1;
  5995.     new ac_gtc = GetTickCount();
  5996.     if(ACInfo[playerid][acACAllow][49])
  5997.     {
  5998.         if(ac_gtc < ACInfo[playerid][acCall][23] + ac_Mtfc[23][0])
  5999.         {
  6000.             ac_FloodDetect(playerid, 23);
  6001.             return 1;
  6002.         }
  6003.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6004.         else ACInfo[playerid][acFloodCount][23] = ACInfo[playerid][acFloodCount][27] = 0;
  6005.     }
  6006.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][23] = ac_gtc;
  6007.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6008.         && defined ac_OnPlayerClickPlayerTextDraw
  6009.         return ac_OnPlayerClickPlayerTextDraw(playerid, playertextid);
  6010.     #else
  6011.         return 0;
  6012.     #endif
  6013. }
  6014.  
  6015. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6016.     #if defined _ALS_OnPlayerClickPlayerTextDra\
  6017.         || defined _ALS_OnPlayerClickPlayerTD
  6018.         #undef OnPlayerClickPlayerTextDraw
  6019.     #else
  6020.         #define _ALS_OnPlayerClickPlayerTD
  6021.     #endif
  6022.     #define OnPlayerClickPlayerTextDraw ac_OnPlayerClickPlayerTextDraw
  6023.     #if defined ac_OnPlayerClickPlayerTextDraw
  6024.         forward ac_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
  6025.     #endif
  6026. #endif
  6027.  
  6028. #if defined _inc_y_hooks || defined _INC_y_hooks
  6029.     hook OnVehDamageStatusUpd(vehicleid, playerid)
  6030. #else
  6031.     public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  6032. #endif
  6033. {
  6034.     if(ACInfo[playerid][acKicked]) return 1;
  6035.     new ac_gtc = GetTickCount();
  6036.     if(ACInfo[playerid][acACAllow][49])
  6037.     {
  6038.         if(ac_gtc < ACInfo[playerid][acCall][24] + ac_Mtfc[24][0])
  6039.         {
  6040.             ac_FloodDetect(playerid, 24);
  6041.             return 1;
  6042.         }
  6043.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6044.         else ACInfo[playerid][acFloodCount][24] = ACInfo[playerid][acFloodCount][27] = 0;
  6045.     }
  6046.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][24] = ac_gtc;
  6047.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6048.         && defined ac_OnVehicleDamageStatusUpdate
  6049.         return ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  6050.     #else
  6051.         return 0;
  6052.     #endif
  6053. }
  6054.  
  6055. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6056.     #if defined _ALS_OnVehicleDamageStatusUpdat\
  6057.         || defined _ALS_OnVehicleDamageStatusUpd
  6058.         #undef OnVehicleDamageStatusUpdate
  6059.     #else
  6060.         #define _ALS_OnVehicleDamageStatusUpd
  6061.     #endif
  6062.     #define OnVehicleDamageStatusUpdate ac_OnVehicleDamageStatusUpdate
  6063.     #if defined ac_OnVehicleDamageStatusUpdate
  6064.         forward ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  6065.     #endif
  6066. #endif
  6067.  
  6068. #if defined _inc_y_hooks || defined _INC_y_hooks
  6069.     hook OnVehicleSirenChange(playerid, vehicleid, newstate)
  6070. #else
  6071.     public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
  6072. #endif
  6073. {
  6074.     if(ACInfo[playerid][acKicked]) return 1;
  6075.     if(!IsPlayerNPC(playerid))
  6076.     {
  6077.         new ac_gtc = GetTickCount();
  6078.         if(ACInfo[playerid][acACAllow][49])
  6079.         {
  6080.             if(ac_gtc < ACInfo[playerid][acCall][25] + ac_Mtfc[25][0])
  6081.             {
  6082.                 ac_FloodDetect(playerid, 25);
  6083.                 return 1;
  6084.             }
  6085.             if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6086.             else ACInfo[playerid][acFloodCount][25] = ACInfo[playerid][acFloodCount][27] = 0;
  6087.         }
  6088.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][25] = ac_gtc;
  6089.     }
  6090.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6091.         && defined ac_OnVehicleSirenStateChange
  6092.         return ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  6093.     #else
  6094.         return 0;
  6095.     #endif
  6096. }
  6097.  
  6098. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6099.     #if defined _ALS_OnVehicleSirenStateChange
  6100.         #undef OnVehicleSirenStateChange
  6101.     #else
  6102.         #define _ALS_OnVehicleSirenStateChange
  6103.     #endif
  6104.     #define OnVehicleSirenStateChange ac_OnVehicleSirenStateChange
  6105.     #if defined ac_OnVehicleSirenStateChange
  6106.         forward ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  6107.     #endif
  6108. #endif
  6109.  
  6110. #if defined OnPlayerSelectDynamicObject
  6111.     #if defined _inc_y_hooks || defined _INC_y_hooks
  6112.         #if defined STREAMER_ENABLE_TAGS
  6113.             hook OnPlayerSelectDynObject(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z)
  6114.         #else
  6115.             hook OnPlayerSelectDynObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  6116.         #endif
  6117.     #else
  6118.         #if defined STREAMER_ENABLE_TAGS
  6119.             public OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z)
  6120.         #else
  6121.             public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  6122.         #endif
  6123.     #endif
  6124.     {
  6125.         if(ACInfo[playerid][acKicked]) return 0;
  6126.         new ac_gtc = GetTickCount();
  6127.         if(ACInfo[playerid][acACAllow][49])
  6128.         {
  6129.             if(ac_gtc < ACInfo[playerid][acCall][26] + ac_Mtfc[26][0]) ac_FloodDetect(playerid, 26);
  6130.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6131.             else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
  6132.         }
  6133.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_gtc;
  6134.         #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6135.             && defined ac_OnPlayerSelectDynamicObject
  6136.             return ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, x, y, z);
  6137.         #else
  6138.             return 1;
  6139.         #endif
  6140.     }
  6141.  
  6142.     #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6143.         #if defined _ALS_OnPlayerSelectDynamicObjec\
  6144.             || defined _ALS_OnPlayerSelectDynObject || defined _ALS_OnPlayerSelectDynamicObj
  6145.             #undef OnPlayerSelectDynamicObject
  6146.         #else
  6147.             #define _ALS_OnPlayerSelectDynObject
  6148.         #endif
  6149.         #define OnPlayerSelectDynamicObject ac_OnPlayerSelectDynamicObject
  6150.         #if defined ac_OnPlayerSelectDynamicObject
  6151.             #if defined STREAMER_ENABLE_TAGS
  6152.                 forward ac_OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z);
  6153.             #else
  6154.                 forward ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z);
  6155.             #endif
  6156.         #endif
  6157.     #endif
  6158. #endif
  6159.  
  6160. #if defined _inc_y_hooks || defined _INC_y_hooks
  6161.     hook OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  6162. #else
  6163.     public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  6164. #endif
  6165. {
  6166.     if(ACInfo[playerid][acKicked]) return 1;
  6167.     new ac_gtc = GetTickCount();
  6168.     if(ACInfo[playerid][acACAllow][49])
  6169.     {
  6170.         if(ac_gtc < ACInfo[playerid][acCall][26] + ac_Mtfc[26][0])
  6171.         {
  6172.             ac_FloodDetect(playerid, 26);
  6173.             return 1;
  6174.         }
  6175.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6176.         else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
  6177.     }
  6178.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_gtc;
  6179.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6180.         && defined ac_OnPlayerSelectObject
  6181.         return ac_OnPlayerSelectObject(playerid, type, objectid, modelid, fX, fY, fZ);
  6182.     #else
  6183.         return 0;
  6184.     #endif
  6185. }
  6186.  
  6187. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6188.     #if defined _ALS_OnPlayerSelectObject
  6189.         #undef OnPlayerSelectObject
  6190.     #else
  6191.         #define _ALS_OnPlayerSelectObject
  6192.     #endif
  6193.     #define OnPlayerSelectObject ac_OnPlayerSelectObject
  6194.     #if defined ac_OnPlayerSelectObject
  6195.         forward ac_OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
  6196.     #endif
  6197. #endif
  6198.  
  6199. #if defined _inc_y_hooks || defined _INC_y_hooks
  6200.     hook OnUnoccupiedVehicleUpd(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  6201. #else
  6202.     public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  6203. #endif
  6204. {
  6205.     if(ACInfo[playerid][acKicked]) return 0;
  6206.     new ac_a, Float:ac_X, Float:ac_Y, Float:ac_Z, Float:ac_D = GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z);
  6207.     GetVehiclePos(vehicleid, ac_X, ac_Y, ac_Z);
  6208.     if(passenger_seat > 0)
  6209.     {
  6210.         if(ACInfo[playerid][acACAllow][50] &&
  6211.         (passenger_seat != (ac_a = GetPlayerVehicleSeat(playerid)) || !IsPlayerInVehicle(playerid, vehicleid)))
  6212.         {
  6213.             #if defined DEBUG
  6214.                 printf("[Nex-AC debug] AC seat: %d, passenger seat: %d, AC veh: %d, veh: %d", ac_a, passenger_seat, GetPlayerVehicleID(playerid), vehicleid);
  6215.             #endif
  6216.             #if defined OnCheatDetected
  6217.                 ac_KickWithCode(playerid, "", 0, 50, 2);
  6218.             #else
  6219.                 return ac_KickWithCode(playerid, "", 0, 50, 2);
  6220.             #endif
  6221.         }
  6222.         new Float:ac_zDiff = floatsub(new_z, ac_Z);
  6223.         if(ACInfo[playerid][acACAllow][31] && floatcmp(ac_zDiff, -5.0) == 1 &&
  6224.         (floatcmp(floatabs(vel_x), floatabs(ACVehInfo[vehicleid][acVelX])) >= 0 && floatcmp(floatabs(ACVehInfo[vehicleid][acVelX]), 0.3) == 1 ||
  6225.         floatcmp(floatabs(vel_y), floatabs(ACVehInfo[vehicleid][acVelY])) >= 0 && floatcmp(floatabs(ACVehInfo[vehicleid][acVelY]), 0.3) == 1 ||
  6226.         floatcmp(floatabs(floatsub(vel_x, ACVehInfo[vehicleid][acVelX])), 25.0) == 1 ||
  6227.         floatcmp(floatabs(floatsub(vel_y, ACVehInfo[vehicleid][acVelY])), 25.0) == 1))
  6228.         {
  6229.             if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
  6230.             {
  6231.                 #undef AC_MAX_CARSHOT_WARNINGS
  6232.                 #if defined DEBUG
  6233.                     printf("[Nex-AC debug] Vel x, y: %f, %f, old vel x, y: %f, %f, pos diff z: %f, vehicleid: %d",
  6234.                     vel_x, vel_y, ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], ac_zDiff, vehicleid);
  6235.                 #endif
  6236.                 #if defined OnCheatDetected
  6237.                     ac_KickWithCode(playerid, "", 0, 31);
  6238.                     ACInfo[playerid][acCheatCount][4] = 0;
  6239.                 #else
  6240.                     return ac_KickWithCode(playerid, "", 0, 31);
  6241.                 #endif
  6242.             }
  6243.         }
  6244.         else if(ACInfo[playerid][acACAllow][8] &&
  6245.         floatcmp(vel_z, 0.1) >= 0 && floatcmp(vel_z, ACVehInfo[vehicleid][acVelZ]) == 1 &&
  6246.         floatcmp(floatabs(floatsub(ac_X, new_x)), floatdiv(ac_zDiff, 2.0)) == -1 && floatcmp(floatabs(floatsub(ac_Y, new_y)), floatdiv(ac_zDiff, 2.0)) == -1)
  6247.         {
  6248.             if(++ACInfo[playerid][acCheatCount][3] > AC_MAX_FLYHACK_VEH_WARNINGS)
  6249.             {
  6250.                 #undef AC_MAX_FLYHACK_VEH_WARNINGS
  6251.                 #if defined DEBUG
  6252.                     printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, vehicleid: %d",
  6253.                     vel_z, ACVehInfo[vehicleid][acVelZ], floatsub(ac_X, new_x), floatsub(ac_Y, new_y), ac_zDiff, vehicleid);
  6254.                 #endif
  6255.                 #if defined OnCheatDetected
  6256.                     ac_KickWithCode(playerid, "", 0, 8, 2);
  6257.                     ACInfo[playerid][acCheatCount][3] = 0;
  6258.                 #else
  6259.                     return ac_KickWithCode(playerid, "", 0, 8, 2);
  6260.                 #endif
  6261.             }
  6262.         }
  6263.         else ACInfo[playerid][acCheatCount][4] =
  6264.         ACInfo[playerid][acCheatCount][3] = 0;
  6265.     }
  6266.     if(ACInfo[playerid][acACAllow][5] &&
  6267.     floatcmp(ac_D, 15.0) == 1 && floatcmp(ac_Z, -45.0) == 1 &&
  6268.     floatcmp(ac_D, floatadd(ACVehInfo[vehicleid][acPosDiff], floatmul(floatdiv(ac_D, 3.0), 1.6))) == 1)
  6269.     {
  6270.         #if defined DEBUG
  6271.             printf("[Nex-AC debug] Distance: %f, old pos diff: %f, pos z: %f, vehicleid: %d, playerid: %d",
  6272.             ac_D, ACVehInfo[vehicleid][acPosDiff], ac_Z, vehicleid, playerid);
  6273.         #endif
  6274.         #if defined OnCheatDetected
  6275.             ac_KickWithCode(playerid, "", 0, 5);
  6276.         #endif
  6277.         GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  6278.         SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  6279.         SetVehiclePos(vehicleid, ac_X, ac_Y, ac_Z);
  6280.         return 0;
  6281.     }
  6282.     ac_a = 1;
  6283.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6284.         && defined ac_OnUnoccupiedVehicleUpdate
  6285.         ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z, vel_x, vel_y, vel_z);
  6286.     #endif
  6287.     if(ac_a)
  6288.     {
  6289.         ACVehInfo[vehicleid][acSpeedDiff] = ac_GetSpeed3D(vel_x, vel_y, vel_z) - ac_GetSpeed3D(ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], ACVehInfo[vehicleid][acVelZ]);
  6290.         ACVehInfo[vehicleid][acPosDiff] = ac_D;
  6291.         ACVehInfo[vehicleid][acVelX] = vel_x;
  6292.         ACVehInfo[vehicleid][acVelY] = vel_y;
  6293.         ACVehInfo[vehicleid][acVelZ] = vel_z;
  6294.     }
  6295.     return ac_a;
  6296. }
  6297.  
  6298. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6299.     #if defined _ALS_OnUnoccupiedVehicleUpdate
  6300.         #undef OnUnoccupiedVehicleUpdate
  6301.     #else
  6302.         #define _ALS_OnUnoccupiedVehicleUpdate
  6303.     #endif
  6304.     #define OnUnoccupiedVehicleUpdate ac_OnUnoccupiedVehicleUpdate
  6305.     #if defined ac_OnUnoccupiedVehicleUpdate
  6306.         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);
  6307.     #endif
  6308. #endif
  6309.  
  6310. #if defined _inc_y_hooks || defined _INC_y_hooks
  6311.     hook OnTrailerUpdate(playerid, vehicleid)
  6312. #else
  6313.     public OnTrailerUpdate(playerid, vehicleid)
  6314. #endif
  6315. {
  6316.     if(ACInfo[playerid][acKicked]) return 0;
  6317.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6318.         && defined ac_OnTrailerUpdate
  6319.         return ac_OnTrailerUpdate(playerid, vehicleid);
  6320.     #else
  6321.         return 1;
  6322.     #endif
  6323. }
  6324.  
  6325. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6326.     #if defined _ALS_OnTrailerUpdate
  6327.         #undef OnTrailerUpdate
  6328.     #else
  6329.         #define _ALS_OnTrailerUpdate
  6330.     #endif
  6331.     #define OnTrailerUpdate ac_OnTrailerUpdate
  6332.     #if defined ac_OnTrailerUpdate
  6333.         forward ac_OnTrailerUpdate(playerid, vehicleid);
  6334.     #endif
  6335. #endif
  6336.  
  6337. #if defined _inc_y_hooks || defined _INC_y_hooks
  6338.     hook OnPlayerEditAttachedObj(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
  6339. #else
  6340.     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)
  6341. #endif
  6342. {
  6343.     if(ACInfo[playerid][acKicked]) return 1;
  6344.     if(ACInfo[playerid][acACAllow][46] && 384 <= modelid <= 393)
  6345.     {
  6346.         #if defined DEBUG
  6347.             printf("[Nex-AC debug] Object modelid: %d", modelid);
  6348.         #endif
  6349.         ac_KickWithCode(playerid, "", 0, 46);
  6350.         return 1;
  6351.     }
  6352.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6353.         && defined ac_OnPlayerEditAttachedObject
  6354.         return ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  6355.     #else
  6356.         return 0;
  6357.     #endif
  6358. }
  6359.  
  6360. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6361.     #if defined _ALS_OnPlayerEditAttachedObject
  6362.         #undef OnPlayerEditAttachedObject
  6363.     #else
  6364.         #define _ALS_OnPlayerEditAttachedObject
  6365.     #endif
  6366.     #define OnPlayerEditAttachedObject ac_OnPlayerEditAttachedObject
  6367.     #if defined ac_OnPlayerEditAttachedObject
  6368.         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);
  6369.     #endif
  6370. #endif
  6371.  
  6372. ac_fpublic ac_Timer(playerid)
  6373. {
  6374.     if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) return 0;
  6375.     new ac_gpp;
  6376.     if(ACInfo[playerid][acACAllow][51] && (ac_gpp = NetStats_MessagesRecvPerSecond(playerid)) > AC_MAX_MSGS_REC_DIFF)
  6377.     {
  6378.         #if defined DEBUG
  6379.             printf("[Nex-AC debug] Max msgs per sec: %d, msgs per sec: %d", AC_MAX_MSGS_REC_DIFF, ac_gpp);
  6380.         #endif
  6381.         #undef AC_MAX_MSGS_REC_DIFF
  6382.         ac_KickWithCode(playerid, "", 0, 51);
  6383.     }
  6384.     ac_gpp = GetPlayerPing(playerid);
  6385.     if(ACInfo[playerid][acACAllow][38])
  6386.     {
  6387.         if(ac_gpp > AC_MAX_PING && ac_gpp != 65535)
  6388.         {
  6389.             if(++ACInfo[playerid][acCheatCount][0] > AC_MAX_PING_WARNINGS)
  6390.             {
  6391.                 #undef AC_MAX_PING_WARNINGS
  6392.                 #if defined DEBUG
  6393.                     printf("[Nex-AC debug] Max ping: %d, ping: %d", AC_MAX_PING, ac_gpp);
  6394.                 #endif
  6395.                 ac_KickWithCode(playerid, "", 0, 38);
  6396.                 #if defined OnCheatDetected
  6397.                     ACInfo[playerid][acCheatCount][0] = 0;
  6398.                 #endif
  6399.             }
  6400.         }
  6401.         else ACInfo[playerid][acCheatCount][0] = 0;
  6402.     }
  6403.     new ac_gtc = GetTickCount();
  6404.     if(ac_gtc < ACInfo[playerid][acUpdateTime] + 1500)
  6405.     {
  6406.         new ac_t;
  6407.         #if AC_USE_AMMUNATIONS || AC_USE_CASINOS
  6408.             new ac_int = GetPlayerInterior(playerid);
  6409.         #endif
  6410.         #if defined Streamer_GetDistanceToItem\
  6411.             && defined Streamer_GetIntData
  6412.             new Float:ac_tmp;
  6413.             if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS)
  6414.             {
  6415.                 new Float:ac_X, Float:ac_Y, Float:ac_Z;
  6416.                 GetPlayerPos(playerid, ac_X, ac_Y, ac_Z);
  6417.                 Streamer_GetDistanceToItem(ac_X, ac_Y, ac_Z, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_tmp);
  6418.                 ac_t = Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) - 100;
  6419.             }
  6420.         #endif
  6421.         if(!ACInfo[playerid][acDead] && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  6422.         {
  6423.             for(new ac_i, ac_w, ac_a, bool:ac_cw, ac_s = ac_wSlot[GetPlayerWeapon(playerid)]; ac_i <= 12; ++ac_i)
  6424.             {
  6425.                 GetPlayerWeaponData(playerid, ac_i, ac_w, ac_a);
  6426.                 if(ac_w == 39) ac_cw = true;
  6427.                 if(ac_s != ac_i)
  6428.                 {
  6429.                     if(ACInfo[playerid][acSetWeapon][ac_i] != -1)
  6430.                     {
  6431.                         if(ACInfo[playerid][acSetWeapon][ac_i] == ac_w)
  6432.                         {
  6433.                             if(ACInfo[playerid][acSet][3] == ac_w) ACInfo[playerid][acSet][3] = -1;
  6434.                             ACInfo[playerid][acSetWeapon][ac_i] = -1;
  6435.                             ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6436.                         }
  6437.                         else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtcSetWeapon][ac_i] + ac_gpp &&
  6438.                         ++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
  6439.                         {
  6440.                             #if defined DEBUG
  6441.                                 printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  6442.                                 printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSetWeapon][ac_i], ac_w);
  6443.                             #endif
  6444.                             ac_KickWithCode(playerid, "", 0, 52, 13);
  6445.                             #if defined OnCheatDetected
  6446.                                 ACInfo[playerid][acSetWeapon][ac_i] = -1;
  6447.                             #endif
  6448.                         }
  6449.                     }
  6450.                     else
  6451.                     {
  6452.                         if(ACInfo[playerid][acWeapon][ac_i] != ac_w)
  6453.                         {
  6454.                             #if defined Streamer_GetDistanceToItem\
  6455.                                 && defined Streamer_GetIntData
  6456.                             if((ac_w == 0 || ac_w == 40 && ac_cw || ac_w == 46 &&
  6457.                             ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute]) ||
  6458.                             0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
  6459.                             ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  6460.                             ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  6461.                             IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  6462.                             ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) ||
  6463.                             ACInfo[playerid][acLastPickup] > MAX_PICKUPS && ac_t == ac_w &&
  6464.                             ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) && floatcmp(ac_tmp, 8.0) <= 0)
  6465.                             {
  6466.                                 ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6467.                                 ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6468.                             }
  6469.                             #else
  6470.                             if((ac_w == 0 || ac_w == 40 && ac_cw || ac_w == 46 &&
  6471.                             ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute]) ||
  6472.                             0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
  6473.                             ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  6474.                             ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  6475.                             IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  6476.                             ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
  6477.                             {
  6478.                                 ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6479.                                 ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6480.                             }
  6481.                             #endif
  6482.                             else if(ACInfo[playerid][acACAllow][15] && !(16 <= ac_w <= 43 && ac_a == 0))
  6483.                             {
  6484.                                 #if defined DEBUG
  6485.                                     printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
  6486.                                     ACInfo[playerid][acWeapon][ac_i], ACInfo[playerid][acAmmo][ac_i], ac_w, ac_a);
  6487.                                 #endif
  6488.                                 ac_KickWithCode(playerid, "", 0, 15, 2);
  6489.                                 #if defined OnCheatDetected
  6490.                                     ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6491.                                     ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6492.                                 #endif
  6493.                             }
  6494.                         }
  6495.                         if(ACInfo[playerid][acGiveAmmo][ac_i] != -65535)
  6496.                         {
  6497.                             if(ACInfo[playerid][acGiveAmmo][ac_i] == ac_a ||
  6498.                             ACInfo[playerid][acGiveAmmo][ac_i] > ac_a && ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_i] + ac_gpp)
  6499.                             {
  6500.                                 ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  6501.                                 ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6502.                             }
  6503.                             else if(ACInfo[playerid][acACAllow][52] &&
  6504.                             ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_i] + ac_gpp &&
  6505.                             ++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS)
  6506.                             {
  6507.                                 #if defined DEBUG
  6508.                                     printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  6509.                                     printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  6510.                                     ACInfo[playerid][acGiveAmmo][ac_i], ac_a, ac_w);
  6511.                                 #endif
  6512.                                 ac_KickWithCode(playerid, "", 0, 52, 14);
  6513.                                 #if defined OnCheatDetected
  6514.                                     ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  6515.                                 #endif
  6516.                             }
  6517.                         }
  6518.                         else if(16 <= ac_w <= 43)
  6519.                         {
  6520.                             if(ac_a == 0) ACInfo[playerid][acAmmo][ac_i] = 0;
  6521.                             else if(ACInfo[playerid][acACAllow][16] &&
  6522.                             (ac_w != 40 && ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i]))
  6523.                             {
  6524.                                 #if defined DEBUG
  6525.                                     printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  6526.                                     ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
  6527.                                 #endif
  6528.                                 ac_KickWithCode(playerid, "", 0, 16, 2);
  6529.                                 #if defined OnCheatDetected
  6530.                                     ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6531.                                 #endif
  6532.                             }
  6533.                         }
  6534.                     }
  6535.                 }
  6536.                 else if(22 <= ac_w <= 32 || 41 <= ac_w <= 42 || !ac_LagCompMode && (ac_w == 43 || 16 <= ac_w <= 39))
  6537.                 {
  6538.                     if((ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i]) &&
  6539.                     ACInfo[playerid][acGiveAmmo][ac_i] == -65535)
  6540.                     {
  6541.                         #if AC_USE_AMMUNATIONS
  6542.                             if(16 <= ac_w <= 39 && ac_InAmmuNation(playerid, ac_int) &&
  6543.                             ac_AmmuNationInfo[ac_w - 16][1] == ac_abs(ac_a - ACInfo[playerid][acAmmo][ac_i]))
  6544.                             {
  6545.                                 if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 16][0];
  6546.                                 else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 16][0];
  6547.                                 ACInfo[playerid][acAmmo][ac_i] += ac_AmmuNationInfo[ac_w - 16][1];
  6548.                                 ACInfo[playerid][acGtc][15] = ac_gtc + 1650;
  6549.                                 ACInfo[playerid][acCheatCount][10] = 0;
  6550.                             }
  6551.                             else
  6552.                             {
  6553.                         #endif
  6554.                             if(ACInfo[playerid][acACAllow][16] && !ac_LagCompMode)
  6555.                             {
  6556.                                 #if defined DEBUG
  6557.                                     printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  6558.                                     ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
  6559.                                 #endif
  6560.                                 ac_KickWithCode(playerid, "", 0, 16, 3);
  6561.                                 #if defined OnCheatDetected
  6562.                                     ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6563.                                 #endif
  6564.                             }
  6565.                         #if AC_USE_AMMUNATIONS
  6566.                             }
  6567.                         #endif
  6568.                         #undef ac_abs
  6569.                     }
  6570.                     else if(ACInfo[playerid][acAmmo][ac_i] != 0) ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6571.                 }
  6572.             }
  6573.         }
  6574.         ac_t = bad_GetPlayerMoney(playerid);
  6575.         #if AC_USE_AMMUNATIONS
  6576.             if(ACInfo[playerid][acSet][10] != -1)
  6577.             {
  6578.                 if(ac_t < ACInfo[playerid][acMoney] &&
  6579.                 ACInfo[playerid][acSet][10] <= ACInfo[playerid][acMoney] - ac_t) ACInfo[playerid][acSet][10] = -1;
  6580.                 else if(ACInfo[playerid][acACAllow][15] && ac_gtc > ACInfo[playerid][acGtc][15] + ac_gpp &&
  6581.                 ++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_WARNINGS)
  6582.                 {
  6583.                     #if defined DEBUG
  6584.                         printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
  6585.                         ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
  6586.                     #endif
  6587.                     ac_KickWithCode(playerid, "", 0, 15, 4);
  6588.                     #if defined OnCheatDetected
  6589.                         ACInfo[playerid][acSet][10] = -1;
  6590.                     #endif
  6591.                 }
  6592.             }
  6593.         #endif
  6594.         #if AC_USE_TUNING_GARAGES
  6595.             if(ACInfo[playerid][acSet][12] != -1)
  6596.             {
  6597.                 if(ac_t < ACInfo[playerid][acMoney] &&
  6598.                 ACInfo[playerid][acSet][12] <= ACInfo[playerid][acMoney] - ac_t) ACInfo[playerid][acSet][12] = -1;
  6599.                 else if(ACInfo[playerid][acACAllow][23] && ac_gtc > ACInfo[playerid][acGtc][17] + ac_gpp &&
  6600.                 ++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_WARNINGS)
  6601.                 {
  6602.                     #undef AC_MAX_NOP_WARNINGS
  6603.                     #if defined DEBUG
  6604.                         printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
  6605.                         ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][12]);
  6606.                     #endif
  6607.                     ac_KickWithCode(playerid, "", 0, 23, 6);
  6608.                     #if defined OnCheatDetected
  6609.                         ACInfo[playerid][acSet][12] = -1;
  6610.                     #endif
  6611.                 }
  6612.             }
  6613.         #endif
  6614.         #undef AC_USE_TUNING_GARAGES
  6615.         if(ACInfo[playerid][acNOPCount][11] > 0) ACInfo[playerid][acNOPCount][11]--;
  6616.         else
  6617.         {
  6618.             if(ACInfo[playerid][acACAllow][14] &&
  6619.             ac_t > ACInfo[playerid][acMoney] && (!ACInfo[playerid][acStuntBonus] || ACInfo[playerid][acVeh] == 0))
  6620.             {
  6621.                 #if AC_USE_CASINOS
  6622.                     if(!ac_InCasino(playerid, ac_int))
  6623.                     {
  6624.                 #endif
  6625.                     #if defined DEBUG
  6626.                         printf("[Nex-AC debug] AC money: %d, money: %d, Stunt Bonus: %d, vehicleid: %d, playerid: %d",
  6627.                         ACInfo[playerid][acMoney], ac_t, ACInfo[playerid][acStuntBonus], ACInfo[playerid][acVeh], playerid);
  6628.                     #endif
  6629.                     #if defined OnCheatDetected
  6630.                         ac_KickWithCode(playerid, "", 0, 14);
  6631.                         ACInfo[playerid][acMoney] = ac_t;
  6632.                     #else
  6633.                         ac_t = ACInfo[playerid][acMoney];
  6634.                         ResetPlayerMoney(playerid);
  6635.                         GivePlayerMoney(playerid, ac_t);
  6636.                     #endif
  6637.                 #if AC_USE_CASINOS
  6638.                     }
  6639.                 #endif
  6640.             }
  6641.             ACInfo[playerid][acMoney] = ac_t;
  6642.         }
  6643.     }
  6644.     ACInfo[playerid][acCheatCount][1] = ACInfo[playerid][acCheatCount][2] = 0;
  6645.     if(ACInfo[playerid][acCheatCount][16] > 0) ACInfo[playerid][acCheatCount][16]--;
  6646.     #if defined SetPlayerTimerEx_
  6647.         ACInfo[playerid][acTimerID] = SetPlayerTimerEx_(playerid, "ac_Timer", 0, 1000, 1, "i", playerid);
  6648.     #else
  6649.         ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
  6650.     #endif
  6651.     return 1;
  6652. }
  6653.  
  6654. //Don't make changes in this public
  6655. //To customize the punishments, declare 'OnCheatDetected' in your script
  6656. ac_fpublic ac_OnCheatDetected(playerid, ip_address[], type, code)
  6657. {
  6658.     if(type) BlockIpAddress(ip_address, 0);
  6659.     else
  6660.     {
  6661.         switch(code)
  6662.         {
  6663.             case 40: SendClientMessage(playerid, AC_DEFAULT_COLOR, MAX_CONNECTS_MSG);
  6664.             case 41: SendClientMessage(playerid, AC_DEFAULT_COLOR, UNKNOWN_CLIENT_MSG);
  6665.             default:
  6666.             {
  6667.                 static ac_strtmp[sizeof KICK_MSG];
  6668.                 format(ac_strtmp, sizeof ac_strtmp, KICK_MSG, code);
  6669.                 SendClientMessage(playerid, AC_DEFAULT_COLOR, ac_strtmp);
  6670.                 #undef AC_DEFAULT_COLOR
  6671.             }
  6672.         }
  6673.         new ac_vehid = GetPlayerVehicleID(playerid), ac_gpp = GetPlayerPing(playerid) + 150;
  6674.         #if defined SetPlayerTimerEx_
  6675.             ACInfo[playerid][acKickTimerID] = SetPlayerTimerEx_(playerid, "ac_KickTimer", 0, (ac_gpp > AC_MAX_PING ? AC_MAX_PING : ac_gpp), 1, "i", playerid);
  6676.         #else
  6677.             ACInfo[playerid][acKickTimerID] = SetTimerEx("ac_KickTimer", (ac_gpp > AC_MAX_PING ? AC_MAX_PING : ac_gpp), false, "i", playerid);
  6678.         #endif
  6679.         #undef AC_MAX_PING
  6680.         if(ac_vehid > 0)
  6681.         {
  6682.             if(code == 4) ACInfo[playerid][acLastVeh] = ac_vehid;
  6683.             ACInfo[playerid][acKicked] = 2;
  6684.         }
  6685.         else ACInfo[playerid][acKicked] = 1;
  6686.     }
  6687.     return 1;
  6688. }
  6689.  
  6690. ac_fpublic ac_KickTimer(playerid) return Kick(playerid);
  6691.  
  6692. #undef ac_fpublic
  6693.  
  6694. stock AntiCheatGetHealth(playerid, &Float:health)
  6695. {
  6696.     if(!IsPlayerConnected(playerid)) return 0;
  6697.     health = ACInfo[playerid][acHealth];
  6698.     return 1;
  6699. }
  6700.  
  6701. stock AntiCheatGetArmour(playerid, &Float:armour)
  6702. {
  6703.     if(!IsPlayerConnected(playerid)) return 0;
  6704.     armour = ACInfo[playerid][acArmour];
  6705.     return 1;
  6706. }
  6707.  
  6708. stock AntiCheatGetVehicleHealth(vehicleid, &Float:health)
  6709. {
  6710.     if(!GetVehicleModel(vehicleid)) return 0;
  6711.     health = ACVehInfo[vehicleid][acHealth];
  6712.     return 1;
  6713. }
  6714.  
  6715. stock AntiCheatGetWeaponData(playerid, slot, &weapons, &ammo)
  6716. {
  6717.     if(!IsPlayerConnected(playerid)) return 0;
  6718.     weapons = ACInfo[playerid][acWeapon][slot];
  6719.     ammo = ACInfo[playerid][acAmmo][slot];
  6720.     return 1;
  6721. }
  6722.  
  6723. stock AntiCheatGetSpawnWeapon(playerid, &weapon1, &weapon1_ammo, &weapon2, &weapon2_ammo, &weapon3, &weapon3_ammo)
  6724. {
  6725.     if(!IsPlayerConnected(playerid)) return 0;
  6726.     weapon1 = ACInfo[playerid][acSpawnWeapon1];
  6727.     weapon1_ammo = ACInfo[playerid][acSpawnAmmo1];
  6728.     weapon2 = ACInfo[playerid][acSpawnWeapon2];
  6729.     weapon2_ammo = ACInfo[playerid][acSpawnAmmo2];
  6730.     weapon3 = ACInfo[playerid][acSpawnWeapon3];
  6731.     weapon3_ammo = ACInfo[playerid][acSpawnAmmo3];
  6732.     return 1;
  6733. }
  6734.  
  6735. stock AntiCheatGetPos(playerid, &Float:x, &Float:y, &Float:z)
  6736. {
  6737.     if(!IsPlayerConnected(playerid)) return 0;
  6738.     x = ACInfo[playerid][acPosX];
  6739.     y = ACInfo[playerid][acPosY];
  6740.     z = ACInfo[playerid][acPosZ];
  6741.     return 1;
  6742. }
  6743.  
  6744. stock AntiCheatGetVehicleVelocity(vehicleid, &Float:x, &Float:y, &Float:z)
  6745. {
  6746.     if(!GetVehicleModel(vehicleid)) return 0;
  6747.     x = ACVehInfo[vehicleid][acVelX];
  6748.     y = ACVehInfo[vehicleid][acVelY];
  6749.     z = ACVehInfo[vehicleid][acVelZ];
  6750.     return 1;
  6751. }
  6752.  
  6753. static ac_GetSpeed2D(Float:ac_x, Float:ac_y) return floatround(floatmul(VectorSize(ac_x, ac_y, 0.0), 179.28625));
  6754.  
  6755. static ac_GetSpeed3D(Float:ac_x, Float:ac_y, Float:ac_z) return floatround(floatmul(VectorSize(ac_x, ac_y, ac_z), 179.28625));
  6756.  
  6757. static ac_IsVehicleSeatOccupied(vehicleid, seat)
  6758. {
  6759.     #if defined foreach
  6760.         foreach(new ac_i : Player)
  6761.         {
  6762.             if(ACInfo[ac_i][acVeh] == vehicleid && ACInfo[ac_i][acSeat] == seat) return 1;
  6763.         }
  6764.     #else
  6765.         for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  6766.         {
  6767.             if(IsPlayerInVehicle(ac_i, vehicleid) && ACInfo[ac_i][acSeat] == seat) return 1;
  6768.         }
  6769.     #endif
  6770.     return 0;
  6771. }
  6772.  
  6773. #if AC_USE_RESTAURANTS
  6774.     static ac_InRestaurant(playerid, interiorid)
  6775.     {
  6776.         new ac_i;
  6777.         switch(interiorid)
  6778.         {
  6779.             case 5: ac_i = 0;
  6780.             case 9: ac_i = 1;
  6781.             case 10: ac_i = 2;
  6782.             default: return 0;
  6783.         }
  6784.         return IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[ac_i][0], ac_Restaurants[ac_i][1], ac_Restaurants[ac_i][2]);
  6785.     }
  6786. #endif
  6787. #undef AC_USE_RESTAURANTS
  6788.  
  6789. #if AC_USE_AMMUNATIONS
  6790.     static ac_InAmmuNation(playerid, interiorid)
  6791.     {
  6792.         new ac_i, ac_s;
  6793.         switch(interiorid)
  6794.         {
  6795.             case 1: ac_i = 0, ac_s = -1;
  6796.             case 4: ac_i = 1, ac_s = 0;
  6797.             case 6: ac_i = 3, ac_s = 1;
  6798.             default: return 0;
  6799.         }
  6800.         for(; ac_i > ac_s; --ac_i)
  6801.         {
  6802.             if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[ac_i][0],
  6803.             ac_AmmuNations[ac_i][1], ac_AmmuNations[ac_i][2])) return 1;
  6804.         }
  6805.         return 0;
  6806.     }
  6807. #endif
  6808. #undef AC_USE_AMMUNATIONS
  6809.  
  6810. #if AC_USE_PAYNSPRAY
  6811.     static ac_InPayNSpray(playerid, interiorid)
  6812.     {
  6813.         if(interiorid == 0)
  6814.         {
  6815.             for(new ac_i = sizeof(ac_PayNSpray) - 1; ac_i >= 0; --ac_i)
  6816.             {
  6817.                 if(IsPlayerInRangeOfPoint(playerid, 7.5, ac_PayNSpray[ac_i][0], ac_PayNSpray[ac_i][1], ac_PayNSpray[ac_i][2])) return 1;
  6818.             }
  6819.         }
  6820.         return 0;
  6821.     }
  6822. #endif
  6823. #undef AC_USE_PAYNSPRAY
  6824.  
  6825. #if AC_USE_VENDING_MACHINES
  6826.     static ac_NearVendingMachine(playerid, interiorid)
  6827.     {
  6828.         new ac_i, ac_s;
  6829.         switch(interiorid)
  6830.         {
  6831.             case 0: ac_i = 44, ac_s = -1;
  6832.             case 1: ac_i = 51, ac_s = 44;
  6833.             case 2: ac_i = 52, ac_s = 51;
  6834.             case 3: ac_i = 58, ac_s = 52;
  6835.             case 6: ac_i = 60, ac_s = 58;
  6836.             case 7: ac_i = 61, ac_s = 60;
  6837.             case 15: ac_i = 62, ac_s = 61;
  6838.             case 16: ac_i = 65, ac_s = 62;
  6839.             case 17: ac_i = 72, ac_s = 65;
  6840.             case 18: ac_i = 74, ac_s = 72;
  6841.             default: return 0;
  6842.         }
  6843.         for(; ac_i > ac_s; --ac_i)
  6844.         {
  6845.             if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1;
  6846.         }
  6847.         return 0;
  6848.     }
  6849. #endif
  6850. #undef AC_USE_VENDING_MACHINES
  6851.  
  6852. #if AC_USE_CASINOS
  6853.     static ac_InCasino(playerid, interiorid)
  6854.     {
  6855.         new ac_i, ac_s;
  6856.         switch(interiorid)
  6857.         {
  6858.             case 1: ac_i = 41, ac_s = -1;
  6859.             case 10: ac_i = 61, ac_s = 41;
  6860.             case 12: ac_i = 70, ac_s = 61;
  6861.             default: return 0;
  6862.         }
  6863.         for(; ac_i > ac_s; --ac_i)
  6864.         {
  6865.             if(IsPlayerInRangeOfPoint(playerid, ac_Casinos[ac_i][3], ac_Casinos[ac_i][0],
  6866.             ac_Casinos[ac_i][1], ac_Casinos[ac_i][2])) return 1;
  6867.         }
  6868.         return 0;
  6869.     }
  6870. #endif
  6871. #undef AC_USE_CASINOS
  6872.  
  6873. static ac_IsCompatible(modelid, componentid)
  6874. {
  6875.     if(modelid > 0)
  6876.     {
  6877.         switch(componentid)
  6878.         {
  6879.             case 1000..1191:
  6880.             {
  6881.                 componentid -= 1000;
  6882.                 if(ac_vMods[(modelid - 400) * 6 + (componentid >>> 5)] & 1 << (componentid & 0b00011111)) return 1;
  6883.             }
  6884.             case 1192, 1193:
  6885.             {
  6886.                 if(modelid == 576) return 1;
  6887.             }
  6888.         }
  6889.     }
  6890.     return 0;
  6891. }
  6892.  
  6893. static ac_IpToInt(const s_szIP[])
  6894. {
  6895.     new ac_aiBytes[1], ac_iPos;
  6896.     ac_aiBytes{0} = strval(s_szIP[ac_iPos]);
  6897.     while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
  6898.     ac_aiBytes{1} = strval(s_szIP[ac_iPos]);
  6899.     while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
  6900.     ac_aiBytes{2} = strval(s_szIP[ac_iPos]);
  6901.     while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
  6902.     ac_aiBytes{3} = strval(s_szIP[ac_iPos]);
  6903.     return ac_aiBytes[0];
  6904. }
  6905.  
  6906. static ac_FloodDetect(playerid, publicid)
  6907. {
  6908.     if(!ACInfo[playerid][acKicked])
  6909.     {
  6910.         if(++ACInfo[playerid][acFloodCount][publicid] > ac_Mtfc[publicid][1])
  6911.         {
  6912.             #if defined DEBUG
  6913.                 printf(DEBUG_CODE_1, playerid, ac_Mtfc[publicid][1], publicid);
  6914.                 #undef DEBUG
  6915.             #endif
  6916.             #if defined OnCheatDetected
  6917.                 ac_KickWithCode(playerid, "", 0, 49, publicid);
  6918.                 ACInfo[playerid][acFloodCount][publicid] = ACInfo[playerid][acFloodCount][27] = 0;
  6919.             #else
  6920.                 return ac_KickWithCode(playerid, "", 0, 49, publicid);
  6921.             #endif
  6922.         }
  6923.         ACInfo[playerid][acCall][publicid] = ACInfo[playerid][acCall][27] = GetTickCount();
  6924.     }
  6925.     return 0;
  6926. }
  6927.  
  6928. static ac_KickWithCode(playerid, ip_address[], type, code, code2 = 0)
  6929. {
  6930.     if(type == 0 && (!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) ||
  6931.     !(0 <= code < sizeof ac_ACAllow)) return 0;
  6932.     ac_sInfo[5]++;
  6933.     switch(code)
  6934.     {
  6935.         case 0..35, 37, 39, 51: ac_sInfo[0]++;
  6936.         case 36, 38, 40, 41, 50: ac_sInfo[4]++;
  6937.         case 42: ac_sInfo[1]++;
  6938.         case 47..49: ac_sInfo[3]++;
  6939.         case 43..46: ac_sInfo[2]++;
  6940.     }
  6941.     new ac_strtmp[6];
  6942.     if(code2) format(ac_strtmp, sizeof ac_strtmp, " (%d)", code2);
  6943.     if(type) printf(SUSPICION_2, ip_address, code, ac_strtmp);
  6944.     else printf(SUSPICION_1, playerid, code, ac_strtmp);
  6945.     #if defined OnCheatDetected
  6946.         OnCheatDetected(playerid, ip_address, type, code);
  6947.     #else
  6948.         ac_OnCheatDetected(playerid, ip_address, type, code);
  6949.     #endif
  6950.     return 0;
  6951. }
  6952.  
  6953. static ac_LoadCfg()
  6954. {
  6955.     static ac_strtmp[10];
  6956.     new ac_i, ac_string[415], File:ac_cfgFile;
  6957.     if(fexist(AC_CONFIG_FILE))
  6958.     {
  6959.         if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_read)))
  6960.         {
  6961.             #if defined sscanf
  6962.                 new ac_j;
  6963.             #endif
  6964.             while(fread(ac_cfgFile, ac_string) > 0)
  6965.             {
  6966.                 #if defined sscanf
  6967.                     sscanf(ac_string, "i'//'i", ac_j, ac_i);
  6968.                     ac_ACAllow[ac_i] = !!ac_j;
  6969.                 #else
  6970.                     if((ac_i = strfind(ac_string, "//")) != -1)
  6971.                     {
  6972.                         strmid(ac_strtmp, ac_string, ac_i + 2, strlen(ac_string));
  6973.                         if(0 <= (ac_i = strval(ac_strtmp)) < sizeof ac_ACAllow) ac_ACAllow[ac_i] = !!strval(ac_string);
  6974.                     }
  6975.                 #endif
  6976.             }
  6977.             fclose(ac_cfgFile);
  6978.         }
  6979.         else return 0;
  6980.     }
  6981.     else if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_write)))
  6982.     {
  6983.         #undef AC_CONFIG_FILE
  6984.         for(; ac_i < sizeof ac_ACAllow; ++ac_i)
  6985.         {
  6986.             format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_ACAllow[ac_i], ac_i);
  6987.             strcat(ac_string, ac_strtmp);
  6988.         }
  6989.         fwrite(ac_cfgFile, ac_string);
  6990.         fclose(ac_cfgFile);
  6991.     }
  6992.     else return 0;
  6993.     return 1;
  6994. }
  6995.  
  6996. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement