Guest User

Nex-AC

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