Guest User

Nex-AC

a guest
Jul 24th, 2019
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Nex-AC by Nexius v1.9.48 (0.3.7)
  2.  
  3. #if defined _nex_ac_included
  4.     #endinput
  5. #endif
  6. #define _nex_ac_included
  7.  
  8. #include <a_samp>
  9.  
  10. #if !defined FILTERSCRIPT
  11.  
  12. #if !defined DEBUG
  13.     #define DEBUG
  14. #endif
  15.  
  16. #if !defined NO_SUSPICION_LOGS
  17.     //#define NO_SUSPICION_LOGS
  18. #endif
  19.  
  20. #if defined NO_SUSPICION_LOGS
  21.     #pragma unused SUSPICION_1
  22.     #pragma unused SUSPICION_2
  23. #endif
  24.  
  25. #if !defined _nex_ac_lang_included
  26.     #include <nex-ac_en.lang>   //Localization
  27. #endif
  28.  
  29. #define NEX_AC_VERSION              "1.9.48"
  30.  
  31. #define AC_SERVER_VERSION           "0.3.7"
  32. #define AC_SERVER_DL_VERSION        "0.3.DL"
  33.  
  34. #if !defined AC_USE_CONFIG_FILES
  35.     #define AC_USE_CONFIG_FILES         true
  36. #endif
  37.  
  38. #if AC_USE_CONFIG_FILES
  39.     #if !defined AC_CONFIG_FILE
  40.         #define AC_CONFIG_FILE          "nex-ac_settings.cfg"
  41.     #endif
  42.  
  43.     #if !defined AC_NOP_CONFIG_FILE
  44.         #define AC_NOP_CONFIG_FILE      "nex-ac_nop_settings.cfg"
  45.     #endif
  46. #else
  47.     #pragma unused CFG_OPENING_ERROR
  48. #endif
  49.  
  50. #if !defined AC_USE_VENDING_MACHINES
  51.     #define AC_USE_VENDING_MACHINES     true
  52. #endif
  53.  
  54. #if !defined AC_USE_TUNING_GARAGES
  55.     #define AC_USE_TUNING_GARAGES       true
  56. #endif
  57.  
  58. #if !defined AC_USE_PICKUP_WEAPONS
  59.     #define AC_USE_PICKUP_WEAPONS       true
  60. #endif
  61.  
  62. #if !defined AC_USE_AMMUNATIONS
  63.     #define AC_USE_AMMUNATIONS          true
  64. #endif
  65.  
  66. #if !defined AC_USE_RESTAURANTS
  67.     #define AC_USE_RESTAURANTS          true
  68. #endif
  69.  
  70. #if !defined AC_USE_PAYNSPRAY
  71.     #define AC_USE_PAYNSPRAY            true
  72. #endif
  73.  
  74. #if !defined AC_USE_CASINOS
  75.     #define AC_USE_CASINOS              true
  76. #endif
  77.  
  78. #if !defined AC_USE_QUERY
  79.     #define AC_USE_QUERY                true
  80. #endif
  81.  
  82. #if !defined AC_USE_NPC
  83.     #define AC_USE_NPC                  true
  84. #endif
  85.  
  86. #if !defined AC_USE_STATISTICS
  87.     #define AC_USE_STATISTICS           true
  88. #endif
  89.  
  90. #if !AC_USE_STATISTICS
  91.     #pragma unused STATS_STRING_1
  92.     #pragma unused STATS_STRING_2
  93.     #pragma unused STATS_STRING_3
  94.     #pragma unused STATS_STRING_4
  95.     #pragma unused STATS_STRING_5
  96.     #pragma unused STATS_STRING_6
  97.     #pragma unused STATS_STRING_7
  98.     #pragma unused STATS_STRING_8
  99. #endif
  100.  
  101. #if !defined AUTOSAVE_SETTINGS_IN_CONFIG
  102.     #define AUTOSAVE_SETTINGS_IN_CONFIG     false
  103. #endif
  104.  
  105. #if !defined AC_DEFAULT_COLOR
  106.     #define AC_DEFAULT_COLOR                -1
  107. #endif
  108.  
  109. #if !defined AC_MAX_CLASSES
  110.     #define AC_MAX_CLASSES                  320
  111. #endif
  112.  
  113. #if !defined AC_MAX_CONNECTS_FROM_IP
  114.     #define AC_MAX_CONNECTS_FROM_IP         1
  115. #endif
  116.  
  117. #if !defined AC_MAX_RCON_LOGIN_ATTEMPT
  118.     #define AC_MAX_RCON_LOGIN_ATTEMPT       1
  119. #endif
  120.  
  121. #if !defined AC_MAX_MSGS_REC_DIFF
  122.     #define AC_MAX_MSGS_REC_DIFF            800
  123. #endif
  124.  
  125. #if !defined AC_MAX_PING
  126.     #define AC_MAX_PING                     500
  127. #endif
  128.  
  129. #if !defined AC_MIN_TIME_RECONNECT
  130.     #define AC_MIN_TIME_RECONNECT           12      //In seconds
  131. #endif
  132.  
  133. #if !defined AC_SPEEDHACK_VEH_RESET_DELAY
  134.     #define AC_SPEEDHACK_VEH_RESET_DELAY    3       //In seconds
  135. #endif
  136.  
  137. #if !defined AC_MAX_NOP_WARNINGS
  138.     #define AC_MAX_NOP_WARNINGS             8
  139. #endif
  140.  
  141. #if !defined AC_MAX_NOP_TIMER_WARNINGS
  142.     #define AC_MAX_NOP_TIMER_WARNINGS       3
  143. #endif
  144.  
  145. #if !defined AC_MAX_PING_WARNINGS
  146.     #define AC_MAX_PING_WARNINGS            8
  147. #endif
  148.  
  149. #if !defined AC_MAX_AIR_WARNINGS
  150.     #define AC_MAX_AIR_WARNINGS             4
  151. #endif
  152.  
  153. #if !defined AC_MAX_AIR_VEH_WARNINGS
  154.     #define AC_MAX_AIR_VEH_WARNINGS         4
  155. #endif
  156.  
  157. #if !defined AC_MAX_FLYHACK_VEH_WARNINGS
  158.     #define AC_MAX_FLYHACK_VEH_WARNINGS     3
  159. #endif
  160.  
  161. #if !defined AC_MAX_FLYHACK_BIKE_WARNINGS
  162.     #define AC_MAX_FLYHACK_BIKE_WARNINGS    5
  163. #endif
  164.  
  165. #if !defined AC_MAX_CARSHOT_WARNINGS
  166.     #define AC_MAX_CARSHOT_WARNINGS         4
  167. #endif
  168.  
  169. #if !defined AC_MAX_PRO_AIM_WARNINGS
  170.     #define AC_MAX_PRO_AIM_WARNINGS         2
  171. #endif
  172.  
  173. #if !defined AC_MAX_AFK_GHOST_WARNINGS
  174.     #define AC_MAX_AFK_GHOST_WARNINGS       2
  175. #endif
  176.  
  177. #if !defined AC_MAX_RAPID_FIRE_WARNINGS
  178.     #define AC_MAX_RAPID_FIRE_WARNINGS      16
  179. #endif
  180.  
  181. #if !defined AC_MAX_AUTO_C_WARNINGS
  182.     #define AC_MAX_AUTO_C_WARNINGS          8
  183. #endif
  184.  
  185. #if !defined AC_MAX_GODMODE_WARNINGS
  186.     #define AC_MAX_GODMODE_WARNINGS         3
  187. #endif
  188.  
  189. #if !defined AC_MAX_GODMODE_VEH_WARNINGS
  190.     #define AC_MAX_GODMODE_VEH_WARNINGS     3
  191. #endif
  192.  
  193. #if !defined AC_MAX_SILENT_AIM_WARNINGS
  194.     #define AC_MAX_SILENT_AIM_WARNINGS      2
  195. #endif
  196.  
  197. #if !defined AC_MAX_FAKE_WEAPON_WARNINGS
  198.     #define AC_MAX_FAKE_WEAPON_WARNINGS     2
  199. #endif
  200.  
  201. #if !defined AC_MAX_FLYHACK_WARNINGS
  202.     #define AC_MAX_FLYHACK_WARNINGS         2
  203. #endif
  204.  
  205. #if !defined AC_MAX_TELEPORT_GLITCH_WARNINGS
  206.     #define AC_MAX_TELEPORT_GLITCH_WARNINGS 1
  207. #endif
  208.  
  209. #if !defined AC_MAX_SPEEDHACK_VEH_WARNINGS
  210.     #define AC_MAX_SPEEDHACK_VEH_WARNINGS   (1 * AC_SPEEDHACK_VEH_RESET_DELAY)
  211. #endif
  212.  
  213. #if !defined AC_MAX_SPEEDHACK_WARNINGS
  214.     #define AC_MAX_SPEEDHACK_WARNINGS       4
  215. #endif
  216.  
  217. #if !defined AC_MAX_CJ_RUN_WARNINGS
  218.     #define AC_MAX_CJ_RUN_WARNINGS          3
  219. #endif
  220.  
  221. #if !defined AC_MAX_MONEY_WARNINGS
  222.     #define AC_MAX_MONEY_WARNINGS           2
  223. #endif
  224.  
  225. #define ac_fpublic%0(%1) forward%0(%1); public%0(%1)
  226. #define ac_AbsoluteAngle(%0) ((floatround(%0, floatround_floor) % 360) + floatfract(%0))
  227. #define ac_abs(%0) (((%0) < 0) ? (-(%0)) : ((%0)))
  228.  
  229. //'ac_ACAllow' contains the default settings that will be set if no config file is found
  230. //Don't change these values if you already have 'scriptfiles\nex-ac_settings.cfg'
  231. static bool:ac_ACAllow[] =
  232. {
  233.     true,   //0 Anti-AirBreak (onfoot)
  234.     true,   //1 Anti-AirBreak (in vehicle)
  235.     true,   //2 Anti-teleport hack (onfoot)
  236.     true,   //3 Anti-teleport hack (in vehicle)
  237.     true,   //4 Anti-teleport hack (into/between vehicles)
  238.     true,   //5 Anti-teleport hack (vehicle to player)
  239.     true,   //6 Anti-teleport hack (pickups)
  240.     true,   //7 Anti-FlyHack (onfoot)
  241.     true,   //8 Anti-FlyHack (in vehicle)
  242.     true,   //9 Anti-SpeedHack (onfoot)
  243.     true,   //10 Anti-SpeedHack (in vehicle)
  244.     true,   //11 Anti-Health hack (in vehicle)
  245.     true,   //12 Anti-Health hack (onfoot)
  246.     true,   //13 Anti-Armour hack
  247.     true,   //14 Anti-Money hack
  248.     true,   //15 Anti-Weapon hack
  249.     true,   //16 Anti-Ammo hack (add)
  250.     true,   //17 Anti-Ammo hack (infinite)
  251.     true,   //18 Anti-Special actions hack
  252.     true,   //19 Anti-GodMode from bullets (onfoot)
  253.     true,   //20 Anti-GodMode from bullets (in vehicle)
  254.     true,   //21 Anti-Invisible hack
  255.     true,   //22 Anti-lagcomp-spoof
  256.     true,   //23 Anti-Tuning hack
  257.     false,  //24 Anti-Parkour mod
  258.     true,   //25 Anti-Quick turn
  259.     true,   //26 Anti-Rapid fire
  260.     true,   //27 Anti-FakeSpawn
  261.     true,   //28 Anti-FakeKill
  262.     true,   //29 Anti-Pro Aim
  263.     true,   //30 Anti-CJ run
  264.     true,   //31 Anti-CarShot
  265.     true,   //32 Anti-CarJack
  266.     false,  //33 Anti-UnFreeze
  267.     true,   //34 Anti-AFK Ghost
  268.     true,   //35 Anti-Full Aiming
  269.  
  270.     false,  //36 Anti-Fake NPC
  271.     true,   //37 Anti-Reconnect
  272.     true,   //38 Anti-High ping
  273.     true,   //39 Anti-Dialog hack
  274.     true,   //40 Protection from sandbox
  275.     true,   //41 Protection from invalid version
  276.     true,   //42 Anti-Rcon hack
  277.  
  278.     true,   //43 Anti-Tuning crasher
  279.     true,   //44 Anti-Invalid seat crasher
  280.     true,   //45 Anti-Dialog crasher
  281.     true,   //46 Anti-Attached object crasher
  282.     true,   //47 Anti-Weapon Crasher
  283.  
  284.     true,   //48 Protection from connection flood in one slot
  285.     true,   //49 Anti-callback functions flood
  286.     true,   //50 Anti-flood by seat changing
  287.  
  288.     true,   //51 Anti-DoS
  289.  
  290.     true    //52 Anti-NOPs
  291. },
  292.  
  293. bool:ac_NOPAllow[] =
  294. {
  295.     true,   //0 Anti-NOP GivePlayerWeapon
  296.     true,   //1 Anti-NOP SetPlayerAmmo
  297.     true,   //2 Anti-NOP SetPlayerInterior
  298.     true,   //3 Anti-NOP SetPlayerHealth
  299.     true,   //4 Anti-NOP SetVehicleHealth
  300.     true,   //5 Anti-NOP SetPlayerArmour
  301.     true,   //6 Anti-NOP SetPlayerSpecialAction
  302.     true,   //7 Anti-NOP PutPlayerInVehicle
  303.     true,   //8 Anti-NOP TogglePlayerSpectating
  304.     true,   //9 Anti-NOP SpawnPlayer
  305.     true,   //10 Anti-NOP SetPlayerPos
  306.     true    //11 Anti-NOP RemovePlayerFromVehicle
  307. };
  308.  
  309. static const ac_Mtfc[][] =
  310. {
  311.     {150, 8},   //0 OnDialogResponse
  312.     {800, 2},   //1 OnEnterExitModShop
  313.     {250, 5},   //2 OnPlayerClickMap
  314.     {400, 5},   //3 OnPlayerClickPlayer
  315.     {50, 11},   //4 OnPlayerClickTextDraw
  316.     {350, 5},   //5 OnPlayerCommandText
  317.     {50, 8},    //6 OnPlayerEnterVehicle
  318.     {50, 11},   //7 OnPlayerExitVehicle
  319.     {50, 8},    //8 OnPlayerPickUpPickup
  320.     {150, 8},   //9 OnPlayerRequestClass
  321.     {150, 8},   //10 OnPlayerSelectedMenuRow
  322.     {600, 5},   //11 OnPlayerStateChange
  323.     {450, 2},   //12 OnVehicleMod
  324.     {450, 2},   //13 OnVehiclePaintjob
  325.     {450, 2},   //14 OnVehicleRespray
  326.     {300, 1},   //15 OnVehicleDeath
  327.     {400, 3},   //16 OnPlayerText
  328.     {150, 8},   //17 OnPlayerEnterCheckpoint
  329.     {150, 8},   //18 OnPlayerLeaveCheckpoint
  330.     {150, 5},   //19 OnPlayerRequestSpawn
  331.     {150, 8},   //20 OnPlayerExitedMenu
  332.     {150, 8},   //21 OnPlayerEnterRaceCheckpoint
  333.     {150, 8},   //22 OnPlayerLeaveRaceCheckpoint
  334.     {50, 11},   //23 OnPlayerClickPlayerTextDraw
  335.     {51, 9},    //24 OnVehicleDamageStatusUpdate
  336.     {150, 8},   //25 OnVehicleSirenStateChange
  337.     {150, 5},   //26 OnPlayerSelectObject
  338.     {50, 11}    //27 Cross-public
  339. },
  340.  
  341. ac_wSlot[] =
  342. {
  343.     0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10,
  344.     10, 8, 8, 8, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5,
  345.     4, 6, 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11, 11, 11
  346. },
  347.  
  348. ac_vType[] =
  349. {
  350.     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
  351.     0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  352.     0, 0, 0, 0, 0, 0, 3, 2, 5, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0,
  353.     1, 5, 5, 5, 0, 0, 0, 0, 5, 2, 0, 5, 3, 3, 0, 0, 1, 0, 0, 0,
  354.     0, 4, 0, 0, 3, 0, 0, 2, 2, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0,
  355.     0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 1, 1, 1, 0, 0, 0, 0, 0, 1,
  356.     1, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  357.     0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
  358.     0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
  359.     0, 5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 1, 0, 3, 0, 0, 0, 0,
  360.     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  361. },
  362.  
  363. #if AC_USE_PICKUP_WEAPONS
  364.     ac_wModel[] =
  365.     {
  366.         0, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325,
  367.         326, 342, 343, 344, 0, 0, 345, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356,
  368.         372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 371
  369.     },
  370.  
  371.     ac_pAmmo[] =
  372.     {
  373.         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  374.         1, 1, 1, 8, 8, 8, 0, 0, 4, 30, 10, 10, 15,
  375.         10, 10, 60, 60, 80, 80, 60, 20, 10, 4, 3,
  376.         100, 500, 5, 1, 500, 500, 36, 1, 1, 1
  377.     },
  378. #endif
  379.  
  380. #if AC_USE_TUNING_GARAGES
  381.     ac_cPrice[] =
  382.     {
  383.         400, 550, 200, 250, 100, 150, 80, 500, 500, 200, 1000, 220, 250, 100, 400,
  384.         500, 200, 500, 350, 300, 250, 200, 150, 350, 50, 1000, 480, 480, 770, 680, 370,
  385.         370, 170, 120, 790, 150, 500, 690, 190, 390, 500, 390, 1000, 500, 500, 510, 710,
  386.         670, 530, 810, 620, 670, 530, 130, 210, 230, 520, 430, 620, 720, 530, 180, 550, 430,
  387.         830, 850, 750, 250, 200, 550, 450, 550, 450, 1100, 1030, 980, 1560, 1620, 1200,
  388.         1030, 900, 1230, 820, 1560, 1350, 770, 100, 1500, 150, 650, 450, 100, 750,
  389.         350, 450, 350, 1000, 620, 1140, 1000, 940, 780, 830, 3250, 1610, 1540, 780, 780, 780,
  390.         1610, 1540, 0, 0, 3340, 3250, 2130, 2050, 2040, 780, 940, 780, 940, 780, 860,
  391.         780, 1120, 3340, 3250, 3340, 1650, 3380, 3290, 1590, 830, 800, 1500, 1000, 800,
  392.         580, 470, 870, 980, 150, 150, 100, 100, 490, 600, 890, 1000, 1090, 840, 910,
  393.         1200, 1030, 1030, 920, 930, 550, 1050, 1050, 950, 650, 450, 550, 850, 950,
  394.         850, 950, 970, 880, 990, 900, 950, 1000, 900, 1000, 900, 2050, 2150, 2130,
  395.         2050, 2130, 2040, 2150, 2040, 2095, 2175, 2080, 2200, 1200, 1040, 940, 1100
  396.     },
  397. #endif
  398.  
  399. #if AC_USE_AMMUNATIONS
  400.     ac_AmmuNationInfo[][] =
  401.     {
  402.         {200, 30}, {600, 30}, {1200, 15},
  403.         {600, 15}, {800, 12}, {1000, 10},
  404.         {500, 60}, {2000, 90}, {3500, 120},
  405.         {4500, 150}, {300, 60}
  406.     },
  407.  
  408.     Float:ac_AmmuNations[][] =
  409.     {
  410.         {296.5541, -38.5138, 1001.5156},
  411.         {295.7008, -80.8109, 1001.5156},
  412.         {290.1963, -109.7721, 1001.5156},
  413.         {312.2592, -166.1385, 999.601}
  414.     },
  415. #endif
  416.  
  417. #if AC_USE_RESTAURANTS
  418.     Float:ac_Restaurants[][] =
  419.     {
  420.         {374.0, -119.641, 1001.4922},
  421.         {368.789, -6.857, 1001.8516},
  422.         {375.566, -68.222, 1001.5151}
  423.     },
  424. #endif
  425.  
  426. #if AC_USE_PAYNSPRAY
  427.     Float:ac_PayNSpray[][] =
  428.     {
  429.         {2064.2842, -1831.4736, 13.5469},
  430.         {-2425.7822, 1021.1392, 50.3977},
  431.         {-1420.5195, 2584.2305, 55.8433},
  432.         {487.6401, -1739.9479, 11.1385},
  433.         {1024.8651, -1024.087, 32.1016},
  434.         {-1904.7019, 284.5968, 41.0469},
  435.         {1975.2384, 2162.5088, 11.0703},
  436.         {2393.4456, 1491.5537, 10.5616},
  437.         {720.0854, -455.2807, 16.3359},
  438.         {-99.9417, 1117.9048, 19.7417}
  439.     },
  440. #endif
  441.  
  442. #if AC_USE_VENDING_MACHINES
  443.     Float:ac_vMachines[][] =
  444.     {
  445.         {-862.82, 1536.6, 21.98},
  446.         {2271.72, -76.46, 25.96},
  447.         {1277.83, 372.51, 18.95},
  448.         {662.42, -552.16, 15.71},
  449.         {201.01, -107.61, 0.89},
  450.         {-253.74, 2597.95, 62.24},
  451.         {-253.74, 2599.75, 62.24},
  452.         {-76.03, 1227.99, 19.12},
  453.         {-14.7, 1175.35, 18.95},
  454.         {-1455.11, 2591.66, 55.23},
  455.         {2352.17, -1357.15, 23.77},
  456.         {2325.97, -1645.13, 14.21},
  457.         {2139.51, -1161.48, 23.35},
  458.         {2153.23, -1016.14, 62.23},
  459.         {1928.73, -1772.44, 12.94},
  460.         {1154.72, -1460.89, 15.15},
  461.         {2480.85, -1959.27, 12.96},
  462.         {2060.11, -1897.64, 12.92},
  463.         {1729.78, -1943.04, 12.94},
  464.         {1634.1, -2237.53, 12.89},
  465.         {1789.21, -1369.26, 15.16},
  466.         {-2229.18, 286.41, 34.7},
  467.         {2319.99, 2532.85, 10.21},
  468.         {2845.72, 1295.04, 10.78},
  469.         {2503.14, 1243.69, 10.21},
  470.         {2647.69, 1129.66, 10.21},
  471.         {-2420.21, 984.57, 44.29},
  472.         {-2420.17, 985.94, 44.29},
  473.         {2085.77, 2071.35, 10.45},
  474.         {1398.84, 2222.6, 10.42},
  475.         {1659.46, 1722.85, 10.21},
  476.         {1520.14, 1055.26, 10.0},
  477.         {-1980.78, 142.66, 27.07},
  478.         {-2118.96, -423.64, 34.72},
  479.         {-2118.61, -422.41, 34.72},
  480.         {-2097.27, -398.33, 34.72},
  481.         {-2092.08, -490.05, 34.72},
  482.         {-2063.27, -490.05, 34.72},
  483.         {-2005.64, -490.05, 34.72},
  484.         {-2034.46, -490.05, 34.72},
  485.         {-2068.56, -398.33, 34.72},
  486.         {-2039.85, -398.33, 34.72},
  487.         {-2011.14, -398.33, 34.72},
  488.         {-1350.11, 492.28, 10.58},
  489.         {-1350.11, 493.85, 10.58},
  490.         {2222.36, 1602.64, 1000.06},
  491.         {2222.2, 1606.77, 1000.05},
  492.         {2155.9, 1606.77, 1000.05},
  493.         {2155.84, 1607.87, 1000.06},
  494.         {2209.9, 1607.19, 1000.05},
  495.         {2202.45, 1617.0, 1000.06},
  496.         {2209.24, 1621.21, 1000.06},
  497.         {2576.7, -1284.43, 1061.09},
  498.         {330.67, 178.5, 1020.07},
  499.         {331.92, 178.5, 1020.07},
  500.         {350.9, 206.08, 1008.47},
  501.         {361.56, 158.61, 1008.47},
  502.         {371.59, 178.45, 1020.07},
  503.         {374.89, 188.97, 1008.47},
  504.         {-19.03, -57.83, 1003.63},
  505.         {-36.14, -57.87, 1003.63},
  506.         {316.87, -140.35, 998.58},
  507.         {2225.2, -1153.42, 1025.9},
  508.         {-15.1, -140.22, 1003.63},
  509.         {-16.53, -140.29, 1003.63},
  510.         {-35.72, -140.22, 1003.63},
  511.         {373.82, -178.14, 1000.73},
  512.         {379.03, -178.88, 1000.73},
  513.         {495.96, -24.32, 1000.73},
  514.         {500.56, -1.36, 1000.73},
  515.         {501.82, -1.42, 1000.73},
  516.         {-33.87, -186.76, 1003.63},
  517.         {-32.44, -186.69, 1003.63},
  518.         {-16.11, -91.64, 1003.63},
  519.         {-17.54, -91.71, 1003.63}
  520.     },
  521. #endif
  522.  
  523. #if AC_USE_CASINOS
  524.     Float:ac_Casinos[][] =
  525.     {
  526.         {2241.2878, 1617.1624, 1006.1797, 2.0},
  527.         {2240.9736, 1604.6592, 1006.1797, 6.0},
  528.         {2242.5427, 1592.8726, 1006.1836, 6.0},
  529.         {2230.2124, 1592.1426, 1006.1832, 6.0},
  530.         {2230.4717, 1604.484, 1006.186, 6.0},
  531.         {2230.3298, 1616.9272, 1006.1799, 3.0},
  532.         {2251.9407, 1586.1736, 1006.186, 1.0},
  533.         {2218.6785, 1587.3448, 1006.1749, 1.0},
  534.         {2219.2773, 1591.7467, 1006.1867, 1.0},
  535.         {2218.5408, 1589.3229, 1006.184, 1.0},
  536.         {2218.6477, 1593.6279, 1006.1797, 1.0},
  537.         {2221.926, 1603.8285, 1006.1797, 1.0},
  538.         {2218.5095, 1603.8385, 1006.1797, 1.0},
  539.         {2219.9597, 1603.9216, 1006.1797, 1.0},
  540.         {2216.3054, 1603.7996, 1006.1819, 1.0},
  541.         {2218.731, 1619.8046, 1006.1794, 1.0},
  542.         {2218.9407, 1617.8413, 1006.1821, 1.0},
  543.         {2218.668, 1615.4681, 1006.1797, 1.0},
  544.         {2218.6418, 1613.2629, 1006.1797, 1.0},
  545.         {2252.4272, 1589.8412, 1006.1797, 5.0},
  546.         {2252.4229, 1596.6169, 1006.1797, 5.0},
  547.         {2255.1565, 1608.8784, 1006.186, 1.0},
  548.         {2254.8496, 1610.8605, 1006.1797, 1.0},
  549.         {2255.2917, 1612.9167, 1006.1797, 1.0},
  550.         {2255.033, 1614.8892, 1006.1797, 1.0},
  551.         {2255.1213, 1616.8284, 1006.1797, 1.0},
  552.         {2255.2161, 1618.8005, 1006.1797, 1.0},
  553.         {2268.5281, 1606.4894, 1006.1797, 1.0},
  554.         {2270.4922, 1606.8539, 1006.1797, 1.0},
  555.         {2272.5693, 1606.4473, 1006.1797, 1.0},
  556.         {2274.5391, 1607.0122, 1006.1797, 1.0},
  557.         {2271.8447, 1586.1633, 1006.1797, 1.0},
  558.         {2261.4844, 1586.1724, 1006.1797, 1.0},
  559.         {2257.4507, 1589.6555, 1006.1797, 5.0},
  560.         {2267.8994, 1589.8672, 1006.1797, 5.0},
  561.         {2262.8486, 1590.026, 1006.1797, 5.0},
  562.         {2272.6458, 1589.7704, 1006.1797, 5.0},
  563.         {2272.6533, 1596.5682, 1006.1797, 5.0},
  564.         {2270.4895, 1596.4606, 1006.1797, 5.0},
  565.         {2265.4441, 1596.4299, 1006.1797, 5.0},
  566.         {2260.0308, 1596.7987, 1006.1797, 5.0},
  567.         {2254.9907, 1596.241, 1006.1797, 5.0},
  568.         {1956.9524, 988.2533, 992.4688, 2.0},
  569.         {1961.6155, 993.0375, 992.4688, 2.0},
  570.         {1963.7998, 998.4406, 992.4745, 2.0},
  571.         {1936.2885, 987.1995, 992.4745, 2.0},
  572.         {1944.9768, 986.3937, 992.4688, 2.0},
  573.         {1940.7397, 990.9521, 992.4609, 2.0},
  574.         {1940.0966, 1005.8996, 992.4688, 6.0},
  575.         {1938.8785, 1014.1768, 992.4688, 6.0},
  576.         {1938.8811, 1021.4434, 992.4688, 6.0},
  577.         {1966.5975, 1006.6469, 992.4745, 6.0},
  578.         {1966.5979, 1014.1024, 992.4688, 6.0},
  579.         {1939.8351, 1029.912, 992.4688, 6.0},
  580.         {1956.854, 1047.3718, 992.4688, 6.0},
  581.         {1961.356, 1042.8112, 992.4688, 6.0},
  582.         {1963.811, 1037.1263, 992.4745, 6.0},
  583.         {1961.733, 1025.8929, 992.4688, 10.0},
  584.         {1961.708, 1010.3194, 992.4688, 10.0},
  585.         {1966.5989, 1029.7954, 992.4745, 6.0},
  586.         {1961.4139, 1017.8281, 992.4688, 10.0},
  587.         {1966.5985, 1021.7686, 992.4688, 6.0},
  588.         {1128.7106, -1.9779, 1000.6797, 1.0},
  589.         {1125.2388, 1.61, 1000.6797, 1.0},
  590.         {1125.1249, -5.0489, 1000.6797, 1.0},
  591.         {1127.4139, 3.0199, 1000.6797, 1.0},
  592.         {1135.0634, -3.8695, 1000.6797, 1.0},
  593.         {1135.0861, 0.6107, 1000.6797, 1.0},
  594.         {1132.8943, -1.7139, 1000.6797, 1.0},
  595.         {1125.3727, 3.0315, 1000.6797, 1.0},
  596.         {1119.0272, -1.4916, 1000.6924, 1.0}
  597.     },
  598. #endif
  599.  
  600. ac_MaxPassengers[] =
  601. {
  602.     0x10331113, 0x11311131, 0x11331313, 0x80133301, 0x1381F110,
  603.     0x10311103, 0x10001F10, 0x11113311, 0x13113311, 0x31101100,
  604.     0x30002301, 0x11031311, 0x11111331, 0x10013111, 0x01131100,
  605.     0x11111110, 0x11100031, 0x11130221, 0x33113311, 0x11111101,
  606.     0x33101133, 0x10100550, 0x03133111, 0xFF11113F, 0x13330111,
  607.     0xFF131111, 0x0000FF3F
  608. },
  609.  
  610. ac_vMods[] =
  611. {
  612.     0x033C2700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x021A27FA, 0x00000000, 0x00FFFE00,
  613.     0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  614.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023B2785, 0x00000000, 0x00FFFE00,
  615.     0x00000007, 0x00000000, 0x00000000, 0x02BC4703, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  616.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  617.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  618.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03BA278A, 0x00000000, 0x00FFFE00,
  619.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  620.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  621.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  622.     0x028E078A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  623.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  624.     0x02310744, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  625.     0x00000007, 0x00000000, 0x00000000, 0x0228073A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  626.     0x02BD4701, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023A2780, 0x00000000, 0x00FFFE00,
  627.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  628.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  629.     0x00000007, 0x00000000, 0x00000000, 0x0228077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  630.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  631.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  632.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  633.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  634.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  635.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  636.     0x027A27CA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  637.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  638.     0x0282278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  639.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  640.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  641.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  642.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  643.     0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  644.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  645.     0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  646.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  647.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  648.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  649.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  650.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  651.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  652.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  653.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  654.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  655.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  656.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  657.     0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  658.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  659.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  660.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  661.     0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  662.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  663.     0x00000007, 0x00000000, 0x00000000, 0x023E07C0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  664.     0x03703730, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  665.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  666.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  667.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  668.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  669.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  670.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  671.     0x00000007, 0x00000000, 0x00000000, 0x031D2775, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  672.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02BE4788, 0x00000000, 0x00FFFE00,
  673.     0x00000007, 0x0003C000, 0x00000000, 0x02010771, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  674.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  675.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  676.     0x029A0FCE, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  677.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  678.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03382700, 0x00000000, 0x00FFFE00,
  679.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  680.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  681.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  682.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  683.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  684.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  685.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  686.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  687.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  688.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  689.     0x00000007, 0x00000000, 0x00000000, 0x023F8795, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  690.     0x029F078C, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x029627EA, 0x00000000, 0x00FFFE00,
  691.     0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  692.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  693.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  694.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  695.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  696.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x0236C782, 0x00000000, 0x00FFFE00,
  697.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  698.     0x029E1FCA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  699.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  700.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  701.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0xFC000437, 0x00000000, 0x021C0000,
  702.     0x02000700, 0x00000000, 0x00FFFE00, 0x03FE6007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  703.     0x00001B87, 0x00000001, 0x01E00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  704.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  705.     0x00000007, 0x00000000, 0x00000000, 0x039E07D2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  706.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023CC700, 0x00000000, 0x00FFFE00,
  707.     0x00000007, 0x00030000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  708.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  709.     0x00000007, 0x00000000, 0x00000000, 0x038E07D6, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  710.     0x023D0709, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  711.     0x00000007, 0x00000000, 0x00000000, 0x029E1F8A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  712.     0x029C077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02BD076C, 0x00000000, 0x00FFFE00,
  713.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  714.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  715.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  716.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  717.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0xFFFFFE00, 0x00000007, 0x00000000, 0x000001F8,
  718.     0x02000700, 0x00000000, 0x00FFFFFE, 0x00000007, 0xC0000000, 0x00002007, 0xFE000700, 0x00000003, 0x00FFFE00,
  719.     0x00000007, 0x00003C00, 0x00000600, 0xCE000700, 0xFF800000, 0x00FFFE01, 0x00000007, 0x3C000000, 0x00000000,
  720.     0x02000700, 0x000003FC, 0x00FFFE00, 0x00000007, 0x003C0000, 0x00001800, 0x02000700, 0x00000000, 0x00FFFE00,
  721.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  722.     0x02000700, 0x007FE000, 0x00FFFE00, 0x00000007, 0x03C00000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  723.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000047, 0x0000003E, 0x3C000000,
  724.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  725.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  726.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  727.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  728.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00001C00, 0x00FFFE00,
  729.     0x0000000F, 0x00000000, 0x0003C000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x000003C0, 0xC0000000,
  730.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  731.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  732.     0x029607C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  733.     0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  734.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  735.     0x00000007, 0x00000000, 0x00000000, 0x03FFE7CF, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  736.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  737.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  738.     0x031727F1, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  739.     0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  740.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  741.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  742.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  743.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  744.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  745.     0x00000007, 0x00000000, 0x00000000, 0x025627F0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  746.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  747.     0x00000007, 0x00000000, 0x00000000, 0x039E07C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  748.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  749.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  750.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  751.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  752.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  753.     0x00000007, 0x00000000, 0x00000000
  754. };
  755.  
  756. static stock const Float:ac_wMinRange[] =
  757. {
  758.     25.0, 25.0, 25.0, 30.0, 25.0, 35.0,
  759.     25.0, 35.0, 40.0, 40.0, 25.0, 55.0,
  760.     50.0, 50.0, 50.0, 4.0, 65.0
  761. };
  762.  
  763. enum acInfo
  764. {
  765.     Float:acPosX,
  766.     Float:acPosY,
  767.     Float:acPosZ,
  768.     Float:acDropJpX,
  769.     Float:acDropJpY,
  770.     Float:acDropJpZ,
  771.     Float:acSpawnPosX,
  772.     Float:acSpawnPosY,
  773.     Float:acSpawnPosZ,
  774.     Float:acSetVehHealth,
  775.     Float:acLastPosX,
  776.     Float:acLastPosY,
  777.     Float:acSetPosX,
  778.     Float:acSetPosY,
  779.     Float:acSetPosZ,
  780.     acSpeed,
  781.     acHealth,
  782.     acArmour,
  783.     acMoney,
  784.     acLastShot,
  785.     acLastWeapon,
  786.     acEnterSeat,
  787.     acEnterVeh,
  788.     acKickVeh,
  789.     acVeh,
  790.     acSeat,
  791.     acDialog,
  792.     acNextDialog,
  793.     acInt,
  794.     acAnim,
  795.     acDmgRes,
  796.     acSpecAct,
  797.     acNextSpecAct,
  798.     acLastSpecAct,
  799.     acLastPickup,
  800.     acReloadTick,
  801.     acShotTick,
  802.     acSpawnTick,
  803.     acTimerTick,
  804.     acSetPosTick,
  805.     acUpdateTick,
  806.     acEnterVehTick,
  807.     acSpawnWeapon1,
  808.     acSpawnWeapon2,
  809.     acSpawnWeapon3,
  810.     acSpawnAmmo1,
  811.     acSpawnAmmo2,
  812.     acSpawnAmmo3,
  813.     acSpawnRes,
  814.     acTimerID,
  815.     acKickTimerID,
  816.     acParachute,
  817.     acIntRet,
  818.     acKicked,
  819.     acIp[16],
  820.     acSet[13],
  821.     acGtc[20],
  822.     acWeapon[13],
  823.     acAmmo[13],
  824.     acSetWeapon[13],
  825.     acGiveAmmo[13],
  826.     acGtcSetWeapon[13],
  827.     acGtcGiveAmmo[13],
  828.     acNOPCount[12],
  829.     acCheatCount[22],
  830.     acCall[sizeof ac_Mtfc],
  831.     acFloodCount[sizeof ac_Mtfc],
  832.     bool:acNOPAllow[sizeof ac_NOPAllow],
  833.     bool:acACAllow[sizeof ac_ACAllow],
  834.     bool:acStuntBonus,
  835.     bool:acModShop,
  836.     bool:acUnFrozen,
  837.     bool:acOnline,
  838.     bool:acDeathRes,
  839.     bool:acVehDmgRes,
  840.     bool:acSpawned,
  841.     bool:acDead,
  842.     bool:acTpToZ,
  843.     bool:acIntEnterExits,
  844.     bool:acSpec
  845. }
  846.  
  847. enum acVehInfo
  848. {
  849.     Float:acVelX,
  850.     Float:acVelY,
  851.     Float:acVelZ,
  852.     Float:acPosX,
  853.     Float:acPosY,
  854.     Float:acPosZ,
  855.     Float:acSpawnPosX,
  856.     Float:acSpawnPosY,
  857.     Float:acSpawnPosZ,
  858.     Float:acSpawnZAngle,
  859.     Float:acPosDiff,
  860.     Float:acZAngle,
  861.     Float:acHealth,
  862.     acLastSpeed,
  863.     acSpeedDiff,
  864.     acDriver,
  865.     acInt,
  866.     acPaintJob,
  867.     bool:acSpawned
  868. }
  869.  
  870. enum acPickInfo
  871. {
  872.     Float:acPosX,
  873.     Float:acPosY,
  874.     Float:acPosZ,
  875.     acType,
  876.     acWeapon
  877. }
  878.  
  879. static
  880.     Float:ac_ClassPos[AC_MAX_CLASSES][3],
  881.     ac_ClassWeapon[AC_MAX_CLASSES][3][2],
  882.  
  883.     #if AC_USE_STATISTICS
  884.         ac_sInfo[6],
  885.     #endif
  886.  
  887.     ACInfo[MAX_PLAYERS][acInfo],
  888.     ACVehInfo[MAX_VEHICLES][acVehInfo],
  889.     ACPickInfo[MAX_PICKUPS][acPickInfo],
  890.  
  891.     bool:ac_IntEnterExits = true,
  892.     bool:ac_StuntBonus = true,
  893.     bool:ac_LagCompMode,
  894.     #if !AC_USE_QUERY
  895.         bool:ac_QueryEnable,
  896.     #endif
  897.     bool:ac_RconEnable,
  898.     bool:ac_PedAnims;
  899.  
  900. static stock bool:ac_VehFriendlyFire;
  901.  
  902. ac_fpublic ac_AddStaticVehicle(vehicleid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle)
  903. {
  904.     ACVehInfo[vehicleid][acInt] =
  905.     ACVehInfo[vehicleid][acLastSpeed] =
  906.     ACVehInfo[vehicleid][acSpeedDiff] = 0;
  907.     ACVehInfo[vehicleid][acPaintJob] = 3;
  908.     ACVehInfo[vehicleid][acSpawned] = true;
  909.     ACVehInfo[vehicleid][acHealth] = 1000.0;
  910.     ACVehInfo[vehicleid][acPosDiff] =
  911.     ACVehInfo[vehicleid][acVelX] =
  912.     ACVehInfo[vehicleid][acVelY] =
  913.     ACVehInfo[vehicleid][acVelZ] = 0.0;
  914.     ACVehInfo[vehicleid][acSpawnPosX] =
  915.     ACVehInfo[vehicleid][acPosX] = spawn_x;
  916.     ACVehInfo[vehicleid][acSpawnPosY] =
  917.     ACVehInfo[vehicleid][acPosY] = spawn_y;
  918.     ACVehInfo[vehicleid][acSpawnPosZ] =
  919.     ACVehInfo[vehicleid][acPosZ] = spawn_z;
  920.     ACVehInfo[vehicleid][acSpawnZAngle] =
  921.     ACVehInfo[vehicleid][acZAngle] = z_angle;
  922.     ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  923.     return 1;
  924. }
  925.  
  926. ac_fpublic ac_CreateVehicle(vehicleid, ac_vehicletype, Float:x, Float:y, Float:z, Float:rotation)
  927. {
  928.     ACVehInfo[vehicleid][acInt] =
  929.     ACVehInfo[vehicleid][acLastSpeed] =
  930.     ACVehInfo[vehicleid][acSpeedDiff] = 0;
  931.     ACVehInfo[vehicleid][acPaintJob] = 3;
  932.     ACVehInfo[vehicleid][acHealth] = 1000.0;
  933.     ACVehInfo[vehicleid][acPosDiff] =
  934.     ACVehInfo[vehicleid][acVelX] =
  935.     ACVehInfo[vehicleid][acVelY] =
  936.     ACVehInfo[vehicleid][acVelZ] = 0.0;
  937.     ACVehInfo[vehicleid][acSpawnPosX] =
  938.     ACVehInfo[vehicleid][acPosX] = x;
  939.     ACVehInfo[vehicleid][acSpawnPosY] =
  940.     ACVehInfo[vehicleid][acPosY] = y;
  941.     ACVehInfo[vehicleid][acSpawnPosZ] =
  942.     ACVehInfo[vehicleid][acPosZ] = z;
  943.     ACVehInfo[vehicleid][acSpawnZAngle] =
  944.     ACVehInfo[vehicleid][acZAngle] = rotation;
  945.     if(!(569 <= ac_vehicletype <= 570)) ACVehInfo[vehicleid][acSpawned] = true;
  946.     ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  947.     return 1;
  948. }
  949.  
  950. ac_fpublic ac_AddPlayerClass(ac_classid, Float:ac_spawn_x, Float:ac_spawn_y, Float:ac_spawn_z, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
  951. {
  952.     if(0 <= ac_classid < AC_MAX_CLASSES)
  953.     {
  954.         #undef AC_MAX_CLASSES
  955.         ac_ClassPos[ac_classid][0] = ac_spawn_x;
  956.         ac_ClassPos[ac_classid][1] = ac_spawn_y;
  957.         ac_ClassPos[ac_classid][2] = ac_spawn_z;
  958.         ac_ClassWeapon[ac_classid][0][0] = ac_weapon1;
  959.         ac_ClassWeapon[ac_classid][0][1] = ac_weapon1_ammo;
  960.         ac_ClassWeapon[ac_classid][1][0] = ac_weapon2;
  961.         ac_ClassWeapon[ac_classid][1][1] = ac_weapon2_ammo;
  962.         ac_ClassWeapon[ac_classid][2][0] = ac_weapon3;
  963.         ac_ClassWeapon[ac_classid][2][1] = ac_weapon3_ammo;
  964.     }
  965.     return 1;
  966. }
  967.  
  968. 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)
  969. {
  970.     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;
  971.     ACInfo[playerid][acSpawnPosX] = ac_x;
  972.     ACInfo[playerid][acSpawnPosY] = ac_y;
  973.     ACInfo[playerid][acSpawnPosZ] = ac_z;
  974.     ACInfo[playerid][acSpawnWeapon1] = ac_weapon1;
  975.     ACInfo[playerid][acSpawnAmmo1] = ac_weapon1_ammo;
  976.     ACInfo[playerid][acSpawnWeapon2] = ac_weapon2;
  977.     ACInfo[playerid][acSpawnAmmo2] = ac_weapon2_ammo;
  978.     ACInfo[playerid][acSpawnWeapon3] = ac_weapon3;
  979.     ACInfo[playerid][acSpawnAmmo3] = ac_weapon3_ammo;
  980.     return 1;
  981. }
  982.  
  983. ac_fpublic ac_AddStaticPickup(pickupid, ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z)
  984. {
  985.     #if AC_USE_PICKUP_WEAPONS
  986.         ACPickInfo[pickupid][acWeapon] = 0;
  987.         switch(ac_type)
  988.         {
  989.             case 2, 3, 15, 22:
  990.             {
  991.                 switch(ac_model)
  992.                 {
  993.                     case 370: ACPickInfo[pickupid][acType] = 2;
  994.                     case 1240: ACPickInfo[pickupid][acType] = 3;
  995.                     case 1242: ACPickInfo[pickupid][acType] = 4;
  996.                     case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
  997.                     {
  998.                         for(new ac_i = 46; ac_i >= 0; --ac_i)
  999.                         {
  1000.                             if(ac_wModel[ac_i] == ac_model)
  1001.                             {
  1002.                                 ACPickInfo[pickupid][acType] = 1;
  1003.                                 ACPickInfo[pickupid][acWeapon] = ac_i;
  1004.                                 break;
  1005.                             }
  1006.                         }
  1007.                     }
  1008.                 }
  1009.             }
  1010.         }
  1011.     #endif
  1012.     ACPickInfo[pickupid][acPosX] = ac_X;
  1013.     ACPickInfo[pickupid][acPosY] = ac_Y;
  1014.     ACPickInfo[pickupid][acPosZ] = ac_Z;
  1015.     return 1;
  1016. }
  1017.  
  1018. ac_fpublic ac_CreatePickup(pickupid, ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1019. {
  1020.     #if AC_USE_PICKUP_WEAPONS
  1021.         ACPickInfo[pickupid][acWeapon] = 0;
  1022.         switch(ac_type)
  1023.         {
  1024.             case 2, 3, 15, 22:
  1025.             {
  1026.                 switch(ac_model)
  1027.                 {
  1028.                     case 370: ACPickInfo[pickupid][acType] = 2;
  1029.                     case 1240: ACPickInfo[pickupid][acType] = 3;
  1030.                     case 1242: ACPickInfo[pickupid][acType] = 4;
  1031.                     case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
  1032.                     {
  1033.                         for(new ac_i = 46; ac_i >= 0; --ac_i)
  1034.                         {
  1035.                             if(ac_wModel[ac_i] == ac_model)
  1036.                             {
  1037.                                 ACPickInfo[pickupid][acType] = 1;
  1038.                                 ACPickInfo[pickupid][acWeapon] = ac_i;
  1039.                                 break;
  1040.                             }
  1041.                         }
  1042.                     }
  1043.                 }
  1044.             }
  1045.         }
  1046.     #endif
  1047.     ACPickInfo[pickupid][acPosX] = ac_X;
  1048.     ACPickInfo[pickupid][acPosY] = ac_Y;
  1049.     ACPickInfo[pickupid][acPosZ] = ac_Z;
  1050.     return 1;
  1051. }
  1052.  
  1053. #if AC_USE_PICKUP_WEAPONS\
  1054.     && defined Streamer_SetIntData
  1055.     #if defined STREAMER_ENABLE_TAGS
  1056.         ac_fpublic ac_CreateDynamicPickup(STREAMER_TAG_PICKUP:pickupid, ac_modelid, ac_type)
  1057.     #else
  1058.         ac_fpublic ac_CreateDynamicPickup(pickupid, ac_modelid, ac_type)
  1059.     #endif
  1060.     {
  1061.         Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 0);
  1062.         switch(ac_type)
  1063.         {
  1064.             case 2, 3, 15, 22:
  1065.             {
  1066.                 switch(ac_modelid)
  1067.                 {
  1068.                     case 370: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 2);
  1069.                     case 1240: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 3);
  1070.                     case 1242: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 4);
  1071.                     case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
  1072.                     {
  1073.                         for(new ac_i = 46; ac_i >= 0; --ac_i)
  1074.                         {
  1075.                             if(ac_wModel[ac_i] == ac_modelid)
  1076.                             {
  1077.                                 Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, ac_i + 100);
  1078.                                 break;
  1079.                             }
  1080.                         }
  1081.                     }
  1082.                 }
  1083.             }
  1084.         }
  1085.         return 1;
  1086.     }
  1087. #endif
  1088.  
  1089. #if defined Streamer_UpdateEx
  1090.     stock ac_Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, type = -1, compensatedtime = -1, freezeplayer = 1)
  1091.     {
  1092.         if(!Streamer_UpdateEx(playerid, x, y, z, worldid, interiorid, type, compensatedtime, freezeplayer)) return 0;
  1093.         if(compensatedtime >= 0)
  1094.         {
  1095.             ACInfo[playerid][acSet][8] = 4;
  1096.             ACInfo[playerid][acNOPCount][10] = 0;
  1097.             ACInfo[playerid][acSetPosX] = x;
  1098.             ACInfo[playerid][acSetPosY] = y;
  1099.             ACInfo[playerid][acSetPosZ] = z;
  1100.             ACInfo[playerid][acSetPosTick] =
  1101.             ACInfo[playerid][acGtc][11] = GetTickCount() + 3250;
  1102.         }
  1103.         return 1;
  1104.     }
  1105.  
  1106.     #if defined _ALS_Streamer_UpdateEx
  1107.         #undef Streamer_UpdateEx
  1108.     #else
  1109.         #define _ALS_Streamer_UpdateEx
  1110.     #endif
  1111.     #define Streamer_UpdateEx ac_Streamer_UpdateEx
  1112. #endif
  1113.  
  1114. stock ac_GetPlayerVersion(playerid, version[], len)
  1115. {
  1116.     new ac_ret = GetPlayerVersion(playerid, version, len);
  1117.     for(new ac_i = ac_ret - 1; ac_i >= 0; --ac_i)
  1118.     {
  1119.         if(version[ac_i] == '%')
  1120.         {
  1121.             strdel(version, ac_i, ac_i + 1);
  1122.             ac_ret--;
  1123.         }
  1124.     }
  1125.     return ac_ret;
  1126. }
  1127.  
  1128. #if defined _ALS_GetPlayerVersion
  1129.     #undef GetPlayerVersion
  1130. #else
  1131.     #define _ALS_GetPlayerVersion
  1132. #endif
  1133. #define GetPlayerVersion ac_GetPlayerVersion
  1134.  
  1135. stock ac_GetPlayerFacingAngle(playerid, &Float:ang)
  1136. {
  1137.     if(!GetPlayerFacingAngle(playerid, ang)) return 0;
  1138.     if(ang != ang) ang = 0.0;
  1139.     ang = ac_AbsoluteAngle(ang);
  1140.     return 1;
  1141. }
  1142.  
  1143. #if defined _ALS_GetPlayerFacingAngle
  1144.     #undef GetPlayerFacingAngle
  1145. #else
  1146.     #define _ALS_GetPlayerFacingAngle
  1147. #endif
  1148. #define GetPlayerFacingAngle ac_GetPlayerFacingAngle
  1149.  
  1150. stock ac_GetVehicleZAngle(vehicleid, &Float:z_angle)
  1151. {
  1152.     if(!GetVehicleZAngle(vehicleid, z_angle)) return 0;
  1153.     if(z_angle != z_angle) z_angle = 0.0;
  1154.     z_angle = ac_AbsoluteAngle(z_angle);
  1155.     #undef ac_AbsoluteAngle
  1156.     return 1;
  1157. }
  1158.  
  1159. #if defined _ALS_GetVehicleZAngle
  1160.     #undef GetVehicleZAngle
  1161. #else
  1162.     #define _ALS_GetVehicleZAngle
  1163. #endif
  1164. #define GetVehicleZAngle ac_GetVehicleZAngle
  1165.  
  1166. ac_fpublic ac_DestroyVehicle(vehicleid)
  1167. {
  1168.     if(!DestroyVehicle(vehicleid)) return 0;
  1169.     ACVehInfo[vehicleid][acSpawned] = false;
  1170.     return 1;
  1171. }
  1172.  
  1173. ac_fpublic ac_DestroyPickup(pickupid)
  1174. {
  1175.     if(!DestroyPickup(pickupid)) return 0;
  1176.     ACPickInfo[pickupid][acType] = 0;
  1177.     return 1;
  1178. }
  1179.  
  1180. ac_fpublic ac_DisableInteriorEnterExits()
  1181. {
  1182.     ac_IntEnterExits = false;
  1183.     return DisableInteriorEnterExits();
  1184. }
  1185.  
  1186. ac_fpublic ac_UsePlayerPedAnims()
  1187. {
  1188.     ac_PedAnims = true;
  1189.     return UsePlayerPedAnims();
  1190. }
  1191.  
  1192. #if defined EnableVehicleFriendlyFire
  1193.     ac_fpublic ac_EnableVehicleFriendlyFire()
  1194.     {
  1195.         ac_VehFriendlyFire = true;
  1196.         return EnableVehicleFriendlyFire();
  1197.     }
  1198. #endif
  1199.  
  1200. ac_fpublic ac_EnableStuntBonusForAll(enable)
  1201. {
  1202.     ac_StuntBonus = !!enable;
  1203.     #if defined foreach
  1204.         foreach(new ac_i : Player) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
  1205.     #else
  1206.         #if defined GetPlayerPoolSize
  1207.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1208.         #else
  1209.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1210.         #endif
  1211.         {
  1212.             if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
  1213.         }
  1214.     #endif
  1215.     return EnableStuntBonusForAll(enable);
  1216. }
  1217.  
  1218. ac_fpublic ac_EnableStuntBonusForPlayer(playerid, enable)
  1219. {
  1220.     if(!EnableStuntBonusForPlayer(playerid, enable)) return 0;
  1221.     ACInfo[playerid][acStuntBonus] = !!enable;
  1222.     return 1;
  1223. }
  1224.  
  1225. ac_fpublic ac_ShowPlayerDialog(playerid, ac_dialogid)
  1226. {
  1227.     ACInfo[playerid][acDialog] = ac_dialogid;
  1228.     return 1;
  1229. }
  1230.  
  1231. ac_fpublic ac_fs_ShowPlayerDialog(playerid, ac_dialogid)
  1232. {
  1233.     ACInfo[playerid][acNextDialog] = ac_dialogid;
  1234.     return 1;
  1235. }
  1236.  
  1237. ac_fpublic ac_TogglePlayerControllable(playerid, toggle)
  1238. {
  1239.     if(!TogglePlayerControllable(playerid, toggle)) return 0;
  1240.     ACInfo[playerid][acUnFrozen] = !!toggle;
  1241.     return 1;
  1242. }
  1243.  
  1244. ac_fpublic ac_TogglePlayerSpectating(playerid, toggle)
  1245. {
  1246.     if(!TogglePlayerSpectating(playerid, toggle)) return 0;
  1247.     if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING || ACInfo[playerid][acSet][6] != -1)
  1248.     {
  1249.         if(!toggle)
  1250.         {
  1251.             if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][7] = 4;
  1252.             else
  1253.             {
  1254.                 ACInfo[playerid][acSet][3] =
  1255.                 ACInfo[playerid][acSet][4] =
  1256.                 ACInfo[playerid][acSet][6] =
  1257.                 ACInfo[playerid][acSet][8] =
  1258.                 ACInfo[playerid][acSet][9] =
  1259.                 ACInfo[playerid][acNextSpecAct] = -1;
  1260.                 for(new ac_i = 12; ac_i >= 0; --ac_i)
  1261.                 {
  1262.                     ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1263.                     ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1264.                 }
  1265.                 ACInfo[playerid][acTpToZ] = false;
  1266.                 ACInfo[playerid][acUnFrozen] = true;
  1267.                 ACInfo[playerid][acSet][7] = 1;
  1268.             }
  1269.             ACInfo[playerid][acSpawnRes]++;
  1270.             ACInfo[playerid][acSpec] = false;
  1271.             ACInfo[playerid][acSpawnTick] =
  1272.             ACInfo[playerid][acNOPCount][9] = 0;
  1273.             ACInfo[playerid][acGtc][13] = GetTickCount() + 2650;
  1274.         }
  1275.     }
  1276.     else if(toggle)
  1277.     {
  1278.         ACInfo[playerid][acSet][6] = 1;
  1279.         ACInfo[playerid][acNOPCount][8] = 0;
  1280.         ACInfo[playerid][acGtc][12] = GetTickCount() + 2650;
  1281.     }
  1282.     return 1;
  1283. }
  1284.  
  1285. ac_fpublic ac_SpawnPlayer(playerid)
  1286. {
  1287.     if(!SpawnPlayer(playerid)) return 0;
  1288.     if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][7] = 5;
  1289.     else
  1290.     {
  1291.         ACInfo[playerid][acSet][3] =
  1292.         ACInfo[playerid][acSet][4] =
  1293.         ACInfo[playerid][acSet][8] =
  1294.         ACInfo[playerid][acSet][9] =
  1295.         ACInfo[playerid][acNextSpecAct] = -1;
  1296.         for(new ac_i = 12; ac_i >= 0; --ac_i)
  1297.         {
  1298.             ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1299.             ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1300.         }
  1301.         ACInfo[playerid][acTpToZ] = false;
  1302.         ACInfo[playerid][acUnFrozen] = true;
  1303.         ACInfo[playerid][acSet][7] = 2;
  1304.     }
  1305.     ACInfo[playerid][acSpawnRes]++;
  1306.     ACInfo[playerid][acSpawnTick] =
  1307.     ACInfo[playerid][acNOPCount][9] = 0;
  1308.     ACInfo[playerid][acGtc][13] = GetTickCount() + 2650;
  1309.     return 1;
  1310. }
  1311.  
  1312. ac_fpublic ac_SetPlayerHealth(playerid, Float:ac_health)
  1313. {
  1314.     if(!SetPlayerHealth(playerid, ac_health)) return 0;
  1315.     if(ac_health < 0.0) ac_health = 0.0;
  1316.     ACInfo[playerid][acNOPCount][3] = 0;
  1317.     ACInfo[playerid][acSet][1] = floatround(ac_health, floatround_tozero);
  1318.     ACInfo[playerid][acGtc][3] = GetTickCount() + 2650;
  1319.     return 1;
  1320. }
  1321.  
  1322. ac_fpublic ac_SetPlayerArmour(playerid, Float:ac_armour)
  1323. {
  1324.     if(!SetPlayerArmour(playerid, ac_armour)) return 0;
  1325.     if(ac_armour < 0.0) ac_armour = 0.0;
  1326.     ACInfo[playerid][acNOPCount][5] = 0;
  1327.     ACInfo[playerid][acSet][2] = floatround(ac_armour, floatround_tozero);
  1328.     ACInfo[playerid][acGtc][5] = GetTickCount() + 2650;
  1329.     return 1;
  1330. }
  1331.  
  1332. ac_fpublic ac_GivePlayerWeapon(playerid, ac_weaponid, ac_ammo)
  1333. {
  1334.     if(0 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 46)
  1335.     {
  1336.         new ac_s = ac_wSlot[ac_weaponid];
  1337.         ACInfo[playerid][acNOPCount][0] =
  1338.         ACInfo[playerid][acNOPCount][1] = 0;
  1339.         if(16 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 43)
  1340.         {
  1341.             if(3 <= ac_s <= 5 || (ACInfo[playerid][acSetWeapon][ac_s] == -1
  1342.             ? ACInfo[playerid][acWeapon][ac_s] : ACInfo[playerid][acSetWeapon][ac_s]) == ac_weaponid)
  1343.             {
  1344.                 if(ACInfo[playerid][acGiveAmmo][ac_s] != -65535) ACInfo[playerid][acGiveAmmo][ac_s] += ac_ammo;
  1345.                 else ACInfo[playerid][acGiveAmmo][ac_s] = ACInfo[playerid][acAmmo][ac_s] + ac_ammo;
  1346.             }
  1347.             else ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo;
  1348.             if(ACInfo[playerid][acGiveAmmo][ac_s] < -32768) ac_ammo = ACInfo[playerid][acGiveAmmo][ac_s] = -32768;
  1349.             else if(ACInfo[playerid][acGiveAmmo][ac_s] > 32767) ac_ammo = ACInfo[playerid][acGiveAmmo][ac_s] = 32767;
  1350.             ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = ac_weaponid;
  1351.             ACInfo[playerid][acReloadTick] = 0;
  1352.         }
  1353.         else
  1354.         {
  1355.             ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  1356.             ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = ac_weaponid;
  1357.         }
  1358.         ACInfo[playerid][acGtcGiveAmmo][ac_s] =
  1359.         ACInfo[playerid][acGtcSetWeapon][ac_s] =
  1360.         ACInfo[playerid][acGtc][2] = GetTickCount() + 2650;
  1361.     }
  1362.     return GivePlayerWeapon(playerid, ac_weaponid, ac_ammo);
  1363. }
  1364.  
  1365. ac_fpublic ac_SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo)
  1366. {
  1367.     if(ac_ammo < -32768) ac_ammo = -32768;
  1368.     else if(ac_ammo > 32767) ac_ammo = 32767;
  1369.     if(16 <= ac_weaponslot <= 43)
  1370.     {
  1371.         new ac_s = ac_wSlot[ac_weaponslot];
  1372.         if(ACInfo[playerid][acWeapon][ac_s] > 0 || ACInfo[playerid][acSetWeapon][ac_s] > 0)
  1373.         {
  1374.             ACInfo[playerid][acNOPCount][1] = 0;
  1375.             ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo;
  1376.             ACInfo[playerid][acGtcGiveAmmo][ac_s] = GetTickCount() + 2650;
  1377.         }
  1378.     }
  1379.     return SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo);
  1380. }
  1381.  
  1382. ac_fpublic ac_SetPlayerArmedWeapon(playerid, ac_weaponid)
  1383. {
  1384.     if(!SetPlayerArmedWeapon(playerid, ac_weaponid)) return 0;
  1385.     if(0 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 46)
  1386.     {
  1387.         new ac_s = ac_wSlot[ac_weaponid];
  1388.         if((ac_weaponid == ACInfo[playerid][acWeapon][ac_s] || ac_weaponid == ACInfo[playerid][acSetWeapon][ac_s]) &&
  1389.         (ACInfo[playerid][acAmmo][ac_s] != 0 || ACInfo[playerid][acGiveAmmo][ac_s] != 0))
  1390.         {
  1391.             ACInfo[playerid][acNOPCount][0] = 0;
  1392.             ACInfo[playerid][acSet][3] = ac_weaponid;
  1393.             ACInfo[playerid][acGtc][2] = GetTickCount() + 2650;
  1394.         }
  1395.     }
  1396.     return 1;
  1397. }
  1398.  
  1399. ac_fpublic ac_ResetPlayerWeapons(playerid)
  1400. {
  1401.     if(!ResetPlayerWeapons(playerid)) return 0;
  1402.     for(new ac_i = 12; ac_i >= 0; --ac_i)
  1403.     {
  1404.         ACInfo[playerid][acWeapon][ac_i] =
  1405.         ACInfo[playerid][acAmmo][ac_i] = 0;
  1406.         ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1407.         ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1408.     }
  1409.     ACInfo[playerid][acSet][3] = -1;
  1410.     ACInfo[playerid][acGtc][7] = GetTickCount() + 2650;
  1411.     return 1;
  1412. }
  1413.  
  1414. ac_fpublic ac_GivePlayerMoney(playerid, ac_money)
  1415. {
  1416.     if(!GivePlayerMoney(playerid, ac_money)) return 0;
  1417.     ACInfo[playerid][acNOPCount][11] = AC_MAX_MONEY_WARNINGS;
  1418.     ACInfo[playerid][acMoney] += ac_money;
  1419.     #undef AC_MAX_MONEY_WARNINGS
  1420.     return 1;
  1421. }
  1422.  
  1423. ac_fpublic ac_ResetPlayerMoney(playerid)
  1424. {
  1425.     if(!ResetPlayerMoney(playerid)) return 0;
  1426.     ACInfo[playerid][acNOPCount][11] = 0;
  1427.     ACInfo[playerid][acMoney] = 0;
  1428.     return 1;
  1429. }
  1430.  
  1431. ac_fpublic ac_GetPlayerMoney(playerid) return ACInfo[playerid][acMoney];
  1432.  
  1433. ac_fpublic ac_SetPlayerSpecialAction(playerid, ac_actionid)
  1434. {
  1435.     if(!SetPlayerSpecialAction(playerid, ac_actionid)) return 0;
  1436.     if(ac_actionid == SPECIAL_ACTION_USEJETPACK || SPECIAL_ACTION_CUFFED <= ac_actionid <= 25 ||
  1437.     (ac_actionid == SPECIAL_ACTION_USECELLPHONE || ac_actionid == 68 || SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4) && ACInfo[playerid][acVeh] == 0 ||
  1438.     ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USECELLPHONE ||
  1439.     (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 ||
  1440.     ac_actionid == SPECIAL_ACTION_NONE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_DUCK &&
  1441.     ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_ENTER_VEHICLE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_HANDSUP)
  1442.     {
  1443.         ACInfo[playerid][acNOPCount][6] = 0;
  1444.         if((ac_actionid == 68 || SPECIAL_ACTION_HANDSUP <= ac_actionid <= SPECIAL_ACTION_USECELLPHONE ||
  1445.         SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= 25) && SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4 ||
  1446.         SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= 25 && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK ||
  1447.         (ac_actionid == SPECIAL_ACTION_NONE || SPECIAL_ACTION_CUFFED <= ac_actionid <= 25) && ACInfo[playerid][acVeh] ||
  1448.         SPECIAL_ACTION_CUFFED <= ac_actionid <= 25 && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) ACInfo[playerid][acNextSpecAct] = ac_actionid;
  1449.         else
  1450.         {
  1451.             if(ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE) ac_actionid = SPECIAL_ACTION_NONE;
  1452.             else if(ac_actionid == SPECIAL_ACTION_USEJETPACK || ac_actionid == SPECIAL_ACTION_HANDSUP ||
  1453.             ac_actionid == 68 || SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4 ||
  1454.             SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_DRINK_SPRUNK) ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct];
  1455.             else ACInfo[playerid][acNextSpecAct] = -1;
  1456.             ACInfo[playerid][acSet][4] = ac_actionid;
  1457.             ACInfo[playerid][acGtc][6] = GetTickCount() + 3250;
  1458.         }
  1459.     }
  1460.     return 1;
  1461. }
  1462.  
  1463. ac_fpublic ac_SetPlayerInterior(playerid, ac_interiorid)
  1464. {
  1465.     if(!SetPlayerInterior(playerid, ac_interiorid)) return 0;
  1466.     ACInfo[playerid][acNOPCount][2] = 0;
  1467.     ACInfo[playerid][acSet][0] = ac_interiorid % 256;
  1468.     ACInfo[playerid][acGtc][0] = GetTickCount() + 3250;
  1469.     return 1;
  1470. }
  1471.  
  1472. ac_fpublic ac_SetPlayerPos(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1473. {
  1474.     if(!SetPlayerPos(playerid, ac_x, ac_y, ac_z)) return 0;
  1475.     ACInfo[playerid][acSet][8] = 1;
  1476.     ACInfo[playerid][acNOPCount][10] = 0;
  1477.     ACInfo[playerid][acSetPosX] = ac_x;
  1478.     ACInfo[playerid][acSetPosY] = ac_y;
  1479.     ACInfo[playerid][acSetPosZ] = ac_z;
  1480.     ACInfo[playerid][acSetPosTick] =
  1481.     ACInfo[playerid][acGtc][11] = GetTickCount() + 3250;
  1482.     return 1;
  1483. }
  1484.  
  1485. ac_fpublic ac_SetPlayerPosFindZ(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1486. {
  1487.     if(!SetPlayerPosFindZ(playerid, ac_x, ac_y, ac_z)) return 0;
  1488.     ACInfo[playerid][acSet][8] = 2;
  1489.     ACInfo[playerid][acTpToZ] = true;
  1490.     ACInfo[playerid][acNOPCount][10] = 0;
  1491.     ACInfo[playerid][acSetPosX] = ac_x;
  1492.     ACInfo[playerid][acSetPosY] = ac_y;
  1493.     ACInfo[playerid][acSetPosTick] =
  1494.     ACInfo[playerid][acGtc][11] = GetTickCount() + 3250;
  1495.     return 1;
  1496. }
  1497.  
  1498. ac_fpublic ac_SetPlayerVelocity(playerid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1499. {
  1500.     if(!SetPlayerVelocity(playerid, ac_X, ac_Y, ac_Z)) return 0;
  1501.     ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_X, ac_Y, ac_Z);
  1502.     ACInfo[playerid][acGtc][10] = GetTickCount() + 1650;
  1503.     return 1;
  1504. }
  1505.  
  1506. ac_fpublic ac_PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid)
  1507. {
  1508.     if(!PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid)) return 0;
  1509.     if(!(SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4) &&
  1510.     !(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DRINK_SPRUNK) &&
  1511.     GetPlayerVirtualWorld(playerid) == GetVehicleVirtualWorld(ac_vehicleid))
  1512.     {
  1513.         new ac_model = GetVehicleModel(ac_vehicleid);
  1514.         ACInfo[playerid][acNOPCount][7] = 0;
  1515.         ACInfo[playerid][acSet][9] = ac_vehicleid;
  1516.         if(ac_model == 431 || ac_model == 437 || ac_IsVehicleSeatOccupied(ac_vehicleid, ac_seatid) ||
  1517.         ac_seatid > ac_GetMaxPassengers(ac_model)) ACInfo[playerid][acSet][5] = -1;
  1518.         else ACInfo[playerid][acSet][5] = ac_seatid;
  1519.         ACInfo[playerid][acGtc][1] = GetTickCount() + 2650;
  1520.     }
  1521.     return 1;
  1522. }
  1523.  
  1524. ac_fpublic ac_RemovePlayerFromVehicle(playerid)
  1525. {
  1526.     if(!RemovePlayerFromVehicle(playerid)) return 0;
  1527.     ACInfo[playerid][acSet][11] = 1;
  1528.     ACInfo[playerid][acGtc][8] = GetTickCount() + 4650;
  1529.     return 1;
  1530. }
  1531.  
  1532. ac_fpublic ac_SetVehiclePos(vehicleid, Float:ac_x, Float:ac_y, Float:ac_z)
  1533. {
  1534.     if(!SetVehiclePos(vehicleid, ac_x, ac_y, ac_z)) return 0;
  1535.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1536.     if(ac_driver != INVALID_PLAYER_ID)
  1537.     {
  1538.         ACInfo[ac_driver][acSet][8] = 3;
  1539.         ACInfo[ac_driver][acNOPCount][10] = 0;
  1540.         ACInfo[ac_driver][acSetPosX] = ac_x;
  1541.         ACInfo[ac_driver][acSetPosY] = ac_y;
  1542.         ACInfo[ac_driver][acSetPosZ] = ac_z;
  1543.         ACInfo[ac_driver][acSetPosTick] =
  1544.         ACInfo[ac_driver][acGtc][11] = GetTickCount() + 3250;
  1545.     }
  1546.     return 1;
  1547. }
  1548.  
  1549. ac_fpublic ac_SetVehicleVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1550. {
  1551.     if(!SetVehicleVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0;
  1552.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1553.     if(ac_driver != INVALID_PLAYER_ID)
  1554.     {
  1555.         ACVehInfo[vehicleid][acVelX] = ac_X;
  1556.         ACVehInfo[vehicleid][acVelY] = ac_Y;
  1557.         ACVehInfo[vehicleid][acVelZ] = ac_Z;
  1558.         ACInfo[ac_driver][acGtc][9] = GetTickCount() + 1650;
  1559.     }
  1560.     return 1;
  1561. }
  1562.  
  1563. ac_fpublic ac_SetVehicleAngularVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1564. {
  1565.     if(!SetVehicleAngularVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0;
  1566.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1567.     if(ac_driver != INVALID_PLAYER_ID)
  1568.     {
  1569.         ACVehInfo[vehicleid][acVelX] = ac_X;
  1570.         ACVehInfo[vehicleid][acVelY] = ac_Y;
  1571.         ACVehInfo[vehicleid][acVelZ] = ac_Z;
  1572.         ACInfo[ac_driver][acGtc][9] = GetTickCount() + 1650;
  1573.     }
  1574.     return 1;
  1575. }
  1576.  
  1577. ac_fpublic ac_LinkVehicleToInterior(vehicleid, ac_interiorid)
  1578. {
  1579.     if(!LinkVehicleToInterior(vehicleid, ac_interiorid)) return 0;
  1580.     ACVehInfo[vehicleid][acInt] = ac_interiorid % 256;
  1581.     return 1;
  1582. }
  1583.  
  1584. ac_fpublic ac_ChangeVehiclePaintjob(vehicleid, ac_paintjobid)
  1585. {
  1586.     ACVehInfo[vehicleid][acPaintJob] = ac_paintjobid;
  1587.     return ChangeVehiclePaintjob(vehicleid, ac_paintjobid);
  1588. }
  1589.  
  1590. ac_fpublic ac_SetVehicleHealth(vehicleid, Float:ac_health)
  1591. {
  1592.     if(!SetVehicleHealth(vehicleid, ac_health)) return 0;
  1593.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1594.     if(ac_driver != INVALID_PLAYER_ID)
  1595.     {
  1596.         ACInfo[ac_driver][acNOPCount][4] = 0;
  1597.         ACInfo[ac_driver][acSetVehHealth] = ac_health;
  1598.         ACInfo[ac_driver][acGtc][4] = GetTickCount() + 2650;
  1599.     }
  1600.     else ACVehInfo[vehicleid][acHealth] = ac_health;
  1601.     return 1;
  1602. }
  1603.  
  1604. ac_fpublic ac_RepairVehicle(vehicleid)
  1605. {
  1606.     if(!RepairVehicle(vehicleid)) return 0;
  1607.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1608.     if(ac_driver != INVALID_PLAYER_ID)
  1609.     {
  1610.         ACInfo[ac_driver][acNOPCount][4] = 0;
  1611.         ACInfo[ac_driver][acSetVehHealth] = 1000.0;
  1612.         ACInfo[ac_driver][acGtc][4] = GetTickCount() + 2650;
  1613.     }
  1614.     else ACVehInfo[vehicleid][acHealth] = 1000.0;
  1615.     return 1;
  1616. }
  1617.  
  1618. ac_fpublic ac_SetVehicleToRespawn(vehicleid)
  1619. {
  1620.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1621.     if(ac_driver != INVALID_PLAYER_ID) ACInfo[ac_driver][acGtc][9] = GetTickCount() + 1650;
  1622.     return SetVehicleToRespawn(vehicleid);
  1623. }
  1624.  
  1625. ac_fpublic ac_EnableAntiCheat(code, enable)
  1626. {
  1627.     if(!(0 <= code < sizeof ac_ACAllow)) return 0;
  1628.     if(code == 42)
  1629.     {
  1630.         if(enable)
  1631.         {
  1632.             if(!ac_ACAllow[code])
  1633.             {
  1634.                 #if !AC_USE_QUERY
  1635.                     ac_QueryEnable = !!GetServerVarAsBool("query");
  1636.                 #endif
  1637.                 ac_RconEnable = !!GetServerVarAsBool("rcon");
  1638.             }
  1639.             #if !AC_USE_QUERY
  1640.                 SendRconCommand("query 0");
  1641.             #endif
  1642.             SendRconCommand("rcon 0");
  1643.         }
  1644.         else
  1645.         {
  1646.             static ac_strtmp[9];
  1647.             #if !AC_USE_QUERY
  1648.                 format(ac_strtmp, sizeof ac_strtmp, "query %b", ac_QueryEnable);
  1649.                 SendRconCommand(ac_strtmp);
  1650.             #endif
  1651.             format(ac_strtmp, sizeof ac_strtmp, "rcon %b", ac_RconEnable);
  1652.             SendRconCommand(ac_strtmp);
  1653.         }
  1654.     }
  1655.     ac_ACAllow[code] = !!enable;
  1656.     if(enable)
  1657.     {
  1658.         #if defined foreach
  1659.             foreach(new ac_i : Player)
  1660.         #else
  1661.             #if defined GetPlayerPoolSize
  1662.                 for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1663.             #else
  1664.                 for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1665.             #endif
  1666.             {
  1667.                 if(IsPlayerConnected(ac_i))
  1668.         #endif
  1669.         {
  1670.             ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code];
  1671.             switch(code)
  1672.             {
  1673.                 case 7: ACInfo[ac_i][acCheatCount][15] = 0;
  1674.                 case 8: ACInfo[ac_i][acCheatCount][3] = 0;
  1675.                 case 9: ACInfo[ac_i][acCheatCount][17] = 0;
  1676.                 case 10: ACInfo[ac_i][acCheatCount][16] = ACInfo[ac_i][acCheatCount][20] = 0;
  1677.                 #if AC_USE_AMMUNATIONS
  1678.                     case 15: ACInfo[ac_i][acCheatCount][10] = 0;
  1679.                 #endif
  1680.                 case 17: ACInfo[ac_i][acCheatCount][7] = 0;
  1681.                 case 19: ACInfo[ac_i][acCheatCount][9] = 0;
  1682.                 case 20: ACInfo[ac_i][acCheatCount][11] = 0;
  1683.                 #if AC_USE_TUNING_GARAGES
  1684.                     case 23: ACInfo[ac_i][acCheatCount][12] = 0;
  1685.                 #endif
  1686.                 case 26: ACInfo[ac_i][acCheatCount][14] = ACInfo[ac_i][acCheatCount][8] = 0;
  1687.                 case 29: ACInfo[ac_i][acCheatCount][13] = ACInfo[ac_i][acCheatCount][6] = 0;
  1688.                 case 30: ACInfo[ac_i][acCheatCount][19] = 0;
  1689.                 case 31: ACInfo[ac_i][acCheatCount][4] = 0;
  1690.                 case 34: ACInfo[ac_i][acCheatCount][5] = 0;
  1691.                 case 38: ACInfo[ac_i][acCheatCount][0] = 0;
  1692.                 case 47: ACInfo[ac_i][acCheatCount][18] = 0;
  1693.             }
  1694.         }
  1695.         #if !defined foreach
  1696.             }
  1697.         #endif
  1698.     }
  1699.     else
  1700.     {
  1701.         #if defined foreach
  1702.             foreach(new ac_i : Player) ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code];
  1703.         #else
  1704.             #if defined GetPlayerPoolSize
  1705.                 for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1706.             #else
  1707.                 for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1708.             #endif
  1709.             {
  1710.                 if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code];
  1711.             }
  1712.         #endif
  1713.     }
  1714.     #if AC_USE_CONFIG_FILES && AUTOSAVE_SETTINGS_IN_CONFIG
  1715.         static ac_strtmp[10];
  1716.         new ac_string[415], File:ac_cfgFile;
  1717.         if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_write)))
  1718.         {
  1719.             for(new ac_i; ac_i < sizeof ac_ACAllow; ++ac_i)
  1720.             {
  1721.                 format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_ACAllow[ac_i], ac_i);
  1722.                 strcat(ac_string, ac_strtmp);
  1723.             }
  1724.             fwrite(ac_cfgFile, ac_string);
  1725.             fclose(ac_cfgFile);
  1726.         }
  1727.     #endif
  1728.     return 1;
  1729. }
  1730.  
  1731. ac_fpublic ac_EnableAntiNOP(nopcode, enable)
  1732. {
  1733.     if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0;
  1734.     ac_NOPAllow[nopcode] = !!enable;
  1735.     #if defined foreach
  1736.         foreach(new ac_i : Player) ACInfo[ac_i][acNOPAllow][nopcode] = ac_NOPAllow[nopcode];
  1737.     #else
  1738.         #if defined GetPlayerPoolSize
  1739.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1740.         #else
  1741.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1742.         #endif
  1743.         {
  1744.             if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acNOPAllow][nopcode] = ac_NOPAllow[nopcode];
  1745.         }
  1746.     #endif
  1747.     #if AC_USE_CONFIG_FILES && AUTOSAVE_SETTINGS_IN_CONFIG
  1748.         static ac_strtmp[10];
  1749.         new ac_string[87], File:ac_cfgFile;
  1750.         if((ac_cfgFile = fopen(AC_NOP_CONFIG_FILE, io_write)))
  1751.         {
  1752.             for(new ac_i; ac_i < sizeof ac_NOPAllow; ++ac_i)
  1753.             {
  1754.                 format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_NOPAllow[ac_i], ac_i);
  1755.                 strcat(ac_string, ac_strtmp);
  1756.             }
  1757.             fwrite(ac_cfgFile, ac_string);
  1758.             fclose(ac_cfgFile);
  1759.         }
  1760.     #endif
  1761.     #undef AUTOSAVE_SETTINGS_IN_CONFIG
  1762.     return 1;
  1763. }
  1764.  
  1765. ac_fpublic ac_EnableAntiCheatForPlayer(playerid, code, enable)
  1766. {
  1767.     if(!(0 <= code < sizeof ac_ACAllow)) return -1;
  1768.     ACInfo[playerid][acACAllow][code] = !!enable;
  1769.     if(enable)
  1770.     {
  1771.         switch(code)
  1772.         {
  1773.             case 7: ACInfo[playerid][acCheatCount][15] = 0;
  1774.             case 8: ACInfo[playerid][acCheatCount][3] = 0;
  1775.             case 9: ACInfo[playerid][acCheatCount][17] = 0;
  1776.             case 10: ACInfo[playerid][acCheatCount][16] = ACInfo[playerid][acCheatCount][20] = 0;
  1777.             #if AC_USE_AMMUNATIONS
  1778.                 case 15: ACInfo[playerid][acCheatCount][10] = 0;
  1779.             #endif
  1780.             case 17: ACInfo[playerid][acCheatCount][7] = 0;
  1781.             case 19: ACInfo[playerid][acCheatCount][9] = 0;
  1782.             case 20: ACInfo[playerid][acCheatCount][11] = 0;
  1783.             #if AC_USE_TUNING_GARAGES
  1784.                 case 23: ACInfo[playerid][acCheatCount][12] = 0;
  1785.             #endif
  1786.             case 26: ACInfo[playerid][acCheatCount][14] = ACInfo[playerid][acCheatCount][8] = 0;
  1787.             case 29: ACInfo[playerid][acCheatCount][13] = ACInfo[playerid][acCheatCount][6] = 0;
  1788.             case 30: ACInfo[playerid][acCheatCount][19] = 0;
  1789.             case 31: ACInfo[playerid][acCheatCount][4] = 0;
  1790.             case 34: ACInfo[playerid][acCheatCount][5] = 0;
  1791.             case 38: ACInfo[playerid][acCheatCount][0] = 0;
  1792.             case 47: ACInfo[playerid][acCheatCount][18] = 0;
  1793.         }
  1794.     }
  1795.     return 1;
  1796. }
  1797.  
  1798. ac_fpublic ac_EnableAntiNOPForPlayer(playerid, nopcode, enable)
  1799. {
  1800.     if(!(0 <= nopcode < sizeof ac_NOPAllow)) return -1;
  1801.     ACInfo[playerid][acNOPAllow][nopcode] = !!enable;
  1802.     return 1;
  1803. }
  1804.  
  1805. ac_fpublic ac_IsAntiCheatEnabled(code)
  1806. {
  1807.     if(!(0 <= code < sizeof ac_ACAllow)) return 0;
  1808.     return ac_ACAllow[code];
  1809. }
  1810.  
  1811. ac_fpublic ac_IsAntiNOPEnabled(nopcode)
  1812. {
  1813.     if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0;
  1814.     return ac_NOPAllow[nopcode];
  1815. }
  1816.  
  1817. ac_fpublic ac_IsAntiCheatEnabledForPlayer(playerid, code)
  1818. {
  1819.     if(!(0 <= code < sizeof ac_ACAllow)) return 0;
  1820.     return ACInfo[playerid][acACAllow][code];
  1821. }
  1822.  
  1823. ac_fpublic ac_IsAntiNOPEnabledForPlayer(playerid, nopcode)
  1824. {
  1825.     if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0;
  1826.     return ACInfo[playerid][acNOPAllow][nopcode];
  1827. }
  1828.  
  1829. ac_fpublic ac_AntiCheatGetSpeed(playerid) return ACInfo[playerid][acSpeed];
  1830.  
  1831. ac_fpublic ac_AntiCheatGetAnimationIndex(playerid) return ACInfo[playerid][acAnim];
  1832.  
  1833. ac_fpublic ac_AntiCheatGetDialog(playerid) return ACInfo[playerid][acDialog];
  1834.  
  1835. ac_fpublic ac_AntiCheatGetEnterVehicle(playerid) return ACInfo[playerid][acEnterVeh];
  1836.  
  1837. ac_fpublic ac_AntiCheatGetVehicleID(playerid) return ACInfo[playerid][acVeh];
  1838.  
  1839. ac_fpublic ac_AntiCheatGetWeapon(playerid) return ACInfo[playerid][acLastWeapon];
  1840.  
  1841. ac_fpublic ac_AntiCheatGetVehicleSeat(playerid) return ACInfo[playerid][acSeat];
  1842.  
  1843. ac_fpublic ac_AntiCheatGetSpecialAction(playerid) return ACInfo[playerid][acSpecAct];
  1844.  
  1845. ac_fpublic ac_AntiCheatGetLastSpecialActio(playerid) return ACInfo[playerid][acLastSpecAct];
  1846.  
  1847. ac_fpublic ac_AntiCheatGetLastShotWeapon(playerid) return ACInfo[playerid][acLastShot];
  1848.  
  1849. ac_fpublic ac_AntiCheatGetLastPickup(playerid) return ACInfo[playerid][acLastPickup];
  1850.  
  1851. ac_fpublic ac_AntiCheatGetLastUpdateTime(playerid) return ACInfo[playerid][acUpdateTick];
  1852.  
  1853. ac_fpublic ac_AntiCheatGetLastReloadTime(playerid) return ACInfo[playerid][acReloadTick];
  1854.  
  1855. ac_fpublic ac_AntiCheatGetLastEnteredVehTi(playerid) return ACInfo[playerid][acEnterVehTick];
  1856.  
  1857. ac_fpublic ac_AntiCheatGetLastShotTime(playerid) return ACInfo[playerid][acShotTick];
  1858.  
  1859. ac_fpublic ac_AntiCheatGetLastSpawnTime(playerid) return ACInfo[playerid][acSpawnTick];
  1860.  
  1861. ac_fpublic ac_AntiCheatIntEnterExitsIsEnab(playerid) return ACInfo[playerid][acIntEnterExits];
  1862.  
  1863. ac_fpublic ac_AntiCheatStuntBonusIsEnabled(playerid) return ACInfo[playerid][acStuntBonus];
  1864.  
  1865. ac_fpublic ac_AntiCheatIsInModShop(playerid) return ACInfo[playerid][acModShop];
  1866.  
  1867. ac_fpublic ac_AntiCheatIsFrozen(playerid) return !ACInfo[playerid][acUnFrozen];
  1868.  
  1869. ac_fpublic ac_AntiCheatIsDead(playerid) return ACInfo[playerid][acDead];
  1870.  
  1871. ac_fpublic ac_AntiCheatIsConnected(playerid) return ACInfo[playerid][acOnline];
  1872.  
  1873. ac_fpublic ac_AntiCheatKickWithDesync(playerid, code)
  1874. {
  1875.     if(ACInfo[playerid][acKicked] > 0) return -1;
  1876.     new ac_gpp = GetPlayerPing(playerid) + 150;
  1877.     #if defined SetPlayerTimerEx_
  1878.         ACInfo[playerid][acKickTimerID] = SetPlayerTimerEx_(playerid, "ac_KickTimer", 0, (ac_gpp > AC_MAX_PING ? AC_MAX_PING : ac_gpp), 1, "i", playerid);
  1879.     #else
  1880.         ACInfo[playerid][acKickTimerID] = SetTimerEx("ac_KickTimer", (ac_gpp > AC_MAX_PING ? AC_MAX_PING : ac_gpp), false, "i", playerid);
  1881.     #endif
  1882.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1883.     {
  1884.         if(code == 4) ACInfo[playerid][acKickVeh] = GetPlayerVehicleID(playerid);
  1885.         ACInfo[playerid][acKicked] = 2;
  1886.     }
  1887.     else ACInfo[playerid][acKicked] = 1;
  1888.     return 1;
  1889. }
  1890.  
  1891. ac_fpublic ac_AntiCheatIsKickedWithDecync(playerid) return ACInfo[playerid][acKicked];
  1892.  
  1893. ac_fpublic ac_AntiCheatGetNextDialog(playerid) return ACInfo[playerid][acNextDialog];
  1894.  
  1895. ac_fpublic ac_AntiCheatGetVehicleDriver(vehicleid) return ACVehInfo[vehicleid][acDriver];
  1896.  
  1897. ac_fpublic ac_AntiCheatGetVehicleInterior(vehicleid) return ACVehInfo[vehicleid][acInt];
  1898.  
  1899. ac_fpublic ac_AntiCheatGetVehiclePaintjob(vehicleid) return ACVehInfo[vehicleid][acPaintJob];
  1900.  
  1901. ac_fpublic ac_AntiCheatGetInterior(playerid) return ACInfo[playerid][acInt];
  1902.  
  1903. #endif
  1904.  
  1905. stock acc_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
  1906. {
  1907.     new ac_vehicleid = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
  1908.     if(ac_vehicleid != INVALID_VEHICLE_ID)
  1909.     {
  1910.         #if defined FILTERSCRIPT
  1911.             CallRemoteFunction("ac_AddStaticVehicle", "iffff", ac_vehicleid, spawn_x, spawn_y, spawn_z, z_angle);
  1912.         #else
  1913.             ac_AddStaticVehicle(ac_vehicleid, spawn_x, spawn_y, spawn_z, z_angle);
  1914.         #endif
  1915.     }
  1916.     return ac_vehicleid;
  1917. }
  1918.  
  1919. #if defined _ALS_AddStaticVehicle
  1920.     #undef AddStaticVehicle
  1921. #else
  1922.     #define _ALS_AddStaticVehicle
  1923. #endif
  1924. #define AddStaticVehicle acc_AddStaticVehicle
  1925.  
  1926. #if defined OnVehicleSirenStateChange
  1927.     stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren = 0)
  1928.     {
  1929.         new ac_vehicleid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren);
  1930. #else
  1931.     stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay)
  1932.     {
  1933.         new ac_vehicleid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay);
  1934. #endif
  1935.     if(ac_vehicleid != INVALID_VEHICLE_ID)
  1936.     {
  1937.         #if defined FILTERSCRIPT
  1938.             CallRemoteFunction("ac_AddStaticVehicle", "iffff", ac_vehicleid, spawn_x, spawn_y, spawn_z, z_angle);
  1939.         #else
  1940.             ac_AddStaticVehicle(ac_vehicleid, spawn_x, spawn_y, spawn_z, z_angle);
  1941.         #endif
  1942.     }
  1943.     return ac_vehicleid;
  1944. }
  1945.  
  1946. #if defined _ALS_AddStaticVehicleEx
  1947.     #undef AddStaticVehicleEx
  1948. #else
  1949.     #define _ALS_AddStaticVehicleEx
  1950. #endif
  1951. #define AddStaticVehicleEx acc_AddStaticVehicleEx
  1952.  
  1953. #if defined OnVehicleSirenStateChange
  1954.     stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren = 0)
  1955.     {
  1956.         new ac_vehicleid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay, addsiren);
  1957. #else
  1958.     stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay)
  1959.     {
  1960.         new ac_vehicleid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay);
  1961. #endif
  1962.     if(ac_vehicleid != INVALID_VEHICLE_ID && ac_vehicleid > 0)
  1963.     {
  1964.         #if defined FILTERSCRIPT
  1965.             CallRemoteFunction("ac_CreateVehicle", "iiffff", ac_vehicleid, vehicletype, x, y, z, rotation);
  1966.         #else
  1967.             ac_CreateVehicle(ac_vehicleid, vehicletype, x, y, z, rotation);
  1968.         #endif
  1969.     }
  1970.     return ac_vehicleid;
  1971. }
  1972.  
  1973. #if defined _ALS_CreateVehicle
  1974.     #undef CreateVehicle
  1975. #else
  1976.     #define _ALS_CreateVehicle
  1977. #endif
  1978. #define CreateVehicle acc_CreateVehicle
  1979.  
  1980. 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)
  1981. {
  1982.     new ac_classid = AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1983.     #if defined FILTERSCRIPT
  1984.         CallRemoteFunction("ac_AddPlayerClass", "ifffiiiiii", ac_classid, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1985.     #else
  1986.         ac_AddPlayerClass(ac_classid, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1987.     #endif
  1988.     return ac_classid;
  1989. }
  1990.  
  1991. #if defined _ALS_AddPlayerClass
  1992.     #undef AddPlayerClass
  1993. #else
  1994.     #define _ALS_AddPlayerClass
  1995. #endif
  1996. #define AddPlayerClass acc_AddPlayerClass
  1997.  
  1998. 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)
  1999. {
  2000.     new ac_classid = AddPlayerClassEx(teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2001.     #if defined FILTERSCRIPT
  2002.         CallRemoteFunction("ac_AddPlayerClass", "ifffiiiiii", ac_classid, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2003.     #else
  2004.         ac_AddPlayerClass(ac_classid, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2005.     #endif
  2006.     return ac_classid;
  2007. }
  2008.  
  2009. #if defined _ALS_AddPlayerClassEx
  2010.     #undef AddPlayerClassEx
  2011. #else
  2012.     #define _ALS_AddPlayerClassEx
  2013. #endif
  2014. #define AddPlayerClassEx acc_AddPlayerClassEx
  2015.  
  2016. stock orig_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  2017.     return SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2018.  
  2019. stock acc_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  2020. {
  2021.     #if defined FILTERSCRIPT
  2022.         return CallRemoteFunction("ac_SetSpawnInfo", "iiiffffiiiiii", playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2023.     #else
  2024.         return ac_SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2025.     #endif
  2026. }
  2027.  
  2028. #if defined _ALS_SetSpawnInfo
  2029.     #undef SetSpawnInfo
  2030. #else
  2031.     #define _ALS_SetSpawnInfo
  2032. #endif
  2033. #define SetSpawnInfo acc_SetSpawnInfo
  2034.  
  2035. stock acc_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)
  2036. {
  2037.     new ac_pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
  2038.     if(ac_pickupid != -1)
  2039.     {
  2040.         #if defined FILTERSCRIPT
  2041.             return CallRemoteFunction("ac_AddStaticPickup", "iiifff", ac_pickupid, model, type, X, Y, Z);
  2042.         #else
  2043.             return ac_AddStaticPickup(ac_pickupid, model, type, X, Y, Z);
  2044.         #endif
  2045.     }
  2046.     return 0;
  2047. }
  2048.  
  2049. #if defined _ALS_AddStaticPickup
  2050.     #undef AddStaticPickup
  2051. #else
  2052.     #define _ALS_AddStaticPickup
  2053. #endif
  2054. #define AddStaticPickup acc_AddStaticPickup
  2055.  
  2056. stock acc_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)
  2057. {
  2058.     new ac_pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
  2059.     if(ac_pickupid != -1)
  2060.     {
  2061.         #if defined FILTERSCRIPT
  2062.             CallRemoteFunction("ac_CreatePickup", "iiifff", ac_pickupid, model, type, X, Y, Z);
  2063.         #else
  2064.             ac_CreatePickup(ac_pickupid, model, type, X, Y, Z);
  2065.         #endif
  2066.     }
  2067.     return ac_pickupid;
  2068. }
  2069.  
  2070. #if defined _ALS_CreatePickup
  2071.     #undef CreatePickup
  2072. #else
  2073.     #define _ALS_CreatePickup
  2074. #endif
  2075. #define CreatePickup acc_CreatePickup
  2076.  
  2077. #if defined CreateDynamicPickup
  2078.     #if defined STREAMER_ENABLE_TAGS
  2079.         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)
  2080.         {
  2081.             new STREAMER_TAG_PICKUP:ac_pickupid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
  2082.     #else
  2083.         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)
  2084.         {
  2085.             new ac_pickupid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
  2086.     #endif
  2087.         if(_:ac_pickupid > 0)
  2088.         {
  2089.             #if defined FILTERSCRIPT
  2090.                 CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickupid, modelid, type);
  2091.             #elseif AC_USE_PICKUP_WEAPONS
  2092.                 ac_CreateDynamicPickup(ac_pickupid, modelid, type);
  2093.             #endif
  2094.         }
  2095.         return ac_pickupid;
  2096.     }
  2097.  
  2098.     #if defined _ALS_CreateDynamicPickup
  2099.         #undef CreateDynamicPickup
  2100.     #else
  2101.         #define _ALS_CreateDynamicPickup
  2102.     #endif
  2103.     #define CreateDynamicPickup acc_CreateDynamicPickup
  2104. #endif
  2105.  
  2106. #if defined CreateDynamicPickupEx
  2107.     #if defined STREAMER_ENABLE_TAGS
  2108.         stock STREAMER_TAG_PICKUP:acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 200.0, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
  2109.         {
  2110.             new STREAMER_TAG_PICKUP:ac_pickupid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
  2111.     #else
  2112.             stock acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 200.0, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const areas[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
  2113.         {
  2114.             new ac_pickupid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
  2115.     #endif
  2116.         if(_:ac_pickupid > 0)
  2117.         {
  2118.             #if defined FILTERSCRIPT
  2119.                 CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickupid, modelid, type);
  2120.             #elseif AC_USE_PICKUP_WEAPONS
  2121.                 ac_CreateDynamicPickup(ac_pickupid, modelid, type);
  2122.             #endif
  2123.         }
  2124.         return ac_pickupid;
  2125.     }
  2126.  
  2127.     #if defined _ALS_CreateDynamicPickupEx
  2128.         #undef CreateDynamicPickupEx
  2129.     #else
  2130.         #define _ALS_CreateDynamicPickupEx
  2131.     #endif
  2132.     #define CreateDynamicPickupEx acc_CreateDynamicPickupEx
  2133. #endif
  2134.  
  2135. stock acc_DestroyVehicle(vehicleid)
  2136. {
  2137.     #if defined FILTERSCRIPT
  2138.         return CallRemoteFunction("ac_DestroyVehicle", "i", vehicleid);
  2139.     #else
  2140.         return ac_DestroyVehicle(vehicleid);
  2141.     #endif
  2142. }
  2143.  
  2144. #if defined _ALS_DestroyVehicle
  2145.     #undef DestroyVehicle
  2146. #else
  2147.     #define _ALS_DestroyVehicle
  2148. #endif
  2149. #define DestroyVehicle acc_DestroyVehicle
  2150.  
  2151. stock acc_DestroyPickup(pickup)
  2152. {
  2153.     #if defined FILTERSCRIPT
  2154.         return CallRemoteFunction("ac_DestroyPickup", "i", pickup);
  2155.     #else
  2156.         return ac_DestroyPickup(pickup);
  2157.     #endif
  2158. }
  2159.  
  2160. #if defined _ALS_DestroyPickup
  2161.     #undef DestroyPickup
  2162. #else
  2163.     #define _ALS_DestroyPickup
  2164. #endif
  2165. #define DestroyPickup acc_DestroyPickup
  2166.  
  2167. stock acc_DisableInteriorEnterExits()
  2168. {
  2169.     #if defined FILTERSCRIPT
  2170.         return CallRemoteFunction("ac_DisableInteriorEnterExits", "");
  2171.     #else
  2172.         return ac_DisableInteriorEnterExits();
  2173.     #endif
  2174. }
  2175.  
  2176. #if defined _ALS_DisableInteriorEnterExits
  2177.     #undef DisableInteriorEnterExits
  2178. #else
  2179.     #define _ALS_DisableInteriorEnterExits
  2180. #endif
  2181. #define DisableInteriorEnterExits acc_DisableInteriorEnterExits
  2182.  
  2183. stock acc_UsePlayerPedAnims()
  2184. {
  2185.     #if defined FILTERSCRIPT
  2186.         return CallRemoteFunction("ac_UsePlayerPedAnims", "");
  2187.     #else
  2188.         return ac_UsePlayerPedAnims();
  2189.     #endif
  2190. }
  2191.  
  2192. #if defined _ALS_UsePlayerPedAnims
  2193.     #undef UsePlayerPedAnims
  2194. #else
  2195.     #define _ALS_UsePlayerPedAnims
  2196. #endif
  2197. #define UsePlayerPedAnims acc_UsePlayerPedAnims
  2198.  
  2199. #if defined EnableVehicleFriendlyFire
  2200.     stock acc_EnableVehicleFriendlyFire()
  2201.     {
  2202.         #if defined FILTERSCRIPT
  2203.             return CallRemoteFunction("ac_EnableVehicleFriendlyFire", "");
  2204.         #else
  2205.             return ac_EnableVehicleFriendlyFire();
  2206.         #endif
  2207.     }
  2208.  
  2209.     #if defined _ALS_EnableVehicleFriendlyFire
  2210.         #undef EnableVehicleFriendlyFire
  2211.     #else
  2212.         #define _ALS_EnableVehicleFriendlyFire
  2213.     #endif
  2214.     #define EnableVehicleFriendlyFire acc_EnableVehicleFriendlyFire
  2215. #endif
  2216.  
  2217. stock acc_EnableStuntBonusForAll(enable)
  2218. {
  2219.     #if defined FILTERSCRIPT
  2220.         return CallRemoteFunction("ac_EnableStuntBonusForAll", "i", enable);
  2221.     #else
  2222.         return ac_EnableStuntBonusForAll(enable);
  2223.     #endif
  2224. }
  2225.  
  2226. #if defined _ALS_EnableStuntBonusForAll
  2227.     #undef EnableStuntBonusForAll
  2228. #else
  2229.     #define _ALS_EnableStuntBonusForAll
  2230. #endif
  2231. #define EnableStuntBonusForAll acc_EnableStuntBonusForAll
  2232.  
  2233. stock acc_EnableStuntBonusForPlayer(playerid, enable)
  2234. {
  2235.     #if defined FILTERSCRIPT
  2236.         return CallRemoteFunction("ac_EnableStuntBonusForPlayer", "ii", playerid, enable);
  2237.     #else
  2238.         return ac_EnableStuntBonusForPlayer(playerid, enable);
  2239.     #endif
  2240. }
  2241.  
  2242. #if defined _ALS_EnableStuntBonusForPlayer
  2243.     #undef EnableStuntBonusForPlayer
  2244. #else
  2245.     #define _ALS_EnableStuntBonusForPlayer
  2246. #endif
  2247. #define EnableStuntBonusForPlayer acc_EnableStuntBonusForPlayer
  2248.  
  2249. #if defined _inc_y_dialog || defined _INC_y_dialog
  2250.     stock ac_Dialog_Show(playerid, style, string:title[], string:caption[], string:button1[], string:button2[] = "", dialog = -1)
  2251.     {
  2252.         if(!(0 <= playerid < MAX_PLAYERS))
  2253.         {
  2254.             #if defined FILTERSCRIPT
  2255.                 CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialog);
  2256.             #else
  2257.                 ac_ShowPlayerDialog(playerid, dialog);
  2258.             #endif
  2259.         }
  2260.         return Dialog_Show(playerid, style, title, caption, button1, button2, dialog);
  2261.     }
  2262.  
  2263.     #if defined _ALS_Dialog_Show
  2264.         #undef Dialog_Show
  2265.     #else
  2266.         #define _ALS_Dialog_Show
  2267.     #endif
  2268.     #define Dialog_Show ac_Dialog_Show
  2269. #endif
  2270.  
  2271. stock orig_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]) return ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);
  2272.  
  2273. stock acc_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
  2274. {
  2275.     if(ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2))
  2276.     {
  2277.         #if defined FILTERSCRIPT
  2278.             return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
  2279.         #else
  2280.             return ac_ShowPlayerDialog(playerid, dialogid);
  2281.         #endif
  2282.     }
  2283.     return 0;
  2284. }
  2285.  
  2286. #if defined _ALS_ShowPlayerDialog
  2287.     #undef ShowPlayerDialog
  2288. #else
  2289.     #define _ALS_ShowPlayerDialog
  2290. #endif
  2291. #define ShowPlayerDialog acc_ShowPlayerDialog
  2292.  
  2293. stock orig_TogglePlayerControllable(playerid, toggle) return TogglePlayerControllable(playerid, toggle);
  2294.  
  2295. stock acc_TogglePlayerControllable(playerid, toggle)
  2296. {
  2297.     #if defined FILTERSCRIPT
  2298.         return CallRemoteFunction("ac_TogglePlayerControllable", "ii", playerid, toggle);
  2299.     #else
  2300.         return ac_TogglePlayerControllable(playerid, toggle);
  2301.     #endif
  2302. }
  2303.  
  2304. #if defined _ALS_TogglePlayerControllable
  2305.     #undef TogglePlayerControllable
  2306. #else
  2307.     #define _ALS_TogglePlayerControllable
  2308. #endif
  2309. #define TogglePlayerControllable acc_TogglePlayerControllable
  2310.  
  2311. stock orig_TogglePlayerSpectating(playerid, toggle) return TogglePlayerSpectating(playerid, toggle);
  2312.  
  2313. stock acc_TogglePlayerSpectating(playerid, toggle)
  2314. {
  2315.     #if defined FILTERSCRIPT
  2316.         return CallRemoteFunction("ac_TogglePlayerSpectating", "ii", playerid, toggle);
  2317.     #else
  2318.         return ac_TogglePlayerSpectating(playerid, toggle);
  2319.     #endif
  2320. }
  2321.  
  2322. #if defined _ALS_TogglePlayerSpectating
  2323.     #undef TogglePlayerSpectating
  2324. #else
  2325.     #define _ALS_TogglePlayerSpectating
  2326. #endif
  2327. #define TogglePlayerSpectating acc_TogglePlayerSpectating
  2328.  
  2329. stock orig_SpawnPlayer(playerid) return SpawnPlayer(playerid);
  2330.  
  2331. stock acc_SpawnPlayer(playerid)
  2332. {
  2333.     #if defined FILTERSCRIPT
  2334.         return CallRemoteFunction("ac_SpawnPlayer", "i", playerid);
  2335.     #else
  2336.         return ac_SpawnPlayer(playerid);
  2337.     #endif
  2338. }
  2339.  
  2340. #if defined _ALS_SpawnPlayer
  2341.     #undef SpawnPlayer
  2342. #else
  2343.     #define _ALS_SpawnPlayer
  2344. #endif
  2345. #define SpawnPlayer acc_SpawnPlayer
  2346.  
  2347. stock orig_SetPlayerHealth(playerid, Float:health) return SetPlayerHealth(playerid, health);
  2348.  
  2349. stock acc_SetPlayerHealth(playerid, Float:health)
  2350. {
  2351.     #if defined FILTERSCRIPT
  2352.         return CallRemoteFunction("ac_SetPlayerHealth", "if", playerid, health);
  2353.     #else
  2354.         return ac_SetPlayerHealth(playerid, health);
  2355.     #endif
  2356. }
  2357.  
  2358. #if defined _ALS_SetPlayerHealth
  2359.     #undef SetPlayerHealth
  2360. #else
  2361.     #define _ALS_SetPlayerHealth
  2362. #endif
  2363. #define SetPlayerHealth acc_SetPlayerHealth
  2364.  
  2365. stock orig_SetPlayerArmour(playerid, Float:armour) return SetPlayerArmour(playerid, armour);
  2366.  
  2367. stock acc_SetPlayerArmour(playerid, Float:armour)
  2368. {
  2369.     #if defined FILTERSCRIPT
  2370.         return CallRemoteFunction("ac_SetPlayerArmour", "if", playerid, armour);
  2371.     #else
  2372.         return ac_SetPlayerArmour(playerid, armour);
  2373.     #endif
  2374. }
  2375.  
  2376. #if defined _ALS_SetPlayerArmour
  2377.     #undef SetPlayerArmour
  2378. #else
  2379.     #define _ALS_SetPlayerArmour
  2380. #endif
  2381. #define SetPlayerArmour acc_SetPlayerArmour
  2382.  
  2383. stock orig_GivePlayerWeapon(playerid, weaponid, ammo) return GivePlayerWeapon(playerid, weaponid, ammo);
  2384.  
  2385. stock acc_GivePlayerWeapon(playerid, weaponid, ammo)
  2386. {
  2387.     if(!(0 <= playerid < MAX_PLAYERS)) return 0;
  2388.     #if defined FILTERSCRIPT
  2389.         return CallRemoteFunction("ac_GivePlayerWeapon", "iid", playerid, weaponid, ammo);
  2390.     #else
  2391.         return ac_GivePlayerWeapon(playerid, weaponid, ammo);
  2392.     #endif
  2393. }
  2394.  
  2395. #if defined _ALS_GivePlayerWeapon
  2396.     #undef GivePlayerWeapon
  2397. #else
  2398.     #define _ALS_GivePlayerWeapon
  2399. #endif
  2400. #define GivePlayerWeapon acc_GivePlayerWeapon
  2401.  
  2402. stock orig_SetPlayerAmmo(playerid, weaponslot, ammo) return SetPlayerAmmo(playerid, weaponslot, ammo);
  2403.  
  2404. stock acc_SetPlayerAmmo(playerid, weaponslot, ammo)
  2405. {
  2406.     if(!(0 <= playerid < MAX_PLAYERS)) return 0;
  2407.     #if defined FILTERSCRIPT
  2408.         return CallRemoteFunction("ac_SetPlayerAmmo", "iid", playerid, weaponslot, ammo);
  2409.     #else
  2410.         return ac_SetPlayerAmmo(playerid, weaponslot, ammo);
  2411.     #endif
  2412. }
  2413.  
  2414. #if defined _ALS_SetPlayerAmmo
  2415.     #undef SetPlayerAmmo
  2416. #else
  2417.     #define _ALS_SetPlayerAmmo
  2418. #endif
  2419. #define SetPlayerAmmo acc_SetPlayerAmmo
  2420.  
  2421. stock orig_SetPlayerArmedWeapon(playerid, weaponid) return SetPlayerArmedWeapon(playerid, weaponid);
  2422.  
  2423. stock acc_SetPlayerArmedWeapon(playerid, weaponid)
  2424. {
  2425.     #if defined FILTERSCRIPT
  2426.         return CallRemoteFunction("ac_SetPlayerArmedWeapon", "ii", playerid, weaponid);
  2427.     #else
  2428.         return ac_SetPlayerArmedWeapon(playerid, weaponid);
  2429.     #endif
  2430. }
  2431.  
  2432. #if defined _ALS_SetPlayerArmedWeapon
  2433.     #undef SetPlayerArmedWeapon
  2434. #else
  2435.     #define _ALS_SetPlayerArmedWeapon
  2436. #endif
  2437. #define SetPlayerArmedWeapon acc_SetPlayerArmedWeapon
  2438.  
  2439. stock orig_ResetPlayerWeapons(playerid) return ResetPlayerWeapons(playerid);
  2440.  
  2441. stock acc_ResetPlayerWeapons(playerid)
  2442. {
  2443.     #if defined FILTERSCRIPT
  2444.         return CallRemoteFunction("ac_ResetPlayerWeapons", "i", playerid);
  2445.     #else
  2446.         return ac_ResetPlayerWeapons(playerid);
  2447.     #endif
  2448. }
  2449.  
  2450. #if defined _ALS_ResetPlayerWeapons
  2451.     #undef ResetPlayerWeapons
  2452. #else
  2453.     #define _ALS_ResetPlayerWeapons
  2454. #endif
  2455. #define ResetPlayerWeapons acc_ResetPlayerWeapons
  2456.  
  2457. stock orig_GivePlayerMoney(playerid, money) return GivePlayerMoney(playerid, money);
  2458.  
  2459. stock acc_GivePlayerMoney(playerid, money)
  2460. {
  2461.     #if defined FILTERSCRIPT
  2462.         return CallRemoteFunction("ac_GivePlayerMoney", "id", playerid, money);
  2463.     #else
  2464.         return ac_GivePlayerMoney(playerid, money);
  2465.     #endif
  2466. }
  2467.  
  2468. #if defined _ALS_GivePlayerMoney
  2469.     #undef GivePlayerMoney
  2470. #else
  2471.     #define _ALS_GivePlayerMoney
  2472. #endif
  2473. #define GivePlayerMoney acc_GivePlayerMoney
  2474.  
  2475. stock orig_ResetPlayerMoney(playerid) return ResetPlayerMoney(playerid);
  2476.  
  2477. stock acc_ResetPlayerMoney(playerid)
  2478. {
  2479.     #if defined FILTERSCRIPT
  2480.         return CallRemoteFunction("ac_ResetPlayerMoney", "i", playerid);
  2481.     #else
  2482.         return ac_ResetPlayerMoney(playerid);
  2483.     #endif
  2484. }
  2485.  
  2486. #if defined _ALS_ResetPlayerMoney
  2487.     #undef ResetPlayerMoney
  2488. #else
  2489.     #define _ALS_ResetPlayerMoney
  2490. #endif
  2491. #define ResetPlayerMoney acc_ResetPlayerMoney
  2492.  
  2493. stock orig_GetPlayerMoney(playerid) return GetPlayerMoney(playerid);
  2494.  
  2495. stock acc_GetPlayerMoney(playerid)
  2496. {
  2497.     if(!IsPlayerConnected(playerid)) return 0;
  2498.     #if defined FILTERSCRIPT
  2499.         return CallRemoteFunction("ac_GetPlayerMoney", "i", playerid);
  2500.     #else
  2501.         return ac_GetPlayerMoney(playerid);
  2502.     #endif
  2503. }
  2504.  
  2505. #if defined _ALS_GetPlayerMoney
  2506.     #undef GetPlayerMoney
  2507. #else
  2508.     #define _ALS_GetPlayerMoney
  2509. #endif
  2510. #define GetPlayerMoney acc_GetPlayerMoney
  2511.  
  2512. stock orig_SetPlayerSpecialAction(playerid, actionid) return SetPlayerSpecialAction(playerid, actionid);
  2513.  
  2514. stock acc_SetPlayerSpecialAction(playerid, actionid)
  2515. {
  2516.     #if defined FILTERSCRIPT
  2517.         return CallRemoteFunction("ac_SetPlayerSpecialAction", "ii", playerid, actionid);
  2518.     #else
  2519.         return ac_SetPlayerSpecialAction(playerid, actionid);
  2520.     #endif
  2521. }
  2522.  
  2523. #if defined _ALS_SetPlayerSpecialAction
  2524.     #undef SetPlayerSpecialAction
  2525. #else
  2526.     #define _ALS_SetPlayerSpecialAction
  2527. #endif
  2528. #define SetPlayerSpecialAction acc_SetPlayerSpecialAction
  2529.  
  2530. stock orig_SetPlayerInterior(playerid, interiorid) return SetPlayerInterior(playerid, interiorid);
  2531.  
  2532. stock acc_SetPlayerInterior(playerid, interiorid)
  2533. {
  2534.     #if defined FILTERSCRIPT
  2535.         return CallRemoteFunction("ac_SetPlayerInterior", "ii", playerid, interiorid);
  2536.     #else
  2537.         return ac_SetPlayerInterior(playerid, interiorid);
  2538.     #endif
  2539. }
  2540.  
  2541. #if defined _ALS_SetPlayerInterior
  2542.     #undef SetPlayerInterior
  2543. #else
  2544.     #define _ALS_SetPlayerInterior
  2545. #endif
  2546. #define SetPlayerInterior acc_SetPlayerInterior
  2547.  
  2548. stock orig_SetPlayerPos(playerid, Float:x, Float:y, Float:z) return SetPlayerPos(playerid, x, y, z);
  2549.  
  2550. stock acc_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
  2551. {
  2552.     #if defined FILTERSCRIPT
  2553.         return CallRemoteFunction("ac_SetPlayerPos", "ifff", playerid, x, y, z);
  2554.     #else
  2555.         return ac_SetPlayerPos(playerid, x, y, z);
  2556.     #endif
  2557. }
  2558.  
  2559. #if defined _ALS_SetPlayerPos
  2560.     #undef SetPlayerPos
  2561. #else
  2562.     #define _ALS_SetPlayerPos
  2563. #endif
  2564. #define SetPlayerPos acc_SetPlayerPos
  2565.  
  2566. stock orig_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z) return SetPlayerPosFindZ(playerid, x, y, z);
  2567.  
  2568. stock acc_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z)
  2569. {
  2570.     #if defined FILTERSCRIPT
  2571.         return CallRemoteFunction("ac_SetPlayerPosFindZ", "ifff", playerid, x, y, z);
  2572.     #else
  2573.         return ac_SetPlayerPosFindZ(playerid, x, y, z);
  2574.     #endif
  2575. }
  2576.  
  2577. #if defined _ALS_SetPlayerPosFindZ
  2578.     #undef SetPlayerPosFindZ
  2579. #else
  2580.     #define _ALS_SetPlayerPosFindZ
  2581. #endif
  2582. #define SetPlayerPosFindZ acc_SetPlayerPosFindZ
  2583.  
  2584. stock orig_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z) return SetPlayerVelocity(playerid, X, Y, Z);
  2585.  
  2586. stock acc_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z)
  2587. {
  2588.     #if defined FILTERSCRIPT
  2589.         return CallRemoteFunction("ac_SetPlayerVelocity", "ifff", playerid, X, Y, Z);
  2590.     #else
  2591.         return ac_SetPlayerVelocity(playerid, X, Y, Z);
  2592.     #endif
  2593. }
  2594.  
  2595. #if defined _ALS_SetPlayerVelocity
  2596.     #undef SetPlayerVelocity
  2597. #else
  2598.     #define _ALS_SetPlayerVelocity
  2599. #endif
  2600. #define SetPlayerVelocity acc_SetPlayerVelocity
  2601.  
  2602. stock orig_PutPlayerInVehicle(playerid, vehicleid, seatid) return PutPlayerInVehicle(playerid, vehicleid, seatid);
  2603.  
  2604. stock acc_PutPlayerInVehicle(playerid, vehicleid, seatid)
  2605. {
  2606.     #if defined FILTERSCRIPT
  2607.         return CallRemoteFunction("ac_PutPlayerInVehicle", "iii", playerid, vehicleid, seatid);
  2608.     #else
  2609.         return ac_PutPlayerInVehicle(playerid, vehicleid, seatid);
  2610.     #endif
  2611. }
  2612.  
  2613. #if defined _ALS_PutPlayerInVehicle
  2614.     #undef PutPlayerInVehicle
  2615. #else
  2616.     #define _ALS_PutPlayerInVehicle
  2617. #endif
  2618. #define PutPlayerInVehicle acc_PutPlayerInVehicle
  2619.  
  2620. stock orig_RemovePlayerFromVehicle(playerid) return RemovePlayerFromVehicle(playerid);
  2621.  
  2622. stock acc_RemovePlayerFromVehicle(playerid)
  2623. {
  2624.     #if defined FILTERSCRIPT
  2625.         return CallRemoteFunction("ac_RemovePlayerFromVehicle", "i", playerid);
  2626.     #else
  2627.         return ac_RemovePlayerFromVehicle(playerid);
  2628.     #endif
  2629. }
  2630.  
  2631. #if defined _ALS_RemovePlayerFromVehicle
  2632.     #undef RemovePlayerFromVehicle
  2633. #else
  2634.     #define _ALS_RemovePlayerFromVehicle
  2635. #endif
  2636. #define RemovePlayerFromVehicle acc_RemovePlayerFromVehicle
  2637.  
  2638. stock orig_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z) return SetVehiclePos(vehicleid, x, y, z);
  2639.  
  2640. stock acc_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z)
  2641. {
  2642.     #if defined FILTERSCRIPT
  2643.         return CallRemoteFunction("ac_SetVehiclePos", "ifff", vehicleid, x, y, z);
  2644.     #else
  2645.         return ac_SetVehiclePos(vehicleid, x, y, z);
  2646.     #endif
  2647. }
  2648.  
  2649. #if defined _ALS_SetVehiclePos
  2650.     #undef SetVehiclePos
  2651. #else
  2652.     #define _ALS_SetVehiclePos
  2653. #endif
  2654. #define SetVehiclePos acc_SetVehiclePos
  2655.  
  2656. stock orig_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z) return SetVehicleVelocity(vehicleid, X, Y, Z);
  2657.  
  2658. stock acc_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  2659. {
  2660.     #if defined FILTERSCRIPT
  2661.         return CallRemoteFunction("ac_SetVehicleVelocity", "ifff", vehicleid, X, Y, Z);
  2662.     #else
  2663.         return ac_SetVehicleVelocity(vehicleid, X, Y, Z);
  2664.     #endif
  2665. }
  2666.  
  2667. #if defined _ALS_SetVehicleVelocity
  2668.     #undef SetVehicleVelocity
  2669. #else
  2670.     #define _ALS_SetVehicleVelocity
  2671. #endif
  2672. #define SetVehicleVelocity acc_SetVehicleVelocity
  2673.  
  2674. stock orig_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z) return SetVehicleAngularVelocity(vehicleid, X, Y, Z);
  2675.  
  2676. stock acc_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  2677. {
  2678.     #if defined FILTERSCRIPT
  2679.         return CallRemoteFunction("ac_SetVehicleAngularVelocity", "ifff", vehicleid, X, Y, Z);
  2680.     #else
  2681.         return ac_SetVehicleAngularVelocity(vehicleid, X, Y, Z);
  2682.     #endif
  2683. }
  2684.  
  2685. #if defined _ALS_SetVehicleAngularVelocity
  2686.     #undef SetVehicleAngularVelocity
  2687. #else
  2688.     #define _ALS_SetVehicleAngularVelocity
  2689. #endif
  2690. #define SetVehicleAngularVelocity acc_SetVehicleAngularVelocity
  2691.  
  2692. stock orig_LinkVehicleToInterior(vehicleid, interiorid) return LinkVehicleToInterior(vehicleid, interiorid);
  2693.  
  2694. stock acc_LinkVehicleToInterior(vehicleid, interiorid)
  2695. {
  2696.     #if defined FILTERSCRIPT
  2697.         return CallRemoteFunction("ac_LinkVehicleToInterior", "ii", vehicleid, interiorid);
  2698.     #else
  2699.         return ac_LinkVehicleToInterior(vehicleid, interiorid);
  2700.     #endif
  2701. }
  2702.  
  2703. #if defined _ALS_LinkVehicleToInterior
  2704.     #undef LinkVehicleToInterior
  2705. #else
  2706.     #define _ALS_LinkVehicleToInterior
  2707. #endif
  2708. #define LinkVehicleToInterior acc_LinkVehicleToInterior
  2709.  
  2710. stock orig_ChangeVehiclePaintjob(vehicleid, paintjobid) return ChangeVehiclePaintjob(vehicleid, paintjobid);
  2711.  
  2712. stock acc_ChangeVehiclePaintjob(vehicleid, paintjobid)
  2713. {
  2714.     if(GetVehicleModel(vehicleid) <= 0) return 1;
  2715.     #if defined FILTERSCRIPT
  2716.         return CallRemoteFunction("ac_ChangeVehiclePaintjob", "ii", vehicleid, paintjobid);
  2717.     #else
  2718.         return ac_ChangeVehiclePaintjob(vehicleid, paintjobid);
  2719.     #endif
  2720. }
  2721.  
  2722. #if defined _ALS_ChangeVehiclePaintjob
  2723.     #undef ChangeVehiclePaintjob
  2724. #else
  2725.     #define _ALS_ChangeVehiclePaintjob
  2726. #endif
  2727. #define ChangeVehiclePaintjob acc_ChangeVehiclePaintjob
  2728.  
  2729. stock orig_SetVehicleHealth(vehicleid, Float:health) return SetVehicleHealth(vehicleid, health);
  2730.  
  2731. stock acc_SetVehicleHealth(vehicleid, Float:health)
  2732. {
  2733.     if(health < 0.0) health = 0.0;
  2734.     #if defined FILTERSCRIPT
  2735.         return CallRemoteFunction("ac_SetVehicleHealth", "if", vehicleid, health);
  2736.     #else
  2737.         return ac_SetVehicleHealth(vehicleid, health);
  2738.     #endif
  2739. }
  2740.  
  2741. #if defined _ALS_SetVehicleHealth
  2742.     #undef SetVehicleHealth
  2743. #else
  2744.     #define _ALS_SetVehicleHealth
  2745. #endif
  2746. #define SetVehicleHealth acc_SetVehicleHealth
  2747.  
  2748. stock orig_RepairVehicle(vehicleid) return RepairVehicle(vehicleid);
  2749.  
  2750. stock acc_RepairVehicle(vehicleid)
  2751. {
  2752.     #if defined FILTERSCRIPT
  2753.         return CallRemoteFunction("ac_RepairVehicle", "i", vehicleid);
  2754.     #else
  2755.         return ac_RepairVehicle(vehicleid);
  2756.     #endif
  2757. }
  2758.  
  2759. #if defined _ALS_RepairVehicle
  2760.     #undef RepairVehicle
  2761. #else
  2762.     #define _ALS_RepairVehicle
  2763. #endif
  2764. #define RepairVehicle acc_RepairVehicle
  2765.  
  2766. stock orig_SetVehicleToRespawn(vehicleid) return SetVehicleToRespawn(vehicleid);
  2767.  
  2768. stock acc_SetVehicleToRespawn(vehicleid)
  2769. {
  2770.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  2771.     #if defined FILTERSCRIPT
  2772.         return CallRemoteFunction("ac_SetVehicleToRespawn", "i", vehicleid);
  2773.     #else
  2774.         return ac_SetVehicleToRespawn(vehicleid);
  2775.     #endif
  2776. }
  2777.  
  2778. #if defined _ALS_SetVehicleToRespawn
  2779.     #undef SetVehicleToRespawn
  2780. #else
  2781.     #define _ALS_SetVehicleToRespawn
  2782. #endif
  2783. #define SetVehicleToRespawn acc_SetVehicleToRespawn
  2784.  
  2785. stock EnableAntiCheat(code, enable)
  2786. {
  2787.     #if defined FILTERSCRIPT
  2788.         return CallRemoteFunction("ac_EnableAntiCheat", "ii", code, enable);
  2789.     #else
  2790.         return ac_EnableAntiCheat(code, enable);
  2791.     #endif
  2792. }
  2793.  
  2794. stock EnableAntiNOP(nopcode, enable)
  2795. {
  2796.     #if defined FILTERSCRIPT
  2797.         return CallRemoteFunction("ac_EnableAntiNOP", "ii", nopcode, enable);
  2798.     #else
  2799.         return ac_EnableAntiNOP(nopcode, enable);
  2800.     #endif
  2801. }
  2802.  
  2803. stock EnableAntiCheatForPlayer(playerid, code, enable)
  2804. {
  2805.     if(!IsPlayerConnected(playerid)) return 0;
  2806.     #if defined FILTERSCRIPT
  2807.         return CallRemoteFunction("ac_EnableAntiCheatForPlayer", "iii", playerid, code, enable);
  2808.     #else
  2809.         return ac_EnableAntiCheatForPlayer(playerid, code, enable);
  2810.     #endif
  2811. }
  2812.  
  2813. stock EnableAntiNOPForPlayer(playerid, nopcode, enable)
  2814. {
  2815.     if(!IsPlayerConnected(playerid)) return 0;
  2816.     #if defined FILTERSCRIPT
  2817.         return CallRemoteFunction("ac_EnableAntiNOPForPlayer", "iii", playerid, nopcode, enable);
  2818.     #else
  2819.         return ac_EnableAntiNOPForPlayer(playerid, nopcode, enable);
  2820.     #endif
  2821. }
  2822.  
  2823. stock IsAntiCheatEnabled(code)
  2824. {
  2825.     #if defined FILTERSCRIPT
  2826.         return CallRemoteFunction("ac_IsAntiCheatEnabled", "i", code);
  2827.     #else
  2828.         return ac_IsAntiCheatEnabled(code);
  2829.     #endif
  2830. }
  2831.  
  2832. stock IsAntiNOPEnabled(nopcode)
  2833. {
  2834.     #if defined FILTERSCRIPT
  2835.         return CallRemoteFunction("ac_IsAntiNOPEnabled", "i", nopcode);
  2836.     #else
  2837.         return ac_IsAntiNOPEnabled(nopcode);
  2838.     #endif
  2839. }
  2840.  
  2841. stock IsAntiCheatEnabledForPlayer(playerid, code)
  2842. {
  2843.     if(!IsPlayerConnected(playerid)) return 0;
  2844.     #if defined FILTERSCRIPT
  2845.         return CallRemoteFunction("ac_IsAntiCheatEnabledForPlayer", "ii", playerid, code);
  2846.     #else
  2847.         return ac_IsAntiCheatEnabledForPlayer(playerid, code);
  2848.     #endif
  2849. }
  2850.  
  2851. stock IsAntiNOPEnabledForPlayer(playerid, nopcode)
  2852. {
  2853.     if(!IsPlayerConnected(playerid)) return 0;
  2854.     #if defined FILTERSCRIPT
  2855.         return CallRemoteFunction("ac_IsAntiNOPEnabledForPlayer", "ii", playerid, nopcode);
  2856.     #else
  2857.         return ac_IsAntiNOPEnabledForPlayer(playerid, nopcode);
  2858.     #endif
  2859. }
  2860.  
  2861. stock AntiCheatGetSpeed(playerid)
  2862. {
  2863.     if(!IsPlayerConnected(playerid)) return 0;
  2864.     #if defined FILTERSCRIPT
  2865.         return CallRemoteFunction("ac_AntiCheatGetSpeed", "i", playerid);
  2866.     #else
  2867.         return ac_AntiCheatGetSpeed(playerid);
  2868.     #endif
  2869. }
  2870.  
  2871. stock AntiCheatGetAnimationIndex(playerid)
  2872. {
  2873.     if(!IsPlayerConnected(playerid)) return 0;
  2874.     #if defined FILTERSCRIPT
  2875.         return CallRemoteFunction("ac_AntiCheatGetAnimationIndex", "i", playerid);
  2876.     #else
  2877.         return ac_AntiCheatGetAnimationIndex(playerid);
  2878.     #endif
  2879. }
  2880.  
  2881. stock AntiCheatGetDialog(playerid)
  2882. {
  2883.     if(!IsPlayerConnected(playerid)) return -1;
  2884.     #if defined FILTERSCRIPT
  2885.         return CallRemoteFunction("ac_AntiCheatGetDialog", "i", playerid);
  2886.     #else
  2887.         return ac_AntiCheatGetDialog(playerid);
  2888.     #endif
  2889. }
  2890.  
  2891. stock AntiCheatGetEnterVehicle(playerid)
  2892. {
  2893.     if(!IsPlayerConnected(playerid)) return 0;
  2894.     #if defined FILTERSCRIPT
  2895.         return CallRemoteFunction("ac_AntiCheatGetEnterVehicle", "i", playerid);
  2896.     #else
  2897.         return ac_AntiCheatGetEnterVehicle(playerid);
  2898.     #endif
  2899. }
  2900.  
  2901. stock AntiCheatGetVehicleID(playerid)
  2902. {
  2903.     if(!IsPlayerConnected(playerid)) return 0;
  2904.     #if defined FILTERSCRIPT
  2905.         return CallRemoteFunction("ac_AntiCheatGetVehicleID", "i", playerid);
  2906.     #else
  2907.         return ac_AntiCheatGetVehicleID(playerid);
  2908.     #endif
  2909. }
  2910.  
  2911. stock AntiCheatGetWeapon(playerid)
  2912. {
  2913.     if(!IsPlayerConnected(playerid)) return -1;
  2914.     #if defined FILTERSCRIPT
  2915.         return CallRemoteFunction("ac_AntiCheatGetWeapon", "i", playerid);
  2916.     #else
  2917.         return ac_AntiCheatGetWeapon(playerid);
  2918.     #endif
  2919. }
  2920.  
  2921. stock AntiCheatGetVehicleSeat(playerid)
  2922. {
  2923.     if(!IsPlayerConnected(playerid)) return -1;
  2924.     #if defined FILTERSCRIPT
  2925.         return CallRemoteFunction("ac_AntiCheatGetVehicleSeat", "i", playerid);
  2926.     #else
  2927.         return ac_AntiCheatGetVehicleSeat(playerid);
  2928.     #endif
  2929. }
  2930.  
  2931. stock AntiCheatGetSpecialAction(playerid)
  2932. {
  2933.     if(!IsPlayerConnected(playerid)) return 0;
  2934.     #if defined FILTERSCRIPT
  2935.         return CallRemoteFunction("ac_AntiCheatGetSpecialAction", "i", playerid);
  2936.     #else
  2937.         return ac_AntiCheatGetSpecialAction(playerid);
  2938.     #endif
  2939. }
  2940.  
  2941. stock AntiCheatGetLastSpecialAction(playerid)
  2942. {
  2943.     if(!IsPlayerConnected(playerid)) return 0;
  2944.     #if defined FILTERSCRIPT
  2945.         return CallRemoteFunction("ac_AntiCheatGetLastSpecialActio", "i", playerid);
  2946.     #else
  2947.         return ac_AntiCheatGetLastSpecialActio(playerid);
  2948.     #endif
  2949. }
  2950.  
  2951. stock AntiCheatGetLastShotWeapon(playerid)
  2952. {
  2953.     if(!IsPlayerConnected(playerid)) return -1;
  2954.     #if defined FILTERSCRIPT
  2955.         return CallRemoteFunction("ac_AntiCheatGetLastShotWeapon", "i", playerid);
  2956.     #else
  2957.         return ac_AntiCheatGetLastShotWeapon(playerid);
  2958.     #endif
  2959. }
  2960.  
  2961. stock AntiCheatGetLastPickup(playerid)
  2962. {
  2963.     if(!IsPlayerConnected(playerid)) return -1;
  2964.     #if defined FILTERSCRIPT
  2965.         return CallRemoteFunction("ac_AntiCheatGetLastPickup", "i", playerid);
  2966.     #else
  2967.         return ac_AntiCheatGetLastPickup(playerid);
  2968.     #endif
  2969. }
  2970.  
  2971. stock AntiCheatGetLastUpdateTime(playerid)
  2972. {
  2973.     if(!IsPlayerConnected(playerid)) return 0;
  2974.     #if defined FILTERSCRIPT
  2975.         return CallRemoteFunction("ac_AntiCheatGetLastUpdateTime", "i", playerid);
  2976.     #else
  2977.         return ac_AntiCheatGetLastUpdateTime(playerid);
  2978.     #endif
  2979. }
  2980.  
  2981. stock AntiCheatGetLastReloadTime(playerid)
  2982. {
  2983.     if(!IsPlayerConnected(playerid)) return 0;
  2984.     #if defined FILTERSCRIPT
  2985.         return CallRemoteFunction("ac_AntiCheatGetLastReloadTime", "i", playerid);
  2986.     #else
  2987.         return ac_AntiCheatGetLastReloadTime(playerid);
  2988.     #endif
  2989. }
  2990.  
  2991. stock AntiCheatGetLastEnteredVehTime(playerid)
  2992. {
  2993.     if(!IsPlayerConnected(playerid)) return 0;
  2994.     #if defined FILTERSCRIPT
  2995.         return CallRemoteFunction("ac_AntiCheatGetLastEnteredVehTi", "i", playerid);
  2996.     #else
  2997.         return ac_AntiCheatGetLastEnteredVehTi(playerid);
  2998.     #endif
  2999. }
  3000.  
  3001. stock AntiCheatGetLastShotTime(playerid)
  3002. {
  3003.     if(!IsPlayerConnected(playerid)) return 0;
  3004.     #if defined FILTERSCRIPT
  3005.         return CallRemoteFunction("ac_AntiCheatGetLastShotTime", "i", playerid);
  3006.     #else
  3007.         return ac_AntiCheatGetLastShotTime(playerid);
  3008.     #endif
  3009. }
  3010.  
  3011. stock AntiCheatGetLastSpawnTime(playerid)
  3012. {
  3013.     if(!IsPlayerConnected(playerid)) return 0;
  3014.     #if defined FILTERSCRIPT
  3015.         return CallRemoteFunction("ac_AntiCheatGetLastSpawnTime", "i", playerid);
  3016.     #else
  3017.         return ac_AntiCheatGetLastSpawnTime(playerid);
  3018.     #endif
  3019. }
  3020.  
  3021. stock AntiCheatIntEnterExitsIsEnabled(playerid)
  3022. {
  3023.     if(!IsPlayerConnected(playerid)) return 0;
  3024.     #if defined FILTERSCRIPT
  3025.         return CallRemoteFunction("ac_AntiCheatIntEnterExitsIsEnab", "i", playerid);
  3026.     #else
  3027.         return ac_AntiCheatIntEnterExitsIsEnab(playerid);
  3028.     #endif
  3029. }
  3030.  
  3031. stock AntiCheatStuntBonusIsEnabled(playerid)
  3032. {
  3033.     if(!IsPlayerConnected(playerid)) return 0;
  3034.     #if defined FILTERSCRIPT
  3035.         return CallRemoteFunction("ac_AntiCheatStuntBonusIsEnabled", "i", playerid);
  3036.     #else
  3037.         return ac_AntiCheatStuntBonusIsEnabled(playerid);
  3038.     #endif
  3039. }
  3040.  
  3041. stock AntiCheatIsInModShop(playerid)
  3042. {
  3043.     if(!IsPlayerConnected(playerid)) return 0;
  3044.     #if defined FILTERSCRIPT
  3045.         return CallRemoteFunction("ac_AntiCheatIsInModShop", "i", playerid);
  3046.     #else
  3047.         return ac_AntiCheatIsInModShop(playerid);
  3048.     #endif
  3049. }
  3050.  
  3051. stock AntiCheatIsFrozen(playerid)
  3052. {
  3053.     if(!IsPlayerConnected(playerid)) return 0;
  3054.     #if defined FILTERSCRIPT
  3055.         return CallRemoteFunction("ac_AntiCheatIsFrozen", "i", playerid);
  3056.     #else
  3057.         return ac_AntiCheatIsFrozen(playerid);
  3058.     #endif
  3059. }
  3060.  
  3061. stock AntiCheatIsDead(playerid)
  3062. {
  3063.     if(!IsPlayerConnected(playerid)) return 0;
  3064.     #if defined FILTERSCRIPT
  3065.         return CallRemoteFunction("ac_AntiCheatIsDead", "i", playerid);
  3066.     #else
  3067.         return ac_AntiCheatIsDead(playerid);
  3068.     #endif
  3069. }
  3070.  
  3071. stock AntiCheatIsConnected(playerid)
  3072. {
  3073.     if(!IsPlayerConnected(playerid)) return 0;
  3074.     #if defined FILTERSCRIPT
  3075.         return CallRemoteFunction("ac_AntiCheatIsConnected", "i", playerid);
  3076.     #else
  3077.         return ac_AntiCheatIsConnected(playerid);
  3078.     #endif
  3079. }
  3080.  
  3081. stock AntiCheatKickWithDesync(playerid, code)
  3082. {
  3083.     if(!IsPlayerConnected(playerid)) return 0;
  3084.     #if defined FILTERSCRIPT
  3085.         return CallRemoteFunction("ac_AntiCheatKickWithDesync", "ii", playerid, code);
  3086.     #else
  3087.         return ac_AntiCheatKickWithDesync(playerid, code);
  3088.     #endif
  3089. }
  3090.  
  3091. stock AntiCheatIsKickedWithDecync(playerid)
  3092. {
  3093.     if(!IsPlayerConnected(playerid)) return 3;
  3094.     #if defined FILTERSCRIPT
  3095.         return CallRemoteFunction("ac_AntiCheatIsKickedWithDecync", "i", playerid);
  3096.     #else
  3097.         return ac_AntiCheatIsKickedWithDecync(playerid);
  3098.     #endif
  3099. }
  3100.  
  3101. stock AntiCheatGetVehicleDriver(vehicleid)
  3102. {
  3103.     if(GetVehicleModel(vehicleid) <= 0) return INVALID_PLAYER_ID;
  3104.     #if defined FILTERSCRIPT
  3105.         return CallRemoteFunction("ac_AntiCheatGetVehicleDriver", "i", vehicleid);
  3106.     #else
  3107.         return ac_AntiCheatGetVehicleDriver(vehicleid);
  3108.     #endif
  3109. }
  3110.  
  3111. stock AntiCheatGetVehicleInterior(vehicleid)
  3112. {
  3113.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  3114.     #if defined FILTERSCRIPT
  3115.         return CallRemoteFunction("ac_AntiCheatGetVehicleInterior", "i", vehicleid);
  3116.     #else
  3117.         return ac_AntiCheatGetVehicleInterior(vehicleid);
  3118.     #endif
  3119. }
  3120.  
  3121. stock AntiCheatGetVehiclePaintjob(vehicleid)
  3122. {
  3123.     if(GetVehicleModel(vehicleid) <= 0) return 3;
  3124.     #if defined FILTERSCRIPT
  3125.         return CallRemoteFunction("ac_AntiCheatGetVehiclePaintjob", "i", vehicleid);
  3126.     #else
  3127.         return ac_AntiCheatGetVehiclePaintjob(vehicleid);
  3128.     #endif
  3129. }
  3130.  
  3131. stock AntiCheatGetInterior(playerid)
  3132. {
  3133.     if(!IsPlayerConnected(playerid)) return 0;
  3134.     #if defined FILTERSCRIPT
  3135.         return CallRemoteFunction("ac_AntiCheatGetInterior", "i", playerid);
  3136.     #else
  3137.         return ac_AntiCheatGetInterior(playerid);
  3138.     #endif
  3139. }
  3140.  
  3141. #if defined _inc_y_hooks || defined _INC_y_hooks
  3142.     DEFINE_HOOK_REPLACEMENT(SirenState, Siren);
  3143.     DEFINE_HOOK_REPLACEMENT(Vehicle, Veh);
  3144. #endif
  3145.  
  3146. #if defined FILTERSCRIPT
  3147.  
  3148. static fs_AntiCheatGetNextDialog(playerid)
  3149. {
  3150.     if(!IsPlayerConnected(playerid)) return -1;
  3151.     return CallRemoteFunction("ac_AntiCheatGetNextDialog", "i", playerid);
  3152. }
  3153.  
  3154. static fs_AntiCheatSetDialog(playerid, dialogid)
  3155. {
  3156.     if(!(0 <= playerid < MAX_PLAYERS)) return 0;
  3157.     return CallRemoteFunction("ac_ShowPlayerDialog", "id", playerid, dialogid);
  3158. }
  3159.  
  3160. static fs_AntiCheatSetNextDialog(playerid, dialogid)
  3161. {
  3162.     if(!(0 <= playerid < MAX_PLAYERS)) return 0;
  3163.     return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
  3164. }
  3165.  
  3166. #else
  3167.  
  3168. public OnGameModeInit()
  3169. {
  3170.     #if AC_USE_CONFIG_FILES
  3171.         if(!ac_LoadCfg()) printf(CFG_OPENING_ERROR, AC_CONFIG_FILE);
  3172.         if(!ac_LoadNOPCfg()) printf(CFG_OPENING_ERROR, AC_NOP_CONFIG_FILE);
  3173.     #endif
  3174.     if(ac_ACAllow[42])
  3175.     {
  3176.         #if !AC_USE_QUERY
  3177.             ac_QueryEnable = !!GetServerVarAsBool("query");
  3178.             SendRconCommand("query 0");
  3179.         #endif
  3180.         #undef AC_USE_QUERY
  3181.         ac_RconEnable = !!GetServerVarAsBool("rcon");
  3182.         SendRconCommand("rcon 0");
  3183.     }
  3184.     #if AC_MAX_CONNECTS_FROM_IP > 1
  3185.         ac_ACAllow[37] = false;
  3186.     #endif
  3187.     ac_LagCompMode = !!GetServerVarAsInt("lagcompmode");
  3188.     print(" ");
  3189.     print("--------------------------------------");
  3190.     print(LOADED_MSG_1);
  3191.     printf(LOADED_MSG_2, NEX_AC_VERSION);
  3192.     print(LOADED_MSG_3);
  3193.     print("--------------------------------------\n");
  3194.     new ac_a = 1;
  3195.     #if defined ac_OnGameModeInit
  3196.         ac_a = ac_OnGameModeInit();
  3197.     #endif
  3198.     static ac_strtmp[10];
  3199.     GetServerVarAsString("version", ac_strtmp, sizeof ac_strtmp);
  3200.     if(strfind(ac_strtmp, AC_SERVER_VERSION) == -1 && strfind(ac_strtmp, AC_SERVER_DL_VERSION) == -1) print(VERSION_WARNING);
  3201.     #undef AC_SERVER_DL_VERSION
  3202.     #undef AC_SERVER_VERSION
  3203.     return ac_a;
  3204. }
  3205.  
  3206. #if defined _ALS_OnGameModeInit
  3207.     #undef OnGameModeInit
  3208. #else
  3209.     #define _ALS_OnGameModeInit
  3210. #endif
  3211. #define OnGameModeInit ac_OnGameModeInit
  3212. #if defined ac_OnGameModeInit
  3213.     forward ac_OnGameModeInit();
  3214. #endif
  3215.  
  3216. #if AC_USE_STATISTICS
  3217.     public OnGameModeExit()
  3218.     {
  3219.         new ac_a = 1;
  3220.         #if defined ac_OnGameModeExit
  3221.             ac_a = ac_OnGameModeExit();
  3222.         #endif
  3223.         print(" ");
  3224.         print("--------------------------------------");
  3225.         print(STATS_STRING_1);
  3226.         print(STATS_STRING_2);
  3227.         printf(STATS_STRING_3, ac_sInfo[0]);
  3228.         printf(STATS_STRING_4, ac_sInfo[1]);
  3229.         printf(STATS_STRING_5, ac_sInfo[2]);
  3230.         printf(STATS_STRING_6, ac_sInfo[3]);
  3231.         printf(STATS_STRING_7, ac_sInfo[4]);
  3232.         printf(STATS_STRING_8, ac_sInfo[5]);
  3233.         print("--------------------------------------\n");
  3234.         return ac_a;
  3235.     }
  3236.  
  3237.     #if defined _ALS_OnGameModeExit
  3238.         #undef OnGameModeExit
  3239.     #else
  3240.         #define _ALS_OnGameModeExit
  3241.     #endif
  3242.     #define OnGameModeExit ac_OnGameModeExit
  3243.     #if defined ac_OnGameModeExit
  3244.         forward ac_OnGameModeExit();
  3245.     #endif
  3246. #endif
  3247.  
  3248. #if defined _inc_y_hooks || defined _INC_y_hooks
  3249.     hook OnPlayerConnect(playerid)
  3250. #else
  3251.     public OnPlayerConnect(playerid)
  3252. #endif
  3253. {
  3254.     ACInfo[playerid][acVeh] =
  3255.     ACInfo[playerid][acKicked] =
  3256.     ACInfo[playerid][acKickVeh] = 0;
  3257.     GetPlayerIp(playerid, ACInfo[playerid][acIp], 16);
  3258.     #if AC_USE_NPC
  3259.         if(IsPlayerNPC(playerid))
  3260.         {
  3261.             if(ac_ACAllow[36] && strcmp(ACInfo[playerid][acIp], "127.0.0.1")) ac_KickWithCode(playerid, "", 0, 36);
  3262.             ACInfo[playerid][acTimerID] = 0;
  3263.         }
  3264.         else
  3265.         {
  3266.     #else
  3267.         if(ac_ACAllow[36] && IsPlayerNPC(playerid)) ac_KickWithCode(playerid, "", 0, 36);
  3268.     #endif
  3269.         if(ac_ACAllow[48] && ACInfo[playerid][acOnline]) ac_KickWithCode(playerid, "", 0, 48, 1);
  3270.         if(ac_ACAllow[41])
  3271.         {
  3272.             static ac_ver[24];
  3273.             GetPlayerVersion(playerid, ac_ver, sizeof ac_ver);
  3274.             if(!strcmp(ac_ver, "unknown", true))
  3275.             {
  3276.                 #if defined DEBUG
  3277.                     printf(DEBUG_CODE_2, playerid, ac_ver);
  3278.                 #endif
  3279.                 ac_KickWithCode(playerid, "", 0, 41);
  3280.             }
  3281.         }
  3282.         new ac_i = AC_MAX_CONNECTS_FROM_IP;
  3283.         if(ac_ACAllow[40])
  3284.         {
  3285.             #if defined foreach
  3286.                 foreach(new ac_j : Player)
  3287.                 {
  3288.                     #if AC_USE_NPC
  3289.                         if(ac_j != playerid && !IsPlayerNPC(ac_j) && !strcmp(ACInfo[playerid][acIp], ACInfo[ac_j][acIp], false))
  3290.                     #else
  3291.                         if(ac_j != playerid && !strcmp(ACInfo[playerid][acIp], ACInfo[ac_j][acIp], false))
  3292.                     #endif
  3293.             #else
  3294.                 #if defined GetPlayerPoolSize
  3295.                     for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j)
  3296.                 #else
  3297.                     for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j)
  3298.                 #endif
  3299.                 {
  3300.                     #if AC_USE_NPC
  3301.                         if(ac_j != playerid && IsPlayerConnected(ac_j) && !IsPlayerNPC(ac_j) &&
  3302.                         !strcmp(ACInfo[playerid][acIp], ACInfo[ac_j][acIp], false))
  3303.                     #else
  3304.                         if(ac_j != playerid && IsPlayerConnected(ac_j) &&
  3305.                         !strcmp(ACInfo[playerid][acIp], ACInfo[ac_j][acIp], false))
  3306.                     #endif
  3307.             #endif
  3308.                 {
  3309.                     ac_i--;
  3310.                     if(ac_i < 1)
  3311.                     {
  3312.                         #if defined DEBUG
  3313.                             printf(DEBUG_CODE_3, playerid, AC_MAX_CONNECTS_FROM_IP);
  3314.                         #endif
  3315.                         #undef AC_MAX_CONNECTS_FROM_IP
  3316.                         ac_KickWithCode(playerid, "", 0, 40);
  3317.                         break;
  3318.                     }
  3319.                 }
  3320.             }
  3321.         }
  3322.         ACInfo[playerid][acSpec] =
  3323.         ACInfo[playerid][acSpawned] =
  3324.         ACInfo[playerid][acDeathRes] = false;
  3325.         ACInfo[playerid][acDead] = true;
  3326.         ACInfo[playerid][acIntEnterExits] = ac_IntEnterExits;
  3327.         ACInfo[playerid][acStuntBonus] = ac_StuntBonus;
  3328.         ACInfo[playerid][acCheatCount][0] =
  3329.         ACInfo[playerid][acLastWeapon] =
  3330.         ACInfo[playerid][acSpawnRes] =
  3331.         ACInfo[playerid][acMoney] =
  3332.         ACInfo[playerid][acAnim] =
  3333.         ACInfo[playerid][acInt] = 0;
  3334.         ACInfo[playerid][acSet][12] =
  3335.         ACInfo[playerid][acSet][10] =
  3336.         ACInfo[playerid][acSet][0] =
  3337.         ACInfo[playerid][acNextDialog] =
  3338.         ACInfo[playerid][acDialog] = -1;
  3339.         ACInfo[playerid][acDropJpX] =
  3340.         ACInfo[playerid][acDropJpY] =
  3341.         ACInfo[playerid][acDropJpZ] = 25000.0;
  3342.         for(ac_i = 12; ac_i >= 0; --ac_i)
  3343.         {
  3344.             ACInfo[playerid][acSetWeapon][ac_i] = -1;
  3345.             ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  3346.         }
  3347.         for(ac_i = 27; ac_i >= 0; --ac_i) ACInfo[playerid][acFloodCount][ac_i] = 0;
  3348.         memcpy(ACInfo[playerid][acNOPAllow], ac_NOPAllow, 0, sizeof(ac_NOPAllow) * 4, sizeof ac_NOPAllow);
  3349.         memcpy(ACInfo[playerid][acACAllow], ac_ACAllow, 0, sizeof(ac_ACAllow) * 4, sizeof ac_ACAllow);
  3350.         if(ACInfo[playerid][acKicked] < 1)
  3351.         {
  3352.             ACInfo[playerid][acTimerTick] = GetTickCount();
  3353.             #if defined SetPlayerTimerEx_
  3354.                 ACInfo[playerid][acTimerID] = SetPlayerTimerEx_(playerid, "ac_Timer", 0, 1000, 1, "i", playerid);
  3355.             #else
  3356.                 ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
  3357.             #endif
  3358.         }
  3359.     #if AC_USE_NPC
  3360.         }
  3361.     #endif
  3362.     ACInfo[playerid][acOnline] = true;
  3363.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3364.         && defined ac_OnPlayerConnect
  3365.         return ac_OnPlayerConnect(playerid);
  3366.     #else
  3367.         return 1;
  3368.     #endif
  3369. }
  3370.  
  3371. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3372.     #if defined _ALS_OnPlayerConnect
  3373.         #undef OnPlayerConnect
  3374.     #else
  3375.         #define _ALS_OnPlayerConnect
  3376.     #endif
  3377.     #define OnPlayerConnect ac_OnPlayerConnect
  3378.     #if defined ac_OnPlayerConnect
  3379.         forward ac_OnPlayerConnect(playerid);
  3380.     #endif
  3381. #endif
  3382.  
  3383. #if defined _inc_y_hooks || defined _INC_y_hooks
  3384.     hook OnPlayerDisconnect(playerid, reason)
  3385. #else
  3386.     public OnPlayerDisconnect(playerid, reason)
  3387. #endif
  3388. {
  3389.     #if AC_USE_NPC
  3390.         if(!IsPlayerNPC(playerid))
  3391.         {
  3392.     #endif
  3393.         #if defined KillPlayerTimer
  3394.             KillPlayerTimer(ACInfo[playerid][acTimerID]);
  3395.         #else
  3396.             KillTimer(ACInfo[playerid][acTimerID]);
  3397.         #endif
  3398.         #if defined BlockIpAddress
  3399.             if(ACInfo[playerid][acACAllow][37]) BlockIpAddress(ACInfo[playerid][acIp],
  3400.             (AC_MIN_TIME_RECONNECT * 1000) - (reason > 0 ? 0 : GetServerVarAsInt("playertimeout")));
  3401.         #endif
  3402.         #undef AC_MIN_TIME_RECONNECT
  3403.     #if AC_USE_NPC
  3404.         }
  3405.     #endif
  3406.     #if defined KillPlayerTimer
  3407.         KillPlayerTimer(ACInfo[playerid][acKickTimerID]);
  3408.     #else
  3409.         KillTimer(ACInfo[playerid][acKickTimerID]);
  3410.     #endif
  3411.     new ac_vehid = ACInfo[playerid][acKickVeh];
  3412.     if(ac_vehid > 0)
  3413.     {
  3414.         if(ACVehInfo[ac_vehid][acDriver] == playerid) ACVehInfo[ac_vehid][acDriver] = INVALID_PLAYER_ID;
  3415.         if(ACInfo[playerid][acKicked] == 2)
  3416.         {
  3417.             LinkVehicleToInterior(ac_vehid, ACVehInfo[ac_vehid][acInt]);
  3418.             SetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
  3419.             SetVehiclePos(ac_vehid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]);
  3420.             SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
  3421.             ChangeVehiclePaintjob(ac_vehid, ACVehInfo[ac_vehid][acPaintJob]);
  3422.         }
  3423.     }
  3424.     if((ac_vehid = ACInfo[playerid][acVeh]) > 0)
  3425.     {
  3426.         if(ACVehInfo[ac_vehid][acDriver] == playerid) ACVehInfo[ac_vehid][acDriver] = INVALID_PLAYER_ID;
  3427.         if(ACInfo[playerid][acKicked] == 2)
  3428.         {
  3429.             LinkVehicleToInterior(ac_vehid, ACVehInfo[ac_vehid][acInt]);
  3430.             SetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
  3431.             SetVehiclePos(ac_vehid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]);
  3432.             SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
  3433.             ChangeVehiclePaintjob(ac_vehid, ACVehInfo[ac_vehid][acPaintJob]);
  3434.         }
  3435.     }
  3436.     ACInfo[playerid][acOnline] = false;
  3437.     if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acKicked] = 3;
  3438.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3439.         && defined ac_OnPlayerDisconnect
  3440.         return ac_OnPlayerDisconnect(playerid, reason);
  3441.     #else
  3442.         return 1;
  3443.     #endif
  3444. }
  3445.  
  3446. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3447.     #if defined _ALS_OnPlayerDisconnect
  3448.         #undef OnPlayerDisconnect
  3449.     #else
  3450.         #define _ALS_OnPlayerDisconnect
  3451.     #endif
  3452.     #define OnPlayerDisconnect ac_OnPlayerDisconnect
  3453.     #if defined ac_OnPlayerDisconnect
  3454.         forward ac_OnPlayerDisconnect(playerid, reason);
  3455.     #endif
  3456. #endif
  3457.  
  3458. #if defined _inc_y_hooks || defined _INC_y_hooks
  3459.     hook OnPlayerSpawn(playerid)
  3460. #else
  3461.     public OnPlayerSpawn(playerid)
  3462. #endif
  3463. {
  3464.     if(ACInfo[playerid][acKicked] > 0) return 0;
  3465.     #if AC_USE_NPC
  3466.         if(!IsPlayerNPC(playerid))
  3467.         {
  3468.     #endif
  3469.         new ac_i, ac_gtc = GetTickCount();
  3470.         if(ACInfo[playerid][acSpec] && ACInfo[playerid][acSet][7] < 2)
  3471.         {
  3472.             ACInfo[playerid][acSet][3] =
  3473.             ACInfo[playerid][acSet][4] =
  3474.             ACInfo[playerid][acSet][8] =
  3475.             ACInfo[playerid][acSet][9] = -1;
  3476.             ACInfo[playerid][acSpec] = false;
  3477.         }
  3478.         else
  3479.         {
  3480.             if(ACInfo[playerid][acACAllow][27] &&
  3481.             (ACInfo[playerid][acSpawnRes] < 1 || ac_gtc < ACInfo[playerid][acSpawnTick] + 1000))
  3482.             {
  3483.                 #if defined DEBUG
  3484.                     printf("[Nex-AC debug] Spawn res: %d, Respawn time: %d",
  3485.                     ACInfo[playerid][acSpawnRes], ac_gtc - ACInfo[playerid][acSpawnTick]);
  3486.                 #endif
  3487.                 ac_KickWithCode(playerid, "", 0, 27);
  3488.                 #if defined OnCheatDetected
  3489.                     ACInfo[playerid][acSpawnRes] = 1;
  3490.                 #endif
  3491.             }
  3492.             if(ACInfo[playerid][acSpawnRes] > 0) ACInfo[playerid][acSpawnRes]--;
  3493.             if(!(1 <= ACInfo[playerid][acSet][7] <= 2))
  3494.             {
  3495.                 for(ac_i = 11; ac_i >= 0; --ac_i) ACInfo[playerid][acSet][ac_i] = -1;
  3496.                 SetPlayerHealth(playerid, 100.0);
  3497.                 SetPlayerArmour(playerid, 0.0);
  3498.                 SetPlayerInterior(playerid, 0);
  3499.             }
  3500.         }
  3501.         if(!(1 <= ACInfo[playerid][acSet][7] <= 2))
  3502.         {
  3503.             for(ac_i = 12; ac_i >= 0; --ac_i)
  3504.             {
  3505.                 ACInfo[playerid][acSetWeapon][ac_i] = -1;
  3506.                 ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  3507.             }
  3508.             ACInfo[playerid][acNextSpecAct] = -1;
  3509.             ACInfo[playerid][acUnFrozen] = true;
  3510.             ACInfo[playerid][acTpToZ] = false;
  3511.         }
  3512.         for(ac_i = 12; ac_i >= 0; --ac_i)
  3513.         {
  3514.             ACInfo[playerid][acWeapon][ac_i] =
  3515.             ACInfo[playerid][acAmmo][ac_i] = 0;
  3516.         }
  3517.         ACInfo[playerid][acModShop] =
  3518.         ACInfo[playerid][acDead] = false;
  3519.         ACInfo[playerid][acSpawned] = true;
  3520.         ACInfo[playerid][acLastPickup] =
  3521.         ACInfo[playerid][acEnterSeat] =
  3522.         ACInfo[playerid][acSet][7] =
  3523.         ACInfo[playerid][acSeat] = -1;
  3524.         ACInfo[playerid][acCheatCount][5] =
  3525.         ACInfo[playerid][acCheatCount][6] =
  3526.         ACInfo[playerid][acCheatCount][7] =
  3527.         ACInfo[playerid][acCheatCount][8] =
  3528.         ACInfo[playerid][acCheatCount][9] =
  3529.         ACInfo[playerid][acCheatCount][13] =
  3530.         ACInfo[playerid][acCheatCount][14] =
  3531.         ACInfo[playerid][acCheatCount][16] =
  3532.         ACInfo[playerid][acCheatCount][18] =
  3533.         ACInfo[playerid][acCheatCount][20] =
  3534.         ACInfo[playerid][acLastSpecAct] =
  3535.         ACInfo[playerid][acLastWeapon] =
  3536.         ACInfo[playerid][acParachute] =
  3537.         ACInfo[playerid][acEnterVeh] =
  3538.         ACInfo[playerid][acLastShot] =
  3539.         ACInfo[playerid][acKickVeh] =
  3540.         ACInfo[playerid][acSpecAct] =
  3541.         ACInfo[playerid][acDmgRes] =
  3542.         ACInfo[playerid][acIntRet] =
  3543.         ACInfo[playerid][acSpeed] =
  3544.         ACInfo[playerid][acVeh] = 0;
  3545.         ACInfo[playerid][acSetPosTick] = ac_gtc + 2650;
  3546.         ACInfo[playerid][acGtc][7] = ac_gtc + 1650;
  3547.         if(1 <= ACInfo[playerid][acSpawnWeapon1] <= 46)
  3548.         {
  3549.             ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon1]];
  3550.             ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon1];
  3551.             ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo1];
  3552.         }
  3553.         if(1 <= ACInfo[playerid][acSpawnWeapon2] <= 46)
  3554.         {
  3555.             ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon2]];
  3556.             ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon2];
  3557.             ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo2];
  3558.         }
  3559.         if(1 <= ACInfo[playerid][acSpawnWeapon3] <= 46)
  3560.         {
  3561.             ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon3]];
  3562.             ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon3];
  3563.             ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo3];
  3564.         }
  3565.     #if AC_USE_NPC
  3566.         }
  3567.     #endif
  3568.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3569.         && defined ac_OnPlayerSpawn
  3570.         return ac_OnPlayerSpawn(playerid);
  3571.     #else
  3572.         return 1;
  3573.     #endif
  3574. }
  3575.  
  3576. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3577.     #if defined _ALS_OnPlayerSpawn
  3578.         #undef OnPlayerSpawn
  3579.     #else
  3580.         #define _ALS_OnPlayerSpawn
  3581.     #endif
  3582.     #define OnPlayerSpawn ac_OnPlayerSpawn
  3583.     #if defined ac_OnPlayerSpawn
  3584.         forward ac_OnPlayerSpawn(playerid);
  3585.     #endif
  3586. #endif
  3587.  
  3588. #if defined _inc_y_hooks || defined _INC_y_hooks
  3589.     hook OnPlayerDeath(playerid, killerid, reason)
  3590. #else
  3591.     public OnPlayerDeath(playerid, killerid, reason)
  3592. #endif
  3593. {
  3594.     if(ACInfo[playerid][acKicked] > 0) return 0;
  3595.     if(ACInfo[playerid][acACAllow][28] &&
  3596.     (ACInfo[playerid][acDead] || !ACInfo[playerid][acDeathRes] &&
  3597.     (reason != WEAPON_COLLISION && reason != 255 || killerid != INVALID_PLAYER_ID)))
  3598.     {
  3599.         #if defined DEBUG
  3600.             printf("[Nex-AC debug] Is dead: %d, death res: %d, killerid: %d, reason: %d",
  3601.             ACInfo[playerid][acDead], ACInfo[playerid][acDeathRes], killerid, reason);
  3602.         #endif
  3603.         ac_KickWithCode(playerid, "", 0, 28);
  3604.     }
  3605.     ACInfo[playerid][acDead] = true;
  3606.     ACInfo[playerid][acDeathRes] = false;
  3607.     if(ACInfo[playerid][acSpawnRes] < 1) ACInfo[playerid][acSpawnTick] = GetTickCount();
  3608.     ACInfo[playerid][acSpawnRes] = 1;
  3609.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3610.         && defined ac_OnPlayerDeath
  3611.         return ac_OnPlayerDeath(playerid, killerid, reason);
  3612.     #else
  3613.         return 1;
  3614.     #endif
  3615. }
  3616.  
  3617. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3618.     #if defined _ALS_OnPlayerDeath
  3619.         #undef OnPlayerDeath
  3620.     #else
  3621.         #define _ALS_OnPlayerDeath
  3622.     #endif
  3623.     #define OnPlayerDeath ac_OnPlayerDeath
  3624.     #if defined ac_OnPlayerDeath
  3625.         forward ac_OnPlayerDeath(playerid, killerid, reason);
  3626.     #endif
  3627. #endif
  3628.  
  3629. #if defined _inc_y_hooks || defined _INC_y_hooks
  3630.     #if defined OnPlayerWeaponShot
  3631.         hook OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  3632.     #else
  3633.         hook OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
  3634.     #endif
  3635. #else
  3636.     #if defined OnPlayerWeaponShot
  3637.         public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  3638.     #else
  3639.         public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
  3640.     #endif
  3641. #endif
  3642. {
  3643.     if(ACInfo[playerid][acKicked] > 0) return 1;
  3644.     #if defined OnPlayerWeaponShot
  3645.         if(ACInfo[playerid][acACAllow][47] && (amount < 0.0 || !(3 <= bodypart <= 9)))
  3646.         {
  3647.             #if defined DEBUG
  3648.                 printf("[Nex-AC debug] Issuerid: %d, amount: %f, weaponid: %d, bodypart: %d", issuerid, amount, weaponid, bodypart);
  3649.             #endif
  3650.             ac_KickWithCode(playerid, "", 0, 47, 4);
  3651.             return 1;
  3652.         }
  3653.     #else
  3654.         if(ACInfo[playerid][acACAllow][47] && amount < 0.0)
  3655.         {
  3656.             #if defined DEBUG
  3657.                 printf("[Nex-AC debug] Issuerid: %d, amount: %f, weaponid: %d", issuerid, amount, weaponid);
  3658.             #endif
  3659.             ac_KickWithCode(playerid, "", 0, 47, 4);
  3660.             return 1;
  3661.         }
  3662.     #endif
  3663.     if(!ACInfo[playerid][acDead]) ACInfo[playerid][acDeathRes] = true;
  3664.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3665.         && defined ac_OnPlayerTakeDamage
  3666.         #if defined OnPlayerWeaponShot
  3667.             return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid, bodypart);
  3668.         #else
  3669.             return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid);
  3670.         #endif
  3671.     #else
  3672.         return 0;
  3673.     #endif
  3674. }
  3675.  
  3676. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3677.     #if defined _ALS_OnPlayerTakeDamage
  3678.         #undef OnPlayerTakeDamage
  3679.     #else
  3680.         #define _ALS_OnPlayerTakeDamage
  3681.     #endif
  3682.     #define OnPlayerTakeDamage ac_OnPlayerTakeDamage
  3683.     #if defined ac_OnPlayerTakeDamage
  3684.         #if defined OnPlayerWeaponShot
  3685.             forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  3686.         #else
  3687.             forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid);
  3688.         #endif
  3689.     #endif
  3690. #endif
  3691.  
  3692. #if defined _inc_y_hooks || defined _INC_y_hooks
  3693.     #if defined OnPlayerWeaponShot
  3694.         hook OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  3695.     #else
  3696.         hook OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
  3697.     #endif
  3698. #else
  3699.     #if defined OnPlayerWeaponShot
  3700.         public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  3701.     #else
  3702.         public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
  3703.     #endif
  3704. #endif
  3705. {
  3706.     if(ACInfo[playerid][acKicked] > 0) return 1;
  3707.     #if defined OnPlayerWeaponShot
  3708.         if(ACInfo[playerid][acACAllow][47])
  3709.         {
  3710.             if(amount < 0.0 || !(0 <= damagedid < MAX_PLAYERS) || !(3 <= bodypart <= 9) ||
  3711.             !(0 <= weaponid <= WEAPON_MOLTOV || WEAPON_COLT45 <= weaponid <= WEAPON_PARACHUTE))
  3712.             {
  3713.                 #if defined DEBUG
  3714.                     printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d, bodypart: %d",
  3715.                     damagedid, amount, weaponid, bodypart);
  3716.                 #endif
  3717.                 ac_KickWithCode(playerid, "", 0, 47, 3);
  3718.                 return 1;
  3719.             }
  3720.             new ac_s = ac_wSlot[weaponid];
  3721.             if(!ACInfo[playerid][acDead] && ACInfo[playerid][acWeapon][ac_s] != weaponid &&
  3722.             ACInfo[playerid][acSetWeapon][ac_s] != weaponid && weaponid != WEAPON_FLAMETHROWER)
  3723.             {
  3724.                 #if defined DEBUG
  3725.                     printf("[Nex-AC debug] Damagedid: %d, amount: %f, AC weapon: %d, weaponid: %d, bodypart: %d",
  3726.                     damagedid, amount, ACInfo[playerid][acWeapon][ac_s], weaponid, bodypart);
  3727.                 #endif
  3728.                 ac_KickWithCode(playerid, "", 0, 47, 5);
  3729.                 return 1;
  3730.             }
  3731.         }
  3732.     #else
  3733.         if(ACInfo[playerid][acACAllow][47])
  3734.         {
  3735.             if(amount < 0.0 || !(0 <= damagedid < MAX_PLAYERS) ||
  3736.             !(0 <= weaponid <= WEAPON_MOLTOV || WEAPON_COLT45 <= weaponid <= WEAPON_PARACHUTE))
  3737.             {
  3738.                 #if defined DEBUG
  3739.                     printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d", damagedid, amount, weaponid);
  3740.                 #endif
  3741.                 ac_KickWithCode(playerid, "", 0, 47, 3);
  3742.                 return 1;
  3743.             }
  3744.             new ac_s = ac_wSlot[weaponid];
  3745.             if(!ACInfo[playerid][acDead] && ACInfo[playerid][acWeapon][ac_s] != weaponid &&
  3746.             ACInfo[playerid][acSetWeapon][ac_s] != weaponid && weaponid != WEAPON_FLAMETHROWER)
  3747.             {
  3748.                 #if defined DEBUG
  3749.                     printf("[Nex-AC debug] Damagedid: %d, amount: %f, AC weapon: %d, weaponid: %d",
  3750.                     damagedid, amount, ACInfo[playerid][acWeapon][ac_s], weaponid);
  3751.                 #endif
  3752.                 ac_KickWithCode(playerid, "", 0, 47, 5);
  3753.                 return 1;
  3754.             }
  3755.         }
  3756.     #endif
  3757.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3758.         && defined ac_OnPlayerGiveDamage
  3759.         #if defined OnPlayerWeaponShot
  3760.             return ac_OnPlayerGiveDamage(playerid, damagedid, amount, weaponid, bodypart);
  3761.         #else
  3762.             return ac_OnPlayerGiveDamage(playerid, damagedid, amount, weaponid);
  3763.         #endif
  3764.     #else
  3765.         return 0;
  3766.     #endif
  3767. }
  3768.  
  3769. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3770.     #if defined _ALS_OnPlayerGiveDamage
  3771.         #undef OnPlayerGiveDamage
  3772.     #else
  3773.         #define _ALS_OnPlayerGiveDamage
  3774.     #endif
  3775.     #define OnPlayerGiveDamage ac_OnPlayerGiveDamage
  3776.     #if defined ac_OnPlayerGiveDamage
  3777.         #if defined OnPlayerWeaponShot
  3778.             forward ac_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart);
  3779.         #else
  3780.             forward ac_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid);
  3781.         #endif
  3782.     #endif
  3783. #endif
  3784.  
  3785. #endif
  3786.  
  3787. #if defined FILTERSCRIPT
  3788.  
  3789. #if defined _inc_y_hooks || defined _INC_y_hooks
  3790.     hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3791. #else
  3792.     public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3793. #endif
  3794. {
  3795.     if(dialogid != AntiCheatGetDialog(playerid))
  3796.     {
  3797.         new ac_nd = fs_AntiCheatGetNextDialog(playerid);
  3798.         if(dialogid == ac_nd) fs_AntiCheatSetDialog(playerid, ac_nd);
  3799.     }
  3800.     fs_AntiCheatSetNextDialog(playerid, -1);
  3801.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3802.         && defined ac_fs_OnDialogResponse
  3803.         return ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  3804.     #else
  3805.         return 0;
  3806.     #endif
  3807. }
  3808.  
  3809. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3810.     #if defined _ALS_OnDialogResponse
  3811.         #undef OnDialogResponse
  3812.     #else
  3813.         #define _ALS_OnDialogResponse
  3814.     #endif
  3815.     #define OnDialogResponse ac_fs_OnDialogResponse
  3816.     #if defined ac_fs_OnDialogResponse
  3817.         forward ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  3818.     #endif
  3819. #endif
  3820.  
  3821. #else
  3822.  
  3823. #if defined _inc_y_hooks || defined _INC_y_hooks
  3824.     hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3825. #else
  3826.     public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3827. #endif
  3828. {
  3829.     if(ACInfo[playerid][acKicked] > 0) return 1;
  3830.     new ac_i = GetTickCount();
  3831.     if(ACInfo[playerid][acACAllow][49])
  3832.     {
  3833.         if(ac_i < ACInfo[playerid][acCall][0] + ac_Mtfc[0][0]) ac_FloodDetect(playerid, 0);
  3834.         else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  3835.         else ACInfo[playerid][acFloodCount][0] = ACInfo[playerid][acFloodCount][27] = 0;
  3836.     }
  3837.     if(ACInfo[playerid][acACAllow][39] && (dialogid != ACInfo[playerid][acDialog] || listitem < -1))
  3838.     {
  3839.         #if defined DEBUG
  3840.             printf("[Nex-AC debug] AC dialog: %d, dialogid: %d, listitem: %d, playerid: %d",
  3841.             ACInfo[playerid][acDialog], dialogid, listitem, playerid);
  3842.         #endif
  3843.         ac_KickWithCode(playerid, "", 0, 39);
  3844.         return 1;
  3845.     }
  3846.     ACInfo[playerid][acDialog] = -1;
  3847.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][0] = ac_i;
  3848.     if(ACInfo[playerid][acACAllow][45])
  3849.     {
  3850.         for(ac_i = strlen(inputtext) - 1; ac_i >= 0; --ac_i)
  3851.         {
  3852.             if(inputtext[ac_i] == '%') strdel(inputtext, ac_i, ac_i + 1);
  3853.         }
  3854.     }
  3855.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3856.         && defined ac_OnDialogResponse
  3857.         return ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  3858.     #else
  3859.         return 0;
  3860.     #endif
  3861. }
  3862.  
  3863. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3864.     #if defined _ALS_OnDialogResponse
  3865.         #undef OnDialogResponse
  3866.     #else
  3867.         #define _ALS_OnDialogResponse
  3868.     #endif
  3869.     #define OnDialogResponse ac_OnDialogResponse
  3870.     #if defined ac_OnDialogResponse
  3871.         forward ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  3872.     #endif
  3873. #endif
  3874.  
  3875. #if defined _inc_y_hooks || defined _INC_y_hooks
  3876.     hook OnEnterExitModShop(playerid, enterexit, interiorid)
  3877. #else
  3878.     public OnEnterExitModShop(playerid, enterexit, interiorid)
  3879. #endif
  3880. {
  3881.     if(ACInfo[playerid][acKicked] > 0) return 0;
  3882.     #if !AC_USE_TUNING_GARAGES
  3883.         if(ACInfo[playerid][acACAllow][23]) ac_KickWithCode(playerid, "", 0, 23, 1);
  3884.     #else
  3885.         if(ACInfo[playerid][acACAllow][23] &&
  3886.         (!(0 <= enterexit <= 1) || !(0 <= interiorid <= 3))) ac_KickWithCode(playerid, "", 0, 23, 7);
  3887.     #endif
  3888.     new ac_i = GetTickCount();
  3889.     if(ACInfo[playerid][acACAllow][49])
  3890.     {
  3891.         if(ac_i < ACInfo[playerid][acCall][1] + ac_Mtfc[1][0]) ac_FloodDetect(playerid, 1);
  3892.         else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  3893.         else ACInfo[playerid][acFloodCount][1] = ACInfo[playerid][acFloodCount][27] = 0;
  3894.     }
  3895.     ACInfo[playerid][acModShop] = !!enterexit;
  3896.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][1] = ac_i;
  3897.     ACInfo[playerid][acSetPosTick] = ACInfo[playerid][acGtc][19] = ac_i + 3250;
  3898.     new ac_vehid = ACInfo[playerid][acVeh];
  3899.     if(ACInfo[playerid][acKicked] < 1)
  3900.     {
  3901.         ac_i = interiorid % 256;
  3902.         ACVehInfo[ac_vehid][acInt] = ac_i;
  3903.         #if defined foreach
  3904.             foreach(new ac_j : Player)
  3905.             {
  3906.                 if(ACInfo[ac_j][acVeh] == ac_vehid) ACInfo[ac_j][acInt] = ac_i;
  3907.             }
  3908.         #else
  3909.             #if defined GetPlayerPoolSize
  3910.                 for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j)
  3911.             #else
  3912.                 for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j)
  3913.             #endif
  3914.             {
  3915.                 if(IsPlayerInVehicle(ac_j, ac_vehid)) ACInfo[ac_j][acInt] = ac_i;
  3916.             }
  3917.         #endif
  3918.     }
  3919.     else
  3920.     {
  3921.         #if defined foreach
  3922.             foreach(new ac_j : Player)
  3923.             {
  3924.                 if(ACInfo[ac_j][acVeh] == ac_vehid)
  3925.                 {
  3926.                     if(ACInfo[ac_j][acUnFrozen]) ACInfo[ac_j][acIntRet] = 2;
  3927.                     else ACInfo[ac_j][acIntRet] = 1;
  3928.                 }
  3929.             }
  3930.         #else
  3931.             #if defined GetPlayerPoolSize
  3932.                 for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j)
  3933.             #else
  3934.                 for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j)
  3935.             #endif
  3936.             {
  3937.                 if(IsPlayerInVehicle(ac_j, ac_vehid))
  3938.                 {
  3939.                     if(ACInfo[ac_j][acUnFrozen]) ACInfo[ac_j][acIntRet] = 2;
  3940.                     else ACInfo[ac_j][acIntRet] = 1;
  3941.                 }
  3942.             }
  3943.         #endif
  3944.     }
  3945.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3946.         && defined ac_OnEnterExitModShop
  3947.         return ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  3948.     #else
  3949.         return 1;
  3950.     #endif
  3951. }
  3952.  
  3953. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3954.     #if defined _ALS_OnEnterExitModShop
  3955.         #undef OnEnterExitModShop
  3956.     #else
  3957.         #define _ALS_OnEnterExitModShop
  3958.     #endif
  3959.     #define OnEnterExitModShop ac_OnEnterExitModShop
  3960.     #if defined ac_OnEnterExitModShop
  3961.         forward ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  3962.     #endif
  3963. #endif
  3964.  
  3965. #if defined _inc_y_hooks || defined _INC_y_hooks
  3966.     hook OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  3967. #else
  3968.     public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  3969. #endif
  3970. {
  3971.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
  3972.     if(ACInfo[playerid][acIntRet] > 0)
  3973.     {
  3974.         SetPlayerInterior(playerid, ACInfo[playerid][acInt]);
  3975.         if(ACInfo[playerid][acIntRet] == 2) TogglePlayerControllable(playerid, 1);
  3976.         ACInfo[playerid][acIntRet] = 0;
  3977.     }
  3978.     else if(newinteriorid != ACInfo[playerid][acSet][0])
  3979.     {
  3980.         if(ACInfo[playerid][acSet][0] == -1)
  3981.         {
  3982.             new ac_vehid = GetPlayerVehicleID(playerid);
  3983.             if(ac_vehid > 0)
  3984.             {
  3985.                 if(ACInfo[playerid][acACAllow][3] && newinteriorid != ACInfo[playerid][acInt])
  3986.                 {
  3987.                     #if defined DEBUG
  3988.                         printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d, veh: %d",
  3989.                         ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid, ac_vehid);
  3990.                     #endif
  3991.                     ac_KickWithCode(playerid, "", 0, 3, 1);
  3992.                 }
  3993.             }
  3994.             else if(ACInfo[playerid][acIntEnterExits]) ACInfo[playerid][acSetPosTick] = GetTickCount() + 3250;
  3995.             else if(ACInfo[playerid][acACAllow][2] && newinteriorid != ACInfo[playerid][acInt])
  3996.             {
  3997.                 #if defined DEBUG
  3998.                     printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d",
  3999.                     ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid);
  4000.                 #endif
  4001.                 ac_KickWithCode(playerid, "", 0, 2, 1);
  4002.             }
  4003.         }
  4004.     }
  4005.     else ACInfo[playerid][acSet][0] = -1;
  4006.     if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acInt] = newinteriorid % 256;
  4007.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4008.         && defined ac_OnPlayerInteriorChange
  4009.         return ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  4010.     #else
  4011.         return 1;
  4012.     #endif
  4013. }
  4014.  
  4015. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4016.     #if defined _ALS_OnPlayerInteriorChange
  4017.         #undef OnPlayerInteriorChange
  4018.     #else
  4019.         #define _ALS_OnPlayerInteriorChange
  4020.     #endif
  4021.     #define OnPlayerInteriorChange ac_OnPlayerInteriorChange
  4022.     #if defined ac_OnPlayerInteriorChange
  4023.         forward ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  4024.     #endif
  4025. #endif
  4026.  
  4027. #if defined _inc_y_hooks || defined _INC_y_hooks
  4028.     hook OnRconLoginAttempt(ip[], password[], success)
  4029. #else
  4030.     public OnRconLoginAttempt(ip[], password[], success)
  4031. #endif
  4032. {
  4033.     static ac_ipTables[MAX_PLAYERS][2], ac_ipIndex;
  4034.     new ac_i, ac_currentIp = ac_IpToInt(ip);
  4035.     for(; ac_i < ac_ipIndex && ac_i < sizeof ac_ipTables; ++ac_i)
  4036.     {
  4037.         if(ac_ipTables[ac_i][0] == ac_currentIp)
  4038.         {
  4039.             if(success) ac_ipTables[ac_i][1] = 0;
  4040.             else if(ac_ACAllow[42])
  4041.             {
  4042.                 if(++ac_ipTables[ac_i][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
  4043.                 {
  4044.                     #if defined DEBUG
  4045.                         printf(DEBUG_CODE_4, ip, password);
  4046.                     #endif
  4047.                     ac_ipTables[ac_i][1] = 0;
  4048.                     ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 1);
  4049.                 }
  4050.                 #if defined OnCheatWarning
  4051.                     else OnCheatWarning(INVALID_PLAYER_ID, ip, 1, 42, 1, ac_ipTables[ac_i][1]);
  4052.                 #endif
  4053.             }
  4054.             ac_i = -1;
  4055.             break;
  4056.         }
  4057.     }
  4058.     if(ac_i != -1 && !success)
  4059.     {
  4060.         ac_ipTables[ac_ipIndex][0] = ac_currentIp;
  4061.         if(ac_ACAllow[42])
  4062.         {
  4063.             if(++ac_ipTables[ac_ipIndex][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
  4064.             {
  4065.                 #undef AC_MAX_RCON_LOGIN_ATTEMPT
  4066.                 #if defined DEBUG
  4067.                     printf(DEBUG_CODE_4, ip, password, ac_ipTables[ac_ipIndex][1]);
  4068.                 #endif
  4069.                 ac_ipTables[ac_ipIndex][1] = 0;
  4070.                 ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 2);
  4071.             }
  4072.             #if defined OnCheatWarning
  4073.                 else OnCheatWarning(INVALID_PLAYER_ID, ip, 1, 42, 2, ac_ipTables[ac_ipIndex][1]);
  4074.             #endif
  4075.         }
  4076.         if(++ac_ipIndex >= sizeof ac_ipTables) ac_ipIndex = 0;
  4077.         ac_ipTables[ac_ipIndex][1] = 0;
  4078.     }
  4079.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4080.         && defined ac_OnRconLoginAttempt
  4081.         return ac_OnRconLoginAttempt(ip, password, success);
  4082.     #else
  4083.         return 1;
  4084.     #endif
  4085. }
  4086.  
  4087. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4088.     #if defined _ALS_OnRconLoginAttempt
  4089.         #undef OnRconLoginAttempt
  4090.     #else
  4091.         #define _ALS_OnRconLoginAttempt
  4092.     #endif
  4093.     #define OnRconLoginAttempt ac_OnRconLoginAttempt
  4094.     #if defined ac_OnRconLoginAttempt
  4095.         forward ac_OnRconLoginAttempt(ip[], password[], success);
  4096.     #endif
  4097. #endif
  4098.  
  4099. public OnPlayerUpdate(playerid)
  4100. {
  4101.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
  4102.     new ac_gtc = GetTickCount(), ac_gpp;
  4103.     #if AC_USE_NPC
  4104.         if(!IsPlayerNPC(playerid))
  4105.         {
  4106.     #endif
  4107.         new ac_w, ac_sa = GetPlayerState(playerid);
  4108.         if(ac_sa != PLAYER_STATE_SPECTATING && (ac_w = GetPlayerWeapon(playerid)) != -1)
  4109.         {
  4110.             ac_gpp = GetPlayerPing(playerid);
  4111.             new ac_a = GetPlayerAmmo(playerid), ac_s = ac_wSlot[ac_w];
  4112.             if(ACInfo[playerid][acSet][3] != -1)
  4113.             {
  4114.                 if(ACInfo[playerid][acSet][3] == ac_w)
  4115.                 {
  4116.                     ACInfo[playerid][acSet][3] =
  4117.                     ACInfo[playerid][acSetWeapon][ac_s] = -1;
  4118.                     ACInfo[playerid][acWeapon][ac_s] = ac_w;
  4119.                 }
  4120.                 else if(ACInfo[playerid][acGiveAmmo][ac_wSlot[ACInfo[playerid][acSet][3]]] == 0 || ACInfo[playerid][acSet][3] == 0 ||
  4121.                 ac_wSlot[ACInfo[playerid][acSet][3]] != ac_s && ac_gtc > ACInfo[playerid][acGtc][2] + ac_gpp) ACInfo[playerid][acSet][3] = -1;
  4122.                 else if(!(PLAYER_STATE_DRIVER <= ac_sa <= PLAYER_STATE_PASSENGER) && ac_gtc > ACInfo[playerid][acGtc][2] + ac_gpp)
  4123.                 {
  4124.                     if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][0])
  4125.                     {
  4126.                         if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
  4127.                         {
  4128.                             #if defined DEBUG
  4129.                                 printf(DEBUG_CODE_5, playerid, "SetPlayerArmedWeapon");
  4130.                                 printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSet][3], ac_w);
  4131.                             #endif
  4132.                             #if defined OnCheatDetected
  4133.                                 ac_KickWithCode(playerid, "", 0, 52, 1);
  4134.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  4135.                                 ACInfo[playerid][acSetWeapon][ac_s] =
  4136.                                 ACInfo[playerid][acSet][3] = -1;
  4137.                             #else
  4138.                                 return ac_KickWithCode(playerid, "", 0, 52, 1);
  4139.                             #endif
  4140.                         }
  4141.                         #if defined OnNOPWarning
  4142.                             else OnNOPWarning(playerid, 1, ACInfo[playerid][acNOPCount][0]);
  4143.                         #endif
  4144.                     }
  4145.                     else if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
  4146.                     {
  4147.                         ACInfo[playerid][acSetWeapon][ac_s] =
  4148.                         ACInfo[playerid][acSet][3] = -1;
  4149.                     }
  4150.                 }
  4151.             }
  4152.             if(ACInfo[playerid][acGiveAmmo][ac_s] != -65535)
  4153.             {
  4154.                 if(ACInfo[playerid][acGiveAmmo][ac_s] == ac_a ||
  4155.                 ACInfo[playerid][acGiveAmmo][ac_s] > ac_a && !(ac_a < 0 <= ACInfo[playerid][acGiveAmmo][ac_s]) &&
  4156.                 ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_s] + ac_gpp)
  4157.                 {
  4158.                     ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  4159.                     ACInfo[playerid][acAmmo][ac_s] = ac_a;
  4160.                 }
  4161.                 else if(ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_s] + ac_gpp)
  4162.                 {
  4163.                     if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][1])
  4164.                     {
  4165.                         if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS)
  4166.                         {
  4167.                             #if defined DEBUG
  4168.                                 printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  4169.                                 printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  4170.                                 ACInfo[playerid][acGiveAmmo][ac_s], ac_a, ac_w);
  4171.                             #endif
  4172.                             #if defined OnCheatDetected
  4173.                                 ac_KickWithCode(playerid, "", 0, 52, 2);
  4174.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  4175.                                 ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  4176.                             #else
  4177.                                 return ac_KickWithCode(playerid, "", 0, 52, 2);
  4178.                             #endif
  4179.                         }
  4180.                         #if defined OnNOPWarning
  4181.                             else OnNOPWarning(playerid, 2, ACInfo[playerid][acNOPCount][1]);
  4182.                         #endif
  4183.                     }
  4184.                     else if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  4185.                 }
  4186.             }
  4187.             #if AC_USE_AMMUNATIONS || AC_USE_TUNING_GARAGES
  4188.                 new ac_money = orig_GetPlayerMoney(playerid);
  4189.             #endif
  4190.             #if AC_USE_AMMUNATIONS
  4191.                 if(ACInfo[playerid][acSet][10] != -1)
  4192.                 {
  4193.                     if(ac_money < ACInfo[playerid][acMoney] &&
  4194.                     ACInfo[playerid][acSet][10] <= ACInfo[playerid][acMoney] - ac_money) ACInfo[playerid][acSet][10] = -1;
  4195.                     else if(ac_gtc > ACInfo[playerid][acGtc][15] + ac_gpp)
  4196.                     {
  4197.                         if(ACInfo[playerid][acACAllow][15])
  4198.                         {
  4199.                             if(++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_WARNINGS)
  4200.                             {
  4201.                                 #if defined DEBUG
  4202.                                     printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
  4203.                                     ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
  4204.                                 #endif
  4205.                                 #if defined OnCheatDetected
  4206.                                     ac_KickWithCode(playerid, "", 0, 15, 3);
  4207.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4208.                                     ACInfo[playerid][acSet][10] = -1;
  4209.                                 #else
  4210.                                     return ac_KickWithCode(playerid, "", 0, 15, 3);
  4211.                                 #endif
  4212.                             }
  4213.                             #if defined OnCheatWarning
  4214.                                 else OnCheatWarning(playerid, "", 0, 15, 3, ACInfo[playerid][acCheatCount][10]);
  4215.                             #endif
  4216.                         }
  4217.                         else if(++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][10] = -1;
  4218.                     }
  4219.                 }
  4220.             #endif
  4221.             new ac_i = GetPlayerInterior(playerid), Float:ac_pX, Float:ac_pY, Float:ac_pZ, Float:ac_tmp;
  4222.             GetPlayerPos(playerid, ac_pX, ac_pY, ac_pZ);
  4223.             if(ACInfo[playerid][acLastWeapon] != ac_w)
  4224.             {
  4225.                 if(ACInfo[playerid][acWeapon][ac_s] != ac_w && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  4226.                 {
  4227.                     #if AC_USE_PICKUP_WEAPONS
  4228.                         #if defined Streamer_GetDistanceToItem\
  4229.                             && defined Streamer_GetIntData
  4230.                         if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS) Streamer_GetDistanceToItem(ac_pX, ac_pY, ac_pZ, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_tmp);
  4231.                         if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  4232.                         ac_a <= (3 <= ac_s <= 5 ? (ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) &&
  4233.                         IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  4234.                         ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) ||
  4235.                         ACInfo[playerid][acLastPickup] > MAX_PICKUPS &&
  4236.                         Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) == ac_w + 100 &&
  4237.                         ac_a <= (3 <= ac_s <= 5 ? (ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) && ac_tmp <= 15.0)
  4238.                         #else
  4239.                         if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  4240.                         ac_a <= (3 <= ac_s <= 5 ? (ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) &&
  4241.                         IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  4242.                         ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
  4243.                         #endif
  4244.                         {
  4245.                             ACInfo[playerid][acWeapon][ac_s] = ac_w;
  4246.                             ACInfo[playerid][acAmmo][ac_s] = ac_a;
  4247.                         }
  4248.                         else
  4249.                         {
  4250.                     #endif
  4251.                         #if AC_USE_AMMUNATIONS
  4252.                             if(22 <= ac_w <= 32 && ac_InAmmuNation(playerid, ac_i))
  4253.                             {
  4254.                                 ACInfo[playerid][acCheatCount][10] = 0;
  4255.                                 if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0];
  4256.                                 else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0];
  4257.                                 if(3 <= ac_s <= 5) ACInfo[playerid][acAmmo][ac_s] += ac_AmmuNationInfo[ac_w - 22][1];
  4258.                                 else ACInfo[playerid][acAmmo][ac_s] = ac_AmmuNationInfo[ac_w - 22][1];
  4259.                                 ACInfo[playerid][acWeapon][ac_s] = ac_w;
  4260.                                 ACInfo[playerid][acGtc][15] = ac_gtc + 2650;
  4261.                             }
  4262.                             else
  4263.                             {
  4264.                         #endif
  4265.                             if(ac_w == 40 || ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute] > 0)
  4266.                             {
  4267.                                 ACInfo[playerid][acWeapon][ac_s] = ac_w;
  4268.                                 ACInfo[playerid][acAmmo][ac_s] = ac_a;
  4269.                                 ACInfo[playerid][acParachute] = 0;
  4270.                             }
  4271.                             else if(ACInfo[playerid][acACAllow][15] && ACInfo[playerid][acSetWeapon][ac_s] == -1)
  4272.                             {
  4273.                                 #if defined DEBUG
  4274.                                     printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
  4275.                                     ACInfo[playerid][acWeapon][ac_s], ACInfo[playerid][acAmmo][ac_s], ac_w, ac_a);
  4276.                                 #endif
  4277.                                 #if defined OnCheatDetected
  4278.                                     ac_KickWithCode(playerid, "", 0, 15, 1);
  4279.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4280.                                     ACInfo[playerid][acWeapon][ac_s] = ac_w;
  4281.                                     ACInfo[playerid][acAmmo][ac_s] = ac_a;
  4282.                                 #else
  4283.                                     return ac_KickWithCode(playerid, "", 0, 15, 1);
  4284.                                 #endif
  4285.                             }
  4286.                         #if AC_USE_AMMUNATIONS
  4287.                             }
  4288.                         #endif
  4289.                     #if AC_USE_PICKUP_WEAPONS
  4290.                         }
  4291.                     #endif
  4292.                 }
  4293.             }
  4294.             else if(ACInfo[playerid][acAmmo][ac_s] != ac_a)
  4295.             {
  4296.                 switch(ac_w)
  4297.                 {
  4298.                     case 16..18, 35..37, 39, 41..43:
  4299.                     {
  4300.                         if(ac_sa != PLAYER_STATE_DRIVER && ACInfo[playerid][acGiveAmmo][ac_s] == -65535 &&
  4301.                         ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  4302.                         {
  4303.                             if(ACInfo[playerid][acACAllow][16] &&
  4304.                             (ACInfo[playerid][acAmmo][ac_s] == 0 || ac_a > ACInfo[playerid][acAmmo][ac_s] ||
  4305.                             ac_a < 0 < ACInfo[playerid][acAmmo][ac_s]))
  4306.                             {
  4307.                                 #if defined DEBUG
  4308.                                     printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  4309.                                     ACInfo[playerid][acAmmo][ac_s], ac_a, ac_w);
  4310.                                 #endif
  4311.                                 #if defined OnCheatDetected
  4312.                                     ac_KickWithCode(playerid, "", 0, 16, 1);
  4313.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4314.                                 #else
  4315.                                     return ac_KickWithCode(playerid, "", 0, 16, 1);
  4316.                                 #endif
  4317.                             }
  4318.                             ACInfo[playerid][acAmmo][ac_s] = ac_a;
  4319.                         }
  4320.                     }
  4321.                 }
  4322.             }
  4323.             GetPlayerHealth(playerid, ac_tmp);
  4324.             new ac_health = floatround(ac_tmp, floatround_tozero);
  4325.             if(ACInfo[playerid][acSet][1] != -1)
  4326.             {
  4327.                 if(ACInfo[playerid][acSet][1] > 255)
  4328.                 {
  4329.                     ac_health += 256 * (((ACInfo[playerid][acSet][1] - (ACInfo[playerid][acSet][1] % 256)) / 256) - 1);
  4330.                     if(ACInfo[playerid][acSet][1] > ac_health + 255) ac_health += 256;
  4331.                 }
  4332.                 if(ACInfo[playerid][acSet][1] == ac_health || ACInfo[playerid][acDmgRes] ||
  4333.                 ACInfo[playerid][acSet][1] > ac_health && ac_gtc > ACInfo[playerid][acGtc][3] + ac_gpp)
  4334.                 {
  4335.                     ACInfo[playerid][acSet][1] = -1;
  4336.                     ACInfo[playerid][acDmgRes] = 0;
  4337.                 }
  4338.                 else if(ac_gtc > ACInfo[playerid][acGtc][3] + ac_gpp)
  4339.                 {
  4340.                     if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][3])
  4341.                     {
  4342.                         if(++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS)
  4343.                         {
  4344.                             #if defined DEBUG
  4345.                                 printf(DEBUG_CODE_5, playerid, "SetPlayerHealth");
  4346.                                 printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acSet][1], ac_health);
  4347.                             #endif
  4348.                             #if defined OnCheatDetected
  4349.                                 ac_KickWithCode(playerid, "", 0, 52, 3);
  4350.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  4351.                                 ACInfo[playerid][acSet][1] = -1;
  4352.                             #else
  4353.                                 return ac_KickWithCode(playerid, "", 0, 52, 3);
  4354.                             #endif
  4355.                         }
  4356.                         #if defined OnNOPWarning
  4357.                             else OnNOPWarning(playerid, 3, ACInfo[playerid][acNOPCount][3]);
  4358.                         #endif
  4359.                     }
  4360.                     else if(++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][1] = -1;
  4361.                 }
  4362.             }
  4363.             else if(ACInfo[playerid][acACAllow][12])
  4364.             {
  4365.                 if(ACInfo[playerid][acHealth] > 255)
  4366.                 {
  4367.                     ac_health += 256 * (((ACInfo[playerid][acHealth] - (ACInfo[playerid][acHealth] % 256)) / 256) - 1);
  4368.                     if(ACInfo[playerid][acHealth] > ac_health + 255) ac_health += 256;
  4369.                 }
  4370.                 if(ac_health > ACInfo[playerid][acHealth])
  4371.                 {
  4372.                     #if AC_USE_RESTAURANTS
  4373.                         if(ac_health > ACInfo[playerid][acHealth] + 70 || !ac_InRestaurant(playerid, ac_i))
  4374.                         {
  4375.                     #endif
  4376.                         #if AC_USE_VENDING_MACHINES
  4377.                             if(ac_health > ACInfo[playerid][acHealth] + 35 || !ac_NearVendingMachine(playerid, ac_i))
  4378.                             {
  4379.                         #endif
  4380.                             #if defined DEBUG
  4381.                                 printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acHealth], ac_health);
  4382.                             #endif
  4383.                             #if defined OnCheatDetected
  4384.                                 ac_KickWithCode(playerid, "", 0, 12);
  4385.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  4386.                             #else
  4387.                                 return ac_KickWithCode(playerid, "", 0, 12);
  4388.                             #endif
  4389.                         #if AC_USE_VENDING_MACHINES
  4390.                             }
  4391.                         #endif
  4392.                     #if AC_USE_RESTAURANTS
  4393.                         }
  4394.                     #endif
  4395.                 }
  4396.             }
  4397.             GetPlayerArmour(playerid, ac_tmp);
  4398.             new ac_armour = floatround(ac_tmp, floatround_tozero);
  4399.             if(ACInfo[playerid][acSet][2] != -1)
  4400.             {
  4401.                 if(ACInfo[playerid][acSet][2] > 255)
  4402.                 {
  4403.                     ac_armour += 256 * (((ACInfo[playerid][acSet][2] - (ACInfo[playerid][acSet][2] % 256)) / 256) - 1);
  4404.                     if(ACInfo[playerid][acSet][2] > ac_armour + 255) ac_armour += 256;
  4405.                 }
  4406.                 if(ACInfo[playerid][acSet][2] == ac_armour || ACInfo[playerid][acDmgRes] ||
  4407.                 ACInfo[playerid][acSet][2] > ac_armour && ac_gtc > ACInfo[playerid][acGtc][5] + ac_gpp)
  4408.                 {
  4409.                     ACInfo[playerid][acSet][2] = -1;
  4410.                     ACInfo[playerid][acDmgRes] = 0;
  4411.                 }
  4412.                 else if(ac_gtc > ACInfo[playerid][acGtc][5] + ac_gpp)
  4413.                 {
  4414.                     if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][5])
  4415.                     {
  4416.                         if(++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS)
  4417.                         {
  4418.                             #if defined DEBUG
  4419.                                 printf(DEBUG_CODE_5, playerid, "SetPlayerArmour");
  4420.                                 printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acSet][2], ac_armour);
  4421.                             #endif
  4422.                             #if defined OnCheatDetected
  4423.                                 ac_KickWithCode(playerid, "", 0, 52, 4);
  4424.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  4425.                                 ACInfo[playerid][acSet][2] = -1;
  4426.                             #else
  4427.                                 return ac_KickWithCode(playerid, "", 0, 52, 4);
  4428.                             #endif
  4429.                         }
  4430.                         #if defined OnNOPWarning
  4431.                             else OnNOPWarning(playerid, 4, ACInfo[playerid][acNOPCount][5]);
  4432.                         #endif
  4433.                     }
  4434.                     else if(++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][2] = -1;
  4435.                 }
  4436.             }
  4437.             else if(ACInfo[playerid][acACAllow][13])
  4438.             {
  4439.                 if(ACInfo[playerid][acArmour] > 255)
  4440.                 {
  4441.                     ac_armour += 256 * (((ACInfo[playerid][acArmour] - (ACInfo[playerid][acArmour] % 256)) / 256) - 1);
  4442.                     if(ACInfo[playerid][acArmour] > ac_armour + 255) ac_armour += 256;
  4443.                 }
  4444.                 if(ac_armour > ACInfo[playerid][acArmour])
  4445.                 {
  4446.                     #if AC_USE_AMMUNATIONS
  4447.                         if(ac_InAmmuNation(playerid, ac_i))
  4448.                         {
  4449.                             ACInfo[playerid][acCheatCount][10] = 0;
  4450.                             if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += 200;
  4451.                             else ACInfo[playerid][acSet][10] = 200;
  4452.                             ACInfo[playerid][acGtc][15] = ac_gtc + 2650;
  4453.                         }
  4454.                         else
  4455.                         {
  4456.                     #endif
  4457.                         #if defined DEBUG
  4458.                             printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acArmour], ac_armour);
  4459.                         #endif
  4460.                         #if defined OnCheatDetected
  4461.                             ac_KickWithCode(playerid, "", 0, 13);
  4462.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4463.                         #else
  4464.                             return ac_KickWithCode(playerid, "", 0, 13);
  4465.                         #endif
  4466.                     #if AC_USE_AMMUNATIONS
  4467.                         }
  4468.                     #endif
  4469.                 }
  4470.             }
  4471.             if(ac_health < ACInfo[playerid][acHealth] || ac_armour < ACInfo[playerid][acArmour])
  4472.             {
  4473.                 ACInfo[playerid][acVehDmgRes] = false;
  4474.                 ACInfo[playerid][acCheatCount][9] = ACInfo[playerid][acDmgRes] = 0;
  4475.             }
  4476.             else if(ACInfo[playerid][acACAllow][19] &&
  4477.             ACInfo[playerid][acDmgRes] && ac_gtc > ACInfo[playerid][acGtc][14] + ac_gpp)
  4478.             {
  4479.                 ACInfo[playerid][acDmgRes] = 0;
  4480.                 ACInfo[playerid][acVehDmgRes] = false;
  4481.                 if(++ACInfo[playerid][acCheatCount][9] > AC_MAX_GODMODE_WARNINGS)
  4482.                 {
  4483.                     #undef AC_MAX_GODMODE_WARNINGS
  4484.                     #if defined DEBUG
  4485.                         printf("[Nex-AC debug] AC health: %d, health: %d, AC armour: %d, armour: %d",
  4486.                         ACInfo[playerid][acHealth], ac_health, ACInfo[playerid][acArmour], ac_armour);
  4487.                     #endif
  4488.                     #if defined OnCheatDetected
  4489.                         ac_KickWithCode(playerid, "", 0, 19);
  4490.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  4491.                         ACInfo[playerid][acCheatCount][9] = 0;
  4492.                     #else
  4493.                         return ac_KickWithCode(playerid, "", 0, 19);
  4494.                     #endif
  4495.                 }
  4496.                 #if defined OnCheatWarning
  4497.                     else OnCheatWarning(playerid, "", 0, 19, 0, ACInfo[playerid][acCheatCount][9]);
  4498.                 #endif
  4499.             }
  4500.             #if AC_USE_TUNING_GARAGES
  4501.             if(ACInfo[playerid][acSet][12] != -1)
  4502.             {
  4503.                 if(ac_money < ACInfo[playerid][acMoney] &&
  4504.                 ACInfo[playerid][acSet][12] <= ACInfo[playerid][acMoney] - ac_money) ACInfo[playerid][acSet][12] = -1;
  4505.                 else if(ac_gtc > ACInfo[playerid][acGtc][17] + ac_gpp)
  4506.                 {
  4507.                     if(ACInfo[playerid][acACAllow][23])
  4508.                     {
  4509.                         if(++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_WARNINGS)
  4510.                         {
  4511.                             #if defined DEBUG
  4512.                                 printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
  4513.                                 ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][12]);
  4514.                             #endif
  4515.                             #if defined OnCheatDetected
  4516.                                 ac_KickWithCode(playerid, "", 0, 23, 3);
  4517.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  4518.                                 ACInfo[playerid][acSet][12] = -1;
  4519.                             #else
  4520.                                 return ac_KickWithCode(playerid, "", 0, 23, 3);
  4521.                             #endif
  4522.                         }
  4523.                         #if defined OnCheatWarning
  4524.                             else OnCheatWarning(playerid, "", 0, 23, 3, ACInfo[playerid][acCheatCount][12]);
  4525.                         #endif
  4526.                     }
  4527.                     else if(++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][12] = -1;
  4528.                 }
  4529.             }
  4530.             #endif
  4531.             if(ACInfo[playerid][acSet][0] != -1 && ac_gtc > ACInfo[playerid][acGtc][0] + ac_gpp)
  4532.             {
  4533.                 if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][2] && ac_i != ACInfo[playerid][acSet][0])
  4534.                 {
  4535.                     if(++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS)
  4536.                     {
  4537.                         #if defined DEBUG
  4538.                             printf(DEBUG_CODE_5, playerid, "SetPlayerInterior");
  4539.                             printf("[Nex-AC debug] AC interior: %d, interiorid: %d", ACInfo[playerid][acSet][0], ac_i);
  4540.                         #endif
  4541.                         #if defined OnCheatDetected
  4542.                             ac_KickWithCode(playerid, "", 0, 52, 5);
  4543.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4544.                             ACInfo[playerid][acSet][0] = -1;
  4545.                         #else
  4546.                             return ac_KickWithCode(playerid, "", 0, 52, 5);
  4547.                         #endif
  4548.                     }
  4549.                     #if defined OnNOPWarning
  4550.                         else OnNOPWarning(playerid, 5, ACInfo[playerid][acNOPCount][2]);
  4551.                     #endif
  4552.                 }
  4553.                 else if(++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][0] = -1;
  4554.             }
  4555.             if(ACInfo[playerid][acSet][6] != -1 && ac_gtc > ACInfo[playerid][acGtc][12] + ac_gpp)
  4556.             {
  4557.                 if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][8])
  4558.                 {
  4559.                     if(++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS)
  4560.                     {
  4561.                         #if defined DEBUG
  4562.                             printf(DEBUG_CODE_5, playerid, "TogglePlayerSpectating");
  4563.                         #endif
  4564.                         #if defined OnCheatDetected
  4565.                             ac_KickWithCode(playerid, "", 0, 52, 6);
  4566.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4567.                             ACInfo[playerid][acSet][6] = -1;
  4568.                         #else
  4569.                             return ac_KickWithCode(playerid, "", 0, 52, 6);
  4570.                         #endif
  4571.                     }
  4572.                     #if defined OnNOPWarning
  4573.                         else OnNOPWarning(playerid, 6, ACInfo[playerid][acNOPCount][8]);
  4574.                     #endif
  4575.                 }
  4576.                 else if(++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][6] = -1;
  4577.             }
  4578.             if(ACInfo[playerid][acSet][7] != -1 && ac_gtc > ACInfo[playerid][acGtc][13] + ac_gpp)
  4579.             {
  4580.                 if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][9])
  4581.                 {
  4582.                     if(++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS)
  4583.                     {
  4584.                         #if defined DEBUG
  4585.                             printf(DEBUG_CODE_5, playerid, "SpawnPlayer");
  4586.                             printf("[Nex-AC debug] acSet[7]: %d", ACInfo[playerid][acSet][7]);
  4587.                         #endif
  4588.                         #if defined OnCheatDetected
  4589.                             ac_KickWithCode(playerid, "", 0, 52, 7);
  4590.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4591.                             ACInfo[playerid][acSet][7] = -1;
  4592.                         #else
  4593.                             return ac_KickWithCode(playerid, "", 0, 52, 7);
  4594.                         #endif
  4595.                     }
  4596.                     #if defined OnNOPWarning
  4597.                         else OnNOPWarning(playerid, 7, ACInfo[playerid][acNOPCount][9]);
  4598.                     #endif
  4599.                 }
  4600.                 else if(++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][7] = -1;
  4601.             }
  4602.             new ac_vehid = GetPlayerVehicleID(playerid);
  4603.             if(ACInfo[playerid][acSet][11] != -1 && ac_vehid > 0 && ac_gtc > ACInfo[playerid][acGtc][8] + ac_gpp)
  4604.             {
  4605.                 if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][11])
  4606.                 {
  4607.                     new Float:ac_vX, Float:ac_vY, Float:ac_vZ;
  4608.                     GetVehicleVelocity(ac_vehid, ac_vX, ac_vY, ac_vZ);
  4609.                     if(ac_GetSpeed(ac_vX, ac_vY, ac_vZ) <= 30)
  4610.                     {
  4611.                         #if defined DEBUG
  4612.                             printf(DEBUG_CODE_5, playerid, "RemovePlayerFromVehicle");
  4613.                             printf("[Nex-AC debug] Veh model: %d, veh: %d", GetVehicleModel(ac_vehid), ac_vehid);
  4614.                         #endif
  4615.                         #if defined OnCheatDetected
  4616.                             ac_KickWithCode(playerid, "", 0, 52, 8);
  4617.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4618.                             ACInfo[playerid][acSet][11] = -1;
  4619.                         #else
  4620.                             return ac_KickWithCode(playerid, "", 0, 52, 8);
  4621.                         #endif
  4622.                     }
  4623.                 }
  4624.                 else ACInfo[playerid][acSet][11] = -1;
  4625.             }
  4626.             ac_s = GetPlayerVehicleSeat(playerid);
  4627.             if(ACInfo[playerid][acSet][9] != -1)
  4628.             {
  4629.                 if(ACInfo[playerid][acSet][9] == ac_vehid &&
  4630.                 (ACInfo[playerid][acSet][5] == ac_s || ACInfo[playerid][acSet][5] == -1))
  4631.                 {
  4632.                     if(ACInfo[playerid][acVeh] > 0)
  4633.                     {
  4634.                         if(ac_IsAnAircraft(GetVehicleModel(ACInfo[playerid][acVeh]))) ACInfo[playerid][acParachute] = 2;
  4635.                         if(ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = INVALID_PLAYER_ID;
  4636.                     }
  4637.                     if(ac_s == 0)
  4638.                     {
  4639.                         ACVehInfo[ac_vehid][acDriver] = playerid;
  4640.                         GetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
  4641.                         ACInfo[playerid][acGtc][9] = ac_gtc + 1650;
  4642.                         ACInfo[playerid][acSetVehHealth] = -1.0;
  4643.                         ACInfo[playerid][acLastPosX] = ac_pX;
  4644.                         ACInfo[playerid][acLastPosY] = ac_pY;
  4645.                     }
  4646.                     ACInfo[playerid][acEnterVeh] =
  4647.                     ACInfo[playerid][acCheatCount][11] = 0;
  4648.                     ACInfo[playerid][acVehDmgRes] = false;
  4649.                     ACInfo[playerid][acEnterSeat] =
  4650.                     ACInfo[playerid][acSet][11] =
  4651.                     ACInfo[playerid][acSet][9] =
  4652.                     ACInfo[playerid][acSet][8] = -1;
  4653.                     ACInfo[playerid][acSeat] = ac_s;
  4654.                 }
  4655.                 else if(ac_gtc > ACInfo[playerid][acGtc][1] + ac_gpp)
  4656.                 {
  4657.                     if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][7] &&
  4658.                     ACInfo[playerid][acSet][5] != -1 && ACVehInfo[ACInfo[playerid][acSet][9]][acSpawned])
  4659.                     {
  4660.                         if(++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS)
  4661.                         {
  4662.                             #if defined DEBUG
  4663.                                 printf(DEBUG_CODE_5, playerid, "PutPlayerInVehicle");
  4664.                                 printf("[Nex-AC debug] AC veh: %d, veh: %d, AC seat: %d, seatid: %d",
  4665.                                 ACInfo[playerid][acSet][9], ac_vehid, ACInfo[playerid][acSet][5], ac_s);
  4666.                             #endif
  4667.                             #if defined OnCheatDetected
  4668.                                 ac_KickWithCode(playerid, "", 0, 52, 9);
  4669.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  4670.                                 ACInfo[playerid][acSet][9] = -1;
  4671.                             #else
  4672.                                 return ac_KickWithCode(playerid, "", 0, 52, 9);
  4673.                             #endif
  4674.                         }
  4675.                         #if defined OnNOPWarning
  4676.                             else OnNOPWarning(playerid, 9, ACInfo[playerid][acNOPCount][7]);
  4677.                         #endif
  4678.                     }
  4679.                     else if(++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][9] = -1;
  4680.                 }
  4681.             }
  4682.             else
  4683.             {
  4684.                 new Float:ac_dist_set = 25000.0;
  4685.                 if(ACInfo[playerid][acSet][8] != -1)
  4686.                 {
  4687.                     ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_pZ : ACInfo[playerid][acSetPosZ]));
  4688.                     if(ac_dist_set < 15.0)
  4689.                     {
  4690.                         ACInfo[playerid][acSet][8] = -1;
  4691.                         ACInfo[playerid][acGtc][11] = 0;
  4692.                         ACInfo[playerid][acTpToZ] = false;
  4693.                         ACInfo[playerid][acLastPosX] = ac_pX;
  4694.                         ACInfo[playerid][acLastPosY] = ac_pY;
  4695.                         ACInfo[playerid][acPosX] = ac_pX;
  4696.                         ACInfo[playerid][acPosY] = ac_pY;
  4697.                         ACInfo[playerid][acPosZ] = ac_pZ;
  4698.                     }
  4699.                     else if(ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  4700.                     {
  4701.                         if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][10])
  4702.                         {
  4703.                             if(++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS)
  4704.                             {
  4705.                                 #if defined DEBUG
  4706.                                     printf(DEBUG_CODE_5, playerid, "SetPlayerPos");
  4707.                                     printf("[Nex-AC debug] Dist: %f, acSet[8]: %d", ac_dist_set, ACInfo[playerid][acSet][8]);
  4708.                                 #endif
  4709.                                 #if defined OnCheatDetected
  4710.                                     ac_KickWithCode(playerid, "", 0, 52, 10);
  4711.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4712.                                     ACInfo[playerid][acTpToZ] = false;
  4713.                                     ACInfo[playerid][acSet][8] = -1;
  4714.                                 #else
  4715.                                     return ac_KickWithCode(playerid, "", 0, 52, 10);
  4716.                                 #endif
  4717.                             }
  4718.                             #if defined OnNOPWarning
  4719.                                 else OnNOPWarning(playerid, 10, ACInfo[playerid][acNOPCount][10]);
  4720.                             #endif
  4721.                         }
  4722.                         else if(++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS)
  4723.                         {
  4724.                             ACInfo[playerid][acTpToZ] = false;
  4725.                             ACInfo[playerid][acSet][8] = -1;
  4726.                         }
  4727.                     }
  4728.                 }
  4729.                 new Float:ac_vX, Float:ac_vY, Float:ac_vZ, ac_specact = GetPlayerSpecialAction(playerid),
  4730.                 Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  4731.                 if(ac_vehid > 0)
  4732.                 {
  4733.                     if(ACInfo[playerid][acVeh] > 0)
  4734.                     {
  4735.                         if(ACInfo[playerid][acVeh] != ac_vehid)
  4736.                         {
  4737.                             if(ACInfo[playerid][acACAllow][4])
  4738.                             {
  4739.                                 #if defined DEBUG
  4740.                                     printf("[Nex-AC debug] AC veh: %d, veh: %d", ACInfo[playerid][acVeh], ac_vehid);
  4741.                                 #endif
  4742.                                 #if defined OnCheatDetected
  4743.                                     ac_KickWithCode(playerid, "", 0, 4, 2);
  4744.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4745.                                 #else
  4746.                                     return ac_KickWithCode(playerid, "", 0, 4, 2);
  4747.                                 #endif
  4748.                             }
  4749.                         }
  4750.                         else if(ACInfo[playerid][acACAllow][50] && ACInfo[playerid][acSeat] != ac_s)
  4751.                         {
  4752.                             #if defined DEBUG
  4753.                                 printf("[Nex-AC debug] AC seat: %d, seatid: %d, veh: %d", ACInfo[playerid][acSeat], ac_s, ac_vehid);
  4754.                             #endif
  4755.                             #if defined OnCheatDetected
  4756.                                 ac_KickWithCode(playerid, "", 0, 50);
  4757.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  4758.                             #else
  4759.                                 return ac_KickWithCode(playerid, "", 0, 50);
  4760.                             #endif
  4761.                         }
  4762.                     }
  4763.                     if(ac_sa == PLAYER_STATE_DRIVER)
  4764.                     {
  4765.                         if(ACInfo[playerid][acACAllow][32] && ACVehInfo[ac_vehid][acDriver] != playerid &&
  4766.                         ACVehInfo[ac_vehid][acDriver] != INVALID_PLAYER_ID)
  4767.                         {
  4768.                             #if defined DEBUG
  4769.                                 printf("[Nex-AC debug] AC driver: %d, driver: %d, veh: %d",
  4770.                                 ACVehInfo[ac_vehid][acDriver], playerid, ac_vehid);
  4771.                             #endif
  4772.                             #if defined OnCheatDetected
  4773.                                 ac_KickWithCode(playerid, "", 0, 32);
  4774.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  4775.                             #else
  4776.                                 return SetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  4777.                             #endif
  4778.                         }
  4779.                         new Float:ac_vHealth;
  4780.                         GetVehicleHealth(ac_vehid, ac_vHealth);
  4781.                         if(ACInfo[playerid][acSetVehHealth] != -1.0)
  4782.                         {
  4783.                             if(ACInfo[playerid][acSetVehHealth] == ac_vHealth ||
  4784.                             ACInfo[playerid][acSetVehHealth] > ac_vHealth && ac_gtc > ACInfo[playerid][acGtc][4] + ac_gpp)
  4785.                             {
  4786.                                 ACInfo[playerid][acSetVehHealth] = -1.0;
  4787.                                 ACInfo[playerid][acVehDmgRes] = false;
  4788.                             }
  4789.                             else if(ac_gtc > ACInfo[playerid][acGtc][4] + ac_gpp)
  4790.                             {
  4791.                                 if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][4])
  4792.                                 {
  4793.                                     if(++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS)
  4794.                                     {
  4795.                                         #if defined DEBUG
  4796.                                             printf(DEBUG_CODE_5, playerid, "SetVehicleHealth");
  4797.                                             printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d",
  4798.                                             ACInfo[playerid][acSetVehHealth], ac_vHealth, ac_vehid);
  4799.                                         #endif
  4800.                                         #if defined OnCheatDetected
  4801.                                             ac_KickWithCode(playerid, "", 0, 52, 11);
  4802.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4803.                                             ACInfo[playerid][acSetVehHealth] = -1.0;
  4804.                                         #else
  4805.                                             return ac_KickWithCode(playerid, "", 0, 52, 11);
  4806.                                         #endif
  4807.                                     }
  4808.                                     #if defined OnNOPWarning
  4809.                                         else OnNOPWarning(playerid, 11, ACInfo[playerid][acNOPCount][4]);
  4810.                                     #endif
  4811.                                 }
  4812.                                 else if(++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSetVehHealth] = -1.0;
  4813.                             }
  4814.                         }
  4815.                         else if(ACInfo[playerid][acACAllow][11] &&
  4816.                         (ac_vHealth != ac_vHealth || ac_vHealth > ACVehInfo[ac_vehid][acHealth] &&
  4817.                         !ACInfo[playerid][acModShop] && ac_vHealth))
  4818.                         {
  4819.                             #if AC_USE_PAYNSPRAY
  4820.                                 if(!ac_InPayNSpray(playerid, ac_i))
  4821.                                 {
  4822.                             #endif
  4823.                                 #if defined DEBUG
  4824.                                     printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d, playerid: %d",
  4825.                                     ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid, playerid);
  4826.                                 #endif
  4827.                                 #if defined OnCheatDetected
  4828.                                     ac_KickWithCode(playerid, "", 0, 11);
  4829.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4830.                                 #endif
  4831.                                 SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
  4832.                             #if AC_USE_PAYNSPRAY
  4833.                                 }
  4834.                             #endif
  4835.                         }
  4836.                         if(ACInfo[playerid][acVehDmgRes])
  4837.                         {
  4838.                             if(ac_vHealth < ACVehInfo[ac_vehid][acHealth])
  4839.                             {
  4840.                                 ACInfo[playerid][acVehDmgRes] = false;
  4841.                                 ACInfo[playerid][acCheatCount][11] = ACInfo[playerid][acDmgRes] = 0;
  4842.                             }
  4843.                             else if(ACInfo[playerid][acACAllow][20] && ac_gtc > ACInfo[playerid][acGtc][16] + ac_gpp)
  4844.                             {
  4845.                                 ACInfo[playerid][acDmgRes] = 0;
  4846.                                 ACInfo[playerid][acVehDmgRes] = false;
  4847.                                 if(++ACInfo[playerid][acCheatCount][11] > AC_MAX_GODMODE_VEH_WARNINGS)
  4848.                                 {
  4849.                                     #undef AC_MAX_GODMODE_VEH_WARNINGS
  4850.                                     #if defined DEBUG
  4851.                                         printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d",
  4852.                                         ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid);
  4853.                                     #endif
  4854.                                     #if defined OnCheatDetected
  4855.                                         ac_KickWithCode(playerid, "", 0, 20);
  4856.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  4857.                                         ACInfo[playerid][acCheatCount][11] = 0;
  4858.                                     #else
  4859.                                         return ac_KickWithCode(playerid, "", 0, 20);
  4860.                                     #endif
  4861.                                 }
  4862.                                 #if defined OnCheatWarning
  4863.                                     else OnCheatWarning(playerid, "", 0, 20, 0, ACInfo[playerid][acCheatCount][11]);
  4864.                                 #endif
  4865.                             }
  4866.                         }
  4867.                         GetVehicleVelocity(ac_vehid, ac_vX, ac_vY, ac_vZ);
  4868.                         new Float:ac_zAngle, ac_vsp = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  4869.                         GetVehicleZAngle(ac_vehid, ac_zAngle);
  4870.                         if(ac_dist > 0.8)
  4871.                         {
  4872.                             if(ac_dist >= 80.0 && ac_dist > ACVehInfo[ac_vehid][acPosDiff] + ((ac_dist / 2.6) * 1.8) &&
  4873.                             ac_dist_set >= 80.0 && ac_dist_set > ACVehInfo[ac_vehid][acPosDiff] + ((ac_dist_set / 2.6) * 1.8))
  4874.                             {
  4875.                                 #if defined VectorSize
  4876.                                 if(ACInfo[playerid][acACAllow][3] && ac_gtc > ACInfo[playerid][acGtc][19] + ac_gpp &&
  4877.                                 (ACInfo[playerid][acPosZ] > -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
  4878.                                 VectorSize(ac_pX - ACInfo[playerid][acPosX], ac_pY - ACInfo[playerid][acPosY], 0.0) >= 180.0 ||
  4879.                                 ++ACInfo[playerid][acCheatCount][21] > AC_MAX_TELEPORT_GLITCH_WARNINGS))
  4880.                                 #else
  4881.                                 if(ACInfo[playerid][acACAllow][3] && ac_gtc > ACInfo[playerid][acGtc][19] + ac_gpp &&
  4882.                                 (ACInfo[playerid][acPosZ] > -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
  4883.                                 floatsqroot(floatpower(ac_pX - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_pY - ACInfo[playerid][acPosY], 2.0)) >= 180.0 ||
  4884.                                 ++ACInfo[playerid][acCheatCount][21] > AC_MAX_TELEPORT_GLITCH_WARNINGS))
  4885.                                 #endif
  4886.                                 {
  4887.                                     #if defined DEBUG
  4888.                                         printf("[Nex-AC debug] Dist: %f, dist set: %f, old pos diff: %f, speed: %d, veh: %d",
  4889.                                         ac_dist, ac_dist_set, ACVehInfo[ac_vehid][acPosDiff], ac_vsp, ac_vehid);
  4890.                                     #endif
  4891.                                     #if defined OnCheatDetected
  4892.                                         ac_KickWithCode(playerid, "", 0, 3, 2);
  4893.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  4894.                                         ACInfo[playerid][acCheatCount][21] = 0;
  4895.                                     #else
  4896.                                         return ac_KickWithCode(playerid, "", 0, 3, 2);
  4897.                                     #endif
  4898.                                 }
  4899.                                 else
  4900.                                 {
  4901.                                     ACInfo[playerid][acLastPosX] = ac_pX;
  4902.                                     ACInfo[playerid][acLastPosY] = ac_pY;
  4903.                                 }
  4904.                             }
  4905.                             else if(ac_vsp < 12 && ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  4906.                             {
  4907.                                 if(ac_dist >= 40.0 && ac_dist_set >= 40.0)
  4908.                                 {
  4909.                                     if(ACInfo[playerid][acACAllow][3])
  4910.                                     {
  4911.                                         #if defined DEBUG
  4912.                                             printf("[Nex-AC debug] Speed: %d, dist: %f, dist set: %f", ac_vsp, ac_dist, ac_dist_set);
  4913.                                         #endif
  4914.                                         #if defined OnCheatDetected
  4915.                                             ac_KickWithCode(playerid, "", 0, 3, 4);
  4916.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4917.                                         #else
  4918.                                             return ac_KickWithCode(playerid, "", 0, 3, 4);
  4919.                                         #endif
  4920.                                     }
  4921.                                 }
  4922.                                 else if(ACInfo[playerid][acACAllow][1])
  4923.                                 {
  4924.                                     if(++ACInfo[playerid][acCheatCount][2] > AC_MAX_AIR_VEH_WARNINGS)
  4925.                                     {
  4926.                                         #undef AC_MAX_AIR_VEH_WARNINGS
  4927.                                         #if defined DEBUG
  4928.                                             printf("[Nex-AC debug] Speed: %d, dist: %f, veh: %d", ac_vsp, ac_dist, ac_vehid);
  4929.                                         #endif
  4930.                                         #if defined OnCheatDetected
  4931.                                             ac_KickWithCode(playerid, "", 0, 1);
  4932.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4933.                                             ACInfo[playerid][acCheatCount][2] = 0;
  4934.                                         #else
  4935.                                             return ac_KickWithCode(playerid, "", 0, 1);
  4936.                                         #endif
  4937.                                     }
  4938.                                     #if defined OnCheatWarning
  4939.                                         else OnCheatWarning(playerid, "", 0, 1, 0, ACInfo[playerid][acCheatCount][2]);
  4940.                                     #endif
  4941.                                 }
  4942.                             }
  4943.                         }
  4944.                         if(ac_gtc > ACInfo[playerid][acGtc][9] + ac_gpp)
  4945.                         {
  4946.                             ac_i = GetVehicleModel(ac_vehid);
  4947.                             new ac_spDiff = ac_vsp - ac_GetSpeed(ACVehInfo[ac_vehid][acVelX], ACVehInfo[ac_vehid][acVelY], ACVehInfo[ac_vehid][acVelZ]);
  4948.                             if(ACInfo[playerid][acACAllow][10])
  4949.                             {
  4950.                                 if(ac_spDiff > 230)
  4951.                                 {
  4952.                                     #if defined DEBUG
  4953.                                         printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d",
  4954.                                         ac_vsp, ac_vsp - ac_spDiff, ac_i);
  4955.                                     #endif
  4956.                                     #if defined OnCheatDetected
  4957.                                         ac_KickWithCode(playerid, "", 0, 10, 3);
  4958.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  4959.                                     #else
  4960.                                         return ac_KickWithCode(playerid, "", 0, 10, 3);
  4961.                                     #endif
  4962.                                 }
  4963.                                 else if(ac_spDiff >= 20 &&
  4964.                                 ACVehInfo[ac_vehid][acSpeedDiff] <= ac_spDiff && ACVehInfo[ac_vehid][acHealth] <= ac_vHealth &&
  4965.                                 !((ac_i == 432 || ac_i == 449 || 537 <= ac_i <= 538) && ac_spDiff < 65 ||
  4966.                                 ac_IsABicycle(ac_i) && floatabs(ac_vX) <= 0.3 && floatabs(ac_vY) <= 0.3 && floatabs(ac_vZ) <= 0.3 ||
  4967.                                 !(ac_IsABicycle(ac_i) || ac_i == 449 || 537 <= ac_i <= 538) && ACVehInfo[ac_vehid][acHealth] < 250.0))
  4968.                                 {
  4969.                                     ACInfo[playerid][acCheatCount][16] += (1 * AC_SPEEDHACK_VEH_RESET_DELAY);
  4970.                                     if(ACInfo[playerid][acCheatCount][16] > AC_MAX_SPEEDHACK_VEH_WARNINGS)
  4971.                                     {
  4972.                                         #if defined DEBUG
  4973.                                             printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d",
  4974.                                             ac_vsp, ac_vsp - ac_spDiff, ac_i);
  4975.                                         #endif
  4976.                                         #if defined OnCheatDetected
  4977.                                             ac_KickWithCode(playerid, "", 0, 10, 1);
  4978.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4979.                                             ACInfo[playerid][acCheatCount][16] = 0;
  4980.                                         #else
  4981.                                             return ac_KickWithCode(playerid, "", 0, 10, 1);
  4982.                                         #endif
  4983.                                     }
  4984.                                     #if defined OnCheatWarning
  4985.                                         else OnCheatWarning(playerid, "", 0, 10, 1, floatround(ACInfo[playerid][acCheatCount][16] / AC_SPEEDHACK_VEH_RESET_DELAY));
  4986.                                     #endif
  4987.                                 }
  4988.                             }
  4989.                             if(ACInfo[playerid][acACAllow][25] &&
  4990.                             ac_vsp > 15 && ac_abs(ac_spDiff) < 25 &&
  4991.                             floatround(floatabs(ac_zAngle - ACVehInfo[ac_vehid][acZAngle])) == 180 &&
  4992.                             (ac_vX < 0.0) != (ACVehInfo[ac_vehid][acVelX] < 0.0) &&
  4993.                             (ac_vY < 0.0) != (ACVehInfo[ac_vehid][acVelY] < 0.0) &&
  4994.                             (ac_vZ < 0.0) != (ACVehInfo[ac_vehid][acVelZ] < 0.0))
  4995.                             {
  4996.                                 #undef ac_abs
  4997.                                 #if defined DEBUG
  4998.                                     printf("[Nex-AC debug] Speed: %d, speed diff: %d, z angle: %f, old z angle: %f, veh: %d",
  4999.                                     ac_vsp, ac_spDiff, ac_zAngle, ACVehInfo[ac_vehid][acZAngle], ac_vehid);
  5000.                                 #endif
  5001.                                 #if defined OnCheatDetected
  5002.                                     ac_KickWithCode(playerid, "", 0, 25);
  5003.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5004.                                 #else
  5005.                                     return ac_KickWithCode(playerid, "", 0, 25);
  5006.                                 #endif
  5007.                             }
  5008.                             if(ac_IsAnAircraft(ac_i))
  5009.                             {
  5010.                                 if(ACInfo[playerid][acACAllow][10] && (ac_vsp = ac_GetSpeed(ac_vX, ac_vY)) > 270)
  5011.                                 {
  5012.                                     #if defined DEBUG
  5013.                                         printf("[Nex-AC debug] Speed (x, y): %d, veh model: %d", ac_vsp, ac_i);
  5014.                                     #endif
  5015.                                     #if defined OnCheatDetected
  5016.                                         ac_KickWithCode(playerid, "", 0, 10, 2);
  5017.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5018.                                     #else
  5019.                                         return ac_KickWithCode(playerid, "", 0, 10, 2);
  5020.                                     #endif
  5021.                                 }
  5022.                             }
  5023.                             else if(ACInfo[playerid][acACAllow][8])
  5024.                             {
  5025.                                 new Float:ac_zDiff = ac_pZ - ACInfo[playerid][acPosZ];
  5026.                                 if(ac_vZ >= 0.1 && ac_vZ > ACVehInfo[ac_vehid][acVelZ] &&
  5027.                                 floatabs(ACInfo[playerid][acPosX] - ac_pX) < ac_zDiff / 2.0 &&
  5028.                                 floatabs(ACInfo[playerid][acPosY] - ac_pY) < ac_zDiff / 2.0)
  5029.                                 {
  5030.                                     if(++ACInfo[playerid][acCheatCount][3] > (ac_IsABicycle(ac_i) ? AC_MAX_FLYHACK_BIKE_WARNINGS : AC_MAX_FLYHACK_VEH_WARNINGS))
  5031.                                     {
  5032.                                         #undef AC_MAX_FLYHACK_BIKE_WARNINGS
  5033.                                         #if defined DEBUG
  5034.                                             printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, veh: %d",
  5035.                                             ac_vZ, ACVehInfo[ac_vehid][acVelZ], ACInfo[playerid][acPosX] - ac_pX, ACInfo[playerid][acPosY] - ac_pY, ac_zDiff, ac_vehid);
  5036.                                         #endif
  5037.                                         #if defined OnCheatDetected
  5038.                                             ac_KickWithCode(playerid, "", 0, 8, 1);
  5039.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5040.                                             ACInfo[playerid][acCheatCount][3] = 0;
  5041.                                         #else
  5042.                                             return ac_KickWithCode(playerid, "", 0, 8, 1);
  5043.                                         #endif
  5044.                                     }
  5045.                                     #if defined OnCheatWarning
  5046.                                         else OnCheatWarning(playerid, "", 0, 8, 1, ACInfo[playerid][acCheatCount][3]);
  5047.                                     #endif
  5048.                                 }
  5049.                                 else ACInfo[playerid][acCheatCount][3] = 0;
  5050.                             }
  5051.                             ACVehInfo[ac_vehid][acSpeedDiff] = ac_spDiff;
  5052.                         }
  5053.                         ACVehInfo[ac_vehid][acPosX] = ac_pX;
  5054.                         ACVehInfo[ac_vehid][acPosY] = ac_pY;
  5055.                         ACVehInfo[ac_vehid][acPosZ] = ac_pZ;
  5056.                         ACVehInfo[ac_vehid][acVelX] = ac_vX;
  5057.                         ACVehInfo[ac_vehid][acVelY] = ac_vY;
  5058.                         ACVehInfo[ac_vehid][acVelZ] = ac_vZ;
  5059.                         ACVehInfo[ac_vehid][acPosDiff] = ac_dist;
  5060.                         if(ACInfo[playerid][acSetVehHealth] == -1.0) ACVehInfo[ac_vehid][acHealth] = ac_vHealth;
  5061.                         ACVehInfo[ac_vehid][acZAngle] = ac_zAngle;
  5062.                     }
  5063.                     ACInfo[playerid][acSeat] = ac_s;
  5064.                 }
  5065.                 else
  5066.                 {
  5067.                     GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  5068.                     ac_s = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  5069.                     if(ACInfo[playerid][acAnim] != (ac_sa = GetPlayerAnimationIndex(playerid)))
  5070.                     {
  5071.                         if(ac_sa == -1)
  5072.                         {
  5073.                             if(ACInfo[playerid][acACAllow][24])
  5074.                             {
  5075.                                 #if defined OnCheatDetected
  5076.                                     ac_KickWithCode(playerid, "", 0, 24);
  5077.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5078.                                 #else
  5079.                                     return ac_KickWithCode(playerid, "", 0, 24);
  5080.                                 #endif
  5081.                             }
  5082.                         }
  5083.                         else if(ACInfo[playerid][acACAllow][30] && !ac_PedAnims)
  5084.                         {
  5085.                             ac_i = GetPlayerSkin(playerid);
  5086.                             if(ac_sa == 1231 && ac_w != 46 && 1 <= ac_i <= 311 && ac_i != 74)
  5087.                             {
  5088.                                 if(++ACInfo[playerid][acCheatCount][19] > AC_MAX_CJ_RUN_WARNINGS)
  5089.                                 {
  5090.                                     #undef AC_MAX_CJ_RUN_WARNINGS
  5091.                                     #if defined DEBUG
  5092.                                         printf("[Nex-AC debug] Skin: %d, old anim: %d, weaponid: %d",
  5093.                                         ac_i, ACInfo[playerid][acAnim], ac_w);
  5094.                                     #endif
  5095.                                     #if defined OnCheatDetected
  5096.                                         ac_KickWithCode(playerid, "", 0, 30);
  5097.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5098.                                         ACInfo[playerid][acCheatCount][19] = 0;
  5099.                                     #else
  5100.                                         return ac_KickWithCode(playerid, "", 0, 30);
  5101.                                     #endif
  5102.                                 }
  5103.                                 #if defined OnCheatWarning
  5104.                                     else OnCheatWarning(playerid, "", 0, 30, 0, ACInfo[playerid][acCheatCount][19]);
  5105.                                 #endif
  5106.                             }
  5107.                             else ACInfo[playerid][acCheatCount][19] = 0;
  5108.                         }
  5109.                     }
  5110.                     else if(ACInfo[playerid][acACAllow][7])
  5111.                     {
  5112.                         if(ac_sa == 157 || ac_sa == 159 || ac_sa == 161 || ac_sa == 1058)
  5113.                         {
  5114.                             if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
  5115.                             {
  5116.                                 #if defined DEBUG
  5117.                                     printf("[Nex-AC debug] Anim: %d, old anim: %d, old veh: %d",
  5118.                                     ac_sa, ACInfo[playerid][acAnim], ACInfo[playerid][acVeh]);
  5119.                                 #endif
  5120.                                 #if defined OnCheatDetected
  5121.                                     ac_KickWithCode(playerid, "", 0, 7, 2);
  5122.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5123.                                     ACInfo[playerid][acCheatCount][15] = 0;
  5124.                                 #else
  5125.                                     return ac_KickWithCode(playerid, "", 0, 7, 2);
  5126.                                 #endif
  5127.                             }
  5128.                             #if defined OnCheatWarning
  5129.                                 else OnCheatWarning(playerid, "", 0, 7, 2, ACInfo[playerid][acCheatCount][15]);
  5130.                             #endif
  5131.                         }
  5132.                         else if(1538 <= ac_sa <= 1544 && ac_s > 36 && ACInfo[playerid][acSpeed] < ac_s)
  5133.                         {
  5134.                             if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
  5135.                             {
  5136.                                 #if defined DEBUG
  5137.                                     printf("[Nex-AC debug] Speed: %d, old speed: %d, anim: %d",
  5138.                                     ac_s, ACInfo[playerid][acSpeed], ac_sa);
  5139.                                 #endif
  5140.                                 #if defined OnCheatDetected
  5141.                                     ac_KickWithCode(playerid, "", 0, 7, 3);
  5142.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5143.                                     ACInfo[playerid][acCheatCount][15] = 0;
  5144.                                 #else
  5145.                                     return ac_KickWithCode(playerid, "", 0, 7, 3);
  5146.                                 #endif
  5147.                             }
  5148.                             #if defined OnCheatWarning
  5149.                                 else OnCheatWarning(playerid, "", 0, 7, 3, ACInfo[playerid][acCheatCount][15]);
  5150.                             #endif
  5151.                         }
  5152.                         #if defined VectorSize
  5153.                         else if(958 <= ac_sa <= 979 && (ac_vZ > 0.08 || VectorSize(ac_vX, ac_vY, 0.0) > 0.9))
  5154.                         #else
  5155.                         else if(958 <= ac_sa <= 979 && (ac_vZ > 0.08 || floatsqroot(floatpower(ac_vX, 2.0) + floatpower(ac_vY, 2.0)) > 0.9))
  5156.                         #endif
  5157.                         {
  5158.                             if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
  5159.                             {
  5160.                                 #undef AC_MAX_FLYHACK_WARNINGS
  5161.                                 #if defined DEBUG
  5162.                                     printf("[Nex-AC debug] Anim: %d, old anim: %d, weaponid: %d, spec act: %d",
  5163.                                     ac_sa, ACInfo[playerid][acAnim], ac_w, ac_specact);
  5164.                                 #endif
  5165.                                 #if defined OnCheatDetected
  5166.                                     ac_KickWithCode(playerid, "", 0, 7, 1);
  5167.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5168.                                     ACInfo[playerid][acCheatCount][15] = 0;
  5169.                                 #else
  5170.                                     return ac_KickWithCode(playerid, "", 0, 7, 1);
  5171.                                 #endif
  5172.                             }
  5173.                             #if defined OnCheatWarning
  5174.                                 else OnCheatWarning(playerid, "", 0, 7, 1, ACInfo[playerid][acCheatCount][15]);
  5175.                             #endif
  5176.                         }
  5177.                         else ACInfo[playerid][acCheatCount][15] = 0;
  5178.                     }
  5179.                     if(ACInfo[playerid][acSet][4] != -1)
  5180.                     {
  5181.                         if(ac_specact == ACInfo[playerid][acSet][4]) ACInfo[playerid][acSet][4] = -1;
  5182.                         else if(ac_gtc > ACInfo[playerid][acGtc][6] + ac_gpp)
  5183.                         {
  5184.                             if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][6] &&
  5185.                             ac_specact != SPECIAL_ACTION_DUCK &&
  5186.                             !(SPECIAL_ACTION_ENTER_VEHICLE <= ac_specact <= SPECIAL_ACTION_EXIT_VEHICLE))
  5187.                             {
  5188.                                 if(++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS)
  5189.                                 {
  5190.                                     #if defined DEBUG
  5191.                                         printf(DEBUG_CODE_5, playerid, "SetPlayerSpecialAction");
  5192.                                         printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSet][4], ac_specact);
  5193.                                     #endif
  5194.                                     #if defined OnCheatDetected
  5195.                                         ac_KickWithCode(playerid, "", 0, 52, 12);
  5196.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5197.                                         ACInfo[playerid][acSet][4] = -1;
  5198.                                     #else
  5199.                                         return ac_KickWithCode(playerid, "", 0, 52, 12);
  5200.                                     #endif
  5201.                                 }
  5202.                                 #if defined OnNOPWarning
  5203.                                     else OnNOPWarning(playerid, 12, ACInfo[playerid][acNOPCount][6]);
  5204.                                 #endif
  5205.                             }
  5206.                             else if(++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][4] = -1;
  5207.                             #undef AC_MAX_NOP_WARNINGS
  5208.                         }
  5209.                     }
  5210.                     else if(ac_specact != ACInfo[playerid][acSpecAct])
  5211.                     {
  5212.                         if(ac_specact == ACInfo[playerid][acNextSpecAct]) ACInfo[playerid][acNextSpecAct] = -1;
  5213.                         else if(ACInfo[playerid][acACAllow][18])
  5214.                         {
  5215.                             switch(ac_specact)
  5216.                             {
  5217.                                 case SPECIAL_ACTION_NONE:
  5218.                                 {
  5219.                                     switch(ACInfo[playerid][acSpecAct])
  5220.                                     {
  5221.                                         case SPECIAL_ACTION_USECELLPHONE, SPECIAL_ACTION_CUFFED, 25:
  5222.                                         {
  5223.                                             #if defined OnCheatDetected
  5224.                                                 ac_KickWithCode(playerid, "", 0, 18, 1);
  5225.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5226.                                             #else
  5227.                                                 return ac_KickWithCode(playerid, "", 0, 18, 1);
  5228.                                             #endif
  5229.                                         }
  5230.                                     }
  5231.                                 }
  5232.                                 case SPECIAL_ACTION_DUCK:
  5233.                                 {
  5234.                                     if(ACInfo[playerid][acSpecAct] > SPECIAL_ACTION_NONE &&
  5235.                                     !(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_CUFFED))
  5236.                                     {
  5237.                                         #if defined DEBUG
  5238.                                             printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSpecAct], ac_specact);
  5239.                                         #endif
  5240.                                         #if defined OnCheatDetected
  5241.                                             ac_KickWithCode(playerid, "", 0, 18, 2);
  5242.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5243.                                         #else
  5244.                                             return ac_KickWithCode(playerid, "", 0, 18, 2);
  5245.                                         #endif
  5246.                                     }
  5247.                                 }
  5248.                                 case SPECIAL_ACTION_USEJETPACK:
  5249.                                 {
  5250.                                     if((ac_tmp = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acDropJpX], ACInfo[playerid][acDropJpY], ACInfo[playerid][acDropJpZ])) > 15.0)
  5251.                                     {
  5252.                                         #if defined DEBUG
  5253.                                             printf("[Nex-AC debug] AC spec act: %d, spec act: %d, dist: %f",
  5254.                                             ACInfo[playerid][acSpecAct], ac_specact, ac_tmp);
  5255.                                         #endif
  5256.                                         #if defined OnCheatDetected
  5257.                                             ac_KickWithCode(playerid, "", 0, 18, 3);
  5258.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5259.                                         #else
  5260.                                             return ac_KickWithCode(playerid, "", 0, 18, 3);
  5261.                                         #endif
  5262.                                     }
  5263.                                     else ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct];
  5264.                                     ACInfo[playerid][acDropJpX] =
  5265.                                     ACInfo[playerid][acDropJpY] =
  5266.                                     ACInfo[playerid][acDropJpZ] = 25000.0;
  5267.                                 }
  5268.                                 case SPECIAL_ACTION_ENTER_VEHICLE:
  5269.                                 {
  5270.                                     switch(ACInfo[playerid][acSpecAct])
  5271.                                     {
  5272.                                         case SPECIAL_ACTION_DANCE1, SPECIAL_ACTION_DANCE2, SPECIAL_ACTION_DANCE3, SPECIAL_ACTION_DANCE4, SPECIAL_ACTION_USECELLPHONE, 68:
  5273.                                         {
  5274.                                             #if defined OnCheatDetected
  5275.                                                 ac_KickWithCode(playerid, "", 0, 18, 4);
  5276.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5277.                                             #else
  5278.                                                 return ac_KickWithCode(playerid, "", 0, 18, 4);
  5279.                                             #endif
  5280.                                         }
  5281.                                     }
  5282.                                 }
  5283.                                 default:
  5284.                                 {
  5285.                                     if(!((SPECIAL_ACTION_DRINK_BEER <= ac_specact <= SPECIAL_ACTION_CUFFED &&
  5286.                                     ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK ||
  5287.                                     ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) &&
  5288.                                     ac_specact == ACInfo[playerid][acLastSpecAct]) &&
  5289.                                     (ACInfo[playerid][acVeh] == 0 || ac_specact != SPECIAL_ACTION_EXIT_VEHICLE &&
  5290.                                     !(SPECIAL_ACTION_CUFFED <= ac_specact <= 25) &&
  5291.                                     ac_specact != SPECIAL_ACTION_USECELLPHONE))
  5292.                                     {
  5293.                                         #if defined DEBUG
  5294.                                             printf("[Nex-AC debug] AC spec act: %d, spec act: %d, Last spec act: %d, old veh: %d",
  5295.                                             ACInfo[playerid][acSpecAct], ac_specact, ACInfo[playerid][acLastSpecAct], ACInfo[playerid][acVeh]);
  5296.                                         #endif
  5297.                                         #if defined OnCheatDetected
  5298.                                             ac_KickWithCode(playerid, "", 0, 18, 5);
  5299.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5300.                                         #else
  5301.                                             return ac_KickWithCode(playerid, "", 0, 18, 5);
  5302.                                         #endif
  5303.                                     }
  5304.                                 }
  5305.                             }
  5306.                         }
  5307.                         ACInfo[playerid][acLastSpecAct] = ACInfo[playerid][acSpecAct];
  5308.                     }
  5309.                     ac_a = GetPlayerSurfingVehicleID(playerid);
  5310.                     if(!IsVehicleStreamedIn(ac_a, playerid) && GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
  5311.                     {
  5312.                         if(ac_dist > 0.7)
  5313.                         {
  5314.                             if(ac_dist >= 40.0 && ac_dist_set >= 40.0)
  5315.                             {
  5316.                                 #if defined VectorSize
  5317.                                 if(ACInfo[playerid][acACAllow][2] && !ACInfo[playerid][acIntEnterExits] &&
  5318.                                 (ACInfo[playerid][acPosZ] > -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
  5319.                                 VectorSize(ac_pX - ACInfo[playerid][acPosX], ac_pY - ACInfo[playerid][acPosY], 0.0) >= 180.0 ||
  5320.                                 ++ACInfo[playerid][acCheatCount][21] > AC_MAX_TELEPORT_GLITCH_WARNINGS))
  5321.                                 #else
  5322.                                 if(ACInfo[playerid][acACAllow][2] && !ACInfo[playerid][acIntEnterExits] &&
  5323.                                 (ACInfo[playerid][acPosZ] > -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
  5324.                                 floatsqroot(floatpower(ac_pX - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_pY - ACInfo[playerid][acPosY], 2.0)) >= 180.0 ||
  5325.                                 ++ACInfo[playerid][acCheatCount][21] > AC_MAX_TELEPORT_GLITCH_WARNINGS))
  5326.                                 #endif
  5327.                                 {
  5328.                                     #undef AC_MAX_TELEPORT_GLITCH_WARNINGS
  5329.                                     #if defined DEBUG
  5330.                                         printf("[Nex-AC debug] Dist: %f, dist set: %f, speed: %d, pos x, y, z: %f, %f, %f, old pos x, y, z: %f, %f, %f",
  5331.                                         ac_dist, ac_dist_set, ac_s, ac_pX, ac_pY, ac_pZ, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5332.                                     #endif
  5333.                                     #if defined OnCheatDetected
  5334.                                         ac_KickWithCode(playerid, "", 0, 2, 2);
  5335.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5336.                                         ACInfo[playerid][acCheatCount][21] = 0;
  5337.                                     #else
  5338.                                         return ac_KickWithCode(playerid, "", 0, 2, 2);
  5339.                                     #endif
  5340.                                 }
  5341.                                 else
  5342.                                 {
  5343.                                     ACInfo[playerid][acLastPosX] = ac_pX;
  5344.                                     ACInfo[playerid][acLastPosY] = ac_pY;
  5345.                                 }
  5346.                             }
  5347.                             else if(ac_s <= ac_dist * (ac_dist < 1.0 ? 14.0 : 5.0) && ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  5348.                             {
  5349.                                 if(ac_s < 3 && (ac_dist >= 30.0 && ac_dist_set >= 30.0 ||
  5350.                                 ac_dist >= 20.0 && ac_dist_set >= 20.0 && ac_gtc < ACInfo[playerid][acUpdateTick] + 1500))
  5351.                                 {
  5352.                                     if(ACInfo[playerid][acACAllow][2])
  5353.                                     {
  5354.                                         #if defined DEBUG
  5355.                                             printf("[Nex-AC debug] Speed: %d, dist: %f, dist set: %f", ac_s, ac_dist, ac_dist_set);
  5356.                                         #endif
  5357.                                         #if defined OnCheatDetected
  5358.                                             ac_KickWithCode(playerid, "", 0, 2, 3);
  5359.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5360.                                         #else
  5361.                                             return ac_KickWithCode(playerid, "", 0, 2, 3);
  5362.                                         #endif
  5363.                                     }
  5364.                                 }
  5365.                                 else if(ACInfo[playerid][acACAllow][0] && (ac_s || ac_dist >= 3.0))
  5366.                                 {
  5367.                                     if(++ACInfo[playerid][acCheatCount][1] > AC_MAX_AIR_WARNINGS)
  5368.                                     {
  5369.                                         #undef AC_MAX_AIR_WARNINGS
  5370.                                         #if defined DEBUG
  5371.                                             printf("[Nex-AC debug] Speed: %d, dist: %f", ac_s, ac_dist);
  5372.                                         #endif
  5373.                                         #if defined OnCheatDetected
  5374.                                             ac_KickWithCode(playerid, "", 0, 0);
  5375.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5376.                                             ACInfo[playerid][acCheatCount][1] = 0;
  5377.                                         #else
  5378.                                             return ac_KickWithCode(playerid, "", 0, 0);
  5379.                                         #endif
  5380.                                     }
  5381.                                     #if defined OnCheatWarning
  5382.                                         else OnCheatWarning(playerid, "", 0, 0, 0, ACInfo[playerid][acCheatCount][1]);
  5383.                                     #endif
  5384.                                 }
  5385.                             }
  5386.                         }
  5387.                         if(ac_gtc > ACInfo[playerid][acGtc][10] + ac_gpp)
  5388.                         {
  5389.                             if(ACInfo[playerid][acACAllow][9] && ACInfo[playerid][acSpeed] < ac_s)
  5390.                             {
  5391.                                 if(ac_s > 530)
  5392.                                 {
  5393.                                     #if defined DEBUG
  5394.                                         printf("[Nex-AC debug] Speed: %d, old speed: %d", ac_s, ACInfo[playerid][acSpeed]);
  5395.                                     #endif
  5396.                                     #if defined OnCheatDetected
  5397.                                         ac_KickWithCode(playerid, "", 0, 9, 1);
  5398.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5399.                                     #else
  5400.                                         return ac_KickWithCode(playerid, "", 0, 9, 1);
  5401.                                     #endif
  5402.                                 }
  5403.                                 else
  5404.                                 {
  5405.                                     ac_i = ac_GetSpeed(ac_vX, ac_vY);
  5406.                                     new Float:ac_zDiff = ac_pZ - ACInfo[playerid][acPosZ];
  5407.                                     if((ac_s > 257 || ac_i > 180 || floatabs(ac_vZ) > 1.0 && floatabs(ac_zDiff) < 2.0) &&
  5408.                                     ACInfo[playerid][acHealth] <= ac_health)
  5409.                                     {
  5410.                                         if(++ACInfo[playerid][acCheatCount][17] > AC_MAX_SPEEDHACK_WARNINGS)
  5411.                                         {
  5412.                                             #if defined DEBUG
  5413.                                                 printf("[Nex-AC debug] Speed: %d, speed x, y: %d, vel z: %f, pos diff z: %f, old speed: %d",
  5414.                                                 ac_s, ac_i, ac_vZ, ac_zDiff, ACInfo[playerid][acSpeed]);
  5415.                                             #endif
  5416.                                             #if defined OnCheatDetected
  5417.                                                 ac_KickWithCode(playerid, "", 0, 9, 2);
  5418.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5419.                                                 ACInfo[playerid][acCheatCount][17] = 0;
  5420.                                             #else
  5421.                                                 return ac_KickWithCode(playerid, "", 0, 9, 2);
  5422.                                             #endif
  5423.                                         }
  5424.                                         #if defined OnCheatWarning
  5425.                                             else OnCheatWarning(playerid, "", 0, 9, 2, ACInfo[playerid][acCheatCount][17]);
  5426.                                         #endif
  5427.                                     }
  5428.                                     else ACInfo[playerid][acCheatCount][17] = 0;
  5429.                                 }
  5430.                             }
  5431.                             ACInfo[playerid][acSpeed] = ac_s;
  5432.                         }
  5433.                     }
  5434.                     else if(ac_gtc > ACInfo[playerid][acGtc][10] + ac_gpp)
  5435.                     {
  5436.                         if(ACInfo[playerid][acACAllow][9] && ac_a != INVALID_VEHICLE_ID)
  5437.                         {
  5438.                             GetVehicleVelocity(ac_a, ac_vX, ac_vY, ac_vZ);
  5439.                             new ac_vsp = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  5440.                             if(ac_s > ac_vsp + 180)
  5441.                             {
  5442.                                 if(++ACInfo[playerid][acCheatCount][17] > AC_MAX_SPEEDHACK_WARNINGS)
  5443.                                 {
  5444.                                     #undef AC_MAX_SPEEDHACK_WARNINGS
  5445.                                     #if defined DEBUG
  5446.                                         printf("[Nex-AC debug] Speed: %d, old speed: %d, veh speed: %d",
  5447.                                         ac_s, ACInfo[playerid][acSpeed], ac_vsp);
  5448.                                     #endif
  5449.                                     #if defined OnCheatDetected
  5450.                                         ac_KickWithCode(playerid, "", 0, 9, 3);
  5451.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5452.                                         ACInfo[playerid][acCheatCount][17] = 0;
  5453.                                     #else
  5454.                                         return ac_KickWithCode(playerid, "", 0, 9, 3);
  5455.                                     #endif
  5456.                                 }
  5457.                                 #if defined OnCheatWarning
  5458.                                     else OnCheatWarning(playerid, "", 0, 9, 3, ACInfo[playerid][acCheatCount][17]);
  5459.                                 #endif
  5460.                             }
  5461.                             else ACInfo[playerid][acCheatCount][17] = 0;
  5462.                         }
  5463.                         ACInfo[playerid][acSpeed] = ac_s;
  5464.                     }
  5465.                     ACInfo[playerid][acAnim] = ac_sa;
  5466.                 }
  5467.                 ACInfo[playerid][acSpecAct] = ac_specact;
  5468.                 ACInfo[playerid][acHealth] = ac_health;
  5469.                 ACInfo[playerid][acArmour] = ac_armour;
  5470.             }
  5471.             ACInfo[playerid][acVeh] = ac_vehid;
  5472.             if(ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp) ACInfo[playerid][acLastWeapon] = ac_w;
  5473.             ACInfo[playerid][acPosX] = ac_pX;
  5474.             ACInfo[playerid][acPosY] = ac_pY;
  5475.             ACInfo[playerid][acPosZ] = ac_pZ;
  5476.         }
  5477.     #if AC_USE_NPC
  5478.         }
  5479.     #endif
  5480.     ac_gpp = 1;
  5481.     ACInfo[playerid][acUpdateTick] = ac_gtc;
  5482.     #if defined ac_OnPlayerUpdate
  5483.         ac_gpp = ac_OnPlayerUpdate(playerid);
  5484.     #endif
  5485.     if(ACInfo[playerid][acACAllow][33] && ac_gpp) return ACInfo[playerid][acUnFrozen];
  5486.     return ac_gpp;
  5487. }
  5488.  
  5489. #if defined _ALS_OnPlayerUpdate
  5490.     #undef OnPlayerUpdate
  5491. #else
  5492.     #define _ALS_OnPlayerUpdate
  5493. #endif
  5494. #define OnPlayerUpdate ac_OnPlayerUpdate
  5495. #if defined ac_OnPlayerUpdate
  5496.     forward ac_OnPlayerUpdate(playerid);
  5497. #endif
  5498.  
  5499. #if defined _inc_y_hooks || defined _INC_y_hooks
  5500.     hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  5501. #else
  5502.     public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  5503. #endif
  5504. {
  5505.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
  5506.     #if AC_USE_NPC
  5507.         if(!IsPlayerNPC(playerid))
  5508.         {
  5509.     #endif
  5510.         if((newkeys & KEY_SECONDARY_ATTACK) && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USEJETPACK &&
  5511.         GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_USEJETPACK)
  5512.         {
  5513.             ACInfo[playerid][acDropJpX] = ACInfo[playerid][acPosX];
  5514.             ACInfo[playerid][acDropJpY] = ACInfo[playerid][acPosY];
  5515.             ACInfo[playerid][acDropJpZ] = ACInfo[playerid][acPosZ];
  5516.         }
  5517.         new ac_w = GetPlayerWeapon(playerid);
  5518.         if((newkeys & KEY_CROUCH) && (24 <= ac_w <= 25 || 33 <= ac_w <= 34)) ACInfo[playerid][acCheatCount][14] = 0;
  5519.     #if AC_USE_NPC
  5520.         }
  5521.     #endif
  5522.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5523.         && defined ac_OnPlayerKeyStateChange
  5524.         return ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  5525.     #else
  5526.         return 1;
  5527.     #endif
  5528. }
  5529.  
  5530. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5531.     #if defined _ALS_OnPlayerKeyStateChange
  5532.         #undef OnPlayerKeyStateChange
  5533.     #else
  5534.         #define _ALS_OnPlayerKeyStateChange
  5535.     #endif
  5536.     #define OnPlayerKeyStateChange ac_OnPlayerKeyStateChange
  5537.     #if defined ac_OnPlayerKeyStateChange
  5538.         forward ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  5539.     #endif
  5540. #endif
  5541.  
  5542. #if defined _inc_y_hooks || defined _INC_y_hooks
  5543.     hook OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  5544. #else
  5545.     public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  5546. #endif
  5547. {
  5548.     if(ACInfo[playerid][acKicked] > 0) return 1;
  5549.     new ac_gtc = GetTickCount();
  5550.     if(ACInfo[playerid][acACAllow][49])
  5551.     {
  5552.         if(ac_gtc < ACInfo[playerid][acCall][2] + ac_Mtfc[2][0]) ac_FloodDetect(playerid, 2);
  5553.         else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5554.         else ACInfo[playerid][acFloodCount][2] = ACInfo[playerid][acFloodCount][27] = 0;
  5555.     }
  5556.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][2] = ac_gtc;
  5557.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5558.         && defined ac_OnPlayerClickMap
  5559.         return ac_OnPlayerClickMap(playerid, fX, fY, fZ);
  5560.     #else
  5561.         return 0;
  5562.     #endif
  5563. }
  5564.  
  5565. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5566.     #if defined _ALS_OnPlayerClickMap
  5567.         #undef OnPlayerClickMap
  5568.     #else
  5569.         #define _ALS_OnPlayerClickMap
  5570.     #endif
  5571.     #define OnPlayerClickMap ac_OnPlayerClickMap
  5572.     #if defined ac_OnPlayerClickMap
  5573.         forward ac_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
  5574.     #endif
  5575. #endif
  5576.  
  5577. #if defined _inc_y_hooks || defined _INC_y_hooks
  5578.     hook OnPlayerClickPlayer(playerid, clickedplayerid, source)
  5579. #else
  5580.     public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  5581. #endif
  5582. {
  5583.     if(ACInfo[playerid][acKicked] > 0) return 1;
  5584.     new ac_gtc = GetTickCount();
  5585.     if(ACInfo[playerid][acACAllow][49])
  5586.     {
  5587.         if(ac_gtc < ACInfo[playerid][acCall][3] + ac_Mtfc[3][0])
  5588.         {
  5589.             ac_FloodDetect(playerid, 3);
  5590.             return 1;
  5591.         }
  5592.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5593.         else ACInfo[playerid][acFloodCount][3] = ACInfo[playerid][acFloodCount][27] = 0;
  5594.     }
  5595.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][3] = ac_gtc;
  5596.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5597.         && defined ac_OnPlayerClickPlayer
  5598.         return ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  5599.     #else
  5600.         return 0;
  5601.     #endif
  5602. }
  5603.  
  5604. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5605.     #if defined _ALS_OnPlayerClickPlayer
  5606.         #undef OnPlayerClickPlayer
  5607.     #else
  5608.         #define _ALS_OnPlayerClickPlayer
  5609.     #endif
  5610.     #define OnPlayerClickPlayer ac_OnPlayerClickPlayer
  5611.     #if defined ac_OnPlayerClickPlayer
  5612.         forward ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  5613.     #endif
  5614. #endif
  5615.  
  5616. #if defined _inc_y_hooks || defined _INC_y_hooks
  5617.     hook OnPlayerClickTextDraw(playerid, Text:clickedid)
  5618. #else
  5619.     public OnPlayerClickTextDraw(playerid, Text:clickedid)
  5620. #endif
  5621. {
  5622.     if(ACInfo[playerid][acKicked] > 0) return 1;
  5623.     new ac_gtc = GetTickCount();
  5624.     if(ACInfo[playerid][acACAllow][49])
  5625.     {
  5626.         if(ac_gtc < ACInfo[playerid][acCall][4] + ac_Mtfc[4][0])
  5627.         {
  5628.             ac_FloodDetect(playerid, 4);
  5629.             return 1;
  5630.         }
  5631.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5632.         else ACInfo[playerid][acFloodCount][4] = ACInfo[playerid][acFloodCount][27] = 0;
  5633.     }
  5634.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][4] = ac_gtc;
  5635.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5636.         && defined ac_OnPlayerClickTextDraw
  5637.         return ac_OnPlayerClickTextDraw(playerid, clickedid);
  5638.     #else
  5639.         return 0;
  5640.     #endif
  5641. }
  5642.  
  5643. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5644.     #if defined _ALS_OnPlayerClickTextDraw
  5645.         #undef OnPlayerClickTextDraw
  5646.     #else
  5647.         #define _ALS_OnPlayerClickTextDraw
  5648.     #endif
  5649.     #define OnPlayerClickTextDraw ac_OnPlayerClickTextDraw
  5650.     #if defined ac_OnPlayerClickTextDraw
  5651.         forward ac_OnPlayerClickTextDraw(playerid, Text:clickedid);
  5652.     #endif
  5653. #endif
  5654.  
  5655. #if defined _inc_y_hooks || defined _INC_y_hooks
  5656.     hook OnPlayerCommandText(playerid, cmdtext[])
  5657. #else
  5658.     public OnPlayerCommandText(playerid, cmdtext[])
  5659. #endif
  5660. {
  5661.     if(ACInfo[playerid][acKicked] > 0) return 1;
  5662.     #if AC_USE_NPC
  5663.         if(!IsPlayerNPC(playerid))
  5664.         {
  5665.     #endif
  5666.         new ac_gtc = GetTickCount();
  5667.         if(ACInfo[playerid][acACAllow][49])
  5668.         {
  5669.             if(ac_gtc < ACInfo[playerid][acCall][5] + ac_Mtfc[5][0])
  5670.             {
  5671.                 ac_FloodDetect(playerid, 5);
  5672.                 return 1;
  5673.             }
  5674.             if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5675.             else ACInfo[playerid][acFloodCount][5] = ACInfo[playerid][acFloodCount][27] = 0;
  5676.         }
  5677.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][5] = ac_gtc;
  5678.     #if AC_USE_NPC
  5679.         }
  5680.     #endif
  5681.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5682.         && defined ac_OnPlayerCommandText
  5683.         return ac_OnPlayerCommandText(playerid, cmdtext);
  5684.     #else
  5685.         return 0;
  5686.     #endif
  5687. }
  5688.  
  5689. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5690.     #if defined _ALS_OnPlayerCommandText
  5691.         #undef OnPlayerCommandText
  5692.     #else
  5693.         #define _ALS_OnPlayerCommandText
  5694.     #endif
  5695.     #define OnPlayerCommandText ac_OnPlayerCommandText
  5696.     #if defined ac_OnPlayerCommandText
  5697.         forward ac_OnPlayerCommandText(playerid, cmdtext[]);
  5698.     #endif
  5699. #endif
  5700.  
  5701. #if defined _inc_y_hooks || defined _INC_y_hooks
  5702.     hook OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  5703. #else
  5704.     public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  5705. #endif
  5706. {
  5707.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
  5708.     new ac_gtc = GetTickCount();
  5709.     if(ACInfo[playerid][acACAllow][49])
  5710.     {
  5711.         if(ac_gtc < ACInfo[playerid][acCall][6] + ac_Mtfc[6][0]) ac_FloodDetect(playerid, 6);
  5712.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5713.         else ACInfo[playerid][acFloodCount][6] = ACInfo[playerid][acFloodCount][27] = 0;
  5714.     }
  5715.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][6] = ac_gtc;
  5716.     new ac_model = GetVehicleModel(vehicleid);
  5717.     if(ACInfo[playerid][acACAllow][44] && !(569 <= ac_model <= 570) && !IsVehicleStreamedIn(vehicleid, playerid))
  5718.     {
  5719.         #if defined DEBUG
  5720.             printf("[Nex-AC debug] Veh: %d, veh model: %d, ispassenger: %d", vehicleid, ac_model, ispassenger);
  5721.         #endif
  5722.         return ac_KickWithCode(playerid, "", 0, 44, 1);
  5723.     }
  5724.     #if defined SetVehicleFakePosForPlayer\
  5725.         && defined SetVehicleFakeZAngleForPlayer
  5726.         if(ACInfo[playerid][acACAllow][5] && !(ac_model == 449 || 537 <= ac_model <= 538 || 569 <= ac_model <= 570))
  5727.         {
  5728.             new Float:ac_dist = GetVehicleDistanceFromPoint(vehicleid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5729.             if(ac_dist > 25.0 || ac_dist > 15.0 && ac_model != 577 && ac_model != 592)
  5730.             {
  5731.                 #if defined DEBUG
  5732.                     printf("[Nex-AC debug] Veh model: %d, dist: %f, ispassenger: %d, playerid: %d",
  5733.                     ac_model, ac_dist, ispassenger, playerid);
  5734.                 #endif
  5735.                 #if defined OnCheatDetected
  5736.                     ac_KickWithCode(playerid, "", 0, 5, 3);
  5737.                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5738.                 #endif
  5739.                 SetVehicleFakeZAngleForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acZAngle]);
  5740.                 SetVehicleFakePosForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]);
  5741.             }
  5742.         }
  5743.     #endif
  5744.     new ac_doors, ac_tmp;
  5745.     GetVehicleParamsEx(vehicleid, ac_tmp, ac_tmp, ac_tmp, ac_doors, ac_tmp, ac_tmp, ac_tmp);
  5746.     if(ispassenger || ac_doors != VEHICLE_PARAMS_ON)
  5747.     {
  5748.         if(ac_doors != VEHICLE_PARAMS_ON) ACInfo[playerid][acEnterSeat] = -1;
  5749.         else ACInfo[playerid][acEnterSeat] = ispassenger;
  5750.         if(ACInfo[playerid][acEnterVeh] != vehicleid)
  5751.         {
  5752.             ACInfo[playerid][acEnterVeh] = vehicleid;
  5753.             if(ac_model == 570 || ac_IsABoat(ac_model)) ACInfo[playerid][acEnterVehTick] = 0;
  5754.             else ACInfo[playerid][acEnterVehTick] = ac_gtc;
  5755.         }
  5756.     }
  5757.     else
  5758.     {
  5759.         ACInfo[playerid][acEnterSeat] = -1;
  5760.         ACInfo[playerid][acEnterVeh] = 0;
  5761.     }
  5762.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5763.         && defined ac_OnPlayerEnterVehicle
  5764.         return ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  5765.     #else
  5766.         return 1;
  5767.     #endif
  5768. }
  5769.  
  5770. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5771.     #if defined _ALS_OnPlayerEnterVehicle
  5772.         #undef OnPlayerEnterVehicle
  5773.     #else
  5774.         #define _ALS_OnPlayerEnterVehicle
  5775.     #endif
  5776.     #define OnPlayerEnterVehicle ac_OnPlayerEnterVehicle
  5777.     #if defined ac_OnPlayerEnterVehicle
  5778.         forward ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  5779.     #endif
  5780. #endif
  5781.  
  5782. #if defined _inc_y_hooks || defined _INC_y_hooks
  5783.     hook OnPlayerExitVehicle(playerid, vehicleid)
  5784. #else
  5785.     public OnPlayerExitVehicle(playerid, vehicleid)
  5786. #endif
  5787. {
  5788.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
  5789.     new ac_gtc = GetTickCount();
  5790.     if(ACInfo[playerid][acACAllow][49])
  5791.     {
  5792.         if(ac_gtc < ACInfo[playerid][acCall][7] + ac_Mtfc[7][0]) ac_FloodDetect(playerid, 7);
  5793.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5794.         else ACInfo[playerid][acFloodCount][7] = ACInfo[playerid][acFloodCount][27] = 0;
  5795.     }
  5796.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][7] = ac_gtc;
  5797.     if(ACInfo[playerid][acACAllow][44] && !IsVehicleStreamedIn(vehicleid, playerid))
  5798.     {
  5799.         #if defined DEBUG
  5800.             printf("[Nex-AC debug] Veh: %d, veh model: %d", vehicleid, GetVehicleModel(vehicleid));
  5801.         #endif
  5802.         return ac_KickWithCode(playerid, "", 0, 44, 5);
  5803.     }
  5804.     if(ac_IsAnAircraft(GetVehicleModel(ACInfo[playerid][acVeh]))) ACInfo[playerid][acParachute] = 1;
  5805.     else if(ACInfo[playerid][acParachute] != 2) ACInfo[playerid][acParachute] = 0;
  5806.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5807.         && defined ac_OnPlayerExitVehicle
  5808.         return ac_OnPlayerExitVehicle(playerid, vehicleid);
  5809.     #else
  5810.         return 1;
  5811.     #endif
  5812. }
  5813.  
  5814. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5815.     #if defined _ALS_OnPlayerExitVehicle
  5816.         #undef OnPlayerExitVehicle
  5817.     #else
  5818.         #define _ALS_OnPlayerExitVehicle
  5819.     #endif
  5820.     #define OnPlayerExitVehicle ac_OnPlayerExitVehicle
  5821.     #if defined ac_OnPlayerExitVehicle
  5822.         forward ac_OnPlayerExitVehicle(playerid, vehicleid);
  5823.     #endif
  5824. #endif
  5825.  
  5826. #if defined OnPlayerPickUpDynamicPickup\
  5827.     && defined Streamer_GetDistanceToItem\
  5828.     && defined Streamer_GetIntData
  5829.     #if defined _inc_y_hooks || defined _INC_y_hooks
  5830.         #if defined STREAMER_ENABLE_TAGS
  5831.             hook OnPlayerPickUpDynPickup(playerid, STREAMER_TAG_PICKUP:pickupid)
  5832.         #else
  5833.             hook OnPlayerPickUpDynPickup(playerid, pickupid)
  5834.         #endif
  5835.     #else
  5836.         #if defined STREAMER_ENABLE_TAGS
  5837.             public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP:pickupid)
  5838.         #else
  5839.             public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  5840.         #endif
  5841.     #endif
  5842.     {
  5843.         if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
  5844.         new ac_i = GetTickCount();
  5845.         if(ACInfo[playerid][acACAllow][49])
  5846.         {
  5847.             if(ac_i < ACInfo[playerid][acCall][8] + ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
  5848.             else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5849.             else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
  5850.         }
  5851.         if(ACInfo[playerid][acACAllow][6])
  5852.         {
  5853.             new Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_dist, Float:ac_dist_set;
  5854.             GetPlayerPos(playerid, ac_x, ac_y, ac_z);
  5855.             Streamer_GetDistanceToItem(ac_x, ac_y, ac_z, STREAMER_TYPE_PICKUP, pickupid, ac_dist);
  5856.             Streamer_GetDistanceToItem(ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_z : ACInfo[playerid][acSetPosZ]), STREAMER_TYPE_PICKUP, pickupid, ac_dist_set);
  5857.             if(ac_dist > 15.0 && (ACInfo[playerid][acSet][8] == -1 || ac_dist_set > 15.0))
  5858.             {
  5859.                 #if defined DEBUG
  5860.                     printf("[Nex-AC debug] Pickupid: %d, dist: %f, dist set: %f, acSet[8]: %d, playerid: %d",
  5861.                     _:pickupid, ac_dist, ac_dist_set, ACInfo[playerid][acSet][8], playerid);
  5862.                 #endif
  5863.                 #if defined OnCheatDetected
  5864.                     ac_KickWithCode(playerid, "", 0, 6, 2);
  5865.                 #endif
  5866.                 return 0;
  5867.             }
  5868.         }
  5869.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
  5870.         #if AC_USE_PICKUP_WEAPONS
  5871.             switch((ac_i = Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID)))
  5872.             {
  5873.                 case 2: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK;
  5874.                 case 3: ACInfo[playerid][acHealth] = 100;
  5875.                 case 4: ACInfo[playerid][acArmour] = 100;
  5876.                 default:
  5877.                 {
  5878.                     if(ac_i > 100)
  5879.                     {
  5880.                         ac_i -= 100;
  5881.                         new ac_s = ac_wSlot[ac_i];
  5882.                         if(ACInfo[playerid][acWeapon][ac_s] == ac_i ||
  5883.                         3 <= ac_s <= 5 && ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i];
  5884.                     }
  5885.                 }
  5886.             }
  5887.         #endif
  5888.         ACInfo[playerid][acLastPickup] = _:pickupid + MAX_PICKUPS;
  5889.         #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5890.             && defined ac_OnPlayerPickUpDynamicPickup
  5891.             return ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  5892.         #else
  5893.             return 1;
  5894.         #endif
  5895.     }
  5896.  
  5897.     #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5898.         #if defined _ALS_OnPlayerPickUpDynamicPicku\
  5899.             || defined _ALS_OnPlayerPickUpDynPickup\
  5900.             || defined _ALS_OnPlayerPickUpDynamicPick || defined _ALS_OnPlayerPickUpDynamicPUp
  5901.             #undef OnPlayerPickUpDynamicPickup
  5902.         #else
  5903.             #define _ALS_OnPlayerPickUpDynamicPicku
  5904.             #define _ALS_OnPlayerPickUpDynPickup
  5905.             #define _ALS_OnPlayerPickUpDynamicPick
  5906.             #define _ALS_OnPlayerPickUpDynamicPUp
  5907.         #endif
  5908.         #define OnPlayerPickUpDynamicPickup ac_OnPlayerPickUpDynamicPickup
  5909.         #if defined ac_OnPlayerPickUpDynamicPickup
  5910.             #if defined STREAMER_ENABLE_TAGS
  5911.                 forward ac_OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP:pickupid);
  5912.             #else
  5913.                 forward ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  5914.             #endif
  5915.         #endif
  5916.     #endif
  5917. #endif
  5918.  
  5919. #if defined _inc_y_hooks || defined _INC_y_hooks
  5920.     hook OnPlayerPickUpPickup(playerid, pickupid)
  5921. #else
  5922.     public OnPlayerPickUpPickup(playerid, pickupid)
  5923. #endif
  5924. {
  5925.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0 || !(0 <= pickupid < MAX_PICKUPS)) return 0;
  5926.     #if defined Streamer_GetItemStreamerID\
  5927.         && defined IsValidDynamicPickup
  5928.         #if defined STREAMER_ENABLE_TAGS
  5929.             new STREAMER_TAG_PICKUP:streamerid = STREAMER_TAG_PICKUP:Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
  5930.         #else
  5931.             new streamerid = Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
  5932.         #endif
  5933.         if(!IsValidDynamicPickup(streamerid))
  5934.         {
  5935.     #endif
  5936.         new ac_i = GetTickCount();
  5937.         if(ACInfo[playerid][acACAllow][49])
  5938.         {
  5939.             if(ac_i < ACInfo[playerid][acCall][8] + ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
  5940.             else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5941.             else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
  5942.         }
  5943.         if(ACInfo[playerid][acACAllow][6])
  5944.         {
  5945.             #if defined VectorSize
  5946.                 new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]),
  5947.                 Float:ac_dist_set = VectorSize(ACInfo[playerid][acSetPosX] - ACPickInfo[pickupid][acPosX], ACInfo[playerid][acSetPosY] - ACPickInfo[pickupid][acPosY], (ACInfo[playerid][acTpToZ] ? ACPickInfo[pickupid][acPosZ] : ACInfo[playerid][acSetPosZ]) - ACPickInfo[pickupid][acPosZ]);
  5948.             #else
  5949.                 new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]),
  5950.                 Float:ac_dist_set = floatsqroot(floatpower(ACInfo[playerid][acSetPosX] - ACPickInfo[pickupid][acPosX], 2.0) + floatpower(ACInfo[playerid][acSetPosY] - ACPickInfo[pickupid][acPosY], 2.0) + floatpower((ACInfo[playerid][acTpToZ] ? ACPickInfo[pickupid][acPosZ] : ACInfo[playerid][acSetPosZ]) - ACPickInfo[pickupid][acPosZ], 2.0));
  5951.             #endif
  5952.             if(ac_dist > 15.0 && (ACInfo[playerid][acSet][8] == -1 || ac_dist_set > 15.0))
  5953.             {
  5954.                 #if defined DEBUG
  5955.                     printf("[Nex-AC debug] Pickupid: %d, dist: %f, dist set: %f, acSet[8]: %d, playerid: %d",
  5956.                     pickupid, ac_dist, ac_dist_set, ACInfo[playerid][acSet][8], playerid);
  5957.                 #endif
  5958.                 #if defined OnCheatDetected
  5959.                     ac_KickWithCode(playerid, "", 0, 6, 1);
  5960.                 #endif
  5961.                 return 0;
  5962.             }
  5963.         }
  5964.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
  5965.         #if AC_USE_PICKUP_WEAPONS
  5966.             switch(ACPickInfo[pickupid][acType])
  5967.             {
  5968.                 case 1:
  5969.                 {
  5970.                     ac_i = ACPickInfo[pickupid][acWeapon];
  5971.                     new ac_s = ac_wSlot[ac_i];
  5972.                     if(ACInfo[playerid][acWeapon][ac_s] == ac_i ||
  5973.                     3 <= ac_s <= 5 && ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i];
  5974.                 }
  5975.                 case 2: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK;
  5976.                 case 3: ACInfo[playerid][acHealth] = 100;
  5977.                 case 4: ACInfo[playerid][acArmour] = 100;
  5978.             }
  5979.         #endif
  5980.         ACInfo[playerid][acLastPickup] = pickupid;
  5981.     #if defined Streamer_GetItemStreamerID\
  5982.         && defined IsValidDynamicPickup
  5983.         }
  5984.     #endif
  5985.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5986.         && defined ac_OnPlayerPickUpPickup
  5987.         return ac_OnPlayerPickUpPickup(playerid, pickupid);
  5988.     #else
  5989.         return 1;
  5990.     #endif
  5991. }
  5992.  
  5993. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5994.     #if defined _ALS_OnPlayerPickUpPickup
  5995.         #undef OnPlayerPickUpPickup
  5996.     #else
  5997.         #define _ALS_OnPlayerPickUpPickup
  5998.     #endif
  5999.     #define OnPlayerPickUpPickup ac_OnPlayerPickUpPickup
  6000.     #if defined ac_OnPlayerPickUpPickup
  6001.         forward ac_OnPlayerPickUpPickup(playerid, pickupid);
  6002.     #endif
  6003. #endif
  6004.  
  6005. #if defined _inc_y_hooks || defined _INC_y_hooks
  6006.     hook OnPlayerRequestClass(playerid, classid)
  6007. #else
  6008.     public OnPlayerRequestClass(playerid, classid)
  6009. #endif
  6010. {
  6011.     if(ACInfo[playerid][acKicked] > 0) return 0;
  6012.     new ac_i = GetPlayerState(playerid);
  6013.     if(PLAYER_STATE_ONFOOT <= ac_i < PLAYER_STATE_WASTED || ac_i == PLAYER_STATE_SPAWNED) return 0;
  6014.     #if AC_USE_NPC
  6015.         if(!IsPlayerNPC(playerid))
  6016.         {
  6017.     #endif
  6018.         ac_i = GetTickCount();
  6019.         if(ACInfo[playerid][acACAllow][49])
  6020.         {
  6021.             if(ac_i < ACInfo[playerid][acCall][9] + ac_Mtfc[9][0]) ac_FloodDetect(playerid, 9);
  6022.             else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6023.             else ACInfo[playerid][acFloodCount][9] = ACInfo[playerid][acFloodCount][27] = 0;
  6024.         }
  6025.         ACInfo[playerid][acSpawned] = false;
  6026.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][9] = ac_i;
  6027.         ACInfo[playerid][acSpawnPosX] = ac_ClassPos[classid][0];
  6028.         ACInfo[playerid][acSpawnPosY] = ac_ClassPos[classid][1];
  6029.         ACInfo[playerid][acSpawnPosZ] = ac_ClassPos[classid][2];
  6030.         ACInfo[playerid][acSpawnWeapon1] = ac_ClassWeapon[classid][0][0];
  6031.         ACInfo[playerid][acSpawnAmmo1] = ac_ClassWeapon[classid][0][1];
  6032.         ACInfo[playerid][acSpawnWeapon2] = ac_ClassWeapon[classid][1][0];
  6033.         ACInfo[playerid][acSpawnAmmo2] = ac_ClassWeapon[classid][1][1];
  6034.         ACInfo[playerid][acSpawnWeapon3] = ac_ClassWeapon[classid][2][0];
  6035.         ACInfo[playerid][acSpawnAmmo3] = ac_ClassWeapon[classid][2][1];
  6036.     #if AC_USE_NPC
  6037.         }
  6038.     #endif
  6039.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6040.         && defined ac_OnPlayerRequestClass
  6041.         return ac_OnPlayerRequestClass(playerid, classid);
  6042.     #else
  6043.         return 1;
  6044.     #endif
  6045. }
  6046.  
  6047. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6048.     #if defined _ALS_OnPlayerRequestClass
  6049.         #undef OnPlayerRequestClass
  6050.     #else
  6051.         #define _ALS_OnPlayerRequestClass
  6052.     #endif
  6053.     #define OnPlayerRequestClass ac_OnPlayerRequestClass
  6054.     #if defined ac_OnPlayerRequestClass
  6055.         forward ac_OnPlayerRequestClass(playerid, classid);
  6056.     #endif
  6057. #endif
  6058.  
  6059. #if defined _inc_y_hooks || defined _INC_y_hooks
  6060.     hook OnPlayerSelectedMenuRow(playerid, row)
  6061. #else
  6062.     public OnPlayerSelectedMenuRow(playerid, row)
  6063. #endif
  6064. {
  6065.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
  6066.     new ac_gtc = GetTickCount();
  6067.     if(ACInfo[playerid][acACAllow][49])
  6068.     {
  6069.         if(ac_gtc < ACInfo[playerid][acCall][10] + ac_Mtfc[10][0]) ac_FloodDetect(playerid, 10);
  6070.         else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6071.         else ACInfo[playerid][acFloodCount][10] = ACInfo[playerid][acFloodCount][27] = 0;
  6072.     }
  6073.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][10] = ac_gtc;
  6074.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6075.         && defined ac_OnPlayerSelectedMenuRow
  6076.         return ac_OnPlayerSelectedMenuRow(playerid, row);
  6077.     #else
  6078.         return 1;
  6079.     #endif
  6080. }
  6081.  
  6082. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6083.     #if defined _ALS_OnPlayerSelectedMenuRow
  6084.         #undef OnPlayerSelectedMenuRow
  6085.     #else
  6086.         #define _ALS_OnPlayerSelectedMenuRow
  6087.     #endif
  6088.     #define OnPlayerSelectedMenuRow ac_OnPlayerSelectedMenuRow
  6089.     #if defined ac_OnPlayerSelectedMenuRow
  6090.         forward ac_OnPlayerSelectedMenuRow(playerid, row);
  6091.     #endif
  6092. #endif
  6093.  
  6094. #if defined _inc_y_hooks || defined _INC_y_hooks
  6095.     hook OnPlayerStateChange(playerid, newstate, oldstate)
  6096. #else
  6097.     public OnPlayerStateChange(playerid, newstate, oldstate)
  6098. #endif
  6099. {
  6100.     if(ACInfo[playerid][acKicked] > 0) return 0;
  6101.     #if AC_USE_NPC
  6102.         if(!IsPlayerNPC(playerid))
  6103.         {
  6104.     #endif
  6105.         new ac_i = GetTickCount(), ac_s = GetPlayerPing(playerid);
  6106.         if(ACInfo[playerid][acACAllow][49])
  6107.         {
  6108.             if(ac_i < ACInfo[playerid][acCall][11] + ac_Mtfc[11][0])
  6109.             {
  6110.                 if(newstate != PLAYER_STATE_ONFOOT || oldstate != PLAYER_STATE_SPAWNED)
  6111.                 {
  6112.                     new ac_model;
  6113.                     if(oldstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(ACInfo[playerid][acVeh]);
  6114.                     else if(newstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(GetPlayerVehicleID(playerid));
  6115.                     if(!ac_IsABoat(ac_model)) ac_FloodDetect(playerid, 11);
  6116.                 }
  6117.             }
  6118.             else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6119.             else ACInfo[playerid][acFloodCount][11] = ACInfo[playerid][acFloodCount][27] = 0;
  6120.         }
  6121.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][11] = ac_i;
  6122.         switch(oldstate)
  6123.         {
  6124.             case PLAYER_STATE_NONE, PLAYER_STATE_WASTED:
  6125.             {
  6126.                 if(ACInfo[playerid][acACAllow][48] && !(PLAYER_STATE_SPAWNED <= newstate <= PLAYER_STATE_SPECTATING))
  6127.                 {
  6128.                     #if defined DEBUG
  6129.                         printf("[Nex-AC debug] Newstate: %d, oldstate: %d", newstate, oldstate);
  6130.                     #endif
  6131.                     ac_KickWithCode(playerid, "", 0, 48, 2);
  6132.                 }
  6133.             }
  6134.             case PLAYER_STATE_DRIVER:
  6135.             {
  6136.                 new ac_t;
  6137.                 if(ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = INVALID_PLAYER_ID;
  6138.                 GetPlayerWeaponData(playerid, 4, ac_t, ac_t);
  6139.                 if(ac_t < ACInfo[playerid][acAmmo][4] && !(ac_t < 0 <= ACInfo[playerid][acAmmo][4])) ACInfo[playerid][acAmmo][4] = ac_t;
  6140.                 ac_t = GetVehicleModel(ACInfo[playerid][acVeh]);
  6141.                 if(1 <= ACInfo[playerid][acHealth] < 5 && ac_IsABike(ac_t)) ACInfo[playerid][acHealth] = 5;
  6142.                 new Float:ac_x, Float:ac_y, Float:ac_z;
  6143.                 GetPlayerPos(playerid, ac_x, ac_y, ac_z);
  6144.                 #if defined VectorSize
  6145.                 if(ACInfo[playerid][acACAllow][2] &&
  6146.                 newstate == PLAYER_STATE_ONFOOT && ac_i > ACInfo[playerid][acGtc][11] + ac_s &&
  6147.                 (ACInfo[playerid][acPosZ] > -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
  6148.                 VectorSize(ac_x - ACInfo[playerid][acPosX], ac_y - ACInfo[playerid][acPosY], 0.0) >= 180.0))
  6149.                 #else
  6150.                 if(ACInfo[playerid][acACAllow][2] &&
  6151.                 newstate == PLAYER_STATE_ONFOOT && ac_i > ACInfo[playerid][acGtc][11] + ac_s &&
  6152.                 (ACInfo[playerid][acPosZ] > -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
  6153.                 floatsqroot(floatpower(ac_x - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_y - ACInfo[playerid][acPosY], 2.0)) >= 180.0))
  6154.                 #endif
  6155.                 {
  6156.                     if(!ac_IsAnAircraft(ac_t)) ac_z = ACInfo[playerid][acPosZ];
  6157.                     if((ac_x = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ac_z)) >= 50.0)
  6158.                     {
  6159.                         #if defined DEBUG
  6160.                             printf("[Nex-AC debug] Veh model: %d, dist: %f", ac_t, ac_x);
  6161.                         #endif
  6162.                         ac_KickWithCode(playerid, "", 0, 2, 4);
  6163.                     }
  6164.                 }
  6165.                 GetPlayerVelocity(playerid, ac_x, ac_y, ac_z);
  6166.                 ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_x, ac_y, ac_z);
  6167.                 if(ACInfo[playerid][acSet][8] == 3) ACInfo[playerid][acSet][8] = -1;
  6168.                 ACInfo[playerid][acGtc][18] = ACInfo[playerid][acGtc][10] = ac_i + 1650;
  6169.             }
  6170.             case PLAYER_STATE_PASSENGER:
  6171.             {
  6172.                 new Float:ac_x, Float:ac_y, Float:ac_z;
  6173.                 GetPlayerPos(playerid, ac_x, ac_y, ac_z);
  6174.                 #if defined VectorSize
  6175.                 if(ACInfo[playerid][acACAllow][2] &&
  6176.                 newstate == PLAYER_STATE_ONFOOT && ac_i > ACInfo[playerid][acGtc][11] + ac_s &&
  6177.                 (ACInfo[playerid][acPosZ] > -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
  6178.                 VectorSize(ac_x - ACInfo[playerid][acPosX], ac_y - ACInfo[playerid][acPosY], 0.0) >= 180.0))
  6179.                 #else
  6180.                 if(ACInfo[playerid][acACAllow][2] &&
  6181.                 newstate == PLAYER_STATE_ONFOOT && ac_i > ACInfo[playerid][acGtc][11] + ac_s &&
  6182.                 (ACInfo[playerid][acPosZ] > -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
  6183.                 floatsqroot(floatpower(ac_x - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_y - ACInfo[playerid][acPosY], 2.0)) >= 180.0))
  6184.                 #endif
  6185.                 {
  6186.                     new ac_model = GetVehicleModel(ACInfo[playerid][acVeh]);
  6187.                     ac_s = ACVehInfo[ACInfo[playerid][acVeh]][acDriver];
  6188.                     ac_x = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  6189.                     if(ac_x >= 180.0 || ac_x >= 50.0 && (ac_s == INVALID_PLAYER_ID || ac_i < ACInfo[ac_s][acUpdateTick] + 2000) &&
  6190.                     !(ac_model == 449 || 537 <= ac_model <= 538 || 569 <= ac_model <= 570))
  6191.                     {
  6192.                         #if defined DEBUG
  6193.                             if(ac_s == INVALID_PLAYER_ID) printf("[Nex-AC debug] Veh model: %d, dist: %f", ac_model, ac_x);
  6194.                             else printf("[Nex-AC debug] Veh model: %d, driver AFK time: %d, dist: %f", ac_model, ac_i - ACInfo[ac_s][acUpdateTick], ac_x);
  6195.                         #endif
  6196.                         ac_KickWithCode(playerid, "", 0, 2, 5);
  6197.                     }
  6198.                 }
  6199.                 GetPlayerVelocity(playerid, ac_x, ac_y, ac_z);
  6200.                 ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_x, ac_y, ac_z);
  6201.                 ACInfo[playerid][acGtc][18] = ACInfo[playerid][acGtc][10] = ac_i + 1650;
  6202.             }
  6203.         }
  6204.         switch(newstate)
  6205.         {
  6206.             case PLAYER_STATE_ONFOOT:
  6207.             {
  6208.                 ACInfo[playerid][acSet][11] = -1;
  6209.                 if(PLAYER_STATE_DRIVER <= oldstate <= PLAYER_STATE_PASSENGER)
  6210.                 {
  6211.                     GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  6212.                     ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX];
  6213.                     ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY];
  6214.                 }
  6215.             }
  6216.             case PLAYER_STATE_DRIVER, PLAYER_STATE_PASSENGER:
  6217.             {
  6218.                 ACInfo[playerid][acSet][11] = -1;
  6219.                 ACInfo[playerid][acCheatCount][3] =
  6220.                 ACInfo[playerid][acCheatCount][4] = 0;
  6221.                 new ac_vehid = GetPlayerVehicleID(playerid);
  6222.                 ac_s = GetVehicleModel(ac_vehid);
  6223.                 if(ACInfo[playerid][acSet][9] == -1)
  6224.                 {
  6225.                     if(ACInfo[playerid][acACAllow][4])
  6226.                     {
  6227.                         new ac_seat = GetPlayerVehicleSeat(playerid);
  6228.                         if(ACInfo[playerid][acEnterVeh] != ac_vehid ||
  6229.                         ACInfo[playerid][acEnterSeat] != -1 && ACInfo[playerid][acEnterSeat] != _:!!ac_seat ||
  6230.                         ac_i < ACInfo[playerid][acEnterVehTick] + 300)
  6231.                         {
  6232.                             #if defined DEBUG
  6233.                                 printf("[Nex-AC debug] Entered veh: %d, veh: %d, entered seat: %d, seat: %d, veh model: %d, enter time: %d",
  6234.                                 ACInfo[playerid][acEnterVeh], ac_vehid, ACInfo[playerid][acEnterSeat], ac_seat, ac_s, ac_i - ACInfo[playerid][acEnterVehTick]);
  6235.                             #endif
  6236.                             ac_KickWithCode(playerid, "", 0, 4, 1);
  6237.                         }
  6238.                         else
  6239.                         {
  6240.                             new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  6241.                             if(newstate == PLAYER_STATE_DRIVER)
  6242.                             {
  6243.                                 if(ac_dist > 25.0 || ac_dist > 15.0 && ac_s != 577 && ac_s != 592)
  6244.                                 {
  6245.                                     #if defined DEBUG
  6246.                                         printf("[Nex-AC debug] Veh model: %d, dist: %f", ac_s, ac_dist);
  6247.                                     #endif
  6248.                                     ac_KickWithCode(playerid, "", 0, 4, 3);
  6249.                                 }
  6250.                             }
  6251.                             else if(ac_dist > 80.0 || ac_dist > 30.0 && ac_i >= ACInfo[playerid][acUpdateTick] + 1500)
  6252.                             {
  6253.                                 #if defined DEBUG
  6254.                                     printf("[Nex-AC debug] Veh model: %d, AFK time: %d, dist: %f", ac_s, ac_i - ACInfo[playerid][acUpdateTick], ac_dist);
  6255.                                 #endif
  6256.                                 ac_KickWithCode(playerid, "", 0, 4, 4);
  6257.                             }
  6258.                             #if defined SetVehicleFakePosForPlayer\
  6259.                                 && defined SetVehicleFakeZAngleForPlayer
  6260.                                 if(ACInfo[playerid][acKicked] < 1 && !(ac_s == 449 || 537 <= ac_s <= 538 || 569 <= ac_s <= 570))
  6261.                                 {
  6262.                                     ac_dist = GetPlayerDistanceFromPoint(playerid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]);
  6263.                                     if(newstate == PLAYER_STATE_DRIVER)
  6264.                                     {
  6265.                                         if(ac_dist > 25.0 || ac_dist > 15.0 && ac_s != 577 && ac_s != 592)
  6266.                                         {
  6267.                                             #if defined DEBUG
  6268.                                                 printf("[Nex-AC debug] Veh model: %d, dist: %f", ac_s, ac_dist);
  6269.                                             #endif
  6270.                                             ac_KickWithCode(playerid, "", 0, 4, 5);
  6271.                                         }
  6272.                                     }
  6273.                                     else if(ac_dist > 80.0 || ac_dist > 30.0 && ac_i >= ACInfo[playerid][acUpdateTick] + 1500)
  6274.                                     {
  6275.                                         #if defined DEBUG
  6276.                                             printf("[Nex-AC debug] Veh model: %d, AFK time: %d, dist: %f", ac_s, ac_i - ACInfo[playerid][acUpdateTick], ac_dist);
  6277.                                         #endif
  6278.                                         ac_KickWithCode(playerid, "", 0, 4, 6);
  6279.                                     }
  6280.                                 }
  6281.                             #endif
  6282.                         }
  6283.                     }
  6284.                     if(newstate == PLAYER_STATE_DRIVER && ACInfo[playerid][acKicked] < 1)
  6285.                     {
  6286.                         ACVehInfo[ac_vehid][acDriver] = playerid;
  6287.                         GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  6288.                         ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX];
  6289.                         ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY];
  6290.                         ACInfo[playerid][acSetVehHealth] = -1.0;
  6291.                         ACInfo[playerid][acCheatCount][11] = 0;
  6292.                         ACInfo[playerid][acVehDmgRes] = false;
  6293.                     }
  6294.                     ACInfo[playerid][acEnterSeat] = -1;
  6295.                     ACInfo[playerid][acEnterVeh] = 0;
  6296.                 }
  6297.                 if(ACInfo[playerid][acACAllow][44])
  6298.                 {
  6299.                     ac_i = GetPlayerVehicleSeat(playerid);
  6300.                     if(ac_s < 400)
  6301.                     {
  6302.                         #if defined DEBUG
  6303.                             printf("[Nex-AC debug] Veh model: %d, seatid: %d", ac_s, ac_i);
  6304.                         #endif
  6305.                         ac_KickWithCode(playerid, "", 0, 44, 2);
  6306.                     }
  6307.                     else if(ACInfo[playerid][acSet][9] == -1)
  6308.                     {
  6309.                         new ac_maxseats = ac_GetMaxPassengers(ac_s);
  6310.                         if(newstate == PLAYER_STATE_DRIVER)
  6311.                         {
  6312.                             if(ac_i != 0 || ac_maxseats == 15)
  6313.                             {
  6314.                                 #if defined DEBUG
  6315.                                     printf("[Nex-AC debug] Veh model: %d, seatid: %d", ac_s, ac_i);
  6316.                                 #endif
  6317.                                 ac_KickWithCode(playerid, "", 0, 44, 3);
  6318.                             }
  6319.                         }
  6320.                         else if(ac_i < 1 || ac_maxseats == 15 || ac_i > ac_maxseats && ac_s != 431 && ac_s != 437 && ac_s != 570)
  6321.                         {
  6322.                             #if defined DEBUG
  6323.                                 printf("[Nex-AC debug] Veh model: %d, max seats: %d, seatid: %d", ac_s, ac_maxseats, ac_i);
  6324.                             #endif
  6325.                             ac_KickWithCode(playerid, "", 0, 44, 4);
  6326.                         }
  6327.                     }
  6328.                 }
  6329.             }
  6330.             case PLAYER_STATE_SPAWNED:
  6331.             {
  6332.                 ACInfo[playerid][acPosX] = ACInfo[playerid][acSpawnPosX];
  6333.                 ACInfo[playerid][acPosY] = ACInfo[playerid][acSpawnPosY];
  6334.                 ACInfo[playerid][acPosZ] = ACInfo[playerid][acSpawnPosZ];
  6335.                 ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX];
  6336.                 ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY];
  6337.             }
  6338.             case PLAYER_STATE_SPECTATING:
  6339.             {
  6340.                 if(ACInfo[playerid][acACAllow][21] && !ACInfo[playerid][acSpec] &&
  6341.                 ACInfo[playerid][acSet][6] == -1) ac_KickWithCode(playerid, "", 0, 21);
  6342.                 if(ACInfo[playerid][acKicked] < 1)
  6343.                 {
  6344.                     ACInfo[playerid][acHealth] = 100;
  6345.                     ACInfo[playerid][acSet][6] = -1;
  6346.                     ACInfo[playerid][acSpec] = true;
  6347.                 }
  6348.             }
  6349.         }
  6350.     #if AC_USE_NPC
  6351.         }
  6352.     #endif
  6353.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6354.         && defined ac_OnPlayerStateChange
  6355.         return ac_OnPlayerStateChange(playerid, newstate, oldstate);
  6356.     #else
  6357.         return 1;
  6358.     #endif
  6359. }
  6360.  
  6361. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6362.     #if defined _ALS_OnPlayerStateChange
  6363.         #undef OnPlayerStateChange
  6364.     #else
  6365.         #define _ALS_OnPlayerStateChange
  6366.     #endif
  6367.     #define OnPlayerStateChange ac_OnPlayerStateChange
  6368.     #if defined ac_OnPlayerStateChange
  6369.         forward ac_OnPlayerStateChange(playerid, newstate, oldstate);
  6370.     #endif
  6371. #endif
  6372.  
  6373. #if defined OnPlayerWeaponShot
  6374.     public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  6375.     {
  6376.         if(ACInfo[playerid][acKicked] > 0 || ACInfo[playerid][acDead]) return 0;
  6377.         if(ACInfo[playerid][acACAllow][22] && !ac_LagCompMode)
  6378.         {
  6379.             #if defined OnCheatDetected
  6380.                 ac_KickWithCode(playerid, "", 0, 22);
  6381.             #endif
  6382.             return 0;
  6383.         }
  6384.         if(ACInfo[playerid][acACAllow][47] &&
  6385.         (!(BULLET_HIT_TYPE_NONE <= hittype <= BULLET_HIT_TYPE_PLAYER_OBJECT) ||
  6386.         hittype == BULLET_HIT_TYPE_PLAYER && !(0 <= hitid < MAX_PLAYERS) ||
  6387.         hittype == BULLET_HIT_TYPE_VEHICLE && !(1 <= hitid < MAX_VEHICLES) ||
  6388.         hittype == BULLET_HIT_TYPE_OBJECT && !(1 <= hitid < MAX_OBJECTS) ||
  6389.         hittype == BULLET_HIT_TYPE_PLAYER_OBJECT && !(1 <= hitid < MAX_OBJECTS) ||
  6390.         weaponid != 38 && !(22 <= weaponid <= 34)))
  6391.         {
  6392.             #if defined DEBUG
  6393.                 printf("[Nex-AC debug] Hittype: %d, hitid: %d, weaponid: %d", hittype, hitid, weaponid);
  6394.             #endif
  6395.             return ac_KickWithCode(playerid, "", 0, 47, 1);
  6396.         }
  6397.         new Float:ac_oX, Float:ac_oY, Float:ac_oZ, Float:ac_hX, Float:ac_hY, Float:ac_hZ;
  6398.         GetPlayerLastShotVectors(playerid, ac_oX, ac_oY, ac_oZ, ac_hX, ac_hY, ac_hZ);
  6399.         if(ACInfo[playerid][acACAllow][34])
  6400.         {
  6401.             new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ac_oX, ac_oY, ac_oZ);
  6402.             if(ac_dist > 50.0 || ac_dist > 15.0 && !IsPlayerInAnyVehicle(playerid) &&
  6403.             !IsVehicleStreamedIn(GetPlayerSurfingVehicleID(playerid), playerid) &&
  6404.             GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
  6405.             {
  6406.                 if(++ACInfo[playerid][acCheatCount][5] > AC_MAX_AFK_GHOST_WARNINGS)
  6407.                 {
  6408.                     #undef AC_MAX_AFK_GHOST_WARNINGS
  6409.                     #if defined DEBUG
  6410.                         printf("[Nex-AC debug] Origin dist: %f", ac_dist);
  6411.                     #endif
  6412.                     #if defined OnCheatDetected
  6413.                         ac_KickWithCode(playerid, "", 0, 34);
  6414.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  6415.                         ACInfo[playerid][acCheatCount][5] = 0;
  6416.                     #else
  6417.                         return ac_KickWithCode(playerid, "", 0, 34);
  6418.                     #endif
  6419.                 }
  6420.                 #if defined OnCheatWarning
  6421.                     else OnCheatWarning(playerid, "", 0, 34, 0, ACInfo[playerid][acCheatCount][5]);
  6422.                 #endif
  6423.             }
  6424.             else ACInfo[playerid][acCheatCount][5] = 0;
  6425.         }
  6426.         new ac_gtc = GetTickCount(), ac_gpp = GetPlayerPing(playerid);
  6427.         if(ACInfo[playerid][acACAllow][29])
  6428.         {
  6429.             if(hittype > BULLET_HIT_TYPE_NONE)
  6430.             {
  6431.                 new Float:ac_pX, Float:ac_pY, Float:ac_pZ;
  6432.                 GetPlayerPos(playerid, ac_pX, ac_pY, ac_pZ);
  6433.                 if(fX == 0.0 && fY == 0.0 && fZ == 0.0 || ac_oX == ac_hX && ac_oY == ac_hY ||
  6434.                 ac_oX == ac_pX || ac_oY == ac_pY || floatabs(ac_oZ - ac_pZ) < 0.01)
  6435.                 {
  6436.                     if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_SILENT_AIM_WARNINGS)
  6437.                     {
  6438.                         #undef AC_MAX_SILENT_AIM_WARNINGS
  6439.                         #if defined DEBUG
  6440.                             printf("[Nex-AC debug] Hittype: %d, weaponid: %d, pZ: %f, oZ: %f, fX, fY, fZ: %f, %f, %f",
  6441.                             hittype, weaponid, ac_pZ, ac_oZ, fX, fY, fZ);
  6442.                         #endif
  6443.                         #if defined OnCheatDetected
  6444.                             ac_KickWithCode(playerid, "", 0, 29, 1);
  6445.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  6446.                             ACInfo[playerid][acCheatCount][13] = 0;
  6447.                         #else
  6448.                             return ac_KickWithCode(playerid, "", 0, 29, 1);
  6449.                         #endif
  6450.                     }
  6451.                     #if defined OnCheatWarning
  6452.                         else OnCheatWarning(playerid, "", 0, 29, 1, ACInfo[playerid][acCheatCount][13]);
  6453.                     #endif
  6454.                 }
  6455.                 else
  6456.                 {
  6457.                     if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID &&
  6458.                     !ACInfo[hitid][acDead] && ac_gtc > ACInfo[hitid][acSetPosTick] + ac_gpp &&
  6459.                     ac_gtc < ACInfo[hitid][acUpdateTick] + 1500)
  6460.                     {
  6461.                         new Float:ac_dist = GetPlayerDistanceFromPoint(hitid, ac_hX, ac_hY, ac_hZ);
  6462.                         if(ac_dist > 50.0 || ac_dist > 20.0 && !IsPlayerInAnyVehicle(hitid) &&
  6463.                         !IsVehicleStreamedIn(GetPlayerSurfingVehicleID(hitid), hitid) &&
  6464.                         GetPlayerSurfingObjectID(hitid) == INVALID_OBJECT_ID)
  6465.                         {
  6466.                             if(++ACInfo[playerid][acCheatCount][6] > AC_MAX_PRO_AIM_WARNINGS)
  6467.                             {
  6468.                                 #undef AC_MAX_PRO_AIM_WARNINGS
  6469.                                 #if defined DEBUG
  6470.                                     printf("[Nex-AC debug] Hit dist: %f", ac_dist);
  6471.                                 #endif
  6472.                                 #if defined OnCheatDetected
  6473.                                     ac_KickWithCode(playerid, "", 0, 29, 2);
  6474.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  6475.                                     ACInfo[playerid][acCheatCount][6] = 0;
  6476.                                 #else
  6477.                                     return ac_KickWithCode(playerid, "", 0, 29, 2);
  6478.                                 #endif
  6479.                             }
  6480.                             #if defined OnCheatWarning
  6481.                                 else OnCheatWarning(playerid, "", 0, 29, 2, ACInfo[playerid][acCheatCount][6]);
  6482.                             #endif
  6483.                         }
  6484.                         else ACInfo[playerid][acCheatCount][6] = 0;
  6485.                     }
  6486.                     ACInfo[playerid][acCheatCount][13] = 0;
  6487.                 }
  6488.             }
  6489.             else ACInfo[playerid][acCheatCount][13] = 0;
  6490.         }
  6491.         new ac_i, ac_t, bool:ac_ur, bool:ac_ur2;
  6492.         switch(hittype)
  6493.         {
  6494.             case BULLET_HIT_TYPE_PLAYER:
  6495.             {
  6496.                 #if AC_USE_NPC
  6497.                     if(hitid != INVALID_PLAYER_ID && !IsPlayerNPC(hitid) &&
  6498.                     ACInfo[hitid][acACAllow][19] && ACInfo[hitid][acUnFrozen] &&
  6499.                     !ACInfo[hitid][acDead] && ac_gtc > ACInfo[hitid][acSetPosTick] + ac_gpp &&
  6500.                     IsPlayerInRangeOfPoint(hitid, ac_wMinRange[weaponid - 22], ac_oX, ac_oY, ac_oZ) &&
  6501.                     !(SPECIAL_ACTION_ENTER_VEHICLE <= GetPlayerSpecialAction(hitid) <= SPECIAL_ACTION_EXIT_VEHICLE))
  6502.                 #else
  6503.                     if(hitid != INVALID_PLAYER_ID && ACInfo[hitid][acACAllow][19] && ACInfo[hitid][acUnFrozen] &&
  6504.                     !ACInfo[hitid][acDead] && ac_gtc > ACInfo[hitid][acSetPosTick] + ac_gpp &&
  6505.                     IsPlayerInRangeOfPoint(hitid, ac_wMinRange[weaponid - 22], ac_oX, ac_oY, ac_oZ) &&
  6506.                     !(SPECIAL_ACTION_ENTER_VEHICLE <= GetPlayerSpecialAction(hitid) <= SPECIAL_ACTION_EXIT_VEHICLE))
  6507.                 #endif
  6508.                 {
  6509.                     ac_t = GetPlayerTeam(playerid);
  6510.                     if(ac_t == NO_TEAM || ac_t != GetPlayerTeam(hitid))
  6511.                     {
  6512.                         #if AC_USE_RESTAURANTS || AC_USE_AMMUNATIONS || AC_USE_CASINOS
  6513.                             ac_i = GetPlayerInterior(hitid);
  6514.                         #endif
  6515.                         #if AC_USE_RESTAURANTS
  6516.                             if(!ac_InRestaurant(hitid, ac_i))
  6517.                             {
  6518.                         #endif
  6519.                             #if AC_USE_AMMUNATIONS
  6520.                                 if(!ac_InAmmuNation(hitid, ac_i))
  6521.                                 {
  6522.                             #endif
  6523.                                 #if AC_USE_CASINOS
  6524.                                     if(!ac_InCasino(hitid, ac_i))
  6525.                                     {
  6526.                                 #endif
  6527.                                     ac_ur = true;
  6528.                                 #if AC_USE_CASINOS
  6529.                                     }
  6530.                                 #endif
  6531.                             #if AC_USE_AMMUNATIONS
  6532.                                 }
  6533.                             #endif
  6534.                         #if AC_USE_RESTAURANTS
  6535.                             }
  6536.                         #endif
  6537.                     }
  6538.                 }
  6539.             }
  6540.             case BULLET_HIT_TYPE_VEHICLE:
  6541.             {
  6542.                 if(hitid != INVALID_VEHICLE_ID)
  6543.                 {
  6544.                     ac_i = ACVehInfo[hitid][acDriver];
  6545.                     #if AC_USE_NPC
  6546.                         if(ac_i != INVALID_PLAYER_ID && !IsPlayerNPC(ac_i) &&
  6547.                         ACInfo[ac_i][acACAllow][20] && ACInfo[ac_i][acUnFrozen] &&
  6548.                         ACVehInfo[hitid][acHealth] >= 250.0 && ac_gtc > ACInfo[ac_i][acSetPosTick] + ac_gpp)
  6549.                     #else
  6550.                         if(ac_i != INVALID_PLAYER_ID && ACInfo[ac_i][acACAllow][20] && ACInfo[ac_i][acUnFrozen] &&
  6551.                         ACVehInfo[hitid][acHealth] >= 250.0 && ac_gtc > ACInfo[ac_i][acSetPosTick] + ac_gpp)
  6552.                     #endif
  6553.                     {
  6554.                         ac_t = GetPlayerTeam(playerid);
  6555.                         if(!ac_VehFriendlyFire || ac_t == NO_TEAM || ac_t != GetPlayerTeam(ac_i))
  6556.                         {
  6557.                             ac_t = GetVehicleModel(hitid);
  6558.                             new Float:ac_wX, Float:ac_wY, Float:ac_wZ;
  6559.                             GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSFRONT, ac_hX, ac_hY, ac_hZ);
  6560.                             GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSREAR, ac_oX, ac_oY, ac_oZ);
  6561.                             GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSMID, ac_wX, ac_wY, ac_wZ);
  6562.                             #if defined VectorSize
  6563.                                 if(VectorSize(ac_hX - fX, ac_hY - fY, ac_hZ - fZ) > 1.2 &&
  6564.                                 VectorSize(-ac_hX - fX, ac_hY - fY, ac_hZ - fZ) > 1.2 &&
  6565.                                 VectorSize(ac_oX - fX, ac_oY - fY, ac_oZ - fZ) > 1.2 &&
  6566.                                 VectorSize(-ac_oX - fX, ac_oY - fY, ac_oZ - fZ) > 1.2 &&
  6567.                                 (ac_wX == 0.0 && ac_wY == 0.0 && ac_wZ == 0.0 || VectorSize(ac_wX - fX, ac_wY - fY, ac_wZ - fZ) > 1.2 &&
  6568.                                 VectorSize(-ac_wX - fX, ac_wY - fY, ac_wZ - fZ) > 1.2)) ac_ur2 = true;
  6569.                             #else
  6570.                                 if(floatsqroot(floatpower(ac_hX - fX, 2.0) + floatpower(ac_hY - fY, 2.0) + floatpower(ac_hZ - fZ, 2.0)) > 1.2 &&
  6571.                                 floatsqroot(floatpower(-ac_hX - fX, 2.0) + floatpower(ac_hY - fY, 2.0) + floatpower(ac_hZ - fZ, 2.0)) > 1.2 &&
  6572.                                 floatsqroot(floatpower(ac_oX - fX, 2.0) + floatpower(ac_oY - fY, 2.0) + floatpower(ac_oZ - fZ, 2.0)) > 1.2 &&
  6573.                                 floatsqroot(floatpower(-ac_oX - fX, 2.0) + floatpower(ac_oY - fY, 2.0) + floatpower(ac_oZ - fZ, 2.0)) > 1.2 &&
  6574.                                 (ac_wX == 0.0 && ac_wY == 0.0 && ac_wZ == 0.0 || floatsqroot(floatpower(ac_wX - fX, 2.0) + floatpower(ac_wY - fY, 2.0) + floatpower(ac_wZ - fZ, 2.0)) > 1.2 &&
  6575.                                 floatsqroot(floatpower(-ac_wX - fX, 2.0) + floatpower(ac_wY - fY, 2.0) + floatpower(ac_wZ - fZ, 2.0)) > 1.2)) ac_ur2 = true;
  6576.                             #endif
  6577.                         }
  6578.                     }
  6579.                 }
  6580.             }
  6581.         }
  6582.         if((ac_t = GetPlayerState(playerid)) != PLAYER_STATE_DRIVER)
  6583.         {
  6584.             new ac_s = ac_wSlot[weaponid];
  6585.             if(ACInfo[playerid][acACAllow][47])
  6586.             {
  6587.                 ac_i = GetPlayerWeapon(playerid);
  6588.                 if(ac_i != weaponid && ac_t != PLAYER_STATE_PASSENGER ||
  6589.                 ACInfo[playerid][acWeapon][ac_s] != weaponid && ACInfo[playerid][acSetWeapon][ac_s] != weaponid)
  6590.                 {
  6591.                     if(++ACInfo[playerid][acCheatCount][18] > AC_MAX_FAKE_WEAPON_WARNINGS)
  6592.                     {
  6593.                         #undef AC_MAX_FAKE_WEAPON_WARNINGS
  6594.                         #if defined DEBUG
  6595.                             printf("[Nex-AC debug] Armed weapon: %d, AC weapon: %d, weaponid: %d, state: %d",
  6596.                             ac_i, ACInfo[playerid][acWeapon][ac_s], weaponid, ac_t);
  6597.                         #endif
  6598.                         ac_KickWithCode(playerid, "", 0, 47, 2);
  6599.                         #if defined OnCheatDetected
  6600.                             ACInfo[playerid][acCheatCount][18] = 0;
  6601.                         #endif
  6602.                     }
  6603.                     #if defined OnCheatWarning
  6604.                         else OnCheatWarning(playerid, "", 0, 47, 2, ACInfo[playerid][acCheatCount][18]);
  6605.                     #endif
  6606.                     return 0;
  6607.                 }
  6608.                 else ACInfo[playerid][acCheatCount][18] = 0;
  6609.             }
  6610.             if(ACInfo[playerid][acACAllow][26])
  6611.             {
  6612.                 ac_i = ac_gtc - ACInfo[playerid][acShotTick];
  6613.                 if(ACInfo[playerid][acLastShot] == weaponid)
  6614.                 {
  6615.                     if(weaponid != 38 && ac_t != PLAYER_STATE_PASSENGER)
  6616.                     {
  6617.                         if(ac_gtc < ACInfo[playerid][acReloadTick] + 110)
  6618.                         {
  6619.                             #if defined DEBUG
  6620.                                 printf("[Nex-AC debug] Weaponid: %d, Reload time: %d, state: %d",
  6621.                                 weaponid, ac_gtc - ACInfo[playerid][acReloadTick], ac_t);
  6622.                             #endif
  6623.                             #if defined OnCheatDetected
  6624.                                 ac_KickWithCode(playerid, "", 0, 26, 4);
  6625.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  6626.                                 ACInfo[playerid][acReloadTick] = 0;
  6627.                             #else
  6628.                                 return ac_KickWithCode(playerid, "", 0, 26, 4);
  6629.                             #endif
  6630.                         }
  6631.                         else if(ac_i < 30 || ac_i < 50 && weaponid != 32 && !(28 <= weaponid <= 29))
  6632.                         {
  6633.                             if(++ACInfo[playerid][acCheatCount][8] > AC_MAX_RAPID_FIRE_WARNINGS)
  6634.                             {
  6635.                                 #undef AC_MAX_RAPID_FIRE_WARNINGS
  6636.                                 #if defined DEBUG
  6637.                                     printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
  6638.                                 #endif
  6639.                                 #if defined OnCheatDetected
  6640.                                     ac_KickWithCode(playerid, "", 0, 26, 1);
  6641.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  6642.                                     ACInfo[playerid][acCheatCount][8] = 0;
  6643.                                 #else
  6644.                                     return ac_KickWithCode(playerid, "", 0, 26, 1);
  6645.                                 #endif
  6646.                             }
  6647.                             #if defined OnCheatWarning
  6648.                                 else OnCheatWarning(playerid, "", 0, 26, 1, ACInfo[playerid][acCheatCount][8]);
  6649.                             #endif
  6650.                         }
  6651.                         else ACInfo[playerid][acCheatCount][8] = 0;
  6652.                         if(weaponid == 25 && ac_i < 600 || (weaponid == 24 || 33 <= weaponid <= 34) && ac_i < 380)
  6653.                         {
  6654.                             if(++ACInfo[playerid][acCheatCount][14] > AC_MAX_AUTO_C_WARNINGS)
  6655.                             {
  6656.                                 #undef AC_MAX_AUTO_C_WARNINGS
  6657.                                 #if defined DEBUG
  6658.                                     printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
  6659.                                 #endif
  6660.                                 #if defined OnCheatDetected
  6661.                                     ac_KickWithCode(playerid, "", 0, 26, 2);
  6662.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  6663.                                     ACInfo[playerid][acCheatCount][14] = 0;
  6664.                                 #else
  6665.                                     return ac_KickWithCode(playerid, "", 0, 26, 2);
  6666.                                 #endif
  6667.                             }
  6668.                             #if defined OnCheatWarning
  6669.                                 else OnCheatWarning(playerid, "", 0, 26, 2, ACInfo[playerid][acCheatCount][14]);
  6670.                             #endif
  6671.                         }
  6672.                     }
  6673.                 }
  6674.                 else if(ac_i < 30)
  6675.                 {
  6676.                     #if defined DEBUG
  6677.                         printf("[Nex-AC debug] Fire rate: %d, weaponid: %d, last weapon: %d",
  6678.                         ac_i, weaponid, ACInfo[playerid][acLastShot]);
  6679.                     #endif
  6680.                     #if defined OnCheatDetected
  6681.                         ac_KickWithCode(playerid, "", 0, 26, 3);
  6682.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  6683.                     #else
  6684.                         return ac_KickWithCode(playerid, "", 0, 26, 3);
  6685.                     #endif
  6686.                 }
  6687.                 if(GetPlayerWeaponState(playerid) == WEAPONSTATE_LAST_BULLET) ACInfo[playerid][acReloadTick] = ac_gtc;
  6688.             }
  6689.             if(ACInfo[playerid][acACAllow][17] && ac_t != PLAYER_STATE_PASSENGER &&
  6690.             ACInfo[playerid][acGiveAmmo][ac_s] == -65535 && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  6691.             {
  6692.                 ac_t = GetPlayerAmmo(playerid);
  6693.                 if(ACInfo[playerid][acAmmo][ac_s] == 0)
  6694.                 {
  6695.                     #if defined DEBUG
  6696.                         printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d", weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  6697.                     #endif
  6698.                     #if defined OnCheatDetected
  6699.                         ac_KickWithCode(playerid, "", 0, 17, 1);
  6700.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  6701.                         ACInfo[playerid][acAmmo][ac_s] = ac_t;
  6702.                     #else
  6703.                         return ac_KickWithCode(playerid, "", 0, 17, 1);
  6704.                     #endif
  6705.                 }
  6706.                 if(ACInfo[playerid][acAmmo][ac_s] < ac_t)
  6707.                 {
  6708.                     switch(weaponid)
  6709.                     {
  6710.                         case 38:
  6711.                         {
  6712.                             if(++ACInfo[playerid][acCheatCount][7] > 9)
  6713.                             {
  6714.                                 #if defined DEBUG
  6715.                                     printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d, acCheatCount[7]: %d",
  6716.                                     weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t, ACInfo[playerid][acCheatCount][7]);
  6717.                                 #endif
  6718.                                 #if defined OnCheatDetected
  6719.                                     ac_KickWithCode(playerid, "", 0, 17, 2);
  6720.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  6721.                                     ACInfo[playerid][acCheatCount][7] = 0;
  6722.                                     ACInfo[playerid][acAmmo][ac_s] = ac_t;
  6723.                                 #else
  6724.                                     return ac_KickWithCode(playerid, "", 0, 17, 2);
  6725.                                 #endif
  6726.                             }
  6727.                             #if defined OnCheatWarning
  6728.                                 else OnCheatWarning(playerid, "", 0, 17, 2, ACInfo[playerid][acCheatCount][7]);
  6729.                             #endif
  6730.                         }
  6731.                         default:
  6732.                         {
  6733.                             if(ac_t > ACInfo[playerid][acAmmo][ac_s] + 6)
  6734.                             {
  6735.                                 #if defined DEBUG
  6736.                                     printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  6737.                                     weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  6738.                                 #endif
  6739.                                 #if defined OnCheatDetected
  6740.                                     ac_KickWithCode(playerid, "", 0, 17, 3);
  6741.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  6742.                                     ACInfo[playerid][acCheatCount][7] = 0;
  6743.                                     ACInfo[playerid][acAmmo][ac_s] = ac_t;
  6744.                                 #else
  6745.                                     return ac_KickWithCode(playerid, "", 0, 17, 3);
  6746.                                 #endif
  6747.                             }
  6748.                         }
  6749.                     }
  6750.                 }
  6751.                 else ACInfo[playerid][acCheatCount][7] = 0;
  6752.             }
  6753.             if(ACInfo[playerid][acAmmo][ac_s] != 0)
  6754.             {
  6755.                 ACInfo[playerid][acAmmo][ac_s]--;
  6756.                 if(ACInfo[playerid][acAmmo][ac_s] == 0 && ACInfo[playerid][acSet][3] == weaponid)
  6757.                 {
  6758.                     ACInfo[playerid][acSet][3] =
  6759.                     ACInfo[playerid][acSetWeapon][ac_s] = -1;
  6760.                 }
  6761.             }
  6762.             if(ACInfo[playerid][acAmmo][ac_s] < -32768) ACInfo[playerid][acAmmo][ac_s] += 65536;
  6763.         }
  6764.         ACInfo[playerid][acLastShot] = weaponid;
  6765.         ACInfo[playerid][acShotTick] = ac_gtc;
  6766.         ac_i = 1;
  6767.         #if defined ac_OnPlayerWeaponShot
  6768.             ac_i = ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
  6769.         #endif
  6770.         if(ac_i)
  6771.         {
  6772.             if(ac_ur)
  6773.             {
  6774.                 if(ACInfo[hitid][acArmour] > 0) ACInfo[hitid][acDmgRes] = 2;
  6775.                 else ACInfo[hitid][acDmgRes] = 1;
  6776.                 ACInfo[hitid][acGtc][14] = ac_gtc + 165;
  6777.             }
  6778.             if(ac_ur2)
  6779.             {
  6780.                 ACInfo[ACVehInfo[hitid][acDriver]][acVehDmgRes] = true;
  6781.                 ACInfo[ACVehInfo[hitid][acDriver]][acGtc][16] = ac_gtc + 165;
  6782.             }
  6783.         }
  6784.         return ac_i;
  6785.     }
  6786.  
  6787.     #if defined _ALS_OnPlayerWeaponShot
  6788.         #undef OnPlayerWeaponShot
  6789.     #else
  6790.         #define _ALS_OnPlayerWeaponShot
  6791.     #endif
  6792.     #define OnPlayerWeaponShot ac_OnPlayerWeaponShot
  6793.     #if defined ac_OnPlayerWeaponShot
  6794.         forward ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  6795.     #endif
  6796. #endif
  6797.  
  6798. #if defined _inc_y_hooks || defined _INC_y_hooks
  6799.     hook OnVehicleMod(playerid, vehicleid, componentid)
  6800. #else
  6801.     public OnVehicleMod(playerid, vehicleid, componentid)
  6802. #endif
  6803. {
  6804.     if(ACInfo[playerid][acKicked] > 0) return 0;
  6805.     new ac_i = GetTickCount();
  6806.     if(ACInfo[playerid][acACAllow][49])
  6807.     {
  6808.         if(ac_i < ACInfo[playerid][acCall][12] + ac_Mtfc[12][0]) return ac_FloodDetect(playerid, 12);
  6809.         if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6810.         else ACInfo[playerid][acFloodCount][12] = ACInfo[playerid][acFloodCount][27] = 0;
  6811.     }
  6812.     if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop])
  6813.     {
  6814.         #if defined OnCheatDetected
  6815.             ac_KickWithCode(playerid, "", 0, 23, 2);
  6816.             if(ACInfo[playerid][acKicked] > 0) return 0;
  6817.         #else
  6818.             return ac_KickWithCode(playerid, "", 0, 23, 2);
  6819.         #endif
  6820.     }
  6821.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][12] = ac_i;
  6822.     #if AC_USE_TUNING_GARAGES
  6823.         ACInfo[playerid][acGtc][17] = ac_i + 3250;
  6824.     #endif
  6825.     if(ACInfo[playerid][acACAllow][43] && !ac_IsCompatible((ac_i = GetVehicleModel(vehicleid)), componentid))
  6826.     {
  6827.         #if defined DEBUG
  6828.             printf("[Nex-AC debug] Veh model: %d, componentid: %d", ac_i, componentid);
  6829.         #endif
  6830.         return ac_KickWithCode(playerid, "", 0, 43, 1);
  6831.     }
  6832.     #if AC_USE_TUNING_GARAGES
  6833.         ac_i = componentid - 1000;
  6834.         if(ACInfo[playerid][acSet][12] != -1) ACInfo[playerid][acSet][12] += ac_cPrice[ac_i];
  6835.         else ACInfo[playerid][acSet][12] = ac_cPrice[ac_i];
  6836.         ACInfo[playerid][acCheatCount][12] = 0;
  6837.     #endif
  6838.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6839.         && defined ac_OnVehicleMod
  6840.         return ac_OnVehicleMod(playerid, vehicleid, componentid);
  6841.     #else
  6842.         return 1;
  6843.     #endif
  6844. }
  6845.  
  6846. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6847.     #if defined _ALS_OnVehicleMod
  6848.         #undef OnVehicleMod
  6849.     #else
  6850.         #define _ALS_OnVehicleMod
  6851.     #endif
  6852.     #define OnVehicleMod ac_OnVehicleMod
  6853.     #if defined ac_OnVehicleMod
  6854.         forward ac_OnVehicleMod(playerid, vehicleid, componentid);
  6855.     #endif
  6856. #endif
  6857.  
  6858. #if defined _inc_y_hooks || defined _INC_y_hooks
  6859.     hook OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  6860. #else
  6861.     public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  6862. #endif
  6863. {
  6864.     if(ACInfo[playerid][acKicked] > 0) return 0;
  6865.     new ac_gtc = GetTickCount();
  6866.     if(ACInfo[playerid][acACAllow][49])
  6867.     {
  6868.         if(ac_gtc < ACInfo[playerid][acCall][13] + ac_Mtfc[13][0]) ac_FloodDetect(playerid, 13);
  6869.         else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6870.         else ACInfo[playerid][acFloodCount][13] = ACInfo[playerid][acFloodCount][27] = 0;
  6871.     }
  6872.     if(ACInfo[playerid][acACAllow][43] && !(0 <= paintjobid <= 2) && paintjobid != 255)
  6873.     {
  6874.         #if defined DEBUG
  6875.             printf("[Nex-AC debug] Veh model: %d, paintjobid: %d", GetVehicleModel(vehicleid), paintjobid);
  6876.         #endif
  6877.         ac_KickWithCode(playerid, "", 0, 43, 2);
  6878.     }
  6879.     else if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop]) ac_KickWithCode(playerid, "", 0, 23, 4);
  6880.     if(ACInfo[playerid][acKicked] < 1)
  6881.     {
  6882.         if(paintjobid == 255) ACVehInfo[vehicleid][acPaintJob] = 3;
  6883.         else ACVehInfo[vehicleid][acPaintJob] = paintjobid;
  6884.     }
  6885.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][13] = ac_gtc;
  6886.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6887.         && defined ac_OnVehiclePaintjob
  6888.         return ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  6889.     #else
  6890.         return 1;
  6891.     #endif
  6892. }
  6893.  
  6894. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6895.     #if defined _ALS_OnVehiclePaintjob
  6896.         #undef OnVehiclePaintjob
  6897.     #else
  6898.         #define _ALS_OnVehiclePaintjob
  6899.     #endif
  6900.     #define OnVehiclePaintjob ac_OnVehiclePaintjob
  6901.     #if defined ac_OnVehiclePaintjob
  6902.         forward ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  6903.     #endif
  6904. #endif
  6905.  
  6906. #if defined _inc_y_hooks || defined _INC_y_hooks
  6907.     hook OnVehicleRespray(playerid, vehicleid, color1, color2)
  6908. #else
  6909.     public OnVehicleRespray(playerid, vehicleid, color1, color2)
  6910. #endif
  6911. {
  6912.     if(ACInfo[playerid][acKicked] > 0) return 0;
  6913.     new ac_gtc = GetTickCount();
  6914.     if(ACInfo[playerid][acACAllow][49])
  6915.     {
  6916.         if(ac_gtc < ACInfo[playerid][acCall][14] + ac_Mtfc[14][0]) return ac_FloodDetect(playerid, 14);
  6917.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6918.         else ACInfo[playerid][acFloodCount][14] = ACInfo[playerid][acFloodCount][27] = 0;
  6919.     }
  6920.     #if !AC_USE_TUNING_GARAGES && !AC_USE_PAYNSPRAY
  6921.         if(ACInfo[playerid][acACAllow][23])
  6922.         {
  6923.             #if defined DEBUG
  6924.                 printf("[Nex-AC debug] Veh model: %d, color1: %d, color2: %d", GetVehicleModel(vehicleid), color1, color2);
  6925.             #endif
  6926.             #if defined OnCheatDetected
  6927.                 ac_KickWithCode(playerid, "", 0, 23, 5);
  6928.                 if(ACInfo[playerid][acKicked] > 0) return 0;
  6929.             #else
  6930.                 return ac_KickWithCode(playerid, "", 0, 23, 5);
  6931.             #endif
  6932.         }
  6933.     #endif
  6934.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][14] = ac_gtc;
  6935.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6936.         && defined ac_OnVehicleRespray
  6937.         return ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  6938.     #else
  6939.         return 1;
  6940.     #endif
  6941. }
  6942.  
  6943. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6944.     #if defined _ALS_OnVehicleRespray
  6945.         #undef OnVehicleRespray
  6946.     #else
  6947.         #define _ALS_OnVehicleRespray
  6948.     #endif
  6949.     #define OnVehicleRespray ac_OnVehicleRespray
  6950.     #if defined ac_OnVehicleRespray
  6951.         forward ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  6952.     #endif
  6953. #endif
  6954.  
  6955. #if defined _inc_y_hooks || defined _INC_y_hooks
  6956.     hook OnVehicleSpawn(vehicleid)
  6957. #else
  6958.     public OnVehicleSpawn(vehicleid)
  6959. #endif
  6960. {
  6961.     ACVehInfo[vehicleid][acPaintJob] = 3;
  6962.     ACVehInfo[vehicleid][acSpawned] = true;
  6963.     ACVehInfo[vehicleid][acHealth] = 1000.0;
  6964.     ACVehInfo[vehicleid][acPosDiff] =
  6965.     ACVehInfo[vehicleid][acVelX] =
  6966.     ACVehInfo[vehicleid][acVelY] =
  6967.     ACVehInfo[vehicleid][acVelZ] = 0.0;
  6968.     ACVehInfo[vehicleid][acLastSpeed] =
  6969.     ACVehInfo[vehicleid][acSpeedDiff] = 0;
  6970.     ACVehInfo[vehicleid][acPosX] = ACVehInfo[vehicleid][acSpawnPosX];
  6971.     ACVehInfo[vehicleid][acPosY] = ACVehInfo[vehicleid][acSpawnPosY];
  6972.     ACVehInfo[vehicleid][acPosZ] = ACVehInfo[vehicleid][acSpawnPosZ];
  6973.     ACVehInfo[vehicleid][acZAngle] = ACVehInfo[vehicleid][acSpawnZAngle];
  6974.     ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  6975.     new ac_gtc = GetTickCount() + 2650;
  6976.     #if defined foreach
  6977.         foreach(new ac_i : Player)
  6978.         {
  6979.             if(ACInfo[ac_i][acVeh] == vehicleid)
  6980.             {
  6981.                 ACInfo[ac_i][acSetPosTick] =
  6982.                 ACInfo[ac_i][acGtc][11] = ac_gtc;
  6983.             }
  6984.         }
  6985.     #else
  6986.         #if defined GetPlayerPoolSize
  6987.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  6988.         #else
  6989.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  6990.         #endif
  6991.         {
  6992.             if(IsPlayerInVehicle(ac_i, vehicleid))
  6993.             {
  6994.                 ACInfo[ac_i][acSetPosTick] =
  6995.                 ACInfo[ac_i][acGtc][11] = ac_gtc;
  6996.             }
  6997.         }
  6998.     #endif
  6999.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7000.         && defined ac_OnVehicleSpawn
  7001.         return ac_OnVehicleSpawn(vehicleid);
  7002.     #else
  7003.         return 1;
  7004.     #endif
  7005. }
  7006.  
  7007. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7008.     #if defined _ALS_OnVehicleSpawn
  7009.         #undef OnVehicleSpawn
  7010.     #else
  7011.         #define _ALS_OnVehicleSpawn
  7012.     #endif
  7013.     #define OnVehicleSpawn ac_OnVehicleSpawn
  7014.     #if defined ac_OnVehicleSpawn
  7015.         forward ac_OnVehicleSpawn(vehicleid);
  7016.     #endif
  7017. #endif
  7018.  
  7019. #if defined _inc_y_hooks || defined _INC_y_hooks
  7020.     hook OnVehicleDeath(vehicleid, killerid)
  7021. #else
  7022.     public OnVehicleDeath(vehicleid, killerid)
  7023. #endif
  7024. {
  7025.     #if AC_USE_NPC
  7026.     if(IsPlayerConnected(killerid) && !IsPlayerNPC(killerid))
  7027.     #else
  7028.     if(IsPlayerConnected(killerid))
  7029.     #endif
  7030.     {
  7031.         new ac_gtc = GetTickCount();
  7032.         if(ACInfo[killerid][acACAllow][49])
  7033.         {
  7034.             if(ac_gtc < ACInfo[killerid][acCall][15] + ac_Mtfc[15][0]) ac_FloodDetect(killerid, 15);
  7035.             else if(ac_gtc < ACInfo[killerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(killerid, 27);
  7036.             else ACInfo[killerid][acFloodCount][15] = ACInfo[killerid][acFloodCount][27] = 0;
  7037.         }
  7038.         ACInfo[killerid][acCall][27] = ACInfo[killerid][acCall][15] = ac_gtc;
  7039.     }
  7040.     new Float:ac_vHealth;
  7041.     GetVehicleHealth(vehicleid, ac_vHealth);
  7042.     if(ac_vHealth < 250.0) ACVehInfo[vehicleid][acSpawned] = false;
  7043.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7044.         && defined ac_OnVehicleDeath
  7045.         return ac_OnVehicleDeath(vehicleid, killerid);
  7046.     #else
  7047.         return 1;
  7048.     #endif
  7049. }
  7050.  
  7051. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7052.     #if defined _ALS_OnVehicleDeath
  7053.         #undef OnVehicleDeath
  7054.     #else
  7055.         #define _ALS_OnVehicleDeath
  7056.     #endif
  7057.     #define OnVehicleDeath ac_OnVehicleDeath
  7058.     #if defined ac_OnVehicleDeath
  7059.         forward ac_OnVehicleDeath(vehicleid, killerid);
  7060.     #endif
  7061. #endif
  7062.  
  7063. #if defined _inc_y_hooks || defined _INC_y_hooks
  7064.     hook OnPlayerText(playerid, text[])
  7065. #else
  7066.     public OnPlayerText(playerid, text[])
  7067. #endif
  7068. {
  7069.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7070.     #if AC_USE_NPC
  7071.         if(!IsPlayerNPC(playerid))
  7072.         {
  7073.     #endif
  7074.         new ac_gtc = GetTickCount();
  7075.         if(ACInfo[playerid][acACAllow][49])
  7076.         {
  7077.             if(ac_gtc < ACInfo[playerid][acCall][16] + ac_Mtfc[16][0]) return ac_FloodDetect(playerid, 16);
  7078.             if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7079.             else ACInfo[playerid][acFloodCount][16] = ACInfo[playerid][acFloodCount][27] = 0;
  7080.         }
  7081.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][16] = ac_gtc;
  7082.     #if AC_USE_NPC
  7083.         }
  7084.     #endif
  7085.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7086.         && defined ac_OnPlayerText
  7087.         return ac_OnPlayerText(playerid, text);
  7088.     #else
  7089.         return 1;
  7090.     #endif
  7091. }
  7092.  
  7093. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7094.     #if defined _ALS_OnPlayerText
  7095.         #undef OnPlayerText
  7096.     #else
  7097.         #define _ALS_OnPlayerText
  7098.     #endif
  7099.     #define OnPlayerText ac_OnPlayerText
  7100.     #if defined ac_OnPlayerText
  7101.         forward ac_OnPlayerText(playerid, text[]);
  7102.     #endif
  7103. #endif
  7104.  
  7105. #if defined _inc_y_hooks || defined _INC_y_hooks
  7106.     hook OnPlayerEnterCheckpoint(playerid)
  7107. #else
  7108.     public OnPlayerEnterCheckpoint(playerid)
  7109. #endif
  7110. {
  7111.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7112.     #if AC_USE_NPC
  7113.         if(!IsPlayerNPC(playerid))
  7114.         {
  7115.     #endif
  7116.         new ac_gtc = GetTickCount();
  7117.         if(ACInfo[playerid][acACAllow][49])
  7118.         {
  7119.             if(ac_gtc < ACInfo[playerid][acCall][17] + ac_Mtfc[17][0]) ac_FloodDetect(playerid, 17);
  7120.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7121.             else ACInfo[playerid][acFloodCount][17] = ACInfo[playerid][acFloodCount][27] = 0;
  7122.         }
  7123.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][17] = ac_gtc;
  7124.     #if AC_USE_NPC
  7125.         }
  7126.     #endif
  7127.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7128.         && defined ac_OnPlayerEnterCheckpoint
  7129.         return ac_OnPlayerEnterCheckpoint(playerid);
  7130.     #else
  7131.         return 1;
  7132.     #endif
  7133. }
  7134.  
  7135. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7136.     #if defined _ALS_OnPlayerEnterCheckpoint
  7137.         #undef OnPlayerEnterCheckpoint
  7138.     #else
  7139.         #define _ALS_OnPlayerEnterCheckpoint
  7140.     #endif
  7141.     #define OnPlayerEnterCheckpoint ac_OnPlayerEnterCheckpoint
  7142.     #if defined ac_OnPlayerEnterCheckpoint
  7143.         forward ac_OnPlayerEnterCheckpoint(playerid);
  7144.     #endif
  7145. #endif
  7146.  
  7147. #if defined _inc_y_hooks || defined _INC_y_hooks
  7148.     hook OnPlayerLeaveCheckpoint(playerid)
  7149. #else
  7150.     public OnPlayerLeaveCheckpoint(playerid)
  7151. #endif
  7152. {
  7153.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7154.     #if AC_USE_NPC
  7155.         if(!IsPlayerNPC(playerid))
  7156.         {
  7157.     #endif
  7158.         new ac_gtc = GetTickCount();
  7159.         if(ACInfo[playerid][acACAllow][49])
  7160.         {
  7161.             if(ac_gtc < ACInfo[playerid][acCall][18] + ac_Mtfc[18][0]) ac_FloodDetect(playerid, 18);
  7162.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7163.             else ACInfo[playerid][acFloodCount][18] = ACInfo[playerid][acFloodCount][27] = 0;
  7164.         }
  7165.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][18] = ac_gtc;
  7166.     #if AC_USE_NPC
  7167.         }
  7168.     #endif
  7169.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7170.         && defined ac_OnPlayerLeaveCheckpoint
  7171.         return ac_OnPlayerLeaveCheckpoint(playerid);
  7172.     #else
  7173.         return 1;
  7174.     #endif
  7175. }
  7176.  
  7177. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7178.     #if defined _ALS_OnPlayerLeaveCheckpoint
  7179.         #undef OnPlayerLeaveCheckpoint
  7180.     #else
  7181.         #define _ALS_OnPlayerLeaveCheckpoint
  7182.     #endif
  7183.     #define OnPlayerLeaveCheckpoint ac_OnPlayerLeaveCheckpoint
  7184.     #if defined ac_OnPlayerLeaveCheckpoint
  7185.         forward ac_OnPlayerLeaveCheckpoint(playerid);
  7186.     #endif
  7187. #endif
  7188.  
  7189. public OnPlayerRequestSpawn(playerid)
  7190. {
  7191.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7192.     new ac_gtc;
  7193.     #if AC_USE_NPC
  7194.         if(!IsPlayerNPC(playerid))
  7195.         {
  7196.     #endif
  7197.         ac_gtc = GetTickCount();
  7198.         if(ACInfo[playerid][acACAllow][49])
  7199.         {
  7200.             if(ac_gtc < ACInfo[playerid][acCall][19] + ac_Mtfc[19][0]) ac_FloodDetect(playerid, 19);
  7201.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7202.             else ACInfo[playerid][acFloodCount][19] = ACInfo[playerid][acFloodCount][27] = 0;
  7203.         }
  7204.     #if AC_USE_NPC
  7205.         }
  7206.     #endif
  7207.     if(!ACInfo[playerid][acSpawned])
  7208.     {
  7209.         new ac_i = 1;
  7210.         #if defined ac_OnPlayerRequestSpawn
  7211.             ac_i = ac_OnPlayerRequestSpawn(playerid);
  7212.         #endif
  7213.         if(ac_i)
  7214.         {
  7215.             ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][19] = ac_gtc;
  7216.             ACInfo[playerid][acSet][7] = 3;
  7217.             ACInfo[playerid][acSpawnTick] =
  7218.             ACInfo[playerid][acNOPCount][9] = 0;
  7219.             ACInfo[playerid][acSpawnRes] = 1;
  7220.         }
  7221.         return ac_i;
  7222.     }
  7223.     else ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][19] = ac_gtc;
  7224.     return 0;
  7225. }
  7226.  
  7227. #if defined _ALS_OnPlayerRequestSpawn
  7228.     #undef OnPlayerRequestSpawn
  7229. #else
  7230.     #define _ALS_OnPlayerRequestSpawn
  7231. #endif
  7232. #define OnPlayerRequestSpawn ac_OnPlayerRequestSpawn
  7233. #if defined ac_OnPlayerRequestSpawn
  7234.     forward ac_OnPlayerRequestSpawn(playerid);
  7235. #endif
  7236.  
  7237. #if defined _inc_y_hooks || defined _INC_y_hooks
  7238.     hook OnPlayerExitedMenu(playerid)
  7239. #else
  7240.     public OnPlayerExitedMenu(playerid)
  7241. #endif
  7242. {
  7243.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
  7244.     new ac_gtc = GetTickCount();
  7245.     if(ACInfo[playerid][acACAllow][49])
  7246.     {
  7247.         if(ac_gtc < ACInfo[playerid][acCall][20] + ac_Mtfc[20][0]) ac_FloodDetect(playerid, 20);
  7248.         else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7249.         else ACInfo[playerid][acFloodCount][20] = ACInfo[playerid][acFloodCount][27] = 0;
  7250.     }
  7251.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][20] = ac_gtc;
  7252.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7253.         && defined ac_OnPlayerExitedMenu
  7254.         return ac_OnPlayerExitedMenu(playerid);
  7255.     #else
  7256.         return 1;
  7257.     #endif
  7258. }
  7259.  
  7260. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7261.     #if defined _ALS_OnPlayerExitedMenu
  7262.         #undef OnPlayerExitedMenu
  7263.     #else
  7264.         #define _ALS_OnPlayerExitedMenu
  7265.     #endif
  7266.     #define OnPlayerExitedMenu ac_OnPlayerExitedMenu
  7267.     #if defined ac_OnPlayerExitedMenu
  7268.         forward ac_OnPlayerExitedMenu(playerid);
  7269.     #endif
  7270. #endif
  7271.  
  7272. #if defined _inc_y_hooks || defined _INC_y_hooks
  7273.     hook OnPlayerEnterRaceCP(playerid)
  7274. #else
  7275.     public OnPlayerEnterRaceCheckpoint(playerid)
  7276. #endif
  7277. {
  7278.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7279.     #if AC_USE_NPC
  7280.         if(!IsPlayerNPC(playerid))
  7281.         {
  7282.     #endif
  7283.         new ac_gtc = GetTickCount();
  7284.         if(ACInfo[playerid][acACAllow][49])
  7285.         {
  7286.             if(ac_gtc < ACInfo[playerid][acCall][21] + ac_Mtfc[21][0]) ac_FloodDetect(playerid, 21);
  7287.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7288.             else ACInfo[playerid][acFloodCount][21] = ACInfo[playerid][acFloodCount][27] = 0;
  7289.         }
  7290.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][21] = ac_gtc;
  7291.     #if AC_USE_NPC
  7292.         }
  7293.     #endif
  7294.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7295.         && defined ac_OnPlayerEnterRaceCheckpoint
  7296.         return ac_OnPlayerEnterRaceCheckpoint(playerid);
  7297.     #else
  7298.         return 1;
  7299.     #endif
  7300. }
  7301.  
  7302. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7303.     #if defined _ALS_OnPlayerEnterRaceCheckpoin\
  7304.         || defined _ALS_OnPlayerEnterRaceCP
  7305.         #undef OnPlayerEnterRaceCheckpoint
  7306.     #else
  7307.         #define _ALS_OnPlayerEnterRaceCheckpoin
  7308.         #define _ALS_OnPlayerEnterRaceCP
  7309.     #endif
  7310.     #define OnPlayerEnterRaceCheckpoint ac_OnPlayerEnterRaceCheckpoint
  7311.     #if defined ac_OnPlayerEnterRaceCheckpoint
  7312.         forward ac_OnPlayerEnterRaceCheckpoint(playerid);
  7313.     #endif
  7314. #endif
  7315.  
  7316. #if defined _inc_y_hooks || defined _INC_y_hooks
  7317.     hook OnPlayerLeaveRaceCP(playerid)
  7318. #else
  7319.     public OnPlayerLeaveRaceCheckpoint(playerid)
  7320. #endif
  7321. {
  7322.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7323.     #if AC_USE_NPC
  7324.         if(!IsPlayerNPC(playerid))
  7325.         {
  7326.     #endif
  7327.         new ac_gtc = GetTickCount();
  7328.         if(ACInfo[playerid][acACAllow][49])
  7329.         {
  7330.             if(ac_gtc < ACInfo[playerid][acCall][22] + ac_Mtfc[22][0]) ac_FloodDetect(playerid, 22);
  7331.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7332.             else ACInfo[playerid][acFloodCount][22] = ACInfo[playerid][acFloodCount][27] = 0;
  7333.         }
  7334.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][22] = ac_gtc;
  7335.     #if AC_USE_NPC
  7336.         }
  7337.     #endif
  7338.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7339.         && defined ac_OnPlayerLeaveRaceCheckpoint
  7340.         return ac_OnPlayerLeaveRaceCheckpoint(playerid);
  7341.     #else
  7342.         return 1;
  7343.     #endif
  7344. }
  7345.  
  7346. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7347.     #if defined _ALS_OnPlayerLeaveRaceCheckpoin\
  7348.         || defined _ALS_OnPlayerLeaveRaceCP
  7349.         #undef OnPlayerLeaveRaceCheckpoint
  7350.     #else
  7351.         #define _ALS_OnPlayerLeaveRaceCheckpoin
  7352.         #define _ALS_OnPlayerLeaveRaceCP
  7353.     #endif
  7354.     #define OnPlayerLeaveRaceCheckpoint ac_OnPlayerLeaveRaceCheckpoint
  7355.     #if defined ac_OnPlayerLeaveRaceCheckpoint
  7356.         forward ac_OnPlayerLeaveRaceCheckpoint(playerid);
  7357.     #endif
  7358. #endif
  7359.  
  7360. #if defined _inc_y_hooks || defined _INC_y_hooks
  7361.     hook OnPlayerClickPlayerTD(playerid, PlayerText:playertextid)
  7362. #else
  7363.     public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  7364. #endif
  7365. {
  7366.     if(ACInfo[playerid][acKicked] > 0) return 1;
  7367.     new ac_gtc = GetTickCount();
  7368.     if(ACInfo[playerid][acACAllow][49])
  7369.     {
  7370.         if(ac_gtc < ACInfo[playerid][acCall][23] + ac_Mtfc[23][0])
  7371.         {
  7372.             ac_FloodDetect(playerid, 23);
  7373.             return 1;
  7374.         }
  7375.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7376.         else ACInfo[playerid][acFloodCount][23] = ACInfo[playerid][acFloodCount][27] = 0;
  7377.     }
  7378.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][23] = ac_gtc;
  7379.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7380.         && defined ac_OnPlayerClickPlayerTextDraw
  7381.         return ac_OnPlayerClickPlayerTextDraw(playerid, playertextid);
  7382.     #else
  7383.         return 0;
  7384.     #endif
  7385. }
  7386.  
  7387. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7388.     #if defined _ALS_OnPlayerClickPlayerTextDra\
  7389.         || defined _ALS_OnPlayerClickPlayerTD
  7390.         #undef OnPlayerClickPlayerTextDraw
  7391.     #else
  7392.         #define _ALS_OnPlayerClickPlayerTextDra
  7393.         #define _ALS_OnPlayerClickPlayerTD
  7394.     #endif
  7395.     #define OnPlayerClickPlayerTextDraw ac_OnPlayerClickPlayerTextDraw
  7396.     #if defined ac_OnPlayerClickPlayerTextDraw
  7397.         forward ac_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
  7398.     #endif
  7399. #endif
  7400.  
  7401. #if defined _inc_y_hooks || defined _INC_y_hooks
  7402.     hook OnVehDamageStatusUpd(vehicleid, playerid)
  7403. #else
  7404.     public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  7405. #endif
  7406. {
  7407.     if(ACInfo[playerid][acKicked] > 0) return 1;
  7408.     new ac_gtc = GetTickCount();
  7409.     if(ACInfo[playerid][acACAllow][49])
  7410.     {
  7411.         if(ac_gtc < ACInfo[playerid][acCall][24] + ac_Mtfc[24][0]) ac_FloodDetect(playerid, 24);
  7412.         else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7413.         else
  7414.         {
  7415.             if(ACInfo[playerid][acFloodCount][24] > 0) ACInfo[playerid][acFloodCount][24]--;
  7416.             ACInfo[playerid][acFloodCount][27] = 0;
  7417.         }
  7418.     }
  7419.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][24] = ac_gtc;
  7420.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7421.         && defined ac_OnVehicleDamageStatusUpdate
  7422.         return ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  7423.     #else
  7424.         return 0;
  7425.     #endif
  7426. }
  7427.  
  7428. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7429.     #if defined _ALS_OnVehicleDamageStatusUpdat\
  7430.         || defined _ALS_OnVehicleDamageStatusUpd
  7431.         #undef OnVehicleDamageStatusUpdate
  7432.     #else
  7433.         #define _ALS_OnVehicleDamageStatusUpdat
  7434.         #define _ALS_OnVehicleDamageStatusUpd
  7435.     #endif
  7436.     #define OnVehicleDamageStatusUpdate ac_OnVehicleDamageStatusUpdate
  7437.     #if defined ac_OnVehicleDamageStatusUpdate
  7438.         forward ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  7439.     #endif
  7440. #endif
  7441.  
  7442. #if defined OnVehicleSirenStateChange
  7443.     #if defined _inc_y_hooks || defined _INC_y_hooks
  7444.         hook OnVehicleSirenChange(playerid, vehicleid, newstate)
  7445.     #else
  7446.         public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
  7447.     #endif
  7448.     {
  7449.         if(ACInfo[playerid][acKicked] > 0) return 1;
  7450.         #if AC_USE_NPC
  7451.             if(!IsPlayerNPC(playerid))
  7452.             {
  7453.         #endif
  7454.             new ac_gtc = GetTickCount();
  7455.             if(ACInfo[playerid][acACAllow][49])
  7456.             {
  7457.                 if(ac_gtc < ACInfo[playerid][acCall][25] + ac_Mtfc[25][0]) ac_FloodDetect(playerid, 25);
  7458.                 else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7459.                 else ACInfo[playerid][acFloodCount][25] = ACInfo[playerid][acFloodCount][27] = 0;
  7460.             }
  7461.             ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][25] = ac_gtc;
  7462.         #if AC_USE_NPC
  7463.             }
  7464.         #endif
  7465.         #undef AC_USE_NPC
  7466.         #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7467.             && defined ac_OnVehicleSirenStateChange
  7468.             return ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  7469.         #else
  7470.             return 0;
  7471.         #endif
  7472.     }
  7473.  
  7474.     #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7475.         #if defined _ALS_OnVehicleSirenStateChange
  7476.             #undef OnVehicleSirenStateChange
  7477.         #else
  7478.             #define _ALS_OnVehicleSirenStateChange
  7479.         #endif
  7480.         #define OnVehicleSirenStateChange ac_OnVehicleSirenStateChange
  7481.         #if defined ac_OnVehicleSirenStateChange
  7482.             forward ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  7483.         #endif
  7484.     #endif
  7485. #endif
  7486.  
  7487. #if defined OnPlayerSelectDynamicObject
  7488.     #if defined _inc_y_hooks || defined _INC_y_hooks
  7489.         #if defined STREAMER_ENABLE_TAGS
  7490.             hook OnPlayerSelectDynObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z)
  7491.         #else
  7492.             hook OnPlayerSelectDynObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  7493.         #endif
  7494.     #else
  7495.         #if defined STREAMER_ENABLE_TAGS
  7496.             public OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z)
  7497.         #else
  7498.             public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  7499.         #endif
  7500.     #endif
  7501.     {
  7502.         if(ACInfo[playerid][acKicked] > 0) return 0;
  7503.         new ac_gtc = GetTickCount();
  7504.         if(ACInfo[playerid][acACAllow][49])
  7505.         {
  7506.             if(ac_gtc < ACInfo[playerid][acCall][26] + ac_Mtfc[26][0]) ac_FloodDetect(playerid, 26);
  7507.             else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7508.             else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
  7509.         }
  7510.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_gtc;
  7511.         #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7512.             && defined ac_OnPlayerSelectDynamicObject
  7513.             return ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, x, y, z);
  7514.         #else
  7515.             return 1;
  7516.         #endif
  7517.     }
  7518.  
  7519.     #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7520.         #if defined _ALS_OnPlayerSelectDynamicObjec\
  7521.             || defined _ALS_OnPlayerSelectDynObject || defined _ALS_OnPlayerSelectDynamicObj
  7522.             #undef OnPlayerSelectDynamicObject
  7523.         #else
  7524.             #define _ALS_OnPlayerSelectDynamicObjec
  7525.             #define _ALS_OnPlayerSelectDynObject
  7526.             #define _ALS_OnPlayerSelectDynamicObj
  7527.         #endif
  7528.         #define OnPlayerSelectDynamicObject ac_OnPlayerSelectDynamicObject
  7529.         #if defined ac_OnPlayerSelectDynamicObject
  7530.             #if defined STREAMER_ENABLE_TAGS
  7531.                 forward ac_OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z);
  7532.             #else
  7533.                 forward ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z);
  7534.             #endif
  7535.         #endif
  7536.     #endif
  7537. #endif
  7538.  
  7539. #if defined _inc_y_hooks || defined _INC_y_hooks
  7540.     hook OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  7541. #else
  7542.     public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  7543. #endif
  7544. {
  7545.     if(ACInfo[playerid][acKicked] > 0) return 1;
  7546.     new ac_gtc = GetTickCount();
  7547.     if(ACInfo[playerid][acACAllow][49])
  7548.     {
  7549.         if(ac_gtc < ACInfo[playerid][acCall][26] + ac_Mtfc[26][0])
  7550.         {
  7551.             ac_FloodDetect(playerid, 26);
  7552.             return 1;
  7553.         }
  7554.         if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7555.         else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
  7556.     }
  7557.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_gtc;
  7558.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7559.         && defined ac_OnPlayerSelectObject
  7560.         return ac_OnPlayerSelectObject(playerid, type, objectid, modelid, fX, fY, fZ);
  7561.     #else
  7562.         return 0;
  7563.     #endif
  7564. }
  7565.  
  7566. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7567.     #if defined _ALS_OnPlayerSelectObject
  7568.         #undef OnPlayerSelectObject
  7569.     #else
  7570.         #define _ALS_OnPlayerSelectObject
  7571.     #endif
  7572.     #define OnPlayerSelectObject ac_OnPlayerSelectObject
  7573.     #if defined ac_OnPlayerSelectObject
  7574.         forward ac_OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
  7575.     #endif
  7576. #endif
  7577.  
  7578. #if defined OnTrailerUpdate
  7579.     public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  7580. #elseif defined GetServerTickRate
  7581.     public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z)
  7582. #else
  7583.     public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
  7584. #endif
  7585. {
  7586.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7587.     #if defined OnTrailerUpdate
  7588.         if(ACInfo[playerid][acACAllow][31] &&
  7589.         (new_x != new_x || new_y != new_y || new_z != new_z || vel_x != vel_x || vel_y != vel_y || vel_z != vel_z ||
  7590.         floatabs(new_x) >= 25000.0 || floatabs(new_y) >= 25000.0 || floatabs(new_z) >= 25000.0 ||
  7591.         floatabs(vel_x) - floatabs(ACVehInfo[vehicleid][acVelX]) >= 4.0 ||
  7592.         floatabs(vel_y) - floatabs(ACVehInfo[vehicleid][acVelY]) >= 4.0 ||
  7593.         floatabs(vel_z) - floatabs(ACVehInfo[vehicleid][acVelZ]) >= 4.0 ||
  7594.         floatabs(vel_x) >= 100.0 || floatabs(vel_y) >= 100.0 || floatabs(vel_z) >= 100.0))
  7595.         {
  7596.             #if defined DEBUG
  7597.                 printf("[Nex-AC debug] Pos x, y, z: %f, %f, %f, vel x, y, z: %f, %f, %f", new_x, new_y, new_z, vel_x, vel_y, vel_z);
  7598.             #endif
  7599.             return ac_KickWithCode(playerid, "", 0, 31, 2);
  7600.         }
  7601.     #elseif defined GetServerTickRate
  7602.         if(ACInfo[playerid][acACAllow][31] &&
  7603.         (new_x != new_x || new_y != new_y || new_z != new_z ||
  7604.         floatabs(new_x) >= 25000.0 || floatabs(new_y) >= 25000.0 || floatabs(new_z) >= 25000.0))
  7605.         {
  7606.             #if defined DEBUG
  7607.                 printf("[Nex-AC debug] Pos x, y, z: %f, %f, %f", new_x, new_y, new_z);
  7608.             #endif
  7609.             return ac_KickWithCode(playerid, "", 0, 31, 2);
  7610.         }
  7611.     #endif
  7612.     #if defined GetServerTickRate
  7613.         new Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_dist = GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z);
  7614.         GetVehiclePos(vehicleid, ac_x, ac_y, ac_z);
  7615.         if(passenger_seat > 0)
  7616.         {
  7617.             new Float:ac_zDiff = new_z - ac_z;
  7618.             #if defined OnTrailerUpdate
  7619.             if(ACInfo[playerid][acACAllow][31] &&
  7620.             ((vel_z > ACVehInfo[vehicleid][acVelZ] || ac_zDiff >= -0.8) &&
  7621.             (floatabs(vel_x) >= floatabs(ACVehInfo[vehicleid][acVelX]) && floatabs(ACVehInfo[vehicleid][acVelX]) >= 0.3 ||
  7622.             floatabs(vel_y) >= floatabs(ACVehInfo[vehicleid][acVelY]) && floatabs(ACVehInfo[vehicleid][acVelY]) >= 0.3) ||
  7623.             ac_zDiff >= -5.0 && (floatabs(new_x - ac_x) >= 12.0 || floatabs(new_y - ac_y) >= 12.0) ||
  7624.             vel_z >= 0.0 && ac_zDiff <= -3.0 || vel_z <= 0.0 && ac_zDiff >= 3.0))
  7625.             {
  7626.                 if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
  7627.                 {
  7628.                     #if defined DEBUG
  7629.                         printf("[Nex-AC debug] Vel x, y, z: %f, %f, %f, old vel x, y: %f, %f, pos diff x, y, z: %f, %f, %f, veh: %d",
  7630.                         vel_x, vel_y, vel_z, ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], new_x - ac_x, new_y - ac_y, ac_zDiff, vehicleid);
  7631.                     #endif
  7632.                     #if defined OnCheatDetected
  7633.                         ac_KickWithCode(playerid, "", 0, 31, 1);
  7634.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  7635.                         ACInfo[playerid][acCheatCount][4] = 0;
  7636.                     #else
  7637.                         return ac_KickWithCode(playerid, "", 0, 31, 1);
  7638.                     #endif
  7639.                 }
  7640.                 #if defined OnCheatWarning
  7641.                     else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]);
  7642.                 #endif
  7643.             }
  7644.             #else
  7645.             if(ACInfo[playerid][acACAllow][31] &&
  7646.             ac_zDiff >= -5.0 && (floatabs(new_x - ac_x) >= 12.0 || floatabs(new_y - ac_y) >= 12.0))
  7647.             {
  7648.                 if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
  7649.                 {
  7650.                     #if defined DEBUG
  7651.                         printf("[Nex-AC debug] Pos diff x, y, z: %f, %f, %f, veh: %d",
  7652.                         new_x - ac_x, new_y - ac_y, ac_zDiff, vehicleid);
  7653.                     #endif
  7654.                     #if defined OnCheatDetected
  7655.                         ac_KickWithCode(playerid, "", 0, 31, 1);
  7656.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  7657.                         ACInfo[playerid][acCheatCount][4] = 0;
  7658.                     #else
  7659.                         return ac_KickWithCode(playerid, "", 0, 31, 1);
  7660.                     #endif
  7661.                 }
  7662.                 #if defined OnCheatWarning
  7663.                     else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]);
  7664.                 #endif
  7665.             }
  7666.             #endif
  7667.             #if defined OnTrailerUpdate
  7668.             else if(ACInfo[playerid][acACAllow][8] &&
  7669.             vel_z >= 0.1 && vel_z > ACVehInfo[vehicleid][acVelZ] &&
  7670.             floatabs(ac_x - new_x) < ac_zDiff / 2.0 && floatabs(ac_y - new_y) < ac_zDiff / 2.0)
  7671.             {
  7672.                 if(++ACInfo[playerid][acCheatCount][3] > AC_MAX_FLYHACK_VEH_WARNINGS)
  7673.                 {
  7674.                     #if defined DEBUG
  7675.                         printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, veh: %d",
  7676.                         vel_z, ACVehInfo[vehicleid][acVelZ], ac_x - new_x, ac_y - new_y, ac_zDiff, vehicleid);
  7677.                     #endif
  7678.                     #if defined OnCheatDetected
  7679.                         ac_KickWithCode(playerid, "", 0, 8, 2);
  7680.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  7681.                         ACInfo[playerid][acCheatCount][3] = 0;
  7682.                     #else
  7683.                         return ac_KickWithCode(playerid, "", 0, 8, 2);
  7684.                     #endif
  7685.                 }
  7686.                 #if defined OnCheatWarning
  7687.                     else OnCheatWarning(playerid, "", 0, 8, 2, ACInfo[playerid][acCheatCount][3]);
  7688.                 #endif
  7689.             }
  7690.             #endif
  7691.             else
  7692.             {
  7693.                 if(ACInfo[playerid][acCheatCount][4] > 0) ACInfo[playerid][acCheatCount][4]--;
  7694.                 ACInfo[playerid][acCheatCount][3] = 0;
  7695.             }
  7696.         }
  7697.         if(ACInfo[playerid][acACAllow][5] &&
  7698.         (ac_dist >= 25.0 || ac_dist >= 15.0 && GetTickCount() > ACInfo[playerid][acGtc][18] + GetPlayerPing(playerid)) &&
  7699.         ac_dist > ACVehInfo[vehicleid][acPosDiff] + ((ac_dist / 3.0) * 1.6) &&
  7700.         (ac_z > -45.0 || VectorSize(new_x - ac_x, new_y - ac_y, 0.0) >= 180.0))
  7701.         {
  7702.             #if defined DEBUG
  7703.                 printf("[Nex-AC debug] Dist: %f, old pos diff: %f, old pos z: %f, veh: %d, playerid: %d",
  7704.                 ac_dist, ACVehInfo[vehicleid][acPosDiff], ac_z, vehicleid, playerid);
  7705.             #endif
  7706.             #if defined OnCheatDetected
  7707.                 ac_KickWithCode(playerid, "", 0, 5, 1);
  7708.             #endif
  7709.             GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  7710.             #if defined SetVehicleFakeZAngleForPlayer
  7711.                 SetVehicleFakeZAngleForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acZAngle]);
  7712.             #else
  7713.                 SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  7714.             #endif
  7715.             #if defined SetVehicleFakePosForPlayer
  7716.                 SetVehicleFakePosForPlayer(playerid, vehicleid, ac_x, ac_y, ac_z);
  7717.             #else
  7718.                 SetVehiclePos(vehicleid, ac_x, ac_y, ac_z);
  7719.             #endif
  7720.             return 0;
  7721.         }
  7722.     #else
  7723.         new Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_dist = GetVehicleDistanceFromPoint(vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]);
  7724.         GetVehiclePos(vehicleid, ac_x, ac_y, ac_z);
  7725.         if(passenger_seat > 0)
  7726.         {
  7727.             new Float:ac_zDiff = ac_z - ACVehInfo[vehicleid][acPosZ];
  7728.             if(ACInfo[playerid][acACAllow][31] && ac_zDiff >= -5.0 &&
  7729.             (floatabs(ac_x - ACVehInfo[vehicleid][acPosX]) >= 12.0 || floatabs(ac_y - ACVehInfo[vehicleid][acPosY]) >= 12.0))
  7730.             {
  7731.                 if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
  7732.                 {
  7733.                     #if defined DEBUG
  7734.                         printf("[Nex-AC debug] Pos diff x, y, z: %f, %f, %f, veh: %d",
  7735.                         ac_x - ACVehInfo[vehicleid][acPosX], ac_y - ACVehInfo[vehicleid][acPosY], ac_zDiff, vehicleid);
  7736.                     #endif
  7737.                     #if defined OnCheatDetected
  7738.                         ac_KickWithCode(playerid, "", 0, 31, 1);
  7739.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  7740.                         ACInfo[playerid][acCheatCount][4] = 0;
  7741.                     #else
  7742.                         return ac_KickWithCode(playerid, "", 0, 31, 1);
  7743.                     #endif
  7744.                 }
  7745.                 #if defined OnCheatWarning
  7746.                     else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]);
  7747.                 #endif
  7748.             }
  7749.             else if(ACInfo[playerid][acCheatCount][4] > 0) ACInfo[playerid][acCheatCount][4]--;
  7750.         }
  7751.         #if defined VectorSize
  7752.         if(ACInfo[playerid][acACAllow][5] &&
  7753.         (ac_dist >= 25.0 || ac_dist >= 15.0 && GetTickCount() > ACInfo[playerid][acGtc][18] + GetPlayerPing(playerid)) &&
  7754.         ac_dist > ACVehInfo[vehicleid][acPosDiff] + ((ac_dist / 3.0) * 1.6) &&
  7755.         (ACVehInfo[vehicleid][acPosZ] > -45.0 || VectorSize(ac_x - ACVehInfo[vehicleid][acPosX], ac_y - ACVehInfo[vehicleid][acPosY], 0.0) >= 180.0))
  7756.         #else
  7757.         if(ACInfo[playerid][acACAllow][5] &&
  7758.         (ac_dist >= 25.0 || ac_dist >= 15.0 && GetTickCount() > ACInfo[playerid][acGtc][18] + GetPlayerPing(playerid)) &&
  7759.         ac_dist > ACVehInfo[vehicleid][acPosDiff] + ((ac_dist / 3.0) * 1.6) &&
  7760.         (ACVehInfo[vehicleid][acPosZ] > -45.0 || floatsqroot(floatpower(ac_x - ACVehInfo[vehicleid][acPosX], 2.0) + floatpower(ac_y - ACVehInfo[vehicleid][acPosY], 2.0)) >= 180.0))
  7761.         #endif
  7762.         {
  7763.             #if defined DEBUG
  7764.                 printf("[Nex-AC debug] Dist: %f, old pos diff: %f, old pos z: %f, veh: %d, playerid: %d",
  7765.                 ac_dist, ACVehInfo[vehicleid][acPosDiff], ACVehInfo[vehicleid][acPosZ], vehicleid, playerid);
  7766.             #endif
  7767.             #if defined OnCheatDetected
  7768.                 ac_KickWithCode(playerid, "", 0, 5, 1);
  7769.             #endif
  7770.             SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  7771.             SetVehiclePos(vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]);
  7772.             return 0;
  7773.         }
  7774.     #endif
  7775.     #undef AC_MAX_FLYHACK_VEH_WARNINGS
  7776.     #undef AC_MAX_CARSHOT_WARNINGS
  7777.     new ac_a = 1;
  7778.     #if defined ac_OnUnoccupiedVehicleUpdate
  7779.         #if defined OnTrailerUpdate
  7780.             ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z, vel_x, vel_y, vel_z);
  7781.         #elseif defined GetServerTickRate
  7782.             ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z);
  7783.         #else
  7784.             ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat);
  7785.         #endif
  7786.     #endif
  7787.     #if defined OnTrailerUpdate
  7788.         if(ac_a)
  7789.         {
  7790.             ACVehInfo[vehicleid][acSpeedDiff] = ac_GetSpeed(vel_x, vel_y, vel_z) - ac_GetSpeed(ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], ACVehInfo[vehicleid][acVelZ]);
  7791.             ACVehInfo[vehicleid][acPosDiff] = ac_dist;
  7792.             ACVehInfo[vehicleid][acPosX] = new_x;
  7793.             ACVehInfo[vehicleid][acPosY] = new_y;
  7794.             ACVehInfo[vehicleid][acPosZ] = new_z;
  7795.             ACVehInfo[vehicleid][acVelX] = vel_x;
  7796.             ACVehInfo[vehicleid][acVelY] = vel_y;
  7797.             ACVehInfo[vehicleid][acVelZ] = vel_z;
  7798.         }
  7799.     #elseif defined GetServerTickRate
  7800.         if(ac_a)
  7801.         {
  7802.             ACVehInfo[vehicleid][acPosDiff] = ac_dist;
  7803.             ACVehInfo[vehicleid][acPosX] = new_x;
  7804.             ACVehInfo[vehicleid][acPosY] = new_y;
  7805.             ACVehInfo[vehicleid][acPosZ] = new_z;
  7806.         }
  7807.     #else
  7808.         GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  7809.         ACVehInfo[vehicleid][acPosDiff] = ac_dist;
  7810.         ACVehInfo[vehicleid][acPosX] = ac_x;
  7811.         ACVehInfo[vehicleid][acPosY] = ac_y;
  7812.         ACVehInfo[vehicleid][acPosZ] = ac_z;
  7813.     #endif
  7814.     return ac_a;
  7815. }
  7816.  
  7817. #if defined _ALS_OnUnoccupiedVehicleUpdate
  7818.     #undef OnUnoccupiedVehicleUpdate
  7819. #else
  7820.     #define _ALS_OnUnoccupiedVehicleUpdate
  7821. #endif
  7822. #define OnUnoccupiedVehicleUpdate ac_OnUnoccupiedVehicleUpdate
  7823. #if defined ac_OnUnoccupiedVehicleUpdate
  7824.     #if defined OnTrailerUpdate
  7825.         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);
  7826.     #elseif defined GetServerTickRate
  7827.         forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z);
  7828.     #else
  7829.         forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat);
  7830.     #endif
  7831. #endif
  7832.  
  7833. #if defined OnTrailerUpdate
  7834.     #if defined _inc_y_hooks || defined _INC_y_hooks
  7835.         hook OnTrailerUpdate(playerid, vehicleid)
  7836.     #else
  7837.         public OnTrailerUpdate(playerid, vehicleid)
  7838.     #endif
  7839.     {
  7840.         if(ACInfo[playerid][acKicked] > 0) return 0;
  7841.         #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7842.             && defined ac_OnTrailerUpdate
  7843.             return ac_OnTrailerUpdate(playerid, vehicleid);
  7844.         #else
  7845.             return 1;
  7846.         #endif
  7847.     }
  7848.  
  7849.     #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7850.         #if defined _ALS_OnTrailerUpdate
  7851.             #undef OnTrailerUpdate
  7852.         #else
  7853.             #define _ALS_OnTrailerUpdate
  7854.         #endif
  7855.         #define OnTrailerUpdate ac_OnTrailerUpdate
  7856.         #if defined ac_OnTrailerUpdate
  7857.             forward ac_OnTrailerUpdate(playerid, vehicleid);
  7858.         #endif
  7859.     #endif
  7860. #endif
  7861.  
  7862. #if defined _inc_y_hooks || defined _INC_y_hooks
  7863.     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)
  7864. #else
  7865.     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)
  7866. #endif
  7867. {
  7868.     if(ACInfo[playerid][acKicked] > 0) return 1;
  7869.     if(ACInfo[playerid][acACAllow][46] && 384 <= modelid <= 393)
  7870.     {
  7871.         #if defined DEBUG
  7872.             printf("[Nex-AC debug] Object modelid: %d", modelid);
  7873.         #endif
  7874.         ac_KickWithCode(playerid, "", 0, 46);
  7875.         return 1;
  7876.     }
  7877.     #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  7878.         && defined ac_OnPlayerEditAttachedObject
  7879.         return ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  7880.     #else
  7881.         return 0;
  7882.     #endif
  7883. }
  7884.  
  7885. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  7886.     #if defined _ALS_OnPlayerEditAttachedObject
  7887.         #undef OnPlayerEditAttachedObject
  7888.     #else
  7889.         #define _ALS_OnPlayerEditAttachedObject
  7890.     #endif
  7891.     #define OnPlayerEditAttachedObject ac_OnPlayerEditAttachedObject
  7892.     #if defined ac_OnPlayerEditAttachedObject
  7893.         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);
  7894.     #endif
  7895. #endif
  7896.  
  7897. #if defined PAWNRAKNET_INC_
  7898.     public OnIncomingPacket(playerid, packetid, BitStream:bs)
  7899.     {
  7900.         if(ACInfo[playerid][acKicked] > 0) return 0;
  7901.         switch(packetid)
  7902.         {
  7903.             case 200:
  7904.             {
  7905.                 if(ACInfo[playerid][acACAllow][44])
  7906.                 {
  7907.                     new ac_cData[PR_InCarSync];
  7908.                     BS_IgnoreBits(bs, 8);
  7909.                     BS_ReadInCarSync(bs, ac_cData);
  7910.                     if(!(1 <= ac_cData[PR_vehicleId] < MAX_VEHICLES))
  7911.                     {
  7912.                         #if defined DEBUG
  7913.                             printf("[Nex-AC debug] Veh: %d", ac_cData[PR_vehicleId]);
  7914.                         #endif
  7915.                         #if defined OnCheatDetected
  7916.                             ac_KickWithCode(playerid, "", 0, 44, 7);
  7917.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  7918.                         #else
  7919.                             return ac_KickWithCode(playerid, "", 0, 44, 7);
  7920.                         #endif
  7921.                     }
  7922.                 }
  7923.             }
  7924.             case 203:
  7925.             {
  7926.                 new ac_aData[PR_AimSync];
  7927.                 BS_IgnoreBits(bs, 8);
  7928.                 BS_ReadAimSync(bs, ac_aData);
  7929.                 if(ac_aData[PR_aimZ] != ac_aData[PR_aimZ])
  7930.                 {
  7931.                     ac_aData[PR_aimZ] = 0.0;
  7932.                     BS_SetWriteOffset(bs, 8);
  7933.                     BS_WriteAimSync(bs, ac_aData);
  7934.                 }
  7935.             }
  7936.             case 207:
  7937.             {
  7938.                 new ac_fData[PR_OnFootSync];
  7939.                 BS_IgnoreBits(bs, 8);
  7940.                 BS_ReadOnFootSync(bs, ac_fData);
  7941.                 if(ac_fData[PR_surfingOffsets][0] != ac_fData[PR_surfingOffsets][0] ||
  7942.                 ac_fData[PR_surfingOffsets][1] != ac_fData[PR_surfingOffsets][1] ||
  7943.                 ac_fData[PR_surfingOffsets][2] != ac_fData[PR_surfingOffsets][2])
  7944.                 {
  7945.                     ac_fData[PR_surfingOffsets][0] =
  7946.                     ac_fData[PR_surfingOffsets][1] =
  7947.                     ac_fData[PR_surfingOffsets][2] = 0.0;
  7948.                     ac_fData[PR_surfingVehicleId] = 0;
  7949.                     BS_SetWriteOffset(bs, 8);
  7950.                     BS_WriteOnFootSync(bs, ac_fData);
  7951.                 }
  7952.             }
  7953.             case 209:
  7954.             {
  7955.                 new ac_uData[PR_UnoccupiedSync];
  7956.                 BS_IgnoreBits(bs, 8);
  7957.                 BS_ReadUnoccupiedSync(bs, ac_uData);
  7958.                 if(ac_uData[PR_seatId] > 0 &&
  7959.                 (ac_uData[PR_seatId] != GetPlayerVehicleSeat(playerid) || !IsPlayerInVehicle(playerid, ac_uData[PR_vehicleId])) ||
  7960.                 ac_uData[PR_roll][0] != ac_uData[PR_roll][0] ||
  7961.                 ac_uData[PR_roll][1] != ac_uData[PR_roll][1] ||
  7962.                 ac_uData[PR_roll][2] != ac_uData[PR_roll][2] ||
  7963.                 ac_uData[PR_direction][0] != ac_uData[PR_direction][0] ||
  7964.                 ac_uData[PR_direction][1] != ac_uData[PR_direction][1] ||
  7965.                 ac_uData[PR_direction][2] != ac_uData[PR_direction][2] ||
  7966.                 ac_uData[PR_angularVelocity][0] != ac_uData[PR_angularVelocity][0] ||
  7967.                 ac_uData[PR_angularVelocity][1] != ac_uData[PR_angularVelocity][1] ||
  7968.                 ac_uData[PR_angularVelocity][2] != ac_uData[PR_angularVelocity][2] ||
  7969.                 floatabs(ac_uData[PR_roll][0]) >= 1.0 ||
  7970.                 floatabs(ac_uData[PR_roll][1]) >= 1.0 ||
  7971.                 floatabs(ac_uData[PR_roll][2]) >= 1.0 ||
  7972.                 floatabs(ac_uData[PR_direction][0]) >= 1.0 ||
  7973.                 floatabs(ac_uData[PR_direction][1]) >= 1.0 ||
  7974.                 floatabs(ac_uData[PR_direction][2]) >= 1.0 ||
  7975.                 floatabs(ac_uData[PR_angularVelocity][0]) >= 1.0 ||
  7976.                 floatabs(ac_uData[PR_angularVelocity][1]) >= 1.0 ||
  7977.                 floatabs(ac_uData[PR_angularVelocity][2]) >= 1.0) return 0;
  7978.             }
  7979.             case 210:
  7980.             {
  7981.                 new ac_tData[PR_TrailerSync];
  7982.                 BS_IgnoreBits(bs, 8);
  7983.                 BS_ReadTrailerSync(bs, ac_tData);
  7984.                 if(!(1 <= ac_tData[PR_trailerId] < MAX_VEHICLES) ||
  7985.                 ACVehInfo[ac_tData[PR_trailerId]][acDriver] != INVALID_PLAYER_ID) return 0;
  7986.                 else if(ACInfo[playerid][acACAllow][5])
  7987.                 {
  7988.                     new Float:ac_dist = GetVehicleDistanceFromPoint(ac_tData[PR_trailerId], ac_tData[PR_position][0], ac_tData[PR_position][1], ac_tData[PR_position][2]);
  7989.                     if(ac_dist >= 80.0)
  7990.                     {
  7991.                         new Float:ac_x, Float:ac_y, Float:ac_z;
  7992.                         GetVehiclePos(ac_tData[PR_trailerId], ac_x, ac_y, ac_z);
  7993.                         #if defined DEBUG
  7994.                             printf("[Nex-AC debug] Dist: %f, old pos z: %f, veh: %d, playerid: %d",
  7995.                             ac_dist, ac_z, ac_tData[PR_trailerId], playerid);
  7996.                         #endif
  7997.                         #if defined OnCheatDetected
  7998.                             ac_KickWithCode(playerid, "", 0, 5, 2);
  7999.                         #endif
  8000.                         GetVehicleZAngle(ac_tData[PR_trailerId], ACVehInfo[ac_tData[PR_trailerId]][acZAngle]);
  8001.                         #if defined SetVehicleFakeZAngleForPlayer
  8002.                             SetVehicleFakeZAngleForPlayer(playerid, ac_tData[PR_trailerId], ACVehInfo[ac_tData[PR_trailerId]][acZAngle]);
  8003.                         #else
  8004.                             SetVehicleZAngle(ac_tData[PR_trailerId], ACVehInfo[ac_tData[PR_trailerId]][acZAngle]);
  8005.                         #endif
  8006.                         #if defined SetVehicleFakePosForPlayer
  8007.                             SetVehicleFakePosForPlayer(playerid, ac_tData[PR_trailerId], ac_x, ac_y, ac_z);
  8008.                         #else
  8009.                             SetVehiclePos(ac_tData[PR_trailerId], ac_x, ac_y, ac_z);
  8010.                         #endif
  8011.                         return 0;
  8012.                     }
  8013.                 }
  8014.             }
  8015.             case 211:
  8016.             {
  8017.                 if(ACInfo[playerid][acACAllow][44])
  8018.                 {
  8019.                     new ac_pData[PR_PassengerSync];
  8020.                     BS_IgnoreBits(bs, 8);
  8021.                     BS_ReadPassengerSync(bs, ac_pData);
  8022.                     if(ac_pData[PR_seatId] < 1 || !(1 <= ac_pData[PR_vehicleId] < MAX_VEHICLES))
  8023.                     {
  8024.                         #if defined DEBUG
  8025.                             printf("[Nex-AC debug] AC seat: %d, seat: %d, veh: %d",
  8026.                             ACInfo[playerid][acSeat], ac_pData[PR_seatId], ac_pData[PR_vehicleId]);
  8027.                         #endif
  8028.                         #if defined OnCheatDetected
  8029.                             ac_KickWithCode(playerid, "", 0, 44, 6);
  8030.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  8031.                         #else
  8032.                             return ac_KickWithCode(playerid, "", 0, 44, 6);
  8033.                         #endif
  8034.                     }
  8035.                 }
  8036.             }
  8037.         }
  8038.         #if defined ac_OnIncomingPacket
  8039.             return ac_OnIncomingPacket(playerid, packetid, bs);
  8040.         #else
  8041.             return 1;
  8042.         #endif
  8043.     }
  8044.  
  8045.     #if defined _ALS_OnIncomingPacket
  8046.         #undef OnIncomingPacket
  8047.     #else
  8048.         #define _ALS_OnIncomingPacket
  8049.     #endif
  8050.     #define OnIncomingPacket ac_OnIncomingPacket
  8051.     #if defined ac_OnIncomingPacket
  8052.         forward ac_OnIncomingPacket(playerid, packetid, BitStream:bs);
  8053.     #endif
  8054.  
  8055.     public OnIncomingRPC(playerid, rpcid, BitStream:bs)
  8056.     {
  8057.         if(ACInfo[playerid][acKicked] > 0 && ACInfo[playerid][acOnline]) return 0;
  8058.         #if defined ac_OnIncomingRPC
  8059.             return ac_OnIncomingRPC(playerid, rpcid, bs);
  8060.         #else
  8061.             return 1;
  8062.         #endif
  8063.     }
  8064.  
  8065.     #if defined _ALS_OnIncomingRPC
  8066.         #undef OnIncomingRPC
  8067.     #else
  8068.         #define _ALS_OnIncomingRPC
  8069.     #endif
  8070.     #define OnIncomingRPC ac_OnIncomingRPC
  8071.     #if defined ac_OnIncomingRPC
  8072.         forward ac_OnIncomingRPC(playerid, rpcid, BitStream:bs);
  8073.     #endif
  8074.  
  8075.     static SetVehicleFakePosForPlayer(playerid, vehicleid, Float:x, Float:y, Float:z)
  8076.     {
  8077.         if(!IsPlayerConnected(playerid) || GetVehicleModel(vehicleid) <= 0) return 0;
  8078.         new BitStream:bs = BS_New();
  8079.         BS_WriteValue(bs, PR_UINT16, vehicleid, PR_FLOAT, x, PR_FLOAT, y, PR_FLOAT, z);
  8080.         #if defined BS_SendRPC
  8081.             BS_SendRPC(bs, playerid, 159);
  8082.         #else
  8083.             BS_RPC(bs, playerid, 159);
  8084.         #endif
  8085.         BS_Delete(bs);
  8086.         return 1;
  8087.     }
  8088.  
  8089.     static SetVehicleFakeZAngleForPlayer(playerid, vehicleid, Float:z_angle)
  8090.     {
  8091.         if(!IsPlayerConnected(playerid) || GetVehicleModel(vehicleid) <= 0) return 0;
  8092.         new BitStream:bs = BS_New();
  8093.         BS_WriteValue(bs, PR_UINT16, vehicleid, PR_FLOAT, z_angle);
  8094.         #if defined BS_SendRPC
  8095.             BS_SendRPC(bs, playerid, 160);
  8096.         #else
  8097.             BS_RPC(bs, playerid, 160);
  8098.         #endif
  8099.         BS_Delete(bs);
  8100.         return 1;
  8101.     }
  8102. #endif
  8103.  
  8104. ac_fpublic ac_Timer(playerid)
  8105. {
  8106.     if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked] > 0) return 0;
  8107.     new ac_gpp;
  8108.     #if defined NetStats_MessagesRecvPerSecond
  8109.         if(ACInfo[playerid][acACAllow][51] && (ac_gpp = NetStats_MessagesRecvPerSecond(playerid)) > AC_MAX_MSGS_REC_DIFF)
  8110.         {
  8111.             #if defined DEBUG
  8112.                 printf("[Nex-AC debug] Max msgs per sec: %d, msgs per sec: %d", AC_MAX_MSGS_REC_DIFF, ac_gpp);
  8113.             #endif
  8114.             ac_KickWithCode(playerid, "", 0, 51);
  8115.         }
  8116.     #endif
  8117.     #undef AC_MAX_MSGS_REC_DIFF
  8118.     ac_gpp = GetPlayerPing(playerid);
  8119.     if(ACInfo[playerid][acACAllow][38])
  8120.     {
  8121.         if(ac_gpp > AC_MAX_PING && ac_gpp != 65535)
  8122.         {
  8123.             if(++ACInfo[playerid][acCheatCount][0] > AC_MAX_PING_WARNINGS)
  8124.             {
  8125.                 #if defined DEBUG
  8126.                     printf("[Nex-AC debug] Max ping: %d, ping: %d", AC_MAX_PING, ac_gpp);
  8127.                 #endif
  8128.                 #undef AC_MAX_PING
  8129.                 #undef AC_MAX_PING_WARNINGS
  8130.                 ac_KickWithCode(playerid, "", 0, 38);
  8131.                 #if defined OnCheatDetected
  8132.                     ACInfo[playerid][acCheatCount][0] = 0;
  8133.                 #endif
  8134.             }
  8135.             #if defined OnCheatWarning
  8136.                 else OnCheatWarning(playerid, "", 0, 38, 0, ACInfo[playerid][acCheatCount][0]);
  8137.             #endif
  8138.         }
  8139.         else ACInfo[playerid][acCheatCount][0] = 0;
  8140.     }
  8141.     new ac_gtc = GetTickCount();
  8142.     if(ac_gtc < ACInfo[playerid][acUpdateTick] + 1500)
  8143.     {
  8144.         new ac_t, ac_s;
  8145.         #if AC_USE_AMMUNATIONS || AC_USE_CASINOS
  8146.             new ac_int = GetPlayerInterior(playerid);
  8147.         #endif
  8148.         #if AC_USE_PICKUP_WEAPONS\
  8149.             && defined Streamer_GetDistanceToItem\
  8150.             && defined Streamer_GetIntData
  8151.             new Float:ac_pick_dist;
  8152.             if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS)
  8153.             {
  8154.                 new Float:ac_x, Float:ac_y, Float:ac_z;
  8155.                 GetPlayerPos(playerid, ac_x, ac_y, ac_z);
  8156.                 Streamer_GetDistanceToItem(ac_x, ac_y, ac_z, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_pick_dist);
  8157.                 ac_t = Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) - 100;
  8158.             }
  8159.         #endif
  8160.         if(!ACInfo[playerid][acDead] && (ac_s = GetPlayerWeapon(playerid)) != -1 && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  8161.         {
  8162.             #if AC_USE_AMMUNATIONS
  8163.                 new ac_m;
  8164.             #endif
  8165.             ac_s = ac_wSlot[ac_s];
  8166.             for(new ac_i, ac_w, ac_a, bool:ac_cw; ac_i <= 12; ++ac_i)
  8167.             {
  8168.                 GetPlayerWeaponData(playerid, ac_i, ac_w, ac_a);
  8169.                 if(ac_w == 39) ac_cw = true;
  8170.                 if(ac_s != ac_i)
  8171.                 {
  8172.                     if(ACInfo[playerid][acSetWeapon][ac_i] != -1)
  8173.                     {
  8174.                         if(ACInfo[playerid][acSetWeapon][ac_i] == ac_w)
  8175.                         {
  8176.                             if(ACInfo[playerid][acSet][3] == ac_w) ACInfo[playerid][acSet][3] = -1;
  8177.                             ACInfo[playerid][acSetWeapon][ac_i] = -1;
  8178.                             ACInfo[playerid][acWeapon][ac_i] = ac_w;
  8179.                         }
  8180.                         else if(ac_gtc > ACInfo[playerid][acGtcSetWeapon][ac_i] + ac_gpp)
  8181.                         {
  8182.                             #if defined _inc_fixes
  8183.                             if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][0] &&
  8184.                             ACInfo[playerid][acGiveAmmo][ac_i] != 0)
  8185.                             #else
  8186.                             if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][0])
  8187.                             #endif
  8188.                             {
  8189.                                 if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_TIMER_WARNINGS)
  8190.                                 {
  8191.                                     #if defined DEBUG
  8192.                                         printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  8193.                                         printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSetWeapon][ac_i], ac_w);
  8194.                                     #endif
  8195.                                     ac_KickWithCode(playerid, "", 0, 52, 13);
  8196.                                     #if defined OnCheatDetected
  8197.                                         ACInfo[playerid][acSetWeapon][ac_i] = -1;
  8198.                                     #endif
  8199.                                 }
  8200.                                 #if defined OnNOPWarning
  8201.                                     else OnNOPWarning(playerid, 13, ACInfo[playerid][acNOPCount][0]);
  8202.                                 #endif
  8203.                             }
  8204.                             else if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSetWeapon][ac_i] = -1;
  8205.                         }
  8206.                     }
  8207.                     else
  8208.                     {
  8209.                         if(ACInfo[playerid][acWeapon][ac_i] != ac_w)
  8210.                         {
  8211.                             #if AC_USE_PICKUP_WEAPONS
  8212.                                 #if defined Streamer_GetDistanceToItem\
  8213.                                     && defined Streamer_GetIntData
  8214.                                 if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
  8215.                                 ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  8216.                                 ac_a <= (3 <= ac_i <= 5 ? (ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) &&
  8217.                                 IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  8218.                                 ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) ||
  8219.                                 ACInfo[playerid][acLastPickup] > MAX_PICKUPS && ac_t == ac_w &&
  8220.                                 ac_a <= (3 <= ac_i <= 5 ? (ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) && ac_pick_dist <= 15.0)
  8221.                                 #else
  8222.                                 if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
  8223.                                 ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  8224.                                 ac_a <= (3 <= ac_i <= 5 ? (ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) &&
  8225.                                 IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  8226.                                 ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
  8227.                                 #endif
  8228.                                 {
  8229.                                     ACInfo[playerid][acWeapon][ac_i] = ac_w;
  8230.                                     ACInfo[playerid][acAmmo][ac_i] = ac_a;
  8231.                                 }
  8232.                                 else
  8233.                                 {
  8234.                             #endif
  8235.                                 if(ac_w == 0 || ac_w == 40 && ac_cw ||
  8236.                                 ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute] > 0)
  8237.                                 {
  8238.                                     ACInfo[playerid][acWeapon][ac_i] = ac_w;
  8239.                                     ACInfo[playerid][acAmmo][ac_i] = ac_a;
  8240.                                     ACInfo[playerid][acParachute] = 0;
  8241.                                 }
  8242.                                 else if(ACInfo[playerid][acACAllow][15] && !(16 <= ac_w <= 43 && ac_a == 0))
  8243.                                 {
  8244.                                     #if defined DEBUG
  8245.                                         printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
  8246.                                         ACInfo[playerid][acWeapon][ac_i], ACInfo[playerid][acAmmo][ac_i], ac_w, ac_a);
  8247.                                     #endif
  8248.                                     ac_KickWithCode(playerid, "", 0, 15, 2);
  8249.                                     #if defined OnCheatDetected
  8250.                                         if(ACInfo[playerid][acKicked] < 1)
  8251.                                         {
  8252.                                             ACInfo[playerid][acWeapon][ac_i] = ac_w;
  8253.                                             ACInfo[playerid][acAmmo][ac_i] = ac_a;
  8254.                                         }
  8255.                                     #endif
  8256.                                 }
  8257.                             #if AC_USE_PICKUP_WEAPONS
  8258.                                 }
  8259.                             #endif
  8260.                             #undef AC_USE_PICKUP_WEAPONS
  8261.                         }
  8262.                         if(ACInfo[playerid][acGiveAmmo][ac_i] != -65535)
  8263.                         {
  8264.                             if(ACInfo[playerid][acGiveAmmo][ac_i] == ac_a ||
  8265.                             ACInfo[playerid][acGiveAmmo][ac_i] > ac_a && !(ac_a < 0 <= ACInfo[playerid][acGiveAmmo][ac_i]) &&
  8266.                             ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_i] + ac_gpp)
  8267.                             {
  8268.                                 ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  8269.                                 ACInfo[playerid][acAmmo][ac_i] = ac_a;
  8270.                             }
  8271.                             else if(ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_i] + ac_gpp)
  8272.                             {
  8273.                                 if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][1])
  8274.                                 {
  8275.                                     if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_TIMER_WARNINGS)
  8276.                                     {
  8277.                                         #if defined DEBUG
  8278.                                             printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  8279.                                             printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  8280.                                             ACInfo[playerid][acGiveAmmo][ac_i], ac_a, ac_w);
  8281.                                         #endif
  8282.                                         ac_KickWithCode(playerid, "", 0, 52, 14);
  8283.                                         #if defined OnCheatDetected
  8284.                                             ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  8285.                                         #endif
  8286.                                     }
  8287.                                     #if defined OnNOPWarning
  8288.                                         else OnNOPWarning(playerid, 14, ACInfo[playerid][acNOPCount][1]);
  8289.                                     #endif
  8290.                                 }
  8291.                                 else if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  8292.                             }
  8293.                         }
  8294.                         else if(16 <= ac_w <= 43)
  8295.                         {
  8296.                             if(ac_a == 0) ACInfo[playerid][acAmmo][ac_i] = 0;
  8297.                             else if(ACInfo[playerid][acACAllow][16] && ac_w != 40 &&
  8298.                             (ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i]) &&
  8299.                             (!ac_LagCompMode || ac_w != 38 && !(22 <= ac_w <= 34) || ac_gtc > ACInfo[playerid][acShotTick] + 3650))
  8300.                             {
  8301.                                 #if defined DEBUG
  8302.                                     printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  8303.                                     ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
  8304.                                 #endif
  8305.                                 ac_KickWithCode(playerid, "", 0, 16, 2);
  8306.                                 #if defined OnCheatDetected
  8307.                                     if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acAmmo][ac_i] = ac_a;
  8308.                                 #endif
  8309.                             }
  8310.                         }
  8311.                     }
  8312.                 }
  8313.                 else if(ac_w == 38 || 22 <= ac_w <= 34)
  8314.                 {
  8315.                     if(ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i])
  8316.                     {
  8317.                         if(ACInfo[playerid][acGiveAmmo][ac_i] == -65535)
  8318.                         {
  8319.                             #if AC_USE_AMMUNATIONS
  8320.                                 if(22 <= ac_w <= 32 && ac_InAmmuNation(playerid, ac_int) &&
  8321.                                 (ac_m = ac_a - ACInfo[playerid][acAmmo][ac_i]) % ac_AmmuNationInfo[ac_w - 22][1] == 0)
  8322.                                 {
  8323.                                     if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0] * (ac_m / ac_AmmuNationInfo[ac_w - 22][1]);
  8324.                                     else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0] * (ac_m / ac_AmmuNationInfo[ac_w - 22][1]);
  8325.                                     ACInfo[playerid][acAmmo][ac_i] += ac_m;
  8326.                                     ACInfo[playerid][acGtc][15] = ac_gtc + 2650;
  8327.                                     ACInfo[playerid][acCheatCount][10] = 0;
  8328.                                 }
  8329.                                 else
  8330.                                 {
  8331.                             #endif
  8332.                                 if(ACInfo[playerid][acACAllow][16] && (!ac_LagCompMode || ac_gtc > ACInfo[playerid][acShotTick] + 3650))
  8333.                                 {
  8334.                                     #if defined DEBUG
  8335.                                         printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  8336.                                         ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
  8337.                                     #endif
  8338.                                     ac_KickWithCode(playerid, "", 0, 16, 3);
  8339.                                     #if defined OnCheatDetected
  8340.                                         if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acAmmo][ac_i] = ac_a;
  8341.                                     #endif
  8342.                                 }
  8343.                             #if AC_USE_AMMUNATIONS
  8344.                                 }
  8345.                             #endif
  8346.                         }
  8347.                     }
  8348.                     else if(ACInfo[playerid][acAmmo][ac_i] != 0) ACInfo[playerid][acAmmo][ac_i] = ac_a;
  8349.                 }
  8350.             }
  8351.         }
  8352.         if((ac_s = GetPlayerState(playerid)) == PLAYER_STATE_DRIVER)
  8353.         {
  8354.             ac_t = GetPlayerVehicleID(playerid);
  8355.             new Float:ac_pX, Float:ac_pY, Float:ac_pZ, Float:ac_vX, Float:ac_vY, Float:ac_vZ;
  8356.             GetPlayerPos(playerid, ac_pX, ac_pY, ac_pZ);
  8357.             GetVehicleVelocity(ac_t, ac_vX, ac_vY, ac_vZ);
  8358.             if(ACInfo[playerid][acACAllow][35] && GetPlayerCameraMode(playerid) == 55) ac_KickWithCode(playerid, "", 0, 35);
  8359.             if(ACInfo[playerid][acACAllow][3] && ACInfo[playerid][acSet][9] == -1)
  8360.             {
  8361.                 new Float:ac_time, Float:ac_maxdist = 140.0,
  8362.                 Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY], ac_pZ),
  8363.                 Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], ac_pZ);
  8364.                 if((ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1000.0) > 1.0) ac_maxdist *= ac_time;
  8365.                 if(ac_dist >= ac_maxdist && (ACInfo[playerid][acSet][8] == -1 || ac_dist_set >= ac_maxdist))
  8366.                 {
  8367.                     #if defined DEBUG
  8368.                         printf("[Nex-AC debug] Dist: %f, dist set: %f, acSet[8]: %d, speed: %d, veh: %d",
  8369.                         ac_dist, ac_dist_set, ACInfo[playerid][acSet][8], ac_GetSpeed(ac_vX, ac_vY, ac_vZ), ac_t);
  8370.                     #endif
  8371.                     ac_KickWithCode(playerid, "", 0, 3, 3);
  8372.                 }
  8373.             }
  8374.             ACInfo[playerid][acLastPosX] = ac_pX;
  8375.             ACInfo[playerid][acLastPosY] = ac_pY;
  8376.             ac_s = ac_GetSpeed(ac_vX, ac_vY);
  8377.             if(ACInfo[playerid][acACAllow][10] && ac_gtc > ACInfo[playerid][acGtc][9] + ac_gpp)
  8378.             {
  8379.                 new ac_model = GetVehicleModel(ac_t), Float:ac_time, ac_maxdiff = 80;
  8380.                 if((ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1100.0) > 1.0) ac_maxdiff = floatround(ac_maxdiff * ac_time);
  8381.                 if(ac_s >= ACVehInfo[ac_t][acLastSpeed] + ac_maxdiff && !(ac_model == 449 || 537 <= ac_model <= 538))
  8382.                 {
  8383.                     ACInfo[playerid][acCheatCount][20] += (1 * AC_SPEEDHACK_VEH_RESET_DELAY);
  8384.                     if(ACInfo[playerid][acCheatCount][20] > AC_MAX_SPEEDHACK_VEH_WARNINGS)
  8385.                     {
  8386.                         #undef AC_MAX_SPEEDHACK_VEH_WARNINGS
  8387.                         #if defined DEBUG
  8388.                             printf("[Nex-AC debug] Speed: %d, last speed: %d, veh model: %d",
  8389.                             ac_s, ACVehInfo[ac_t][acLastSpeed], ac_model);
  8390.                         #endif
  8391.                         ac_KickWithCode(playerid, "", 0, 10, 4);
  8392.                         #if defined OnCheatDetected
  8393.                             ACInfo[playerid][acCheatCount][20] = 0;
  8394.                         #endif
  8395.                     }
  8396.                     #if defined OnCheatWarning
  8397.                         else OnCheatWarning(playerid, "", 0, 10, 4, floatround(ACInfo[playerid][acCheatCount][20] / AC_SPEEDHACK_VEH_RESET_DELAY));
  8398.                     #endif
  8399.                     #undef AC_SPEEDHACK_VEH_RESET_DELAY
  8400.                 }
  8401.             }
  8402.             ACVehInfo[ac_t][acLastSpeed] = ac_s;
  8403.         }
  8404.         else if(ac_s == PLAYER_STATE_ONFOOT)
  8405.         {
  8406.             new Float:ac_pX, Float:ac_pY, Float:ac_pZ;
  8407.             GetPlayerPos(playerid, ac_pX, ac_pY, ac_pZ);
  8408.             if(ACInfo[playerid][acACAllow][2] && ACInfo[playerid][acSet][9] == -1 &&
  8409.             !IsVehicleStreamedIn(GetPlayerSurfingVehicleID(playerid), playerid) &&
  8410.             GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
  8411.             {
  8412.                 new Float:ac_time, Float:ac_maxdist = 80.0,
  8413.                 Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY], ac_pZ),
  8414.                 Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], ac_pZ);
  8415.                 if((ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1000.0) > 1.0) ac_maxdist *= ac_time;
  8416.                 if(ac_dist >= ac_maxdist && (ACInfo[playerid][acSet][8] == -1 || ac_dist_set >= ac_maxdist))
  8417.                 {
  8418.                     #if defined DEBUG
  8419.                         new Float:ac_vX, Float:ac_vY, Float:ac_vZ;
  8420.                         GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  8421.                         printf("[Nex-AC debug] Dist: %f, dist set: %f, acSet[8]: %d, speed: %d, old pos x, y: %f, %f",
  8422.                         ac_dist, ac_dist_set, ACInfo[playerid][acSet][8], ac_GetSpeed(ac_vX, ac_vY, ac_vZ), ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY]);
  8423.                     #endif
  8424.                     ac_KickWithCode(playerid, "", 0, 2, 6);
  8425.                 }
  8426.             }
  8427.             ACInfo[playerid][acLastPosX] = ac_pX;
  8428.             ACInfo[playerid][acLastPosY] = ac_pY;
  8429.         }
  8430.         ac_t = orig_GetPlayerMoney(playerid);
  8431.         #if AC_USE_AMMUNATIONS
  8432.             if(ACInfo[playerid][acSet][10] != -1)
  8433.             {
  8434.                 if(ac_t < ACInfo[playerid][acMoney] &&
  8435.                 ACInfo[playerid][acSet][10] <= ACInfo[playerid][acMoney] - ac_t) ACInfo[playerid][acSet][10] = -1;
  8436.                 else if(ac_gtc > ACInfo[playerid][acGtc][15] + ac_gpp)
  8437.                 {
  8438.                     if(ACInfo[playerid][acACAllow][15])
  8439.                     {
  8440.                         if(++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_TIMER_WARNINGS)
  8441.                         {
  8442.                             #if defined DEBUG
  8443.                                 printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
  8444.                                 ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
  8445.                             #endif
  8446.                             ac_KickWithCode(playerid, "", 0, 15, 4);
  8447.                             #if defined OnCheatDetected
  8448.                                 ACInfo[playerid][acSet][10] = -1;
  8449.                             #endif
  8450.                         }
  8451.                         #if defined OnCheatWarning
  8452.                             else OnCheatWarning(playerid, "", 0, 15, 4, ACInfo[playerid][acCheatCount][10]);
  8453.                         #endif
  8454.                     }
  8455.                     else if(++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSet][10] = -1;
  8456.                 }
  8457.             }
  8458.         #endif
  8459.         #if AC_USE_TUNING_GARAGES
  8460.             if(ACInfo[playerid][acSet][12] != -1)
  8461.             {
  8462.                 if(ac_t < ACInfo[playerid][acMoney] &&
  8463.                 ACInfo[playerid][acSet][12] <= ACInfo[playerid][acMoney] - ac_t) ACInfo[playerid][acSet][12] = -1;
  8464.                 else if(ac_gtc > ACInfo[playerid][acGtc][17] + ac_gpp)
  8465.                 {
  8466.                     if(ACInfo[playerid][acACAllow][23])
  8467.                     {
  8468.                         if(++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_TIMER_WARNINGS)
  8469.                         {
  8470.                             #if defined DEBUG
  8471.                                 printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
  8472.                                 ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][12]);
  8473.                             #endif
  8474.                             ac_KickWithCode(playerid, "", 0, 23, 6);
  8475.                             #if defined OnCheatDetected
  8476.                                 ACInfo[playerid][acSet][12] = -1;
  8477.                             #endif
  8478.                         }
  8479.                         #if defined OnCheatWarning
  8480.                             else OnCheatWarning(playerid, "", 0, 23, 6, ACInfo[playerid][acCheatCount][12]);
  8481.                         #endif
  8482.                     }
  8483.                     else if(++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSet][12] = -1;
  8484.                 }
  8485.             }
  8486.         #endif
  8487.         #undef AC_USE_TUNING_GARAGES
  8488.         #undef AC_MAX_NOP_TIMER_WARNINGS
  8489.         if(ACInfo[playerid][acNOPCount][11] > 0) ACInfo[playerid][acNOPCount][11]--;
  8490.         else
  8491.         {
  8492.             if(ACInfo[playerid][acACAllow][14] && ac_t > ACInfo[playerid][acMoney] &&
  8493.             (!ACInfo[playerid][acStuntBonus] || ACInfo[playerid][acVeh] == 0))
  8494.             {
  8495.                 #if AC_USE_CASINOS
  8496.                     if(!ac_InCasino(playerid, ac_int))
  8497.                     {
  8498.                 #endif
  8499.                     #if defined DEBUG
  8500.                         printf("[Nex-AC debug] AC money: %d, money: %d, stunt bonus: %d, veh: %d, playerid: %d",
  8501.                         ACInfo[playerid][acMoney], ac_t, ACInfo[playerid][acStuntBonus], ACInfo[playerid][acVeh], playerid);
  8502.                     #endif
  8503.                     #if defined OnCheatDetected
  8504.                         ac_KickWithCode(playerid, "", 0, 14);
  8505.                     #endif
  8506.                     ac_t = ACInfo[playerid][acMoney];
  8507.                     ResetPlayerMoney(playerid);
  8508.                     GivePlayerMoney(playerid, ac_t);
  8509.                 #if AC_USE_CASINOS
  8510.                     }
  8511.                 #endif
  8512.             }
  8513.             ACInfo[playerid][acMoney] = ac_t;
  8514.         }
  8515.     }
  8516.     else if(ACInfo[playerid][acSet][11] != -1) ACInfo[playerid][acGtc][8] += (ac_gtc - ACInfo[playerid][acTimerTick]);
  8517.     else if(ac_gtc <= ACInfo[playerid][acGtc][10] + ac_gpp) ACInfo[playerid][acGtc][10] += (ac_gtc - ACInfo[playerid][acTimerTick]);
  8518.     else if(ac_gtc <= ACInfo[playerid][acGtc][9] + ac_gpp) ACInfo[playerid][acGtc][9] += (ac_gtc - ACInfo[playerid][acTimerTick]);
  8519.     else if(ac_gtc <= ACInfo[playerid][acGtc][7] + ac_gpp) ACInfo[playerid][acGtc][7] += (ac_gtc - ACInfo[playerid][acTimerTick]);
  8520.     ACInfo[playerid][acCheatCount][1] =
  8521.     ACInfo[playerid][acCheatCount][2] =
  8522.     ACInfo[playerid][acCheatCount][21] = 0;
  8523.     if(ACInfo[playerid][acCheatCount][16] > 0) ACInfo[playerid][acCheatCount][16]--;
  8524.     if(ACInfo[playerid][acCheatCount][20] > 0) ACInfo[playerid][acCheatCount][20]--;
  8525.     if(ACInfo[playerid][acKicked] < 1)
  8526.     {
  8527.         ACInfo[playerid][acTimerTick] = ac_gtc;
  8528.         #if defined SetPlayerTimerEx_
  8529.             ACInfo[playerid][acTimerID] = SetPlayerTimerEx_(playerid, "ac_Timer", 0, 1000, 1, "i", playerid);
  8530.         #else
  8531.             ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
  8532.         #endif
  8533.     }
  8534.     return 1;
  8535. }
  8536.  
  8537. #if !defined OnCheatDetected
  8538.     //Don't make changes in this public
  8539.     //To customize punishments, declare 'OnCheatDetected' in your script
  8540.     ac_fpublic ac_OnCheatDetected(playerid, ip_address[], type, code)
  8541.     {
  8542.         if(type)
  8543.         {
  8544.             #if defined BlockIpAddress
  8545.                 BlockIpAddress(ip_address, 0);
  8546.             #else
  8547.                 new ac_strtmp[32];
  8548.                 format(ac_strtmp, sizeof ac_strtmp, "banip %s", ip_address);
  8549.                 SendRconCommand(ac_strtmp);
  8550.             #endif
  8551.         }
  8552.         else
  8553.         {
  8554.             switch(code)
  8555.             {
  8556.                 case 40: SendClientMessage(playerid, AC_DEFAULT_COLOR, MAX_CONNECTS_MSG);
  8557.                 case 41: SendClientMessage(playerid, AC_DEFAULT_COLOR, UNKNOWN_CLIENT_MSG);
  8558.                 default:
  8559.                 {
  8560.                     static ac_strtmp[sizeof KICK_MSG];
  8561.                     format(ac_strtmp, sizeof ac_strtmp, KICK_MSG, code);
  8562.                     SendClientMessage(playerid, AC_DEFAULT_COLOR, ac_strtmp);
  8563.                     #undef AC_DEFAULT_COLOR
  8564.                 }
  8565.             }
  8566.             AntiCheatKickWithDesync(playerid, code);
  8567.         }
  8568.         return 1;
  8569.     }
  8570. #endif
  8571.  
  8572. ac_fpublic ac_KickTimer(playerid) return Kick(playerid);
  8573.  
  8574. #undef ac_fpublic
  8575.  
  8576. stock AntiCheatGetHealth(playerid, &Float:health)
  8577. {
  8578.     if(!IsPlayerConnected(playerid)) return 0;
  8579.     health = ACInfo[playerid][acHealth];
  8580.     return 1;
  8581. }
  8582.  
  8583. stock AntiCheatGetArmour(playerid, &Float:armour)
  8584. {
  8585.     if(!IsPlayerConnected(playerid)) return 0;
  8586.     armour = ACInfo[playerid][acArmour];
  8587.     return 1;
  8588. }
  8589.  
  8590. stock AntiCheatGetVehicleHealth(vehicleid, &Float:health)
  8591. {
  8592.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  8593.     health = ACVehInfo[vehicleid][acHealth];
  8594.     return 1;
  8595. }
  8596.  
  8597. stock AntiCheatGetWeaponData(playerid, slot, &weapons, &ammo)
  8598. {
  8599.     if(!IsPlayerConnected(playerid)) return 0;
  8600.     if(!(0 <= slot <= 12)) return -1;
  8601.     weapons = ACInfo[playerid][acWeapon][slot];
  8602.     ammo = ACInfo[playerid][acAmmo][slot];
  8603.     return 1;
  8604. }
  8605.  
  8606. stock AntiCheatGetSpawnPos(playerid, &Float:x, &Float:y, &Float:z)
  8607. {
  8608.     if(!IsPlayerConnected(playerid)) return 0;
  8609.     x = ACInfo[playerid][acSpawnPosX];
  8610.     y = ACInfo[playerid][acSpawnPosY];
  8611.     z = ACInfo[playerid][acSpawnPosZ];
  8612.     return 1;
  8613. }
  8614.  
  8615. stock AntiCheatGetSpawnWeapon(playerid, &weapon1, &weapon1_ammo, &weapon2, &weapon2_ammo, &weapon3, &weapon3_ammo)
  8616. {
  8617.     if(!IsPlayerConnected(playerid)) return 0;
  8618.     weapon1 = ACInfo[playerid][acSpawnWeapon1];
  8619.     weapon1_ammo = ACInfo[playerid][acSpawnAmmo1];
  8620.     weapon2 = ACInfo[playerid][acSpawnWeapon2];
  8621.     weapon2_ammo = ACInfo[playerid][acSpawnAmmo2];
  8622.     weapon3 = ACInfo[playerid][acSpawnWeapon3];
  8623.     weapon3_ammo = ACInfo[playerid][acSpawnAmmo3];
  8624.     return 1;
  8625. }
  8626.  
  8627. stock AntiCheatGetPos(playerid, &Float:x, &Float:y, &Float:z)
  8628. {
  8629.     if(!IsPlayerConnected(playerid)) return 0;
  8630.     x = ACInfo[playerid][acPosX];
  8631.     y = ACInfo[playerid][acPosY];
  8632.     z = ACInfo[playerid][acPosZ];
  8633.     return 1;
  8634. }
  8635.  
  8636. stock AntiCheatGetVehicleVelocity(vehicleid, &Float:x, &Float:y, &Float:z)
  8637. {
  8638.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  8639.     x = ACVehInfo[vehicleid][acVelX];
  8640.     y = ACVehInfo[vehicleid][acVelY];
  8641.     z = ACVehInfo[vehicleid][acVelZ];
  8642.     return 1;
  8643. }
  8644.  
  8645. stock AntiCheatGetVehiclePos(vehicleid, &Float:x, &Float:y, &Float:z)
  8646. {
  8647.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  8648.     x = ACVehInfo[vehicleid][acPosX];
  8649.     y = ACVehInfo[vehicleid][acPosY];
  8650.     z = ACVehInfo[vehicleid][acPosZ];
  8651.     return 1;
  8652. }
  8653.  
  8654. stock AntiCheatGetVehicleZAngle(vehicleid, &Float:z_angle)
  8655. {
  8656.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  8657.     z_angle = ACVehInfo[vehicleid][acZAngle];
  8658.     return 1;
  8659. }
  8660.  
  8661. stock AntiCheatGetVehicleSpawnPos(vehicleid, &Float:x, &Float:y, &Float:z)
  8662. {
  8663.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  8664.     x = ACVehInfo[vehicleid][acSpawnPosX];
  8665.     y = ACVehInfo[vehicleid][acSpawnPosY];
  8666.     z = ACVehInfo[vehicleid][acSpawnPosZ];
  8667.     return 1;
  8668. }
  8669.  
  8670. stock AntiCheatGetVehicleSpawnZAngle(vehicleid, &Float:z_angle)
  8671. {
  8672.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  8673.     z_angle = ACVehInfo[vehicleid][acSpawnZAngle];
  8674.     return 1;
  8675. }
  8676.  
  8677. static ac_IsAnAircraft(modelid) return (417 <= modelid <= 593 && 1 <= ac_vType[modelid - 400] <= 2);
  8678.  
  8679. static ac_IsABoat(modelid) return (430 <= modelid <= 595 && ac_vType[modelid - 400] == 3);
  8680.  
  8681. static ac_IsABicycle(modelid) return (481 <= modelid <= 510 && ac_vType[modelid - 400] == 4);
  8682.  
  8683. static ac_IsABike(modelid) return (448 <= modelid <= 586 && 4 <= ac_vType[modelid - 400] <= 5);
  8684.  
  8685. #if defined VectorSize
  8686.     static ac_GetSpeed(Float:ac_x, Float:ac_y, Float:ac_z = 0.0) return floatround(VectorSize(ac_x, ac_y, ac_z) * 179.28625);
  8687. #else
  8688.     static ac_GetSpeed(Float:ac_x, Float:ac_y, Float:ac_z = 0.0) return floatround(floatsqroot(floatpower(ac_x, 2.0) + floatpower(ac_y, 2.0) + floatpower(ac_z, 2.0)) * 179.28625);
  8689. #endif
  8690.  
  8691. static ac_IsVehicleSeatOccupied(vehicleid, seat)
  8692. {
  8693.     #if defined foreach
  8694.         foreach(new ac_i : Player)
  8695.         {
  8696.             if(ACInfo[ac_i][acVeh] == vehicleid && ACInfo[ac_i][acSeat] == seat) return 1;
  8697.         }
  8698.     #else
  8699.         #if defined GetPlayerPoolSize
  8700.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  8701.         #else
  8702.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  8703.         #endif
  8704.         {
  8705.             if(IsPlayerInVehicle(ac_i, vehicleid) && ACInfo[ac_i][acSeat] == seat) return 1;
  8706.         }
  8707.     #endif
  8708.     return 0;
  8709. }
  8710.  
  8711. #if AC_USE_RESTAURANTS
  8712.     static ac_InRestaurant(playerid, interiorid)
  8713.     {
  8714.         new ac_i;
  8715.         switch(interiorid)
  8716.         {
  8717.             case 5: ac_i = 0;
  8718.             case 9: ac_i = 1;
  8719.             case 10: ac_i = 2;
  8720.             default: return 0;
  8721.         }
  8722.         return IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[ac_i][0], ac_Restaurants[ac_i][1], ac_Restaurants[ac_i][2]);
  8723.     }
  8724. #endif
  8725. #undef AC_USE_RESTAURANTS
  8726.  
  8727. #if AC_USE_AMMUNATIONS
  8728.     static ac_InAmmuNation(playerid, interiorid)
  8729.     {
  8730.         new ac_i, ac_s;
  8731.         switch(interiorid)
  8732.         {
  8733.             case 1: ac_i = 0, ac_s = -1;
  8734.             case 4: ac_i = 1, ac_s = 0;
  8735.             case 6: ac_i = 3, ac_s = 1;
  8736.             default: return 0;
  8737.         }
  8738.         for(; ac_i > ac_s; --ac_i)
  8739.         {
  8740.             if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[ac_i][0],
  8741.             ac_AmmuNations[ac_i][1], ac_AmmuNations[ac_i][2])) return 1;
  8742.         }
  8743.         return 0;
  8744.     }
  8745. #endif
  8746. #undef AC_USE_AMMUNATIONS
  8747.  
  8748. #if AC_USE_PAYNSPRAY
  8749.     static ac_InPayNSpray(playerid, interiorid)
  8750.     {
  8751.         if(interiorid == 0)
  8752.         {
  8753.             for(new ac_i = sizeof(ac_PayNSpray) - 1; ac_i >= 0; --ac_i)
  8754.             {
  8755.                 if(IsPlayerInRangeOfPoint(playerid, 7.5, ac_PayNSpray[ac_i][0], ac_PayNSpray[ac_i][1], ac_PayNSpray[ac_i][2])) return 1;
  8756.             }
  8757.         }
  8758.         return 0;
  8759.     }
  8760. #endif
  8761. #undef AC_USE_PAYNSPRAY
  8762.  
  8763. #if AC_USE_VENDING_MACHINES
  8764.     static ac_NearVendingMachine(playerid, interiorid)
  8765.     {
  8766.         new ac_i, ac_s;
  8767.         switch(interiorid)
  8768.         {
  8769.             case 0: ac_i = 44, ac_s = -1;
  8770.             case 1: ac_i = 51, ac_s = 44;
  8771.             case 2: ac_i = 52, ac_s = 51;
  8772.             case 3: ac_i = 58, ac_s = 52;
  8773.             case 6: ac_i = 60, ac_s = 58;
  8774.             case 7: ac_i = 61, ac_s = 60;
  8775.             case 15: ac_i = 62, ac_s = 61;
  8776.             case 16: ac_i = 65, ac_s = 62;
  8777.             case 17: ac_i = 72, ac_s = 65;
  8778.             case 18: ac_i = 74, ac_s = 72;
  8779.             default: return 0;
  8780.         }
  8781.         for(; ac_i > ac_s; --ac_i)
  8782.         {
  8783.             if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1;
  8784.         }
  8785.         return 0;
  8786.     }
  8787. #endif
  8788. #undef AC_USE_VENDING_MACHINES
  8789.  
  8790. #if AC_USE_CASINOS
  8791.     static ac_InCasino(playerid, interiorid)
  8792.     {
  8793.         new ac_i, ac_s;
  8794.         switch(interiorid)
  8795.         {
  8796.             case 1: ac_i = 41, ac_s = -1;
  8797.             case 10: ac_i = 61, ac_s = 41;
  8798.             case 12: ac_i = 70, ac_s = 61;
  8799.             default: return 0;
  8800.         }
  8801.         for(; ac_i > ac_s; --ac_i)
  8802.         {
  8803.             if(IsPlayerInRangeOfPoint(playerid, ac_Casinos[ac_i][3], ac_Casinos[ac_i][0],
  8804.             ac_Casinos[ac_i][1], ac_Casinos[ac_i][2])) return 1;
  8805.         }
  8806.         return 0;
  8807.     }
  8808. #endif
  8809. #undef AC_USE_CASINOS
  8810.  
  8811. static ac_IsCompatible(modelid, componentid)
  8812. {
  8813.     if(400 <= modelid <= 611)
  8814.     {
  8815.         switch(componentid)
  8816.         {
  8817.             case 1000..1191:
  8818.             {
  8819.                 componentid -= 1000;
  8820.                 if(ac_vMods[(modelid - 400) * 6 + (componentid >>> 5)] & 1 << (componentid & 0b00011111)) return 1;
  8821.             }
  8822.             case 1192, 1193:
  8823.             {
  8824.                 if(modelid == 576) return 1;
  8825.             }
  8826.         }
  8827.     }
  8828.     return 0;
  8829. }
  8830.  
  8831. static ac_GetMaxPassengers(modelid)
  8832. {
  8833.     if(400 <= modelid <= 611)
  8834.     {
  8835.         modelid -= 400;
  8836.         return ((ac_MaxPassengers[modelid >>> 3] >>> ((modelid & 7) << 2)) & 0xF);
  8837.     }
  8838.     return 0xF;
  8839. }
  8840.  
  8841. static ac_IpToInt(const ip[])
  8842. {
  8843.     new ac_bytes[1], ac_pos;
  8844.     ac_bytes{0} = strval(ip[ac_pos]);
  8845.     while(ac_pos < 15 && ip[ac_pos++] != '.'){}
  8846.     ac_bytes{1} = strval(ip[ac_pos]);
  8847.     while(ac_pos < 15 && ip[ac_pos++] != '.'){}
  8848.     ac_bytes{2} = strval(ip[ac_pos]);
  8849.     while(ac_pos < 15 && ip[ac_pos++] != '.'){}
  8850.     ac_bytes{3} = strval(ip[ac_pos]);
  8851.     return ac_bytes[0];
  8852. }
  8853.  
  8854. static ac_FloodDetect(playerid, publicid)
  8855. {
  8856.     if(ACInfo[playerid][acKicked] < 1)
  8857.     {
  8858.         if(++ACInfo[playerid][acFloodCount][publicid] > ac_Mtfc[publicid][1])
  8859.         {
  8860.             #if defined DEBUG
  8861.                 printf(DEBUG_CODE_1, playerid, ac_Mtfc[publicid][1], publicid);
  8862.                 #if !defined mysql_included
  8863.                     #undef DEBUG
  8864.                 #endif
  8865.             #endif
  8866.             #if defined OnCheatDetected
  8867.                 ac_KickWithCode(playerid, "", 0, 49, publicid);
  8868.                 ACInfo[playerid][acFloodCount][publicid] =
  8869.                 ACInfo[playerid][acFloodCount][27] = 0;
  8870.             #else
  8871.                 return ac_KickWithCode(playerid, "", 0, 49, publicid);
  8872.             #endif
  8873.         }
  8874.         #if defined OnFloodWarning
  8875.             else OnFloodWarning(playerid, publicid, ACInfo[playerid][acFloodCount][publicid]);
  8876.         #endif
  8877.         ACInfo[playerid][acCall][publicid] =
  8878.         ACInfo[playerid][acCall][27] = GetTickCount();
  8879.     }
  8880.     return 0;
  8881. }
  8882.  
  8883. static ac_KickWithCode(playerid, ip_address[], type, code, code2 = 0)
  8884. {
  8885.     if(type == 0 && (!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked] > 0)) return 0;
  8886.     #if AC_USE_STATISTICS
  8887.         ac_sInfo[5]++;
  8888.         switch(code)
  8889.         {
  8890.             case 0..35, 37, 39, 51: ac_sInfo[0]++;
  8891.             case 36, 38, 40, 41, 50: ac_sInfo[4]++;
  8892.             case 42: ac_sInfo[1]++;
  8893.             case 47..49: ac_sInfo[3]++;
  8894.             case 43..46: ac_sInfo[2]++;
  8895.         }
  8896.     #endif
  8897.     #undef AC_USE_STATISTICS
  8898.     #if defined NO_SUSPICION_LOGS
  8899.         #pragma unused code2
  8900.     #else
  8901.         new ac_strtmp[6];
  8902.         if(code2) format(ac_strtmp, sizeof ac_strtmp, " (%d)", code2);
  8903.         if(type) printf(SUSPICION_2, ip_address, code, ac_strtmp);
  8904.         else printf(SUSPICION_1, playerid, code, ac_strtmp);
  8905.     #endif
  8906.     #if defined OnCheatDetected
  8907.         OnCheatDetected(playerid, ip_address, type, code);
  8908.     #else
  8909.         ac_OnCheatDetected(playerid, ip_address, type, code);
  8910.     #endif
  8911.     return 0;
  8912. }
  8913.  
  8914. #if AC_USE_CONFIG_FILES
  8915.     static ac_LoadCfg()
  8916.     {
  8917.         static ac_strtmp[10];
  8918.         new ac_i, ac_string[415], File:ac_cfgFile;
  8919.         if(fexist(AC_CONFIG_FILE))
  8920.         {
  8921.             if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_read)))
  8922.             {
  8923.                 #if defined sscanf
  8924.                     new ac_j;
  8925.                 #endif
  8926.                 while(fread(ac_cfgFile, ac_string) > 0)
  8927.                 {
  8928.                     #if defined sscanf
  8929.                         sscanf(ac_string, "i'//'i", ac_j, ac_i);
  8930.                         ac_ACAllow[ac_i] = !!ac_j;
  8931.                     #else
  8932.                         if((ac_i = strfind(ac_string, "//")) != -1)
  8933.                         {
  8934.                             strmid(ac_strtmp, ac_string, ac_i + 2, strlen(ac_string));
  8935.                             if(0 <= (ac_i = strval(ac_strtmp)) < sizeof ac_ACAllow) ac_ACAllow[ac_i] = !!strval(ac_string);
  8936.                         }
  8937.                     #endif
  8938.                 }
  8939.                 fclose(ac_cfgFile);
  8940.             }
  8941.             else return 0;
  8942.         }
  8943.         else if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_write)))
  8944.         {
  8945.             #undef AC_CONFIG_FILE
  8946.             for(; ac_i < sizeof ac_ACAllow; ++ac_i)
  8947.             {
  8948.                 format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_ACAllow[ac_i], ac_i);
  8949.                 strcat(ac_string, ac_strtmp);
  8950.             }
  8951.             fwrite(ac_cfgFile, ac_string);
  8952.             fclose(ac_cfgFile);
  8953.         }
  8954.         else return 0;
  8955.         return 1;
  8956.     }
  8957.  
  8958.     static ac_LoadNOPCfg()
  8959.     {
  8960.         static ac_strtmp[10];
  8961.         new ac_i, ac_string[87], File:ac_cfgFile;
  8962.         if(fexist(AC_NOP_CONFIG_FILE))
  8963.         {
  8964.             if((ac_cfgFile = fopen(AC_NOP_CONFIG_FILE, io_read)))
  8965.             {
  8966.                 #if defined sscanf
  8967.                     new ac_j;
  8968.                 #endif
  8969.                 while(fread(ac_cfgFile, ac_string) > 0)
  8970.                 {
  8971.                     #if defined sscanf
  8972.                         sscanf(ac_string, "i'//'i", ac_j, ac_i);
  8973.                         ac_NOPAllow[ac_i] = !!ac_j;
  8974.                     #else
  8975.                         if((ac_i = strfind(ac_string, "//")) != -1)
  8976.                         {
  8977.                             strmid(ac_strtmp, ac_string, ac_i + 2, strlen(ac_string));
  8978.                             if(0 <= (ac_i = strval(ac_strtmp)) < sizeof ac_NOPAllow) ac_NOPAllow[ac_i] = !!strval(ac_string);
  8979.                         }
  8980.                     #endif
  8981.                 }
  8982.                 fclose(ac_cfgFile);
  8983.             }
  8984.             else return 0;
  8985.         }
  8986.         else if((ac_cfgFile = fopen(AC_NOP_CONFIG_FILE, io_write)))
  8987.         {
  8988.             #undef AC_NOP_CONFIG_FILE
  8989.             for(; ac_i < sizeof ac_NOPAllow; ++ac_i)
  8990.             {
  8991.                 format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_NOPAllow[ac_i], ac_i);
  8992.                 strcat(ac_string, ac_strtmp);
  8993.             }
  8994.             fwrite(ac_cfgFile, ac_string);
  8995.             fclose(ac_cfgFile);
  8996.         }
  8997.         else return 0;
  8998.         return 1;
  8999.     }
  9000. #endif
  9001. #undef AC_USE_CONFIG_FILES
  9002.  
  9003. #endif
Advertisement
Add Comment
Please, Sign In to add comment