Advertisement
Guest User

Nex-AC

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