Advertisement
Guest User

Nex-AC

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