Advertisement
Fr0z3nCheats

.CS_TEAM

Apr 21st, 2022
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 365.01 KB | None | 0 0
  1. /*
  2. *   .CS TEAM 1.0.1 by Fr0z3n - youtube.com/Fr0z3nCheats
  3. *
  4. *   Credits:
  5. *   Nex-AC by Nexius - 1.9.59 (0.3.7) -> https://github.com/NexiusTailer/Nex-Ac
  6. *   Pawn.Raknet by katursis - 1.5.1 -> https://github.com/katursis/Pawn.RakNet
  7. */
  8. #if defined _nex_ac_included
  9.     #endinput
  10. #endif
  11. #define _nex_ac_included
  12.  
  13. #tryinclude <a_samp>
  14.  
  15. #pragma warning disable 239
  16.  
  17. #if !defined FILTERSCRIPT
  18.  
  19. #if !defined DEBUG
  20.     #define DEBUG
  21. #endif
  22.  
  23. #if !defined NO_SUSPICION_LOGS
  24.     //#define NO_SUSPICION_LOGS
  25. #endif
  26.  
  27. #if defined NO_SUSPICION_LOGS
  28.     #pragma unused SUSPICION_1
  29.     #pragma unused SUSPICION_2
  30. #endif
  31.  
  32. #if !defined _nex_ac_lang_included
  33.     #include <nex-ac_en.lang>   //Localization
  34. #endif
  35.  
  36. #define NEX_AC_VERSION              "1.9.59"
  37. #define CS_TEAM_MODULE_VERSION      "1.0.1"
  38.  
  39. #define AC_SERVER_VERSION           "0.3.7"
  40. #define AC_SERVER_DL_VERSION        "0.3.DL"
  41.  
  42. #if !defined AC_CLIENT_VERSION
  43.     #define AC_CLIENT_VERSION           "0.3"
  44. #endif
  45.  
  46. #if !defined AC_USE_CONFIG_FILES
  47.     #define AC_USE_CONFIG_FILES             false
  48. #endif
  49.  
  50. #if !defined AUTOSAVE_SETTINGS_IN_CONFIG
  51.     #define AUTOSAVE_SETTINGS_IN_CONFIG     false
  52. #endif
  53.  
  54. #if AC_USE_CONFIG_FILES
  55.     #if !defined AC_CONFIG_FILE
  56.         #define AC_CONFIG_FILE              "nex-ac_settings.cfg"
  57.     #endif
  58.  
  59.     #if !defined AC_NOP_CONFIG_FILE
  60.         #define AC_NOP_CONFIG_FILE          "nex-ac_nop_settings.cfg"
  61.     #endif
  62. #else
  63.     #pragma unused CFG_OPENING_ERROR
  64. #endif
  65.  
  66. #if !defined AC_USE_AMMUNATIONS
  67.     #define AC_USE_AMMUNATIONS              false
  68. #endif
  69.  
  70. #if !defined AC_USE_PICKUP_WEAPONS
  71.     #define AC_USE_PICKUP_WEAPONS           false
  72. #endif
  73.  
  74. #if !defined AC_USE_RESTAURANTS
  75.     #define AC_USE_RESTAURANTS              false
  76. #endif
  77.  
  78. #if !defined AC_USE_VENDING_MACHINES
  79.     #define AC_USE_VENDING_MACHINES         false
  80. #endif
  81.  
  82. #if !defined AC_USE_TUNING_GARAGES
  83.     #define AC_USE_TUNING_GARAGES           false
  84. #endif
  85.  
  86. #if !defined AC_USE_PAYNSPRAY
  87.     #define AC_USE_PAYNSPRAY                false
  88. #endif
  89.  
  90. #if !defined AC_USE_CASINOS
  91.     #define AC_USE_CASINOS                  false
  92. #endif
  93.  
  94. #if !defined AC_USE_NPC
  95.     #define AC_USE_NPC                      false
  96. #endif
  97.  
  98. #if !defined AC_USE_QUERY
  99.     #define AC_USE_QUERY                    true
  100. #endif
  101.  
  102. #if !defined AC_USE_STATISTICS
  103.     #define AC_USE_STATISTICS               false
  104. #endif
  105.  
  106. #if !AC_USE_STATISTICS
  107.     #pragma unused STATS_STRING_1
  108.     #pragma unused STATS_STRING_2
  109.     #pragma unused STATS_STRING_3
  110.     #pragma unused STATS_STRING_4
  111.     #pragma unused STATS_STRING_5
  112.     #pragma unused STATS_STRING_6
  113.     #pragma unused STATS_STRING_7
  114.     #pragma unused STATS_STRING_8
  115. #endif
  116.  
  117. #if !defined AC_DEFAULT_COLOR
  118.     #define AC_DEFAULT_COLOR                -1
  119. #endif
  120.  
  121. #if !defined AC_MAX_CLASSES
  122.     #define AC_MAX_CLASSES                  320
  123. #endif
  124.  
  125. #if !defined AC_MAX_SKINS
  126.     #define AC_MAX_SKINS                    312
  127. #endif
  128.  
  129. #if !defined AC_STREAM_DISTANCE
  130.     #define AC_STREAM_DISTANCE              350.0
  131. #endif
  132.  
  133. #if !defined AC_MIN_STREAM_DISTANCE
  134.     #define AC_MIN_STREAM_DISTANCE          100.0
  135. #endif
  136.  
  137. #if !defined AC_MAX_CONNECTS_FROM_IP
  138.     #define AC_MAX_CONNECTS_FROM_IP         3
  139. #endif
  140.  
  141. #if !defined AC_MAX_RCON_LOGIN_ATTEMPT
  142.     #define AC_MAX_RCON_LOGIN_ATTEMPT       3
  143. #endif
  144.  
  145. #if !defined AC_MAX_MSGS_REC_DIFF
  146.     #define AC_MAX_MSGS_REC_DIFF            800
  147. #endif
  148.  
  149. #if !defined AC_MAX_PING
  150.     #define AC_MAX_PING                     500
  151. #endif
  152.  
  153. #if !defined AC_MIN_TIME_RECONNECT
  154.     #define AC_MIN_TIME_RECONNECT           12      //In seconds
  155. #endif
  156.  
  157. #if !defined AC_SPEEDHACK_VEH_RESET_DELAY
  158.     #define AC_SPEEDHACK_VEH_RESET_DELAY    3       //In seconds
  159. #endif
  160.  
  161. #if !defined AC_PACKETS_RESET_DELAY
  162.     #define AC_PACKETS_RESET_DELAY          3       //In seconds
  163. #endif
  164.  
  165. #if !defined AC_FLYHACK_RESET_DELAY
  166.     #define AC_FLYHACK_RESET_DELAY          2       //In seconds
  167. #endif
  168.  
  169. #if !defined AC_MAX_NOP_WARNINGS
  170.     #define AC_MAX_NOP_WARNINGS             8
  171. #endif
  172.  
  173. #if !defined AC_MAX_NOP_TIMER_WARNINGS
  174.     #define AC_MAX_NOP_TIMER_WARNINGS       3
  175. #endif
  176.  
  177. #if !defined AC_MAX_PING_WARNINGS
  178.     #define AC_MAX_PING_WARNINGS            8
  179. #endif
  180.  
  181. #if !defined AC_MAX_MONEY_WARNINGS
  182.     #define AC_MAX_MONEY_WARNINGS           2
  183. #endif
  184.  
  185. #if !defined AC_MAX_AIR_WARNINGS
  186.     #define AC_MAX_AIR_WARNINGS             4
  187. #endif
  188.  
  189. #if !defined AC_MAX_AIR_VEH_WARNINGS
  190.     #define AC_MAX_AIR_VEH_WARNINGS         4
  191. #endif
  192.  
  193. #if !defined AC_MAX_SPEEDHACK_WARNINGS
  194.     #define AC_MAX_SPEEDHACK_WARNINGS       4
  195. #endif
  196.  
  197. #if !defined AC_MAX_SPEEDHACK_VEH_WARNINGS
  198.     #define AC_MAX_SPEEDHACK_VEH_WARNINGS   (1 * AC_SPEEDHACK_VEH_RESET_DELAY)
  199. #endif
  200.  
  201. #if !defined AC_MAX_FLYHACK_WARNINGS
  202.     #define AC_MAX_FLYHACK_WARNINGS         (1 * AC_FLYHACK_RESET_DELAY)
  203. #endif
  204.  
  205. #if !defined AC_MAX_FLYHACK_BIKE_WARNINGS
  206.     #define AC_MAX_FLYHACK_BIKE_WARNINGS    8
  207. #endif
  208.  
  209. #if !defined AC_MAX_FLYHACK_VEH_WARNINGS
  210.     #define AC_MAX_FLYHACK_VEH_WARNINGS     4
  211. #endif
  212.  
  213. #if !defined AC_MAX_CARSHOT_WARNINGS
  214.     #define AC_MAX_CARSHOT_WARNINGS         4
  215. #endif
  216.  
  217. #if !defined AC_MAX_GODMODE_WARNINGS
  218.     #define AC_MAX_GODMODE_WARNINGS         3
  219. #endif
  220.  
  221. #if !defined AC_MAX_GODMODE_VEH_WARNINGS
  222.     #define AC_MAX_GODMODE_VEH_WARNINGS     3
  223. #endif
  224.  
  225. #if !defined AC_MAX_FAKE_WEAPON_WARNINGS
  226.     #define AC_MAX_FAKE_WEAPON_WARNINGS     2
  227. #endif
  228.  
  229. #if !defined AC_MAX_SILENT_AIM_WARNINGS
  230.     #define AC_MAX_SILENT_AIM_WARNINGS      2
  231. #endif
  232.  
  233. #if !defined AC_MAX_PRO_AIM_WARNINGS
  234.     #define AC_MAX_PRO_AIM_WARNINGS         2
  235. #endif
  236.  
  237. #if !defined AC_MAX_AFK_GHOST_WARNINGS
  238.     #define AC_MAX_AFK_GHOST_WARNINGS       2
  239. #endif
  240.  
  241. #if !defined AC_MAX_RAPID_FIRE_WARNINGS
  242.     #define AC_MAX_RAPID_FIRE_WARNINGS      16
  243. #endif
  244.  
  245. #if !defined AC_MAX_AUTO_C_WARNINGS
  246.     #define AC_MAX_AUTO_C_WARNINGS          8
  247. #endif
  248.  
  249. #if !defined AC_MAX_TELEPORT_GLITCH_WARNINGS
  250.     #define AC_MAX_TELEPORT_GLITCH_WARNINGS 1
  251. #endif
  252.  
  253. #if !defined AC_MAX_CJ_RUN_WARNINGS
  254.     #define AC_MAX_CJ_RUN_WARNINGS          3
  255. #endif
  256.  
  257. #if !defined AC_MAX_QUATERN_WARNINGS
  258.     #define AC_MAX_QUATERN_WARNINGS         1
  259. #endif
  260.  
  261. #if !defined AC_MAX_QUATERN_VEH_WARNINGS
  262.     #define AC_MAX_QUATERN_VEH_WARNINGS     6
  263. #endif
  264.  
  265. #if !defined AC_MAX_SURF_WARNINGS
  266.     #define AC_MAX_SURF_WARNINGS            25
  267. #endif
  268.  
  269. #if !defined AC_MAX_DIST_SURF_WARNINGS
  270.     #define AC_MAX_DIST_SURF_WARNINGS       25
  271. #endif
  272.  
  273. #if !defined AC_MAX_STREAM_SURF_WARNINGS
  274.     #define AC_MAX_STREAM_SURF_WARNINGS     15
  275. #endif
  276.  
  277. #if !defined AC_MAX_PACKETS_WARNINGS
  278.     #define AC_MAX_PACKETS_WARNINGS         (1 * AC_PACKETS_RESET_DELAY)
  279. #endif
  280.  
  281. #define ac_fpublic%0(%1) forward%0(%1); public%0(%1)
  282. #define ac_AbsoluteAngle(%0) ((floatround(%0, floatround_floor) % 360) + floatfract(%0))
  283. #define ac_abs(%0) (((%0) < 0) ? (-(%0)) : ((%0)))
  284.  
  285. //'ac_ACAllow' contains the default settings that will be set if no config file is found
  286. //Don't change these values if you already have 'scriptfiles\nex-ac_settings.cfg'
  287. static bool:ac_ACAllow[] =
  288. {
  289.     true,   //0 Anti-AirBreak (onfoot)
  290.     true,   //1 Anti-AirBreak (in vehicle)
  291.     true,   //2 Anti-teleport hack (onfoot)
  292.     true,   //3 Anti-teleport hack (in vehicle)
  293.     true,   //4 Anti-teleport hack (into/between vehicles)
  294.     true,   //5 Anti-teleport hack (vehicle to player)
  295.     true,   //6 Anti-teleport hack (pickups)
  296.     true,   //7 Anti-FlyHack (onfoot)
  297.     true,   //8 Anti-FlyHack (in vehicle)
  298.     true,   //9 Anti-SpeedHack (onfoot)
  299.     true,   //10 Anti-SpeedHack (in vehicle)
  300.     true,   //11 Anti-Health hack (in vehicle)
  301.     true,   //12 Anti-Health hack (onfoot)
  302.     true,   //13 Anti-Armour hack
  303.     true,   //14 Anti-Money hack
  304.     true,   //15 Anti-Weapon hack
  305.     true,   //16 Anti-Ammo hack (add)
  306.     true,   //17 Anti-Ammo hack (infinite)
  307.     true,   //18 Anti-Special actions hack
  308.     true,   //19 Anti-GodMode from bullets (onfoot)
  309.     true,   //20 Anti-GodMode from bullets (in vehicle)
  310.     true,   //21 Anti-Invisible hack
  311.     true,   //22 Anti-lagcomp-spoof
  312.     true,   //23 Anti-Tuning hack
  313.     false//24 Anti-Parkour mod
  314.     true,   //25 Anti-Quick turn
  315.     true,   //26 Anti-Rapid fire
  316.     true,   //27 Anti-FakeSpawn
  317.     true,   //28 Anti-FakeKill
  318.     true,   //29 Anti-Pro Aim
  319.     true,   //30 Anti-CJ run
  320.     true,   //31 Anti-CarShot
  321.     true,   //32 Anti-CarJack
  322.     false//33 Anti-UnFreeze
  323.     true,   //34 Anti-AFK Ghost
  324.     true,   //35 Anti-Full Aiming
  325.  
  326.     false//36 Anti-Fake NPC
  327.     true,   //37 Anti-Reconnect
  328.     true,   //38 Anti-High ping
  329.     true,   //39 Anti-Dialog hack
  330.     true,   //40 Protection from sandbox
  331.     true,   //41 Protection from invalid version
  332.     true,   //42 Anti-Rcon hack
  333.  
  334.     true,   //43 Anti-Tuning crasher
  335.     true,   //44 Anti-Invalid seat crasher
  336.     true,   //45 Anti-Dialog crasher
  337.     true,   //46 Anti-Attached object crasher
  338.     true,   //47 Anti-Weapon Crasher
  339.  
  340.     true,   //48 Protection from connection flood in one slot
  341.     true,   //49 Anti-callback functions flood
  342.     true,   //50 Anti-flood by seat changing
  343.  
  344.     true,   //51 Anti-DoS
  345.  
  346.     true,   //52 Anti-NOPs
  347.    
  348.     true    //53 Anti-Fast movement
  349. },
  350.  
  351. bool:ac_NOPAllow[] =
  352. {
  353.     true,   //0 Anti-NOP GivePlayerWeapon
  354.     true,   //1 Anti-NOP SetPlayerAmmo
  355.     true,   //2 Anti-NOP SetPlayerInterior
  356.     true,   //3 Anti-NOP SetPlayerHealth
  357.     true,   //4 Anti-NOP SetVehicleHealth
  358.     true,   //5 Anti-NOP SetPlayerArmour
  359.     true,   //6 Anti-NOP SetPlayerSpecialAction
  360.     true,   //7 Anti-NOP PutPlayerInVehicle
  361.     true,   //8 Anti-NOP TogglePlayerSpectating
  362.     true,   //9 Anti-NOP SpawnPlayer
  363.     true,   //10 Anti-NOP SetPlayerPos
  364.     true    //11 Anti-NOP RemovePlayerFromVehicle
  365. };
  366.  
  367. static const ac_Mtfc[][] =
  368. {
  369.     {120, 8},   //0 OnDialogResponse
  370.     {800, 2},   //1 OnEnterExitModShop
  371.     {250, 8},   //2 OnPlayerClickMap
  372.     {400, 5},   //3 OnPlayerClickPlayer
  373.     {50, 11},   //4 OnPlayerClickTextDraw
  374.     {400, 8},   //5 OnPlayerCommandText
  375.     {50, 8},    //6 OnPlayerEnterVehicle
  376.     {50, 11},   //7 OnPlayerExitVehicle
  377.     {50, 11},   //8 OnPlayerPickUpPickup
  378.     {150, 8},   //9 OnPlayerRequestClass
  379.     {120, 8},   //10 OnPlayerSelectedMenuRow
  380.     {600, 8},   //11 OnPlayerStateChange
  381.     {450, 2},   //12 OnVehicleMod
  382.     {450, 2},   //13 OnVehiclePaintjob
  383.     {450, 2},   //14 OnVehicleRespray
  384.     {300, 1},   //15 OnVehicleDeath
  385.     {450, 8},   //16 OnPlayerText
  386.     {150, 8},   //17 OnPlayerEnterCheckpoint
  387.     {150, 8},   //18 OnPlayerLeaveCheckpoint
  388.     {150, 5},   //19 OnPlayerRequestSpawn
  389.     {120, 8},   //20 OnPlayerExitedMenu
  390.     {150, 8},   //21 OnPlayerEnterRaceCheckpoint
  391.     {150, 8},   //22 OnPlayerLeaveRaceCheckpoint
  392.     {50, 11},   //23 OnPlayerClickPlayerTextDraw
  393.     {60, 9},    //24 OnVehicleDamageStatusUpdate
  394.     {150, 8},   //25 OnVehicleSirenStateChange
  395.     {150, 5},   //26 OnPlayerSelectObject
  396.     {50, 11}    //27 Cross-public
  397. },
  398.  
  399. ac_wSlot[] =
  400. {
  401.     0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10,
  402.     10, 8, 8, 8, 8, 8, 8, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5,
  403.     4, 6, 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11, 11, 11
  404. },
  405.  
  406. ac_vType[] =
  407. {
  408.     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
  409.     0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 6, 0, 0, 0, 0, 0, 6, 0, 0,
  410.     0, 0, 0, 0, 0, 0, 3, 2, 5, 7, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0,
  411.     1, 5, 5, 5, 0, 0, 0, 0, 5, 2, 0, 5, 3, 3, 0, 0, 1, 0, 0, 0,
  412.     0, 4, 0, 0, 3, 0, 0, 2, 2, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0,
  413.     0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 1, 1, 1, 0, 0, 0, 0, 0, 1,
  414.     1, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 1,
  415.     0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
  416.     0, 0, 0, 2, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 1, 0, 0,
  417.     0, 5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 1, 0, 3, 0, 0, 0, 0,
  418.     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  419. },
  420.  
  421. #if AC_USE_PICKUP_WEAPONS
  422.     ac_wModel[] =
  423.     {
  424.         0, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325,
  425.         326, 342, 343, 344, 345, 345, 345, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356,
  426.         372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 371
  427.     },
  428.  
  429.     ac_pAmmo[] =
  430.     {
  431.         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  432.         1, 1, 1, 8, 8, 8, 8, 4, 4, 30, 10, 10, 15,
  433.         10, 10, 60, 60, 80, 80, 60, 20, 10, 4, 3,
  434.         100, 500, 5, 1, 500, 500, 36, 0, 0, 1
  435.     },
  436. #endif
  437.  
  438. #if AC_USE_TUNING_GARAGES
  439.     ac_cPrice[] =
  440.     {
  441.         400, 550, 200, 250, 100, 150, 80, 500, 500, 200, 1000, 220, 250, 100, 400,
  442.         500, 200, 500, 350, 300, 250, 200, 150, 350, 50, 1000, 480, 480, 770, 680, 370,
  443.         370, 170, 120, 790, 150, 500, 690, 190, 390, 500, 390, 1000, 500, 500, 510, 710,
  444.         670, 530, 810, 620, 670, 530, 130, 210, 230, 520, 430, 620, 720, 530, 180, 550, 430,
  445.         830, 850, 750, 250, 200, 550, 450, 550, 450, 1100, 1030, 980, 1560, 1620, 1200,
  446.         1030, 900, 1230, 820, 1560, 1350, 770, 100, 1500, 150, 650, 450, 100, 750,
  447.         350, 450, 350, 1000, 620, 1140, 1000, 940, 780, 830, 3250, 1610, 1540, 780, 780, 780,
  448.         1610, 1540, 0, 0, 3340, 3250, 2130, 2050, 2040, 780, 940, 780, 940, 780, 860,
  449.         780, 1120, 3340, 3250, 3340, 1650, 3380, 3290, 1590, 830, 800, 1500, 1000, 800,
  450.         580, 470, 870, 980, 150, 150, 100, 100, 490, 600, 890, 1000, 1090, 840, 910,
  451.         1200, 1030, 1030, 920, 930, 550, 1050, 1050, 950, 650, 450, 550, 850, 950,
  452.         850, 950, 970, 880, 990, 900, 950, 1000, 900, 1000, 900, 2050, 2150, 2130,
  453.         2050, 2130, 2040, 2150, 2040, 2095, 2175, 2080, 2200, 1200, 1040, 940, 1100
  454.     },
  455. #endif
  456.  
  457. #if AC_USE_AMMUNATIONS
  458.     ac_AmmuNationInfo[][] =
  459.     {
  460.         {200, 30}, {600, 30}, {1200, 15},
  461.         {600, 15}, {800, 12}, {1000, 10},
  462.         {500, 60}, {2000, 90}, {3500, 120},
  463.         {4500, 150}, {300, 60}
  464.     },
  465.  
  466.     Float:ac_AmmuNations[][] =
  467.     {
  468.         {296.3255, -38.304, 1001.5156},
  469.         {295.7595, -80.5579, 1001.5156},
  470.         {290.1898, -109.482, 1001.5156},
  471.         {312.6785, -165.5487, 999.6016},
  472.         {308.2072, -141.0583, 999.6016}
  473.     },
  474. #endif
  475.  
  476. #if AC_USE_RESTAURANTS
  477.     Float:ac_Restaurants[][] =
  478.     {
  479.         {374.0, -119.641, 1001.4922},
  480.         {368.789, -6.857, 1001.8516},
  481.         {375.566, -68.222, 1001.5151}
  482.     },
  483. #endif
  484.  
  485. #if AC_USE_PAYNSPRAY
  486.     Float:ac_PayNSpray[][] =
  487.     {
  488.         {2064.2842, -1831.4736, 13.5469},
  489.         {-2425.7822, 1021.1392, 50.3977},
  490.         {-1420.5195, 2584.2305, 55.8433},
  491.         {487.6401, -1739.9479, 11.1385},
  492.         {1024.8651, -1024.087, 32.1016},
  493.         {-1904.7019, 284.5968, 41.0469},
  494.         {1975.2384, 2162.5088, 11.0703},
  495.         {2393.4456, 1491.5537, 10.5616},
  496.         {720.0854, -455.2807, 16.3359},
  497.         {-99.9417, 1117.9048, 19.7417}
  498.     },
  499. #endif
  500.  
  501. #if AC_USE_VENDING_MACHINES
  502.     Float:ac_vMachines[][] =
  503.     {
  504.         {-862.82, 1536.6, 21.98},
  505.         {2271.72, -76.46, 25.96},
  506.         {1277.83, 372.51, 18.95},
  507.         {662.42, -552.16, 15.71},
  508.         {201.01, -107.61, 0.89},
  509.         {-253.74, 2597.95, 62.24},
  510.         {-253.74, 2599.75, 62.24},
  511.         {-76.03, 1227.99, 19.12},
  512.         {-14.7, 1175.35, 18.95},
  513.         {-1455.11, 2591.66, 55.23},
  514.         {2352.17, -1357.15, 23.77},
  515.         {2325.97, -1645.13, 14.21},
  516.         {2139.51, -1161.48, 23.35},
  517.         {2153.23, -1016.14, 62.23},
  518.         {1928.73, -1772.44, 12.94},
  519.         {1154.72, -1460.89, 15.15},
  520.         {2480.85, -1959.27, 12.96},
  521.         {2060.11, -1897.64, 12.92},
  522.         {1729.78, -1943.04, 12.94},
  523.         {1634.1, -2237.53, 12.89},
  524.         {1789.21, -1369.26, 15.16},
  525.         {-2229.18, 286.41, 34.7},
  526.         {2319.99, 2532.85, 10.21},
  527.         {2845.72, 1295.04, 10.78},
  528.         {2503.14, 1243.69, 10.21},
  529.         {2647.69, 1129.66, 10.21},
  530.         {-2420.21, 984.57, 44.29},
  531.         {-2420.17, 985.94, 44.29},
  532.         {2085.77, 2071.35, 10.45},
  533.         {1398.84, 2222.6, 10.42},
  534.         {1659.46, 1722.85, 10.21},
  535.         {1520.14, 1055.26, 10.0},
  536.         {-1980.78, 142.66, 27.07},
  537.         {-2118.96, -423.64, 34.72},
  538.         {-2118.61, -422.41, 34.72},
  539.         {-2097.27, -398.33, 34.72},
  540.         {-2092.08, -490.05, 34.72},
  541.         {-2063.27, -490.05, 34.72},
  542.         {-2005.64, -490.05, 34.72},
  543.         {-2034.46, -490.05, 34.72},
  544.         {-2068.56, -398.33, 34.72},
  545.         {-2039.85, -398.33, 34.72},
  546.         {-2011.14, -398.33, 34.72},
  547.         {-1350.11, 492.28, 10.58},
  548.         {-1350.11, 493.85, 10.58},
  549.         {2222.36, 1602.64, 1000.06},
  550.         {2222.2, 1606.77, 1000.05},
  551.         {2155.9, 1606.77, 1000.05},
  552.         {2155.84, 1607.87, 1000.06},
  553.         {2209.9, 1607.19, 1000.05},
  554.         {2202.45, 1617.0, 1000.06},
  555.         {2209.24, 1621.21, 1000.06},
  556.         {2576.7, -1284.43, 1061.09},
  557.         {330.67, 178.5, 1020.07},
  558.         {331.92, 178.5, 1020.07},
  559.         {350.9, 206.08, 1008.47},
  560.         {361.56, 158.61, 1008.47},
  561.         {371.59, 178.45, 1020.07},
  562.         {374.89, 188.97, 1008.47},
  563.         {-19.03, -57.83, 1003.63},
  564.         {-36.14, -57.87, 1003.63},
  565.         {316.87, -140.35, 998.58},
  566.         {2225.2, -1153.42, 1025.9},
  567.         {-15.1, -140.22, 1003.63},
  568.         {-16.53, -140.29, 1003.63},
  569.         {-35.72, -140.22, 1003.63},
  570.         {373.82, -178.14, 1000.73},
  571.         {379.03, -178.88, 1000.73},
  572.         {495.96, -24.32, 1000.73},
  573.         {500.56, -1.36, 1000.73},
  574.         {501.82, -1.42, 1000.73},
  575.         {-33.87, -186.76, 1003.63},
  576.         {-32.44, -186.69, 1003.63},
  577.         {-16.11, -91.64, 1003.63},
  578.         {-17.54, -91.71, 1003.63}
  579.     },
  580. #endif
  581.  
  582. #if AC_USE_CASINOS
  583.     Float:ac_Casinos[][] =
  584.     {
  585.         {2241.2878, 1617.1624, 1006.1797, 2.0},
  586.         {2240.9736, 1604.6592, 1006.1797, 6.0},
  587.         {2242.5427, 1592.8726, 1006.1836, 6.0},
  588.         {2230.2124, 1592.1426, 1006.1832, 6.0},
  589.         {2230.4717, 1604.484, 1006.186, 6.0},
  590.         {2230.3298, 1616.9272, 1006.1799, 3.0},
  591.         {2251.9407, 1586.1736, 1006.186, 1.0},
  592.         {2218.6785, 1587.3448, 1006.1749, 1.0},
  593.         {2219.2773, 1591.7467, 1006.1867, 1.0},
  594.         {2218.5408, 1589.3229, 1006.184, 1.0},
  595.         {2218.6477, 1593.6279, 1006.1797, 1.0},
  596.         {2221.926, 1603.8285, 1006.1797, 1.0},
  597.         {2218.5095, 1603.8385, 1006.1797, 1.0},
  598.         {2219.9597, 1603.9216, 1006.1797, 1.0},
  599.         {2216.3054, 1603.7996, 1006.1819, 1.0},
  600.         {2218.731, 1619.8046, 1006.1794, 1.0},
  601.         {2218.9407, 1617.8413, 1006.1821, 1.0},
  602.         {2218.668, 1615.4681, 1006.1797, 1.0},
  603.         {2218.6418, 1613.2629, 1006.1797, 1.0},
  604.         {2252.4272, 1589.8412, 1006.1797, 5.0},
  605.         {2252.4229, 1596.6169, 1006.1797, 5.0},
  606.         {2255.1565, 1608.8784, 1006.186, 1.0},
  607.         {2254.8496, 1610.8605, 1006.1797, 1.0},
  608.         {2255.2917, 1612.9167, 1006.1797, 1.0},
  609.         {2255.033, 1614.8892, 1006.1797, 1.0},
  610.         {2255.1213, 1616.8284, 1006.1797, 1.0},
  611.         {2255.2161, 1618.8005, 1006.1797, 1.0},
  612.         {2268.5281, 1606.4894, 1006.1797, 1.0},
  613.         {2270.4922, 1606.8539, 1006.1797, 1.0},
  614.         {2272.5693, 1606.4473, 1006.1797, 1.0},
  615.         {2274.5391, 1607.0122, 1006.1797, 1.0},
  616.         {2271.8447, 1586.1633, 1006.1797, 1.0},
  617.         {2261.4844, 1586.1724, 1006.1797, 1.0},
  618.         {2257.4507, 1589.6555, 1006.1797, 5.0},
  619.         {2267.8994, 1589.8672, 1006.1797, 5.0},
  620.         {2262.8486, 1590.026, 1006.1797, 5.0},
  621.         {2272.6458, 1589.7704, 1006.1797, 5.0},
  622.         {2272.6533, 1596.5682, 1006.1797, 5.0},
  623.         {2270.4895, 1596.4606, 1006.1797, 5.0},
  624.         {2265.4441, 1596.4299, 1006.1797, 5.0},
  625.         {2260.0308, 1596.7987, 1006.1797, 5.0},
  626.         {2254.9907, 1596.241, 1006.1797, 5.0},
  627.         {1956.9524, 988.2533, 992.4688, 2.0},
  628.         {1961.6155, 993.0375, 992.4688, 2.0},
  629.         {1963.7998, 998.4406, 992.4745, 2.0},
  630.         {1936.2885, 987.1995, 992.4745, 2.0},
  631.         {1944.9768, 986.3937, 992.4688, 2.0},
  632.         {1940.7397, 990.9521, 992.4609, 2.0},
  633.         {1940.0966, 1005.8996, 992.4688, 6.0},
  634.         {1938.8785, 1014.1768, 992.4688, 6.0},
  635.         {1938.8811, 1021.4434, 992.4688, 6.0},
  636.         {1966.5975, 1006.6469, 992.4745, 6.0},
  637.         {1966.5979, 1014.1024, 992.4688, 6.0},
  638.         {1939.8351, 1029.912, 992.4688, 6.0},
  639.         {1956.854, 1047.3718, 992.4688, 6.0},
  640.         {1961.356, 1042.8112, 992.4688, 6.0},
  641.         {1963.811, 1037.1263, 992.4745, 6.0},
  642.         {1961.733, 1025.8929, 992.4688, 10.0},
  643.         {1961.708, 1010.3194, 992.4688, 10.0},
  644.         {1966.5989, 1029.7954, 992.4745, 6.0},
  645.         {1961.4139, 1017.8281, 992.4688, 10.0},
  646.         {1966.5985, 1021.7686, 992.4688, 6.0},
  647.         {1128.7106, -1.9779, 1000.6797, 1.0},
  648.         {1125.2388, 1.61, 1000.6797, 1.0},
  649.         {1125.1249, -5.0489, 1000.6797, 1.0},
  650.         {1127.4139, 3.0199, 1000.6797, 1.0},
  651.         {1135.0634, -3.8695, 1000.6797, 1.0},
  652.         {1135.0861, 0.6107, 1000.6797, 1.0},
  653.         {1132.8943, -1.7139, 1000.6797, 1.0},
  654.         {1125.3727, 3.0315, 1000.6797, 1.0},
  655.         {1119.0272, -1.4916, 1000.6924, 1.0}
  656.     },
  657. #endif
  658.  
  659. ac_MaxPassengers[] =
  660. {
  661.     0x10331113, 0x11311131, 0x11331313, 0x80133301, 0x1381F110,
  662.     0x10311103, 0x10001F10, 0x11113311, 0x13113311, 0x31101100,
  663.     0x30002301, 0x11031311, 0x11111331, 0x10013111, 0x01131100,
  664.     0x11111110, 0x11100031, 0x11130111, 0x33113311, 0x11111101,
  665.     0x33101133, 0x10100510, 0x03133111, 0xFF11113F, 0x13330111,
  666.     0xFF131111, 0x0000FF3F
  667. },
  668.  
  669. ac_vMods[] =
  670. {
  671.     0x033C2700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x021A27FA, 0x00000000, 0x00FFFE00,
  672.     0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  673.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023B2785, 0x00000000, 0x00FFFE00,
  674.     0x00000007, 0x00000000, 0x00000000, 0x02BC4703, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  675.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  676.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  677.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03BA278A, 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, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  681.     0x028E078A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  682.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  683.     0x02310744, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  684.     0x00000007, 0x00000000, 0x00000000, 0x0228073A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  685.     0x02BD4701, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023A2780, 0x00000000, 0x00FFFE00,
  686.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  687.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  688.     0x00000007, 0x00000000, 0x00000000, 0x0228077A, 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.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  692.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  693.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  694.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  695.     0x027A27CA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  696.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  697.     0x0282278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  698.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  699.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  700.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  701.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  702.     0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  703.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  704.     0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  705.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  706.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  707.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 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, 0x00000007, 0x00000000, 0x00000000,
  711.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  712.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  713.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  714.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  715.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  716.     0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  717.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  718.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  719.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  720.     0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  721.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  722.     0x00000007, 0x00000000, 0x00000000, 0x023E07C0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  723.     0x03703730, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  724.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  725.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  726.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  727.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  728.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  729.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  730.     0x00000007, 0x00000000, 0x00000000, 0x031D2775, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  731.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02BE4788, 0x00000000, 0x00FFFE00,
  732.     0x00000007, 0x0003C000, 0x00000000, 0x02010771, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  733.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  734.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  735.     0x029A0FCE, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  736.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  737.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03382700, 0x00000000, 0x00FFFE00,
  738.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  739.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  740.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  741.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  742.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  743.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  744.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  745.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  746.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  747.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  748.     0x00000007, 0x00000000, 0x00000000, 0x023F8795, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  749.     0x029F078C, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x029627EA, 0x00000000, 0x00FFFE00,
  750.     0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  751.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  752.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  753.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  754.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  755.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x0236C782, 0x00000000, 0x00FFFE00,
  756.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  757.     0x029E1FCA, 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, 0xFC000437, 0x00000000, 0x021C0000,
  761.     0x02000700, 0x00000000, 0x00FFFE00, 0x03FE6007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  762.     0x00001B87, 0x00000001, 0x01E00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  763.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  764.     0x00000007, 0x00000000, 0x00000000, 0x039E07D2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  765.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023CC700, 0x00000000, 0x00FFFE00,
  766.     0x00000007, 0x00030000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  767.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  768.     0x00000007, 0x00000000, 0x00000000, 0x038E07D6, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  769.     0x023D0709, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  770.     0x00000007, 0x00000000, 0x00000000, 0x029E1F8A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  771.     0x029C077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02BD076C, 0x00000000, 0x00FFFE00,
  772.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  773.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  774.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  775.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  776.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0xFFFFFE00, 0x00000007, 0x00000000, 0x000001F8,
  777.     0x02000700, 0x00000000, 0x00FFFFFE, 0x00000007, 0xC0000000, 0x00002007, 0xFE000700, 0x00000003, 0x00FFFE00,
  778.     0x00000007, 0x00003C00, 0x00000600, 0xCE000700, 0xFF800000, 0x00FFFE01, 0x00000007, 0x3C000000, 0x00000000,
  779.     0x02000700, 0x000003FC, 0x00FFFE00, 0x00000007, 0x003C0000, 0x00001800, 0x02000700, 0x00000000, 0x00FFFE00,
  780.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  781.     0x02000700, 0x007FE000, 0x00FFFE00, 0x00000007, 0x03C00000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  782.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000047, 0x0000003E, 0x3C000000,
  783.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  784.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  785.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  786.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  787.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00001C00, 0x00FFFE00,
  788.     0x0000000F, 0x00000000, 0x0003C000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x000003C0, 0xC0000000,
  789.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  790.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  791.     0x029607C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  792.     0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  793.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  794.     0x00000007, 0x00000000, 0x00000000, 0x03FFE7CF, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  795.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  796.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  797.     0x031727F1, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  798.     0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  799.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  800.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  801.     0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  802.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  803.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  804.     0x00000007, 0x00000000, 0x00000000, 0x025627F0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  805.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  806.     0x00000007, 0x00000000, 0x00000000, 0x039E07C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  807.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  808.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  809.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  810.     0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  811.     0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  812.     0x00000007, 0x00000000, 0x00000000
  813. };
  814.  
  815. static stock const Float:ac_wMinRange[] =
  816. {
  817.     25.0, 25.0, 25.0, 30.0, 25.0, 35.0,
  818.     25.0, 35.0, 40.0, 40.0, 25.0, 55.0,
  819.     50.0, 50.0, 50.0, 4.0, 65.0
  820. };
  821.  
  822. enum acInfo
  823. {
  824.     Float:acVelZ,
  825.     Float:acPosX,
  826.     Float:acPosY,
  827.     Float:acPosZ,
  828.     Float:acDropJpX,
  829.     Float:acDropJpY,
  830.     Float:acDropJpZ,
  831.     Float:acSpawnPosX,
  832.     Float:acSpawnPosY,
  833.     Float:acSpawnPosZ,
  834.     Float:acSetVehHealth,
  835.     Float:acLastPosX,
  836.     Float:acLastPosY,
  837.     Float:acLastFivePosX,
  838.     Float:acLastFivePosY,
  839.     Float:acSetPosX,
  840.     Float:acSetPosY,
  841.     Float:acSetPosZ,
  842.     Float:acQuaternion,
  843.     acLastPackets,
  844.     acPackets,
  845.     acCamMode,
  846.     acSpeed,
  847.     acHealth,
  848.     acArmour,
  849.     acMoney,
  850.     acShotWeapon,
  851.     acHoldWeapon,
  852.     acLastWeapon,
  853.     acEnterSeat,
  854.     acEnterVeh,
  855.     acKickVeh,
  856.     acVeh,
  857.     acSeat,
  858.     acNextDialog,
  859.     acDialog,
  860.     acInt,
  861.     acAnim,
  862.     acSpecAct,
  863.     acNextSpecAct,
  864.     acLastSpecAct,
  865.     acLastPickup,
  866.     acReloadTick,
  867.     acShotTick,
  868.     acSpawnTick,
  869.     acTimerTick,
  870.     acSetPosTick,
  871.     acUpdateTick,
  872.     acEnterVehTick,
  873.     acFiveSecTick,
  874.     acSpawnWeapon1,
  875.     acSpawnWeapon2,
  876.     acSpawnWeapon3,
  877.     acSpawnAmmo1,
  878.     acSpawnAmmo2,
  879.     acSpawnAmmo3,
  880.     acSpawnRes,
  881.     acTimerID,
  882.     acKickTimerID,
  883.     acParachute,
  884.     acIntRet,
  885.     acKicked,
  886.     acIp[16],
  887.     acSet[13],
  888.     acGtc[21],
  889.     acWeapon[13],
  890.     acAmmo[13],
  891.     acSetWeapon[13],
  892.     acGiveAmmo[13],
  893.     acGtcSetWeapon[13],
  894.     acGtcGiveAmmo[13],
  895.     acNOPCount[12],
  896.     acCheatCount[27],
  897.     acCall[sizeof ac_Mtfc],
  898.     acFloodCount[sizeof ac_Mtfc],
  899.     bool:acNOPAllow[sizeof ac_NOPAllow],
  900.     bool:acACAllow[sizeof ac_ACAllow],
  901.     bool:acStuntBonus,
  902.     bool:acModShop,
  903.     bool:acUnFrozen,
  904.     bool:acOnline,
  905.     bool:acDeathRes,
  906.     bool:acDmgRes,
  907.     bool:acVehDmgRes,
  908.     bool:acForceClass,
  909.     bool:acClassRes,
  910.     bool:acDead,
  911.     bool:acTpToZ,
  912.     bool:acIntEnterExits,
  913.     bool:acSpec
  914. }
  915.  
  916. enum acVehInfo
  917. {
  918.     Float:acVelX,
  919.     Float:acVelY,
  920.     Float:acVelZ,
  921.     Float:acTrVelX,
  922.     Float:acTrVelY,
  923.     Float:acTrVelZ,
  924.     Float:acPosX,
  925.     Float:acPosY,
  926.     Float:acPosZ,
  927.     Float:acSpawnPosX,
  928.     Float:acSpawnPosY,
  929.     Float:acSpawnPosZ,
  930.     Float:acSpawnZAngle,
  931.     Float:acPosDiff,
  932.     Float:acZAngle,
  933.     Float:acHealth,
  934.     acLastSpeed,
  935.     acSpeedDiff,
  936.     acTrSpeedDiff,
  937.     acDestroyTick,
  938.     acExitTick,
  939.     acDriver,
  940.     acPanels,
  941.     acDoors,
  942.     acLights,
  943.     acTires,
  944.     acInt,
  945.     acSpeed,
  946.     acTrSpeed,
  947.     acPaintJob,
  948.     acLocked[MAX_PLAYERS],
  949.     bool:acSpawned
  950. }
  951.  
  952. enum acPickInfo
  953. {
  954.     Float:acPosX,
  955.     Float:acPosY,
  956.     Float:acPosZ,
  957.     acType,
  958.     acWeapon
  959. }
  960.  
  961. static
  962.     Float:ac_ClassPos[AC_MAX_CLASSES][3],
  963.     ac_ClassWeapon[AC_MAX_CLASSES][3],
  964.     ac_ClassAmmo[AC_MAX_CLASSES][3],
  965.  
  966.     #if AC_USE_STATISTICS
  967.         ac_sInfo[6],
  968.     #endif
  969.  
  970.     ACInfo[MAX_PLAYERS][acInfo],
  971.     ACVehInfo[MAX_VEHICLES][acVehInfo],
  972.     ACPickInfo[MAX_PICKUPS][acPickInfo],
  973.  
  974.     #if defined PAWNRAKNET_INC_
  975.         ac_ObjDelTick[MAX_OBJECTS],
  976.     #endif
  977.  
  978.     bool:ac_IntEnterExits = true,
  979.     bool:ac_StuntBonus = true,
  980.     bool:ac_LagCompMode,
  981.     #if !AC_USE_QUERY
  982.         bool:ac_QueryEnable,
  983.     #endif
  984.     bool:ac_RconEnable,
  985.     bool:ac_PedAnims;
  986.  
  987. static stock bool:ac_VehFriendlyFire;
  988.  
  989. ac_fpublic ac_AddStaticVehicle(vehicleid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle)
  990. {
  991.     ACVehInfo[vehicleid][acInt] =
  992.     ACVehInfo[vehicleid][acSpeed] =
  993.     ACVehInfo[vehicleid][acTires] =
  994.     ACVehInfo[vehicleid][acLights] =
  995.     ACVehInfo[vehicleid][acDoors] =
  996.     ACVehInfo[vehicleid][acPanels] =
  997.     ACVehInfo[vehicleid][acLastSpeed] =
  998.     ACVehInfo[vehicleid][acSpeedDiff] =
  999.     ACVehInfo[vehicleid][acDestroyTick] =
  1000.     ACVehInfo[vehicleid][acExitTick] = 0;
  1001.     ACVehInfo[vehicleid][acPaintJob] = 3;
  1002.     ACVehInfo[vehicleid][acHealth] = 1000.0;
  1003.     ACVehInfo[vehicleid][acSpawned] = true;
  1004.     ACVehInfo[vehicleid][acTrSpeed] = -1;
  1005.     ACVehInfo[vehicleid][acPosDiff] =
  1006.     ACVehInfo[vehicleid][acVelX] =
  1007.     ACVehInfo[vehicleid][acVelY] =
  1008.     ACVehInfo[vehicleid][acVelZ] = 0.0;
  1009.     ACVehInfo[vehicleid][acSpawnPosX] =
  1010.     ACVehInfo[vehicleid][acPosX] = spawn_x;
  1011.     ACVehInfo[vehicleid][acSpawnPosY] =
  1012.     ACVehInfo[vehicleid][acPosY] = spawn_y;
  1013.     ACVehInfo[vehicleid][acSpawnPosZ] =
  1014.     ACVehInfo[vehicleid][acPosZ] = spawn_z;
  1015.     ACVehInfo[vehicleid][acSpawnZAngle] =
  1016.     ACVehInfo[vehicleid][acZAngle] = z_angle;
  1017.     ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  1018.     return 1;
  1019. }
  1020.  
  1021. ac_fpublic ac_AddPlayerClass(classid, Float:spawn_x, Float:spawn_y, Float:spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  1022. {
  1023.     if(0 <= classid < AC_MAX_CLASSES)
  1024.     {
  1025.         #undef AC_MAX_CLASSES
  1026.         ac_ClassPos[classid][0] = spawn_x;
  1027.         ac_ClassPos[classid][1] = spawn_y;
  1028.         ac_ClassPos[classid][2] = spawn_z;
  1029.         ac_ClassWeapon[classid][0] = weapon1;
  1030.         ac_ClassAmmo[classid][0] = weapon1_ammo;
  1031.         ac_ClassWeapon[classid][1] = weapon2;
  1032.         ac_ClassAmmo[classid][1] = weapon2_ammo;
  1033.         ac_ClassWeapon[classid][2] = weapon3;
  1034.         ac_ClassAmmo[classid][2] = weapon3_ammo;
  1035.     }
  1036.     return 1;
  1037. }
  1038.  
  1039. 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)
  1040. {
  1041.     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;
  1042.     ACInfo[playerid][acSpawnPosX] = ac_x;
  1043.     ACInfo[playerid][acSpawnPosY] = ac_y;
  1044.     ACInfo[playerid][acSpawnPosZ] = ac_z;
  1045.     ACInfo[playerid][acSpawnWeapon1] = weapon1;
  1046.     ACInfo[playerid][acSpawnAmmo1] = weapon1_ammo;
  1047.     ACInfo[playerid][acSpawnWeapon2] = weapon2;
  1048.     ACInfo[playerid][acSpawnAmmo2] = weapon2_ammo;
  1049.     ACInfo[playerid][acSpawnWeapon3] = weapon3;
  1050.     ACInfo[playerid][acSpawnAmmo3] = weapon3_ammo;
  1051.     return 1;
  1052. }
  1053.  
  1054. ac_fpublic ac_CreatePickup(pickupid, modelid, type, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1055. {
  1056.     ACPickInfo[pickupid][acType] = 5;
  1057.     #if AC_USE_PICKUP_WEAPONS
  1058.         switch(type)
  1059.         {
  1060.             case 2, 3, 15, 22:
  1061.             {
  1062.                 switch(modelid)
  1063.                 {
  1064.                     case 370: ACPickInfo[pickupid][acType] = 1;
  1065.                     case 1240: ACPickInfo[pickupid][acType] = 2;
  1066.                     case 1242: ACPickInfo[pickupid][acType] = 3;
  1067.                     case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
  1068.                     {
  1069.                         for(new ac_i = 46; ac_i >= 1; --ac_i)
  1070.                         {
  1071.                             if(ac_wModel[ac_i] == modelid)
  1072.                             {
  1073.                                 ACPickInfo[pickupid][acType] = 4;
  1074.                                 ACPickInfo[pickupid][acWeapon] = ac_i;
  1075.                                 break;
  1076.                             }
  1077.                         }
  1078.                     }
  1079.                 }
  1080.             }
  1081.         }
  1082.     #endif
  1083.     ACPickInfo[pickupid][acPosX] = ac_X;
  1084.     ACPickInfo[pickupid][acPosY] = ac_Y;
  1085.     ACPickInfo[pickupid][acPosZ] = ac_Z;
  1086.     return 1;
  1087. }
  1088.  
  1089. #if AC_USE_PICKUP_WEAPONS\
  1090.     && defined Streamer_SetIntData
  1091.     #if defined STREAMER_ENABLE_TAGS
  1092.         ac_fpublic ac_CreateDynamicPickup(STREAMER_TAG_PICKUP:pickupid, modelid, type)
  1093.     #else
  1094.         ac_fpublic ac_CreateDynamicPickup(pickupid, modelid, type)
  1095.     #endif
  1096.     {
  1097.         Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 0);
  1098.         switch(type)
  1099.         {
  1100.             case 2, 3, 15, 22:
  1101.             {
  1102.                 switch(modelid)
  1103.                 {
  1104.                     case 370: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 1);
  1105.                     case 1240: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 2);
  1106.                     case 1242: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 3);
  1107.                     case 321..326, 331, 333..339, 341..353, 355..369, 371, 372:
  1108.                     {
  1109.                         for(new ac_i = 46; ac_i >= 1; --ac_i)
  1110.                         {
  1111.                             if(ac_wModel[ac_i] == modelid)
  1112.                             {
  1113.                                 Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, ac_i + 100);
  1114.                                 break;
  1115.                             }
  1116.                         }
  1117.                     }
  1118.                 }
  1119.             }
  1120.         }
  1121.         return 1;
  1122.     }
  1123. #endif
  1124.  
  1125. #if defined Streamer_UpdateEx
  1126.     stock ac_Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, type = -1, compensatedtime = -1, freezeplayer = 1)
  1127.     {
  1128.         if(!Streamer_UpdateEx(playerid, x, y, z, worldid, interiorid, type, compensatedtime, freezeplayer)) return 0;
  1129.         if(compensatedtime >= 0)
  1130.         {
  1131.             ACInfo[playerid][acSet][7] = 4;
  1132.             ACInfo[playerid][acTpToZ] = false;
  1133.             ACInfo[playerid][acNOPCount][10] = 0;
  1134.             ACInfo[playerid][acSetPosX] = x;
  1135.             ACInfo[playerid][acSetPosY] = y;
  1136.             ACInfo[playerid][acSetPosZ] = z;
  1137.             ACInfo[playerid][acSetPosTick] =
  1138.             ACInfo[playerid][acGtc][10] = GetTickCount() + 3850;
  1139.             #if defined FreezeSyncPacket
  1140.                 if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false);
  1141.             #endif
  1142.         }
  1143.         return 1;
  1144.     }
  1145.  
  1146.     #if defined _ALS_Streamer_UpdateEx
  1147.         #undef Streamer_UpdateEx
  1148.     #else
  1149.         #define _ALS_Streamer_UpdateEx
  1150.     #endif
  1151.     #define Streamer_UpdateEx ac_Streamer_UpdateEx
  1152. #endif
  1153.  
  1154. #if defined GetPlayerVersion
  1155.     stock ac_GetPlayerVersion(playerid, version[], len)
  1156.     {
  1157.         new ac_i, ac_ret = GetPlayerVersion(playerid, version, len);
  1158.         for(ac_i = ac_ret - 1; ac_i >= 0; --ac_i)
  1159.         {
  1160.             if(version[ac_i] == '%')
  1161.             {
  1162.                 strdel(version, ac_i, ac_i + 1);
  1163.                 ac_ret--;
  1164.             }
  1165.         }
  1166.         while((ac_i = strfind(version, "~k~")) != -1)
  1167.         {
  1168.             strdel(version, ac_i, ac_i + 3);
  1169.             ac_ret -= 3;
  1170.         }
  1171.         return ac_ret;
  1172.     }
  1173.  
  1174.     #if defined _ALS_GetPlayerVersion
  1175.         #undef GetPlayerVersion
  1176.     #else
  1177.         #define _ALS_GetPlayerVersion
  1178.     #endif
  1179.     #define GetPlayerVersion ac_GetPlayerVersion
  1180. #endif
  1181.  
  1182. #if !defined PAWNRAKNET_INC_
  1183.     stock ac_GetPlayerFacingAngle(playerid, &Float:ang)
  1184.     {
  1185.         if(!GetPlayerFacingAngle(playerid, ang)) return 0;
  1186.         if(!ac_IsValidFloat(ang)) ang = 0.0;
  1187.         ang = ac_AbsoluteAngle(ang);
  1188.         return 1;
  1189.     }
  1190.  
  1191.     #if defined _ALS_GetPlayerFacingAngle
  1192.         #undef GetPlayerFacingAngle
  1193.     #else
  1194.         #define _ALS_GetPlayerFacingAngle
  1195.     #endif
  1196.     #define GetPlayerFacingAngle ac_GetPlayerFacingAngle
  1197.  
  1198.     stock ac_GetVehicleZAngle(vehicleid, &Float:z_angle)
  1199.     {
  1200.         if(!GetVehicleZAngle(vehicleid, z_angle)) return 0;
  1201.         if(!ac_IsValidFloat(z_angle)) z_angle = 0.0;
  1202.         z_angle = ac_AbsoluteAngle(z_angle);
  1203.         #undef ac_AbsoluteAngle
  1204.         return 1;
  1205.     }
  1206.  
  1207.     #if defined _ALS_GetVehicleZAngle
  1208.         #undef GetVehicleZAngle
  1209.     #else
  1210.         #define _ALS_GetVehicleZAngle
  1211.     #endif
  1212.     #define GetVehicleZAngle ac_GetVehicleZAngle
  1213. #endif
  1214.  
  1215. ac_fpublic ac_DestroyVehicle(vehicleid)
  1216. {
  1217.     if(!DestroyVehicle(vehicleid)) return 0;
  1218.     ACVehInfo[vehicleid][acSpawned] = false;
  1219.     new ac_gtc = GetTickCount();
  1220.     ACVehInfo[vehicleid][acDestroyTick] = ac_gtc + 1650;
  1221.     ACVehInfo[vehicleid][acExitTick] = 0;
  1222.     #if defined foreach
  1223.         foreach(new ac_i : Player)
  1224.         {
  1225.             if(ACInfo[ac_i][acVeh] == vehicleid) ACInfo[ac_i][acSetPosTick] = ACInfo[ac_i][acGtc][10] = ac_gtc + 2650;
  1226.         }
  1227.     #else
  1228.         #if defined GetPlayerPoolSize
  1229.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1230.         #else
  1231.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1232.         #endif
  1233.         {
  1234.             if(IsPlayerInVehicle(ac_i, vehicleid)) ACInfo[ac_i][acSetPosTick] = ACInfo[ac_i][acGtc][10] = ac_gtc + 2650;
  1235.         }
  1236.     #endif
  1237.     return 1;
  1238. }
  1239.  
  1240. ac_fpublic ac_DestroyPickup(pickupid)
  1241. {
  1242.     if(!DestroyPickup(pickupid)) return 0;
  1243.     ACPickInfo[pickupid][acType] = 0;
  1244.     #if AC_USE_PICKUP_WEAPONS
  1245.         ACPickInfo[pickupid][acWeapon] = 0;
  1246.         #if defined foreach
  1247.             foreach(new ac_i : Player)
  1248.             {
  1249.         #else
  1250.             #if defined GetPlayerPoolSize
  1251.                 for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1252.             #else
  1253.                 for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1254.             #endif
  1255.             {
  1256.                 if(!IsPlayerConnected(ac_i)) continue;
  1257.         #endif
  1258.             if(ACInfo[ac_i][acLastPickup] == pickupid) ACInfo[ac_i][acLastPickup] = -1;
  1259.         }
  1260.     #endif
  1261.     return 1;
  1262. }
  1263.  
  1264. #if defined DestroyDynamicPickup
  1265.     #if defined STREAMER_ENABLE_TAGS
  1266.         ac_fpublic ac_DestroyDynamicPickup(STREAMER_TAG_PICKUP:pickupid)
  1267.     #else
  1268.         ac_fpublic ac_DestroyDynamicPickup(pickupid)
  1269.     #endif
  1270.     {
  1271.         if(!DestroyDynamicPickup(pickupid)) return 0;
  1272.         #if AC_USE_PICKUP_WEAPONS
  1273.             #if defined foreach
  1274.                 foreach(new ac_i : Player)
  1275.                 {
  1276.             #else
  1277.                 #if defined GetPlayerPoolSize
  1278.                     for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1279.                 #else
  1280.                     for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1281.                 #endif
  1282.                 {
  1283.                     if(!IsPlayerConnected(ac_i)) continue;
  1284.             #endif
  1285.                 if(ACInfo[ac_i][acLastPickup] > MAX_PICKUPS &&
  1286.                 (ACInfo[ac_i][acLastPickup] - MAX_PICKUPS) == _:pickupid) ACInfo[ac_i][acLastPickup] = -1;
  1287.             }
  1288.         #endif
  1289.         return 1;
  1290.     }
  1291. #endif
  1292.  
  1293. ac_fpublic ac_DisableInteriorEnterExits()
  1294. {
  1295.     ac_IntEnterExits = false;
  1296.     return DisableInteriorEnterExits();
  1297. }
  1298.  
  1299. ac_fpublic ac_UsePlayerPedAnims()
  1300. {
  1301.     ac_PedAnims = true;
  1302.     return UsePlayerPedAnims();
  1303. }
  1304.  
  1305. #if defined EnableVehicleFriendlyFire
  1306.     ac_fpublic ac_EnableVehicleFriendlyFire()
  1307.     {
  1308.         ac_VehFriendlyFire = true;
  1309.         return EnableVehicleFriendlyFire();
  1310.     }
  1311. #endif
  1312.  
  1313. ac_fpublic ac_EnableStuntBonusForAll(enable)
  1314. {
  1315.     ac_StuntBonus = (enable != 0);
  1316.     #if defined foreach
  1317.         foreach(new ac_i : Player) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
  1318.     #else
  1319.         #if defined GetPlayerPoolSize
  1320.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1321.         #else
  1322.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1323.         #endif
  1324.         {
  1325.             if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
  1326.         }
  1327.     #endif
  1328.     return EnableStuntBonusForAll(enable);
  1329. }
  1330.  
  1331. ac_fpublic ac_EnableStuntBonusForPlayer(playerid, enable)
  1332. {
  1333.     if(!EnableStuntBonusForPlayer(playerid, enable)) return 0;
  1334.     ACInfo[playerid][acStuntBonus] = (enable != 0);
  1335.     return 1;
  1336. }
  1337.  
  1338. ac_fpublic ac_ShowPlayerDialog(playerid, dialogid)
  1339. {
  1340.     if(dialogid > 65535) dialogid %= 32768;
  1341.     ACInfo[playerid][acDialog] = dialogid;
  1342.     return 1;
  1343. }
  1344.  
  1345. ac_fpublic ac_fs_ShowPlayerDialog(playerid, dialogid)
  1346. {
  1347.     if(dialogid > 65535) dialogid %= 32768;
  1348.     ACInfo[playerid][acNextDialog] = dialogid;
  1349.     return 1;
  1350. }
  1351.  
  1352. ac_fpublic ac_TogglePlayerControllable(playerid, toggle)
  1353. {
  1354.     if(!TogglePlayerControllable(playerid, toggle)) return 0;
  1355.     ACInfo[playerid][acUnFrozen] = (toggle != 0);
  1356.     #if defined FreezeSyncPacket
  1357.         if(toggle) FreezeSyncPacket(playerid, E_ALL_SYNC, false);
  1358.         else if(ACInfo[playerid][acACAllow][33]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  1359.     #endif
  1360.     return 1;
  1361. }
  1362.  
  1363. ac_fpublic ac_TogglePlayerSpectating(playerid, toggle)
  1364. {
  1365.     if(!TogglePlayerSpectating(playerid, toggle)) return 0;
  1366.     if(ACInfo[playerid][acSpec] || ACInfo[playerid][acSet][5] != -1)
  1367.     {
  1368.         if(!toggle)
  1369.         {
  1370.             if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][6] = 4;
  1371.             else
  1372.             {
  1373.                 ACInfo[playerid][acSet][3] =
  1374.                 ACInfo[playerid][acSet][5] =
  1375.                 ACInfo[playerid][acSet][7] =
  1376.                 ACInfo[playerid][acSet][8] =
  1377.                 ACInfo[playerid][acSet][12] =
  1378.                 ACInfo[playerid][acNextSpecAct] = -1;
  1379.                 for(new ac_i = 12; ac_i >= 0; --ac_i)
  1380.                 {
  1381.                     ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1382.                     ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1383.                 }
  1384.                 ACInfo[playerid][acForceClass] =
  1385.                 ACInfo[playerid][acUnFrozen] = true;
  1386.                 ACInfo[playerid][acSet][6] = 1;
  1387.                 #if defined FreezeSyncPacket
  1388.                     FreezeSyncPacket(playerid, E_ALL_SYNC, false);
  1389.                 #endif
  1390.             }
  1391.             ACInfo[playerid][acSpawnRes]++;
  1392.             ACInfo[playerid][acSpec] = false;
  1393.             ACInfo[playerid][acSpawnTick] = ACInfo[playerid][acNOPCount][9] = 0;
  1394.             ACInfo[playerid][acGtc][12] = GetTickCount() + 2650;
  1395.         }
  1396.     }
  1397.     else if(toggle)
  1398.     {
  1399.         ACInfo[playerid][acSet][5] = 1;
  1400.         ACInfo[playerid][acNOPCount][8] = 0;
  1401.         ACInfo[playerid][acGtc][11] = GetTickCount() + 2650;
  1402.     }
  1403.     return 1;
  1404. }
  1405.  
  1406. ac_fpublic ac_SpawnPlayer(playerid)
  1407. {
  1408.     if(!SpawnPlayer(playerid)) return 0;
  1409.     if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][6] = 5;
  1410.     else
  1411.     {
  1412.         ACInfo[playerid][acSet][3] =
  1413.         ACInfo[playerid][acSet][7] =
  1414.         ACInfo[playerid][acSet][8] =
  1415.         ACInfo[playerid][acSet][12] =
  1416.         ACInfo[playerid][acNextSpecAct] = -1;
  1417.         for(new ac_i = 12; ac_i >= 0; --ac_i)
  1418.         {
  1419.             ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1420.             ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1421.         }
  1422.         ACInfo[playerid][acUnFrozen] = true;
  1423.         ACInfo[playerid][acSet][6] = 2;
  1424.         #if defined FreezeSyncPacket
  1425.             FreezeSyncPacket(playerid, E_ALL_SYNC, false);
  1426.         #endif
  1427.     }
  1428.     ACInfo[playerid][acSpawnRes]++;
  1429.     ACInfo[playerid][acSpawnTick] = ACInfo[playerid][acNOPCount][9] = 0;
  1430.     ACInfo[playerid][acGtc][12] = GetTickCount() + 2650;
  1431.     return 1;
  1432. }
  1433.  
  1434. ac_fpublic ac_SetPlayerHealth(playerid, Float:ac_health)
  1435. {
  1436.     if(!SetPlayerHealth(playerid, ac_health)) return 0;
  1437.     if(ac_health < 0.0) ac_health = 0.0;
  1438.     ACInfo[playerid][acNOPCount][3] = 0;
  1439.     ACInfo[playerid][acSet][1] = floatround(ac_health, floatround_tozero);
  1440.     ACInfo[playerid][acGtc][2] = GetTickCount() + 2650;
  1441.     #if defined FreezeSyncPacket
  1442.         if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false);
  1443.     #endif
  1444.     return 1;
  1445. }
  1446.  
  1447. ac_fpublic ac_SetPlayerArmour(playerid, Float:ac_armour)
  1448. {
  1449.     if(!SetPlayerArmour(playerid, ac_armour)) return 0;
  1450.     if(ac_armour < 0.0) ac_armour = 0.0;
  1451.     ACInfo[playerid][acNOPCount][5] = 0;
  1452.     ACInfo[playerid][acSet][2] = floatround(ac_armour, floatround_tozero);
  1453.     ACInfo[playerid][acGtc][4] = GetTickCount() + 2650;
  1454.     #if defined FreezeSyncPacket
  1455.         if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false);
  1456.     #endif
  1457.     return 1;
  1458. }
  1459.  
  1460. ac_fpublic ac_GivePlayerWeapon(playerid, weaponid, ac_ammo)
  1461. {
  1462.     if(ac_IsValidWeapon(weaponid))
  1463.     {
  1464.         new ac_s = ac_wSlot[weaponid];
  1465.         ACInfo[playerid][acNOPCount][0] = ACInfo[playerid][acNOPCount][1] = 0;
  1466.         if(ac_IsWeaponWithAmmo(weaponid))
  1467.         {
  1468.             if(ac_IsAmmoSharingInSlot(ac_s) || (ACInfo[playerid][acSetWeapon][ac_s] == -1
  1469.             ? ACInfo[playerid][acWeapon][ac_s] : ACInfo[playerid][acSetWeapon][ac_s]) == weaponid)
  1470.             {
  1471.                 new ac_tmp;
  1472.                 if(ACInfo[playerid][acGiveAmmo][ac_s] == -65535) ac_tmp = ACInfo[playerid][acAmmo][ac_s] + ac_ammo;
  1473.                 else ac_tmp = ACInfo[playerid][acGiveAmmo][ac_s] + ac_ammo;
  1474.                 if(ac_tmp < -32768)
  1475.                 {
  1476.                     ac_ammo -= ac_tmp + 32768;
  1477.                     ac_tmp = -32768;
  1478.                 }
  1479.                 else if(ac_tmp > 32767)
  1480.                 {
  1481.                     ac_ammo -= ac_tmp - 32767;
  1482.                     ac_tmp = 32767;
  1483.                 }
  1484.                 ACInfo[playerid][acGiveAmmo][ac_s] = ac_tmp;
  1485.             }
  1486.             else
  1487.             {
  1488.                 if(ac_ammo < -32768) ac_ammo = -32768;
  1489.                 else if(ac_ammo > 32767) ac_ammo = 32767;
  1490.                 ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo;
  1491.             }
  1492.             ACInfo[playerid][acCheatCount][12] = ACInfo[playerid][acReloadTick] = 0;
  1493.         }
  1494.         else ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  1495.         ACInfo[playerid][acSetWeapon][ac_s] = weaponid;
  1496.         ACInfo[playerid][acGtcSetWeapon][ac_s] =
  1497.         ACInfo[playerid][acGtcGiveAmmo][ac_s] = GetTickCount() + 2850;
  1498.     }
  1499.     return GivePlayerWeapon(playerid, weaponid, ac_ammo);
  1500. }
  1501.  
  1502. ac_fpublic ac_SetPlayerAmmo(playerid, weaponid, ac_ammo)
  1503. {
  1504.     if(ac_ammo < -32768) ac_ammo = -32768;
  1505.     else if(ac_ammo > 32767) ac_ammo = 32767;
  1506.     if(ac_IsWeaponWithAmmo(weaponid))
  1507.     {
  1508.         new ac_s = ac_wSlot[weaponid];
  1509.         if((ACInfo[playerid][acSetWeapon][ac_s] == -1
  1510.         ? ACInfo[playerid][acWeapon][ac_s] : ACInfo[playerid][acSetWeapon][ac_s]) == weaponid)
  1511.         {
  1512.             ACInfo[playerid][acNOPCount][1] = 0;
  1513.             ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo;
  1514.             ACInfo[playerid][acGtcGiveAmmo][ac_s] = GetTickCount() + 2850;
  1515.         }
  1516.     }
  1517.     return SetPlayerAmmo(playerid, weaponid, ac_ammo);
  1518. }
  1519.  
  1520. ac_fpublic ac_ResetPlayerWeapons(playerid)
  1521. {
  1522.     if(!ResetPlayerWeapons(playerid)) return 0;
  1523.     for(new ac_i = 12; ac_i >= 0; --ac_i)
  1524.     {
  1525.         ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acAmmo][ac_i] = 0;
  1526.         ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1527.         ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1528.     }
  1529.     ACInfo[playerid][acGtc][6] = GetTickCount() + 2650;
  1530.     return 1;
  1531. }
  1532.  
  1533. ac_fpublic ac_GivePlayerMoney(playerid, ac_money)
  1534. {
  1535.     if(!GivePlayerMoney(playerid, ac_money)) return 0;
  1536.     ACInfo[playerid][acNOPCount][11] = AC_MAX_MONEY_WARNINGS;
  1537.     ACInfo[playerid][acMoney] += ac_money;
  1538.     #undef AC_MAX_MONEY_WARNINGS
  1539.     return 1;
  1540. }
  1541.  
  1542. ac_fpublic ac_ResetPlayerMoney(playerid)
  1543. {
  1544.     if(!ResetPlayerMoney(playerid)) return 0;
  1545.     ACInfo[playerid][acNOPCount][11] = 0;
  1546.     ACInfo[playerid][acMoney] = 0;
  1547.     return 1;
  1548. }
  1549.  
  1550. ac_fpublic ac_GetPlayerMoney(playerid) return ACInfo[playerid][acMoney];
  1551.  
  1552. ac_fpublic ac_SetPlayerSpecialAction(playerid, ac_actionid)
  1553. {
  1554.     if(!SetPlayerSpecialAction(playerid, ac_actionid)) return 0;
  1555.     if(ac_actionid == SPECIAL_ACTION_USEJETPACK || 24 <= ac_actionid <= 25 ||
  1556.     (ac_actionid == SPECIAL_ACTION_USECELLPHONE || ac_actionid == 68 || SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4) && ACInfo[playerid][acVeh] == 0 ||
  1557.     ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USECELLPHONE ||
  1558.     (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 ||
  1559.     ac_actionid == SPECIAL_ACTION_NONE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_DUCK &&
  1560.     ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_ENTER_VEHICLE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_HANDSUP)
  1561.     {
  1562.         ACInfo[playerid][acNOPCount][6] = 0;
  1563.         if((ac_actionid == 68 || SPECIAL_ACTION_HANDSUP <= ac_actionid <= SPECIAL_ACTION_USECELLPHONE || SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= 25) &&
  1564.         SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4 ||
  1565.         SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= 25 && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK ||
  1566.         (ac_actionid == SPECIAL_ACTION_NONE || 24 <= ac_actionid <= 25) && ACInfo[playerid][acVeh] > 0 ||
  1567.         24 <= ac_actionid <= 25 && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) ACInfo[playerid][acNextSpecAct] = ac_actionid;
  1568.         else
  1569.         {
  1570.             if(ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE) ac_actionid = SPECIAL_ACTION_NONE;
  1571.             else if(ac_actionid == SPECIAL_ACTION_USEJETPACK || ac_actionid == SPECIAL_ACTION_HANDSUP ||
  1572.             ac_actionid == 68 || SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4 ||
  1573.             SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_DRINK_SPRUNK) ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct];
  1574.             else ACInfo[playerid][acNextSpecAct] = -1;
  1575.             ACInfo[playerid][acSet][3] = ac_actionid;
  1576.             ACInfo[playerid][acGtc][5] = GetTickCount() + 3250;
  1577.             #if defined FreezeSyncPacket
  1578.                 if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false);
  1579.             #endif
  1580.         }
  1581.     }
  1582.     return 1;
  1583. }
  1584.  
  1585. ac_fpublic ac_PlayerSpecPlayerOrVehicle(playerid)
  1586. {
  1587.     ACInfo[playerid][acGtc][16] = GetTickCount() + 2650;
  1588.     return 1;
  1589. }
  1590.  
  1591. ac_fpublic ac_SetPlayerInterior(playerid, interiorid)
  1592. {
  1593.     if(!SetPlayerInterior(playerid, interiorid)) return 0;
  1594.     ACInfo[playerid][acNOPCount][2] = 0;
  1595.     ACInfo[playerid][acSet][0] = interiorid % 256;
  1596.     ACInfo[playerid][acGtc][16] =
  1597.     ACInfo[playerid][acGtc][0] = GetTickCount() + 3250;
  1598.     return 1;
  1599. }
  1600.  
  1601. ac_fpublic ac_SetPlayerPos(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1602. {
  1603.     if(!SetPlayerPos(playerid, ac_x, ac_y, ac_z)) return 0;
  1604.     ACInfo[playerid][acSet][7] = 1;
  1605.     ACInfo[playerid][acTpToZ] = false;
  1606.     ACInfo[playerid][acNOPCount][10] = 0;
  1607.     ACInfo[playerid][acSetPosX] = ac_x;
  1608.     ACInfo[playerid][acSetPosY] = ac_y;
  1609.     ACInfo[playerid][acSetPosZ] = ac_z;
  1610.     ACInfo[playerid][acSetPosTick] =
  1611.     ACInfo[playerid][acGtc][10] = GetTickCount() + 3850;
  1612.     #if defined FreezeSyncPacket
  1613.         if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false);
  1614.     #endif
  1615.     return 1;
  1616. }
  1617.  
  1618. ac_fpublic ac_SetPlayerPosFindZ(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1619. {
  1620.     if(!SetPlayerPosFindZ(playerid, ac_x, ac_y, ac_z)) return 0;
  1621.     ACInfo[playerid][acSet][7] = 2;
  1622.     ACInfo[playerid][acTpToZ] = true;
  1623.     ACInfo[playerid][acNOPCount][10] = 0;
  1624.     ACInfo[playerid][acSetPosX] = ac_x;
  1625.     ACInfo[playerid][acSetPosY] = ac_y;
  1626.     ACInfo[playerid][acSetPosTick] =
  1627.     ACInfo[playerid][acGtc][10] = GetTickCount() + 3850;
  1628.     #if defined FreezeSyncPacket
  1629.         if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false);
  1630.     #endif
  1631.     return 1;
  1632. }
  1633.  
  1634. ac_fpublic ac_SetPlayerVelocity(playerid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1635. {
  1636.     if(!SetPlayerVelocity(playerid, ac_X, ac_Y, ac_Z)) return 0;
  1637.     ACInfo[playerid][acVelZ] = ac_Z;
  1638.     ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_X, ac_Y, ac_Z);
  1639.     ACInfo[playerid][acGtc][9] = GetTickCount() + 1650;
  1640.     return 1;
  1641. }
  1642.  
  1643. ac_fpublic ac_PutPlayerInVehicle(playerid, vehicleid, ac_seatid)
  1644. {
  1645.     if(!PutPlayerInVehicle(playerid, vehicleid, ac_seatid)) return 0;
  1646.     if(!(SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4) &&
  1647.     !(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DRINK_SPRUNK) &&
  1648.     GetPlayerVirtualWorld(playerid) == GetVehicleVirtualWorld(vehicleid))
  1649.     {
  1650.         new ac_model = GetVehicleModel(vehicleid);
  1651.         ACInfo[playerid][acNOPCount][7] = 0;
  1652.         ACInfo[playerid][acSet][8] = vehicleid;
  1653.         if(ac_IsABusEx(ac_model) || ac_IsVehicleSeatOccupied(vehicleid, ac_seatid) ||
  1654.         ac_seatid > ac_GetMaxPassengers(ac_model)) ACInfo[playerid][acSet][4] = -1;
  1655.         else ACInfo[playerid][acSet][4] = ac_seatid;
  1656.         ACInfo[playerid][acGtc][1] = GetTickCount() + 2650;
  1657.     }
  1658.     return 1;
  1659. }
  1660.  
  1661. ac_fpublic ac_RemovePlayerFromVehicle(playerid)
  1662. {
  1663.     if(!RemovePlayerFromVehicle(playerid)) return 0;
  1664.     ACInfo[playerid][acSet][9] = 1;
  1665.     ACInfo[playerid][acGtc][7] = GetTickCount() + 4650;
  1666.     return 1;
  1667. }
  1668.  
  1669. ac_fpublic ac_SetVehiclePos(vehicleid, Float:ac_x, Float:ac_y, Float:ac_z)
  1670. {
  1671.     if(!SetVehiclePos(vehicleid, ac_x, ac_y, ac_z)) return 0;
  1672.     new ac_driver = ACVehInfo[vehicleid][acDriver], ac_gtc = GetTickCount();
  1673.     if(ac_driver != INVALID_PLAYER_ID)
  1674.     {
  1675.         ACInfo[ac_driver][acSet][7] = 3;
  1676.         ACInfo[ac_driver][acTpToZ] = false;
  1677.         ACInfo[ac_driver][acNOPCount][10] = 0;
  1678.         ACInfo[ac_driver][acSetPosX] = ac_x;
  1679.         ACInfo[ac_driver][acSetPosY] = ac_y;
  1680.         ACInfo[ac_driver][acSetPosZ] = ac_z;
  1681.         ACInfo[ac_driver][acSetPosTick] =
  1682.         ACInfo[ac_driver][acGtc][10] = ac_gtc + 3850;
  1683.         #if defined FreezeSyncPacket
  1684.             if(!ACInfo[ac_driver][acUnFrozen]) FreezeSyncPacket(ac_driver, E_ALL_SYNC, false);
  1685.         #endif
  1686.     }
  1687.     else
  1688.     {
  1689.         ACVehInfo[vehicleid][acPosX] = ac_x;
  1690.         ACVehInfo[vehicleid][acPosY] = ac_y;
  1691.         ACVehInfo[vehicleid][acPosZ] = ac_z;
  1692.     }
  1693.     #if defined foreach
  1694.         foreach(new ac_i : Player)
  1695.         {
  1696.     #else
  1697.         #if defined GetPlayerPoolSize
  1698.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1699.         #else
  1700.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1701.         #endif
  1702.         {
  1703.             if(!IsPlayerConnected(ac_i)) continue;
  1704.     #endif
  1705.         if(ac_driver != INVALID_PLAYER_ID && GetPlayerSurfingVehicleID(ac_i) == vehicleid && ac_gtc - ACInfo[ac_i][acUpdateTick] < 1500)
  1706.         {
  1707.             ACInfo[ac_i][acSet][7] = 5;
  1708.             ACInfo[ac_i][acTpToZ] = false;
  1709.             ACInfo[ac_i][acNOPCount][10] = 0;
  1710.             ACInfo[ac_i][acSetPosX] = ac_x;
  1711.             ACInfo[ac_i][acSetPosY] = ac_y;
  1712.             ACInfo[ac_i][acSetPosZ] = ac_z;
  1713.             ACInfo[ac_i][acSetPosTick] =
  1714.             ACInfo[ac_i][acGtc][10] = ac_gtc + 3850;
  1715.             #if defined FreezeSyncPacket
  1716.                 if(!ACInfo[ac_i][acUnFrozen]) FreezeSyncPacket(ac_i, E_ALL_SYNC, false);
  1717.             #endif
  1718.         }
  1719.         else if(ACInfo[ac_i][acVeh] == vehicleid && ACInfo[ac_i][acSeat] > 0)
  1720.         {
  1721.             ACInfo[ac_i][acSet][12] = 1;
  1722.             ACInfo[ac_i][acTpToZ] = false;
  1723.             ACInfo[ac_i][acSetPosX] = ac_x;
  1724.             ACInfo[ac_i][acSetPosY] = ac_y;
  1725.             ACInfo[ac_i][acSetPosZ] = ac_z;
  1726.             #if defined FreezeSyncPacket
  1727.                 if(!ACInfo[ac_i][acUnFrozen]) FreezeSyncPacket(ac_i, E_ALL_SYNC, false);
  1728.             #endif
  1729.         }
  1730.     }
  1731.     return 1;
  1732. }
  1733.  
  1734. ac_fpublic ac_SetVehicleVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1735. {
  1736.     if(!SetVehicleVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0;
  1737.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1738.     if(ac_driver != INVALID_PLAYER_ID)
  1739.     {
  1740.         ACVehInfo[vehicleid][acVelX] = ac_X;
  1741.         ACVehInfo[vehicleid][acVelY] = ac_Y;
  1742.         ACVehInfo[vehicleid][acVelZ] = ac_Z;
  1743.         ACVehInfo[vehicleid][acSpeed] = ac_GetSpeed(ac_X, ac_Y, ac_Z);
  1744.         ACInfo[ac_driver][acGtc][8] = GetTickCount() + 1650;
  1745.     }
  1746.     return 1;
  1747. }
  1748.  
  1749. ac_fpublic ac_SetVehicleAngularVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1750. {
  1751.     if(!SetVehicleAngularVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0;
  1752.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1753.     if(ac_driver != INVALID_PLAYER_ID)
  1754.     {
  1755.         ACVehInfo[vehicleid][acVelX] = ac_X;
  1756.         ACVehInfo[vehicleid][acVelY] = ac_Y;
  1757.         ACVehInfo[vehicleid][acVelZ] = ac_Z;
  1758.         ACVehInfo[vehicleid][acSpeed] = ac_GetSpeed(ac_X, ac_Y, ac_Z);
  1759.         ACInfo[ac_driver][acGtc][8] = GetTickCount() + 1650;
  1760.     }
  1761.     return 1;
  1762. }
  1763.  
  1764. ac_fpublic ac_LinkVehicleToInterior(vehicleid, interiorid)
  1765. {
  1766.     if(!LinkVehicleToInterior(vehicleid, interiorid)) return 0;
  1767.     ACVehInfo[vehicleid][acInt] = interiorid % 256;
  1768.     return 1;
  1769. }
  1770.  
  1771. ac_fpublic ac_ChangeVehiclePaintjob(vehicleid, paintjobid)
  1772. {
  1773.     ACVehInfo[vehicleid][acPaintJob] = paintjobid;
  1774.     return ChangeVehiclePaintjob(vehicleid, paintjobid);
  1775. }
  1776.  
  1777. ac_fpublic ac_SetVehicleHealth(vehicleid, Float:ac_health)
  1778. {
  1779.     if(!SetVehicleHealth(vehicleid, ac_health)) return 0;
  1780.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1781.     if(ac_driver != INVALID_PLAYER_ID)
  1782.     {
  1783.         ACInfo[ac_driver][acNOPCount][4] = 0;
  1784.         ACInfo[ac_driver][acSetVehHealth] = ac_health;
  1785.         ACInfo[ac_driver][acGtc][3] = GetTickCount() + 2650;
  1786.         #if defined FreezeSyncPacket
  1787.             if(!ACInfo[ac_driver][acUnFrozen]) FreezeSyncPacket(ac_driver, E_ALL_SYNC, false);
  1788.         #endif
  1789.     }
  1790.     else ACVehInfo[vehicleid][acHealth] = ac_health;
  1791.     return 1;
  1792. }
  1793.  
  1794. ac_fpublic ac_RepairVehicle(vehicleid)
  1795. {
  1796.     if(!RepairVehicle(vehicleid)) return 0;
  1797.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1798.     if(ac_driver != INVALID_PLAYER_ID)
  1799.     {
  1800.         ACInfo[ac_driver][acNOPCount][4] = 0;
  1801.         ACInfo[ac_driver][acSetVehHealth] = 1000.0;
  1802.         ACInfo[ac_driver][acGtc][3] = GetTickCount() + 2650;
  1803.         #if defined FreezeSyncPacket
  1804.             if(!ACInfo[ac_driver][acUnFrozen]) FreezeSyncPacket(ac_driver, E_ALL_SYNC, false);
  1805.         #endif
  1806.     }
  1807.     else ACVehInfo[vehicleid][acHealth] = 1000.0;
  1808.     ACVehInfo[vehicleid][acPanels] =
  1809.     ACVehInfo[vehicleid][acDoors] =
  1810.     ACVehInfo[vehicleid][acLights] =
  1811.     ACVehInfo[vehicleid][acTires] = 0;
  1812.     return 1;
  1813. }
  1814.  
  1815. ac_fpublic ac_UpdateVehicleDamageStatus(vehicleid, ac_panels, ac_doors, ac_lights, ac_tires)
  1816. {
  1817.     if(!UpdateVehicleDamageStatus(vehicleid, ac_panels, ac_doors, ac_lights, ac_tires)) return 0;
  1818.     ACVehInfo[vehicleid][acPanels] = ac_panels;
  1819.     ACVehInfo[vehicleid][acDoors] = ac_doors;
  1820.     ACVehInfo[vehicleid][acLights] = ac_lights;
  1821.     ACVehInfo[vehicleid][acTires] = ac_tires;
  1822.     return 1;
  1823. }
  1824.  
  1825. ac_fpublic ac_SetVehicleParamsEx(vehicleid, ac_engine, ac_lights, ac_alarm, ac_doors, ac_bonnet, ac_boot, ac_objective)
  1826. {
  1827.     if(!SetVehicleParamsEx(vehicleid, ac_engine, ac_lights, ac_alarm, ac_doors, ac_bonnet, ac_boot, ac_objective)) return 0;
  1828.     #if defined foreach
  1829.         foreach(new ac_i : Player) ACVehInfo[vehicleid][acLocked][ac_i] = ac_doors;
  1830.     #else
  1831.         #if defined GetPlayerPoolSize
  1832.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1833.         #else
  1834.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1835.         #endif
  1836.         {
  1837.             if(IsVehicleStreamedIn(vehicleid, ac_i)) ACVehInfo[vehicleid][acLocked][ac_i] = ac_doors;
  1838.         }
  1839.     #endif
  1840.     return 1;
  1841. }
  1842.  
  1843. ac_fpublic ac_SetVehicleParamsForPlayer(vehicleid, playerid, ac_objective, ac_doorslocked)
  1844. {
  1845.     if(!SetVehicleParamsForPlayer(vehicleid, playerid, ac_objective, ac_doorslocked)) return 0;
  1846.     ACVehInfo[vehicleid][acLocked][playerid] = ac_doorslocked;
  1847.     return 1;
  1848. }
  1849.  
  1850. ac_fpublic ac_SetVehicleToRespawn(vehicleid)
  1851. {
  1852.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1853.     if(ac_driver != INVALID_PLAYER_ID)
  1854.     {
  1855.         ACInfo[ac_driver][acGtc][8] = GetTickCount() + 1650;
  1856.         ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  1857.     }
  1858.     ACVehInfo[vehicleid][acPaintJob] = 3;
  1859.     ACVehInfo[vehicleid][acHealth] = 1000.0;
  1860.     ACVehInfo[vehicleid][acSpawned] = true;
  1861.     ACVehInfo[vehicleid][acTrSpeed] = -1;
  1862.     ACVehInfo[vehicleid][acPosDiff] =
  1863.     ACVehInfo[vehicleid][acVelX] =
  1864.     ACVehInfo[vehicleid][acVelY] =
  1865.     ACVehInfo[vehicleid][acVelZ] = 0.0;
  1866.     ACVehInfo[vehicleid][acSpeed] =
  1867.     ACVehInfo[vehicleid][acTires] =
  1868.     ACVehInfo[vehicleid][acLights] =
  1869.     ACVehInfo[vehicleid][acDoors] =
  1870.     ACVehInfo[vehicleid][acPanels] =
  1871.     ACVehInfo[vehicleid][acLastSpeed] =
  1872.     ACVehInfo[vehicleid][acSpeedDiff] = 0;
  1873.     ACVehInfo[vehicleid][acPosX] = ACVehInfo[vehicleid][acSpawnPosX];
  1874.     ACVehInfo[vehicleid][acPosY] = ACVehInfo[vehicleid][acSpawnPosY];
  1875.     ACVehInfo[vehicleid][acPosZ] = ACVehInfo[vehicleid][acSpawnPosZ];
  1876.     ACVehInfo[vehicleid][acZAngle] = ACVehInfo[vehicleid][acSpawnZAngle];
  1877.     return SetVehicleToRespawn(vehicleid);
  1878. }
  1879.  
  1880. ac_fpublic ac_SetVehicleZAngle(vehicleid, Float:z_angle)
  1881. {
  1882.     if(!SetVehicleZAngle(vehicleid, z_angle)) return 0;
  1883.     new ac_driver = ACVehInfo[vehicleid][acDriver];
  1884.     if(ac_driver != INVALID_PLAYER_ID) ACInfo[ac_driver][acGtc][20] = GetTickCount() + 1650;
  1885.     return 1;
  1886. }
  1887.  
  1888. ac_fpublic ac_EnableAntiCheat(code, enable)
  1889. {
  1890.     if(!(0 <= code < sizeof ac_ACAllow)) return 0;
  1891.     if(code == 42)
  1892.     {
  1893.         if(enable)
  1894.         {
  1895.             if(!ac_ACAllow[code])
  1896.             {
  1897.                 #if !AC_USE_QUERY
  1898.                     #if defined GetConsoleVarAsBool
  1899.                         ac_QueryEnable = (GetConsoleVarAsBool("query") != 0);
  1900.                     #else
  1901.                         ac_QueryEnable = (GetServerVarAsBool("query") != 0);
  1902.                     #endif
  1903.                 #endif
  1904.                 #if defined GetConsoleVarAsBool
  1905.                     ac_RconEnable = (GetConsoleVarAsBool("rcon") != 0);
  1906.                 #else
  1907.                     ac_RconEnable = (GetServerVarAsBool("rcon") != 0);
  1908.                 #endif
  1909.             }
  1910.             #if !AC_USE_QUERY
  1911.                 SendRconCommand("query 0");
  1912.             #endif
  1913.             SendRconCommand("rcon 0");
  1914.         }
  1915.         else
  1916.         {
  1917.             static ac_strtmp[9];
  1918.             #if !AC_USE_QUERY
  1919.                 format(ac_strtmp, sizeof ac_strtmp, "query %b", ac_QueryEnable);
  1920.                 SendRconCommand(ac_strtmp);
  1921.             #endif
  1922.             format(ac_strtmp, sizeof ac_strtmp, "rcon %b", ac_RconEnable);
  1923.             SendRconCommand(ac_strtmp);
  1924.         }
  1925.     }
  1926.     ac_ACAllow[code] = (enable != 0);
  1927.     if(enable)
  1928.     {
  1929.         #if defined foreach
  1930.             foreach(new ac_i : Player)
  1931.             {
  1932.         #else
  1933.             #if defined GetPlayerPoolSize
  1934.                 for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1935.             #else
  1936.                 for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1937.             #endif
  1938.             {
  1939.                 if(!IsPlayerConnected(ac_i)) continue;
  1940.         #endif
  1941.             ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code];
  1942.             switch(code)
  1943.             {
  1944.                 case 7: ACInfo[ac_i][acCheatCount][26] = ACInfo[ac_i][acCheatCount][13] = 0;
  1945.                 case 9: ACInfo[ac_i][acCheatCount][15] = 0;
  1946.                 case 10: ACInfo[ac_i][acCheatCount][18] = ACInfo[ac_i][acCheatCount][14] = 0;
  1947.                 #if AC_USE_AMMUNATIONS
  1948.                     case 15: ACInfo[ac_i][acCheatCount][20] = 0;
  1949.                 #endif
  1950.                 case 17: ACInfo[ac_i][acCheatCount][7] = 0;
  1951.                 case 19: ACInfo[ac_i][acCheatCount][9] = 0;
  1952.                 case 20: ACInfo[ac_i][acCheatCount][10] = 0;
  1953.                 #if AC_USE_TUNING_GARAGES
  1954.                     case 23: ACInfo[ac_i][acCheatCount][21] = 0;
  1955.                 #endif
  1956.                 case 26: ACInfo[ac_i][acCheatCount][12] = ACInfo[ac_i][acCheatCount][8] = 0;
  1957.                 case 29: ACInfo[ac_i][acCheatCount][11] = ACInfo[ac_i][acCheatCount][6] = 0;
  1958.                 case 30: ACInfo[ac_i][acCheatCount][17] = 0;
  1959.                 case 34: ACInfo[ac_i][acCheatCount][5] = 0;
  1960.                 case 38: ACInfo[ac_i][acCheatCount][0] = 0;
  1961.                 case 47: ACInfo[ac_i][acCheatCount][16] = 0;
  1962.                 case 51: ACInfo[ac_i][acCheatCount][25] = 0;
  1963.             }
  1964.         }
  1965.     }
  1966.     else
  1967.     {
  1968.         #if defined foreach
  1969.             foreach(new ac_i : Player)
  1970.             {
  1971.         #else
  1972.             #if defined GetPlayerPoolSize
  1973.                 for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1974.             #else
  1975.                 for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  1976.             #endif
  1977.             {
  1978.                 if(!IsPlayerConnected(ac_i)) continue;
  1979.         #endif
  1980.             ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code];
  1981.         }
  1982.     }
  1983.     #if AC_USE_CONFIG_FILES && AUTOSAVE_SETTINGS_IN_CONFIG
  1984.         static ac_strtmp[10];
  1985.         new ac_string[430], File:ac_cfgFile = fopen(AC_CONFIG_FILE, io_write);
  1986.         if(ac_cfgFile)
  1987.         {
  1988.             for(new ac_i; ac_i < sizeof ac_ACAllow; ++ac_i)
  1989.             {
  1990.                 format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_ACAllow[ac_i], ac_i);
  1991.                 strcat(ac_string, ac_strtmp);
  1992.             }
  1993.             fwrite(ac_cfgFile, ac_string);
  1994.             fclose(ac_cfgFile);
  1995.         }
  1996.     #endif
  1997.     return 1;
  1998. }
  1999.  
  2000. ac_fpublic ac_EnableAntiNOP(nopcode, enable)
  2001. {
  2002.     if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0;
  2003.     ac_NOPAllow[nopcode] = (enable != 0);
  2004.     #if defined foreach
  2005.         foreach(new ac_i : Player)
  2006.         {
  2007.     #else
  2008.         #if defined GetPlayerPoolSize
  2009.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  2010.         #else
  2011.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  2012.         #endif
  2013.         {
  2014.             if(!IsPlayerConnected(ac_i)) continue;
  2015.     #endif
  2016.         ACInfo[ac_i][acNOPAllow][nopcode] = ac_NOPAllow[nopcode];
  2017.     }
  2018.     #if AC_USE_CONFIG_FILES && AUTOSAVE_SETTINGS_IN_CONFIG
  2019.         static ac_strtmp[10];
  2020.         new ac_string[87], File:ac_cfgFile = fopen(AC_NOP_CONFIG_FILE, io_write);
  2021.         if(ac_cfgFile)
  2022.         {
  2023.             for(new ac_i; ac_i < sizeof ac_NOPAllow; ++ac_i)
  2024.             {
  2025.                 format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_NOPAllow[ac_i], ac_i);
  2026.                 strcat(ac_string, ac_strtmp);
  2027.             }
  2028.             fwrite(ac_cfgFile, ac_string);
  2029.             fclose(ac_cfgFile);
  2030.         }
  2031.     #endif
  2032.     #undef AUTOSAVE_SETTINGS_IN_CONFIG
  2033.     return 1;
  2034. }
  2035.  
  2036. ac_fpublic ac_EnableAntiCheatForPlayer(playerid, code, enable)
  2037. {
  2038.     if(!(0 <= code < sizeof ac_ACAllow)) return -1;
  2039.     ACInfo[playerid][acACAllow][code] = (enable != 0);
  2040.     if(enable)
  2041.     {
  2042.         switch(code)
  2043.         {
  2044.             case 7: ACInfo[playerid][acCheatCount][26] = ACInfo[playerid][acCheatCount][13] = 0;
  2045.             case 9: ACInfo[playerid][acCheatCount][15] = 0;
  2046.             case 10: ACInfo[playerid][acCheatCount][18] = ACInfo[playerid][acCheatCount][14] = 0;
  2047.             #if AC_USE_AMMUNATIONS
  2048.                 case 15: ACInfo[playerid][acCheatCount][20] = 0;
  2049.             #endif
  2050.             case 17: ACInfo[playerid][acCheatCount][7] = 0;
  2051.             case 19: ACInfo[playerid][acCheatCount][9] = 0;
  2052.             case 20: ACInfo[playerid][acCheatCount][10] = 0;
  2053.             #if AC_USE_TUNING_GARAGES
  2054.                 case 23: ACInfo[playerid][acCheatCount][21] = 0;
  2055.             #endif
  2056.             case 26: ACInfo[playerid][acCheatCount][12] = ACInfo[playerid][acCheatCount][8] = 0;
  2057.             case 29: ACInfo[playerid][acCheatCount][11] = ACInfo[playerid][acCheatCount][6] = 0;
  2058.             case 30: ACInfo[playerid][acCheatCount][17] = 0;
  2059.             case 34: ACInfo[playerid][acCheatCount][5] = 0;
  2060.             case 38: ACInfo[playerid][acCheatCount][0] = 0;
  2061.             case 47: ACInfo[playerid][acCheatCount][16] = 0;
  2062.             case 51: ACInfo[playerid][acCheatCount][25] = 0;
  2063.         }
  2064.     }
  2065.     return 1;
  2066. }
  2067.  
  2068. ac_fpublic ac_EnableAntiNOPForPlayer(playerid, nopcode, enable)
  2069. {
  2070.     if(!(0 <= nopcode < sizeof ac_NOPAllow)) return -1;
  2071.     ACInfo[playerid][acNOPAllow][nopcode] = (enable != 0);
  2072.     return 1;
  2073. }
  2074.  
  2075. ac_fpublic ac_IsAntiCheatEnabled(code)
  2076. {
  2077.     if(!(0 <= code < sizeof ac_ACAllow)) return 0;
  2078.     return ac_ACAllow[code];
  2079. }
  2080.  
  2081. ac_fpublic ac_IsAntiNOPEnabled(nopcode)
  2082. {
  2083.     if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0;
  2084.     return ac_NOPAllow[nopcode];
  2085. }
  2086.  
  2087. ac_fpublic ac_IsAntiCheatEnabledForPlayer(playerid, code)
  2088. {
  2089.     if(!(0 <= code < sizeof ac_ACAllow)) return 0;
  2090.     return ACInfo[playerid][acACAllow][code];
  2091. }
  2092.  
  2093. ac_fpublic ac_IsAntiNOPEnabledForPlayer(playerid, nopcode)
  2094. {
  2095.     if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0;
  2096.     return ACInfo[playerid][acNOPAllow][nopcode];
  2097. }
  2098.  
  2099. ac_fpublic ac_AntiCheatGetSpeed(playerid) return ACInfo[playerid][acSpeed];
  2100.  
  2101. ac_fpublic ac_AntiCheatGetAnimationIndex(playerid) return ACInfo[playerid][acAnim];
  2102.  
  2103. ac_fpublic ac_AntiCheatGetDialog(playerid) return ACInfo[playerid][acDialog];
  2104.  
  2105. ac_fpublic ac_AntiCheatGetInterior(playerid) return ACInfo[playerid][acInt];
  2106.  
  2107. ac_fpublic ac_AntiCheatGetEnterVehicle(playerid) return ACInfo[playerid][acEnterVeh];
  2108.  
  2109. ac_fpublic ac_AntiCheatGetEnterVehicleSeat(playerid) return ACInfo[playerid][acEnterSeat];
  2110.  
  2111. ac_fpublic ac_AntiCheatGetVehicleID(playerid) return ACInfo[playerid][acVeh];
  2112.  
  2113. ac_fpublic ac_AntiCheatGetVehicleSeat(playerid) return ACInfo[playerid][acSeat];
  2114.  
  2115. ac_fpublic ac_AntiCheatGetWeapon(playerid) return ACInfo[playerid][acHoldWeapon];
  2116.  
  2117. ac_fpublic ac_AntiCheatGetWeaponInSlot(playerid, slot) return ACInfo[playerid][acWeapon][slot];
  2118.  
  2119. ac_fpublic ac_AntiCheatGetAmmoInSlot(playerid, slot) return ACInfo[playerid][acAmmo][slot];
  2120.  
  2121. ac_fpublic ac_AntiCheatGetSpecialAction(playerid) return ACInfo[playerid][acSpecAct];
  2122.  
  2123. ac_fpublic ac_AntiCheatGetLastSpecialActio(playerid) return ACInfo[playerid][acLastSpecAct];
  2124.  
  2125. ac_fpublic ac_AntiCheatGetLastShotWeapon(playerid) return ACInfo[playerid][acShotWeapon];
  2126.  
  2127. ac_fpublic ac_AntiCheatGetLastPickup(playerid) return ACInfo[playerid][acLastPickup];
  2128.  
  2129. ac_fpublic ac_AntiCheatGetLastUpdateTime(playerid) return ACInfo[playerid][acUpdateTick];
  2130.  
  2131. ac_fpublic ac_AntiCheatGetLastReloadTime(playerid) return ACInfo[playerid][acReloadTick];
  2132.  
  2133. ac_fpublic ac_AntiCheatGetLastEnteredVehTi(playerid) return ACInfo[playerid][acEnterVehTick];
  2134.  
  2135. ac_fpublic ac_AntiCheatGetLastShotTime(playerid) return ACInfo[playerid][acShotTick];
  2136.  
  2137. ac_fpublic ac_AntiCheatGetLastSpawnTime(playerid) return ACInfo[playerid][acSpawnTick];
  2138.  
  2139. ac_fpublic ac_AntiCheatIntEnterExitsIsEnab(playerid) return ACInfo[playerid][acIntEnterExits];
  2140.  
  2141. ac_fpublic ac_AntiCheatStuntBonusIsEnabled(playerid) return ACInfo[playerid][acStuntBonus];
  2142.  
  2143. ac_fpublic ac_AntiCheatIsInModShop(playerid) return ACInfo[playerid][acModShop];
  2144.  
  2145. ac_fpublic ac_AntiCheatIsInSpectate(playerid) return ACInfo[playerid][acSpec];
  2146.  
  2147. ac_fpublic ac_AntiCheatIsFrozen(playerid) return !ACInfo[playerid][acUnFrozen];
  2148.  
  2149. ac_fpublic ac_AntiCheatIsDead(playerid) return ACInfo[playerid][acDead];
  2150.  
  2151. ac_fpublic ac_AntiCheatIsConnected(playerid) return ACInfo[playerid][acOnline];
  2152.  
  2153. ac_fpublic ac_AntiCheatKickWithDesync(playerid, code)
  2154. {
  2155.     if(ACInfo[playerid][acKicked] > 0) return -1;
  2156.     new ac_gpp = GetPlayerPing(playerid) + 150;
  2157.     ACInfo[playerid][acKickTimerID] = SetTimerEx("ac_KickTimer", (ac_gpp > AC_MAX_PING ? AC_MAX_PING : ac_gpp), false, "i", playerid);
  2158.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  2159.     {
  2160.         if(code == 4) ACInfo[playerid][acKickVeh] = GetPlayerVehicleID(playerid);
  2161.         ACInfo[playerid][acKicked] = 2;
  2162.     }
  2163.     else ACInfo[playerid][acKicked] = 1;
  2164.     return 1;
  2165. }
  2166.  
  2167. ac_fpublic ac_AntiCheatIsKickedWithDesync(playerid) return ACInfo[playerid][acKicked];
  2168.  
  2169. ac_fpublic ac_AntiCheatGetVehicleDriver(vehicleid) return ACVehInfo[vehicleid][acDriver];
  2170.  
  2171. ac_fpublic ac_AntiCheatGetVehicleInterior(vehicleid) return ACVehInfo[vehicleid][acInt];
  2172.  
  2173. ac_fpublic ac_AntiCheatGetVehiclePaintjob(vehicleid) return ACVehInfo[vehicleid][acPaintJob];
  2174.  
  2175. ac_fpublic ac_AntiCheatGetVehicleSpeed(vehicleid) return ACVehInfo[vehicleid][acSpeed];
  2176.  
  2177. ac_fpublic ac_AntiCheatIsVehicleSpawned(vehicleid) return ACVehInfo[vehicleid][acSpawned];
  2178.  
  2179. ac_fpublic ac_AntiCheatGetNextDialog(playerid) return ACInfo[playerid][acNextDialog];
  2180.  
  2181. #endif
  2182.  
  2183. stock acc_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
  2184. {
  2185.     new ac_vehid = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
  2186.     if(ac_vehid != INVALID_VEHICLE_ID)
  2187.     {
  2188.         #if defined FILTERSCRIPT
  2189.             CallRemoteFunction("ac_AddStaticVehicle", "iffff", ac_vehid, spawn_x, spawn_y, spawn_z, z_angle);
  2190.         #else
  2191.             ac_AddStaticVehicle(ac_vehid, spawn_x, spawn_y, spawn_z, z_angle);
  2192.         #endif
  2193.     }
  2194.     return ac_vehid;
  2195. }
  2196.  
  2197. #if defined _ALS_AddStaticVehicle
  2198.     #undef AddStaticVehicle
  2199. #else
  2200.     #define _ALS_AddStaticVehicle
  2201. #endif
  2202. #define AddStaticVehicle acc_AddStaticVehicle
  2203.  
  2204. #if defined OnVehicleSirenStateChange
  2205.     stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren = 0)
  2206.     {
  2207.         new ac_vehid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren);
  2208. #else
  2209.     stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay)
  2210.     {
  2211.         new ac_vehid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay);
  2212. #endif
  2213.     if(ac_vehid != INVALID_VEHICLE_ID)
  2214.     {
  2215.         #if defined FILTERSCRIPT
  2216.             CallRemoteFunction("ac_AddStaticVehicle", "iffff", ac_vehid, spawn_x, spawn_y, spawn_z, z_angle);
  2217.         #else
  2218.             ac_AddStaticVehicle(ac_vehid, spawn_x, spawn_y, spawn_z, z_angle);
  2219.         #endif
  2220.     }
  2221.     return ac_vehid;
  2222. }
  2223.  
  2224. #if defined _ALS_AddStaticVehicleEx
  2225.     #undef AddStaticVehicleEx
  2226. #else
  2227.     #define _ALS_AddStaticVehicleEx
  2228. #endif
  2229. #define AddStaticVehicleEx acc_AddStaticVehicleEx
  2230.  
  2231. #if defined OnVehicleSirenStateChange
  2232.     stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren = 0)
  2233.     {
  2234.         new ac_vehid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay, addsiren);
  2235. #else
  2236.     stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay)
  2237.     {
  2238.         new ac_vehid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay);
  2239. #endif
  2240.     if(ac_vehid != INVALID_VEHICLE_ID && ac_vehid > 0)
  2241.     {
  2242.         #if defined FILTERSCRIPT
  2243.             CallRemoteFunction("ac_AddStaticVehicle", "iffff", ac_vehid, x, y, z, rotation);
  2244.         #else
  2245.             ac_AddStaticVehicle(ac_vehid, x, y, z, rotation);
  2246.         #endif
  2247.     }
  2248.     return ac_vehid;
  2249. }
  2250.  
  2251. #if defined _ALS_CreateVehicle
  2252.     #undef CreateVehicle
  2253. #else
  2254.     #define _ALS_CreateVehicle
  2255. #endif
  2256. #define CreateVehicle acc_CreateVehicle
  2257.  
  2258. 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)
  2259. {
  2260.     new ac_class = AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2261.     #if defined FILTERSCRIPT
  2262.         CallRemoteFunction("ac_AddPlayerClass", "ifffiiiiii", ac_class, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2263.     #else
  2264.         ac_AddPlayerClass(ac_class, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2265.     #endif
  2266.     return ac_class;
  2267. }
  2268.  
  2269. #if defined _ALS_AddPlayerClass
  2270.     #undef AddPlayerClass
  2271. #else
  2272.     #define _ALS_AddPlayerClass
  2273. #endif
  2274. #define AddPlayerClass acc_AddPlayerClass
  2275.  
  2276. 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)
  2277. {
  2278.     new ac_class = AddPlayerClassEx(teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2279.     #if defined FILTERSCRIPT
  2280.         CallRemoteFunction("ac_AddPlayerClass", "ifffiiiiii", ac_class, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2281.     #else
  2282.         ac_AddPlayerClass(ac_class, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2283.     #endif
  2284.     return ac_class;
  2285. }
  2286.  
  2287. #if defined _ALS_AddPlayerClassEx
  2288.     #undef AddPlayerClassEx
  2289. #else
  2290.     #define _ALS_AddPlayerClassEx
  2291. #endif
  2292. #define AddPlayerClassEx acc_AddPlayerClassEx
  2293.  
  2294. stock orig_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  2295.     return SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2296.  
  2297. stock acc_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  2298. {
  2299.     #if defined FILTERSCRIPT
  2300.         return CallRemoteFunction("ac_SetSpawnInfo", "iiiffffiiiiii", playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2301.     #else
  2302.         return ac_SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  2303.     #endif
  2304. }
  2305.  
  2306. #if defined _ALS_SetSpawnInfo
  2307.     #undef SetSpawnInfo
  2308. #else
  2309.     #define _ALS_SetSpawnInfo
  2310. #endif
  2311. #define SetSpawnInfo acc_SetSpawnInfo
  2312.  
  2313. stock acc_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)
  2314. {
  2315.     new ac_pickid = CreatePickup(model, type, X, Y, Z, virtualworld);
  2316.     if(ac_pickid != -1)
  2317.     {
  2318.         #if defined FILTERSCRIPT
  2319.             return CallRemoteFunction("ac_CreatePickup", "iiifff", ac_pickid, model, type, X, Y, Z);
  2320.         #else
  2321.             return ac_CreatePickup(ac_pickid, model, type, X, Y, Z);
  2322.         #endif
  2323.     }
  2324.     return 0;
  2325. }
  2326.  
  2327. #if defined _ALS_AddStaticPickup
  2328.     #undef AddStaticPickup
  2329. #else
  2330.     #define _ALS_AddStaticPickup
  2331. #endif
  2332. #define AddStaticPickup acc_AddStaticPickup
  2333.  
  2334. stock acc_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)
  2335. {
  2336.     new ac_pickid = CreatePickup(model, type, X, Y, Z, virtualworld);
  2337.     if(ac_pickid != -1)
  2338.     {
  2339.         #if defined FILTERSCRIPT
  2340.             CallRemoteFunction("ac_CreatePickup", "iiifff", ac_pickid, model, type, X, Y, Z);
  2341.         #else
  2342.             ac_CreatePickup(ac_pickid, model, type, X, Y, Z);
  2343.         #endif
  2344.     }
  2345.     return ac_pickid;
  2346. }
  2347.  
  2348. #if defined _ALS_CreatePickup
  2349.     #undef CreatePickup
  2350. #else
  2351.     #define _ALS_CreatePickup
  2352. #endif
  2353. #define CreatePickup acc_CreatePickup
  2354.  
  2355. #if defined CreateDynamicPickup
  2356.     #if defined STREAMER_ENABLE_TAGS
  2357.         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)
  2358.         {
  2359.             new STREAMER_TAG_PICKUP:ac_pickid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
  2360.     #else
  2361.         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)
  2362.         {
  2363.             new ac_pickid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
  2364.     #endif
  2365.         if(_:ac_pickid > 0)
  2366.         {
  2367.             #if defined FILTERSCRIPT
  2368.                 CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickid, modelid, type);
  2369.             #else
  2370.                 #if AC_USE_PICKUP_WEAPONS\
  2371.                     && defined Streamer_SetIntData
  2372.                     ac_CreateDynamicPickup(ac_pickid, modelid, type);
  2373.                 #endif
  2374.             #endif
  2375.         }
  2376.         return ac_pickid;
  2377.     }
  2378.  
  2379.     #if defined _ALS_CreateDynamicPickup
  2380.         #undef CreateDynamicPickup
  2381.     #else
  2382.         #define _ALS_CreateDynamicPickup
  2383.     #endif
  2384.     #define CreateDynamicPickup acc_CreateDynamicPickup
  2385. #endif
  2386.  
  2387. #if defined CreateDynamicPickupEx
  2388.     #if defined STREAMER_ENABLE_TAGS
  2389.         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)
  2390.         {
  2391.             new STREAMER_TAG_PICKUP:ac_pickid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
  2392.     #else
  2393.         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)
  2394.         {
  2395.             new ac_pickid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
  2396.     #endif
  2397.         if(_:ac_pickid > 0)
  2398.         {
  2399.             #if defined FILTERSCRIPT
  2400.                 CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickid, modelid, type);
  2401.             #else
  2402.                 #if AC_USE_PICKUP_WEAPONS\
  2403.                     && defined Streamer_SetIntData
  2404.                     ac_CreateDynamicPickup(ac_pickid, modelid, type);
  2405.                 #endif
  2406.             #endif
  2407.         }
  2408.         return ac_pickid;
  2409.     }
  2410.  
  2411.     #if defined _ALS_CreateDynamicPickupEx
  2412.         #undef CreateDynamicPickupEx
  2413.     #else
  2414.         #define _ALS_CreateDynamicPickupEx
  2415.     #endif
  2416.     #define CreateDynamicPickupEx acc_CreateDynamicPickupEx
  2417. #endif
  2418.  
  2419. stock acc_DestroyVehicle(vehicleid)
  2420. {
  2421.     #if defined FILTERSCRIPT
  2422.         return CallRemoteFunction("ac_DestroyVehicle", "i", vehicleid);
  2423.     #else
  2424.         return ac_DestroyVehicle(vehicleid);
  2425.     #endif
  2426. }
  2427.  
  2428. #if defined _ALS_DestroyVehicle
  2429.     #undef DestroyVehicle
  2430. #else
  2431.     #define _ALS_DestroyVehicle
  2432. #endif
  2433. #define DestroyVehicle acc_DestroyVehicle
  2434.  
  2435. stock acc_DestroyPickup(pickup)
  2436. {
  2437.     #if defined FILTERSCRIPT
  2438.         return CallRemoteFunction("ac_DestroyPickup", "i", pickup);
  2439.     #else
  2440.         return ac_DestroyPickup(pickup);
  2441.     #endif
  2442. }
  2443.  
  2444. #if defined _ALS_DestroyPickup
  2445.     #undef DestroyPickup
  2446. #else
  2447.     #define _ALS_DestroyPickup
  2448. #endif
  2449. #define DestroyPickup acc_DestroyPickup
  2450.  
  2451. #if defined DestroyDynamicPickup
  2452.     #if defined STREAMER_ENABLE_TAGS
  2453.         stock acc_DestroyDynamicPickup(STREAMER_TAG_PICKUP:pickupid)
  2454.     #else
  2455.         stock acc_DestroyDynamicPickup(pickupid)
  2456.     #endif
  2457.     {
  2458.         #if defined FILTERSCRIPT
  2459.             return CallRemoteFunction("ac_DestroyDynamicPickup", "i", pickupid);
  2460.         #else
  2461.             return ac_DestroyDynamicPickup(pickupid);
  2462.         #endif
  2463.     }
  2464.  
  2465.     #if defined _ALS_DestroyDynamicPickup
  2466.         #undef DestroyDynamicPickup
  2467.     #else
  2468.         #define _ALS_DestroyDynamicPickup
  2469.     #endif
  2470.     #define DestroyDynamicPickup acc_DestroyDynamicPickup
  2471. #endif
  2472.  
  2473. stock acc_DisableInteriorEnterExits()
  2474. {
  2475.     #if defined FILTERSCRIPT
  2476.         return CallRemoteFunction("ac_DisableInteriorEnterExits", "");
  2477.     #else
  2478.         return ac_DisableInteriorEnterExits();
  2479.     #endif
  2480. }
  2481.  
  2482. #if defined _ALS_DisableInteriorEnterExits
  2483.     #undef DisableInteriorEnterExits
  2484. #else
  2485.     #define _ALS_DisableInteriorEnterExits
  2486. #endif
  2487. #define DisableInteriorEnterExits acc_DisableInteriorEnterExits
  2488.  
  2489. stock acc_UsePlayerPedAnims()
  2490. {
  2491.     #if defined FILTERSCRIPT
  2492.         return CallRemoteFunction("ac_UsePlayerPedAnims", "");
  2493.     #else
  2494.         return ac_UsePlayerPedAnims();
  2495.     #endif
  2496. }
  2497.  
  2498. #if defined _ALS_UsePlayerPedAnims
  2499.     #undef UsePlayerPedAnims
  2500. #else
  2501.     #define _ALS_UsePlayerPedAnims
  2502. #endif
  2503. #define UsePlayerPedAnims acc_UsePlayerPedAnims
  2504.  
  2505. #if defined EnableVehicleFriendlyFire
  2506.     stock acc_EnableVehicleFriendlyFire()
  2507.     {
  2508.         #if defined FILTERSCRIPT
  2509.             return CallRemoteFunction("ac_EnableVehicleFriendlyFire", "");
  2510.         #else
  2511.             return ac_EnableVehicleFriendlyFire();
  2512.         #endif
  2513.     }
  2514.  
  2515.     #if defined _ALS_EnableVehicleFriendlyFire
  2516.         #undef EnableVehicleFriendlyFire
  2517.     #else
  2518.         #define _ALS_EnableVehicleFriendlyFire
  2519.     #endif
  2520.     #define EnableVehicleFriendlyFire acc_EnableVehicleFriendlyFire
  2521. #endif
  2522.  
  2523. stock acc_EnableStuntBonusForAll(enable)
  2524. {
  2525.     #if defined FILTERSCRIPT
  2526.         return CallRemoteFunction("ac_EnableStuntBonusForAll", "i", enable);
  2527.     #else
  2528.         return ac_EnableStuntBonusForAll(enable);
  2529.     #endif
  2530. }
  2531.  
  2532. #if defined _ALS_EnableStuntBonusForAll
  2533.     #undef EnableStuntBonusForAll
  2534. #else
  2535.     #define _ALS_EnableStuntBonusForAll
  2536. #endif
  2537. #define EnableStuntBonusForAll acc_EnableStuntBonusForAll
  2538.  
  2539. stock acc_EnableStuntBonusForPlayer(playerid, enable)
  2540. {
  2541.     #if defined FILTERSCRIPT
  2542.         return CallRemoteFunction("ac_EnableStuntBonusForPlayer", "ii", playerid, enable);
  2543.     #else
  2544.         return ac_EnableStuntBonusForPlayer(playerid, enable);
  2545.     #endif
  2546. }
  2547.  
  2548. #if defined _ALS_EnableStuntBonusForPlayer
  2549.     #undef EnableStuntBonusForPlayer
  2550. #else
  2551.     #define _ALS_EnableStuntBonusForPlayer
  2552. #endif
  2553. #define EnableStuntBonusForPlayer acc_EnableStuntBonusForPlayer
  2554.  
  2555. stock orig_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]) return ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);
  2556.  
  2557. stock acc_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
  2558. {
  2559.     if(ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2))
  2560.     {
  2561.         #if defined FILTERSCRIPT
  2562.             return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
  2563.         #else
  2564.             return ac_ShowPlayerDialog(playerid, dialogid);
  2565.         #endif
  2566.     }
  2567.     return 0;
  2568. }
  2569.  
  2570. #if defined _ALS_ShowPlayerDialog
  2571.     #undef ShowPlayerDialog
  2572. #else
  2573.     #define _ALS_ShowPlayerDialog
  2574. #endif
  2575. #define ShowPlayerDialog acc_ShowPlayerDialog
  2576.  
  2577. stock orig_TogglePlayerControllable(playerid, toggle) return TogglePlayerControllable(playerid, toggle);
  2578.  
  2579. stock acc_TogglePlayerControllable(playerid, toggle)
  2580. {
  2581.     #if defined FILTERSCRIPT
  2582.         return CallRemoteFunction("ac_TogglePlayerControllable", "ii", playerid, toggle);
  2583.     #else
  2584.         return ac_TogglePlayerControllable(playerid, toggle);
  2585.     #endif
  2586. }
  2587.  
  2588. #if defined _ALS_TogglePlayerControllable
  2589.     #undef TogglePlayerControllable
  2590. #else
  2591.     #define _ALS_TogglePlayerControllable
  2592. #endif
  2593. #define TogglePlayerControllable acc_TogglePlayerControllable
  2594.  
  2595. stock orig_TogglePlayerSpectating(playerid, toggle) return TogglePlayerSpectating(playerid, toggle);
  2596.  
  2597. stock acc_TogglePlayerSpectating(playerid, toggle)
  2598. {
  2599.     #if defined FILTERSCRIPT
  2600.         return CallRemoteFunction("ac_TogglePlayerSpectating", "ii", playerid, toggle);
  2601.     #else
  2602.         return ac_TogglePlayerSpectating(playerid, toggle);
  2603.     #endif
  2604. }
  2605.  
  2606. #if defined _ALS_TogglePlayerSpectating
  2607.     #undef TogglePlayerSpectating
  2608. #else
  2609.     #define _ALS_TogglePlayerSpectating
  2610. #endif
  2611. #define TogglePlayerSpectating acc_TogglePlayerSpectating
  2612.  
  2613. stock orig_SpawnPlayer(playerid) return SpawnPlayer(playerid);
  2614.  
  2615. stock acc_SpawnPlayer(playerid)
  2616. {
  2617.     #if defined FILTERSCRIPT
  2618.         return CallRemoteFunction("ac_SpawnPlayer", "i", playerid);
  2619.     #else
  2620.         return ac_SpawnPlayer(playerid);
  2621.     #endif
  2622. }
  2623.  
  2624. #if defined _ALS_SpawnPlayer
  2625.     #undef SpawnPlayer
  2626. #else
  2627.     #define _ALS_SpawnPlayer
  2628. #endif
  2629. #define SpawnPlayer acc_SpawnPlayer
  2630.  
  2631. stock orig_SetPlayerHealth(playerid, Float:health) return SetPlayerHealth(playerid, health);
  2632.  
  2633. stock acc_SetPlayerHealth(playerid, Float:health)
  2634. {
  2635.     #if defined FILTERSCRIPT
  2636.         return CallRemoteFunction("ac_SetPlayerHealth", "if", playerid, health);
  2637.     #else
  2638.         return ac_SetPlayerHealth(playerid, health);
  2639.     #endif
  2640. }
  2641.  
  2642. #if defined _ALS_SetPlayerHealth
  2643.     #undef SetPlayerHealth
  2644. #else
  2645.     #define _ALS_SetPlayerHealth
  2646. #endif
  2647. #define SetPlayerHealth acc_SetPlayerHealth
  2648.  
  2649. stock orig_SetPlayerArmour(playerid, Float:armour) return SetPlayerArmour(playerid, armour);
  2650.  
  2651. stock acc_SetPlayerArmour(playerid, Float:armour)
  2652. {
  2653.     #if defined FILTERSCRIPT
  2654.         return CallRemoteFunction("ac_SetPlayerArmour", "if", playerid, armour);
  2655.     #else
  2656.         return ac_SetPlayerArmour(playerid, armour);
  2657.     #endif
  2658. }
  2659.  
  2660. #if defined _ALS_SetPlayerArmour
  2661.     #undef SetPlayerArmour
  2662. #else
  2663.     #define _ALS_SetPlayerArmour
  2664. #endif
  2665. #define SetPlayerArmour acc_SetPlayerArmour
  2666.  
  2667. stock orig_GivePlayerWeapon(playerid, weaponid, ammo) return GivePlayerWeapon(playerid, weaponid, ammo);
  2668.  
  2669. stock acc_GivePlayerWeapon(playerid, weaponid, ammo)
  2670. {
  2671.     if(!(0 <= playerid < MAX_PLAYERS)) return 0;
  2672.     #if defined FILTERSCRIPT
  2673.         return CallRemoteFunction("ac_GivePlayerWeapon", "iid", playerid, weaponid, ammo);
  2674.     #else
  2675.         return ac_GivePlayerWeapon(playerid, weaponid, ammo);
  2676.     #endif
  2677. }
  2678.  
  2679. #if defined _ALS_GivePlayerWeapon
  2680.     #undef GivePlayerWeapon
  2681. #else
  2682.     #define _ALS_GivePlayerWeapon
  2683. #endif
  2684. #define GivePlayerWeapon acc_GivePlayerWeapon
  2685.  
  2686. stock orig_SetPlayerAmmo(playerid, weaponslot, ammo) return SetPlayerAmmo(playerid, weaponslot, ammo);
  2687.  
  2688. stock acc_SetPlayerAmmo(playerid, weaponslot, ammo)
  2689. {
  2690.     if(!(0 <= playerid < MAX_PLAYERS)) return 0;
  2691.     #if defined FILTERSCRIPT
  2692.         return CallRemoteFunction("ac_SetPlayerAmmo", "iid", playerid, weaponslot, ammo);
  2693.     #else
  2694.         return ac_SetPlayerAmmo(playerid, weaponslot, ammo);
  2695.     #endif
  2696. }
  2697.  
  2698. #if defined _ALS_SetPlayerAmmo
  2699.     #undef SetPlayerAmmo
  2700. #else
  2701.     #define _ALS_SetPlayerAmmo
  2702. #endif
  2703. #define SetPlayerAmmo acc_SetPlayerAmmo
  2704.  
  2705. stock orig_ResetPlayerWeapons(playerid) return ResetPlayerWeapons(playerid);
  2706.  
  2707. stock acc_ResetPlayerWeapons(playerid)
  2708. {
  2709.     #if defined FILTERSCRIPT
  2710.         return CallRemoteFunction("ac_ResetPlayerWeapons", "i", playerid);
  2711.     #else
  2712.         return ac_ResetPlayerWeapons(playerid);
  2713.     #endif
  2714. }
  2715.  
  2716. #if defined _ALS_ResetPlayerWeapons
  2717.     #undef ResetPlayerWeapons
  2718. #else
  2719.     #define _ALS_ResetPlayerWeapons
  2720. #endif
  2721. #define ResetPlayerWeapons acc_ResetPlayerWeapons
  2722.  
  2723. stock orig_GivePlayerMoney(playerid, money) return GivePlayerMoney(playerid, money);
  2724.  
  2725. stock acc_GivePlayerMoney(playerid, money)
  2726. {
  2727.     #if defined FILTERSCRIPT
  2728.         return CallRemoteFunction("ac_GivePlayerMoney", "id", playerid, money);
  2729.     #else
  2730.         return ac_GivePlayerMoney(playerid, money);
  2731.     #endif
  2732. }
  2733.  
  2734. #if defined _ALS_GivePlayerMoney
  2735.     #undef GivePlayerMoney
  2736. #else
  2737.     #define _ALS_GivePlayerMoney
  2738. #endif
  2739. #define GivePlayerMoney acc_GivePlayerMoney
  2740.  
  2741. stock orig_ResetPlayerMoney(playerid) return ResetPlayerMoney(playerid);
  2742.  
  2743. stock acc_ResetPlayerMoney(playerid)
  2744. {
  2745.     #if defined FILTERSCRIPT
  2746.         return CallRemoteFunction("ac_ResetPlayerMoney", "i", playerid);
  2747.     #else
  2748.         return ac_ResetPlayerMoney(playerid);
  2749.     #endif
  2750. }
  2751.  
  2752. #if defined _ALS_ResetPlayerMoney
  2753.     #undef ResetPlayerMoney
  2754. #else
  2755.     #define _ALS_ResetPlayerMoney
  2756. #endif
  2757. #define ResetPlayerMoney acc_ResetPlayerMoney
  2758.  
  2759. stock orig_GetPlayerMoney(playerid) return GetPlayerMoney(playerid);
  2760.  
  2761. stock acc_GetPlayerMoney(playerid)
  2762. {
  2763.     if(!IsPlayerConnected(playerid)) return 0;
  2764.     #if defined FILTERSCRIPT
  2765.         return CallRemoteFunction("ac_GetPlayerMoney", "i", playerid);
  2766.     #else
  2767.         return ac_GetPlayerMoney(playerid);
  2768.     #endif
  2769. }
  2770.  
  2771. #if defined _ALS_GetPlayerMoney
  2772.     #undef GetPlayerMoney
  2773. #else
  2774.     #define _ALS_GetPlayerMoney
  2775. #endif
  2776. #define GetPlayerMoney acc_GetPlayerMoney
  2777.  
  2778. stock orig_SetPlayerSpecialAction(playerid, actionid) return SetPlayerSpecialAction(playerid, actionid);
  2779.  
  2780. stock acc_SetPlayerSpecialAction(playerid, actionid)
  2781. {
  2782.     #if defined FILTERSCRIPT
  2783.         return CallRemoteFunction("ac_SetPlayerSpecialAction", "ii", playerid, actionid);
  2784.     #else
  2785.         return ac_SetPlayerSpecialAction(playerid, actionid);
  2786.     #endif
  2787. }
  2788.  
  2789. #if defined _ALS_SetPlayerSpecialAction
  2790.     #undef SetPlayerSpecialAction
  2791. #else
  2792.     #define _ALS_SetPlayerSpecialAction
  2793. #endif
  2794. #define SetPlayerSpecialAction acc_SetPlayerSpecialAction
  2795.  
  2796. stock orig_PlayerSpectatePlayer(playerid, targetplayerid, mode = SPECTATE_MODE_NORMAL) return PlayerSpectatePlayer(playerid, targetplayerid, mode);
  2797.  
  2798. stock acc_PlayerSpectatePlayer(playerid, targetplayerid, mode = SPECTATE_MODE_NORMAL)
  2799. {
  2800.     if(PlayerSpectatePlayer(playerid, targetplayerid, mode))
  2801.     {
  2802.         #if defined FILTERSCRIPT
  2803.             return CallRemoteFunction("ac_PlayerSpecPlayerOrVehicle", "i", playerid);
  2804.         #else
  2805.             return ac_PlayerSpecPlayerOrVehicle(playerid);
  2806.         #endif
  2807.     }
  2808.     return 0;
  2809. }
  2810.  
  2811. #if defined _ALS_PlayerSpectatePlayer
  2812.     #undef PlayerSpectatePlayer
  2813. #else
  2814.     #define _ALS_PlayerSpectatePlayer
  2815. #endif
  2816. #define PlayerSpectatePlayer acc_PlayerSpectatePlayer
  2817.  
  2818. stock orig_PlayerSpectateVehicle(playerid, targetvehicleid, mode = SPECTATE_MODE_NORMAL) return PlayerSpectateVehicle(playerid, targetvehicleid, mode);
  2819.  
  2820. stock acc_PlayerSpectateVehicle(playerid, targetvehicleid, mode = SPECTATE_MODE_NORMAL)
  2821. {
  2822.     if(PlayerSpectateVehicle(playerid, targetvehicleid, mode))
  2823.     {
  2824.         #if defined FILTERSCRIPT
  2825.             return CallRemoteFunction("ac_PlayerSpecPlayerOrVehicle", "i", playerid);
  2826.         #else
  2827.             return ac_PlayerSpecPlayerOrVehicle(playerid);
  2828.         #endif
  2829.     }
  2830.     return 0;
  2831. }
  2832.  
  2833. #if defined _ALS_PlayerSpectateVehicle
  2834.     #undef PlayerSpectateVehicle
  2835. #else
  2836.     #define _ALS_PlayerSpectateVehicle
  2837. #endif
  2838. #define PlayerSpectateVehicle acc_PlayerSpectateVehicle
  2839.  
  2840. stock orig_SetPlayerInterior(playerid, interiorid) return SetPlayerInterior(playerid, interiorid);
  2841.  
  2842. stock acc_SetPlayerInterior(playerid, interiorid)
  2843. {
  2844.     #if defined FILTERSCRIPT
  2845.         return CallRemoteFunction("ac_SetPlayerInterior", "ii", playerid, interiorid);
  2846.     #else
  2847.         return ac_SetPlayerInterior(playerid, interiorid);
  2848.     #endif
  2849. }
  2850.  
  2851. #if defined _ALS_SetPlayerInterior
  2852.     #undef SetPlayerInterior
  2853. #else
  2854.     #define _ALS_SetPlayerInterior
  2855. #endif
  2856. #define SetPlayerInterior acc_SetPlayerInterior
  2857.  
  2858. stock orig_SetPlayerPos(playerid, Float:x, Float:y, Float:z) return SetPlayerPos(playerid, x, y, z);
  2859.  
  2860. stock acc_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
  2861. {
  2862.     #if defined FILTERSCRIPT
  2863.         return CallRemoteFunction("ac_SetPlayerPos", "ifff", playerid, x, y, z);
  2864.     #else
  2865.         return ac_SetPlayerPos(playerid, x, y, z);
  2866.     #endif
  2867. }
  2868.  
  2869. #if defined _ALS_SetPlayerPos
  2870.     #undef SetPlayerPos
  2871. #else
  2872.     #define _ALS_SetPlayerPos
  2873. #endif
  2874. #define SetPlayerPos acc_SetPlayerPos
  2875.  
  2876. stock orig_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z) return SetPlayerPosFindZ(playerid, x, y, z);
  2877.  
  2878. stock acc_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z)
  2879. {
  2880.     #if defined FILTERSCRIPT
  2881.         return CallRemoteFunction("ac_SetPlayerPosFindZ", "ifff", playerid, x, y, z);
  2882.     #else
  2883.         return ac_SetPlayerPosFindZ(playerid, x, y, z);
  2884.     #endif
  2885. }
  2886.  
  2887. #if defined _ALS_SetPlayerPosFindZ
  2888.     #undef SetPlayerPosFindZ
  2889. #else
  2890.     #define _ALS_SetPlayerPosFindZ
  2891. #endif
  2892. #define SetPlayerPosFindZ acc_SetPlayerPosFindZ
  2893.  
  2894. stock orig_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z) return SetPlayerVelocity(playerid, X, Y, Z);
  2895.  
  2896. stock acc_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z)
  2897. {
  2898.     #if defined FILTERSCRIPT
  2899.         return CallRemoteFunction("ac_SetPlayerVelocity", "ifff", playerid, X, Y, Z);
  2900.     #else
  2901.         return ac_SetPlayerVelocity(playerid, X, Y, Z);
  2902.     #endif
  2903. }
  2904.  
  2905. #if defined _ALS_SetPlayerVelocity
  2906.     #undef SetPlayerVelocity
  2907. #else
  2908.     #define _ALS_SetPlayerVelocity
  2909. #endif
  2910. #define SetPlayerVelocity acc_SetPlayerVelocity
  2911.  
  2912. stock orig_PutPlayerInVehicle(playerid, vehicleid, seatid) return PutPlayerInVehicle(playerid, vehicleid, seatid);
  2913.  
  2914. stock acc_PutPlayerInVehicle(playerid, vehicleid, seatid)
  2915. {
  2916.     #if defined FILTERSCRIPT
  2917.         return CallRemoteFunction("ac_PutPlayerInVehicle", "iii", playerid, vehicleid, seatid);
  2918.     #else
  2919.         return ac_PutPlayerInVehicle(playerid, vehicleid, seatid);
  2920.     #endif
  2921. }
  2922.  
  2923. #if defined _ALS_PutPlayerInVehicle
  2924.     #undef PutPlayerInVehicle
  2925. #else
  2926.     #define _ALS_PutPlayerInVehicle
  2927. #endif
  2928. #define PutPlayerInVehicle acc_PutPlayerInVehicle
  2929.  
  2930. stock orig_RemovePlayerFromVehicle(playerid) return RemovePlayerFromVehicle(playerid);
  2931.  
  2932. stock acc_RemovePlayerFromVehicle(playerid)
  2933. {
  2934.     #if defined FILTERSCRIPT
  2935.         return CallRemoteFunction("ac_RemovePlayerFromVehicle", "i", playerid);
  2936.     #else
  2937.         return ac_RemovePlayerFromVehicle(playerid);
  2938.     #endif
  2939. }
  2940.  
  2941. #if defined _ALS_RemovePlayerFromVehicle
  2942.     #undef RemovePlayerFromVehicle
  2943. #else
  2944.     #define _ALS_RemovePlayerFromVehicle
  2945. #endif
  2946. #define RemovePlayerFromVehicle acc_RemovePlayerFromVehicle
  2947.  
  2948. stock orig_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z) return SetVehiclePos(vehicleid, x, y, z);
  2949.  
  2950. stock acc_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z)
  2951. {
  2952.     #if defined FILTERSCRIPT
  2953.         return CallRemoteFunction("ac_SetVehiclePos", "ifff", vehicleid, x, y, z);
  2954.     #else
  2955.         return ac_SetVehiclePos(vehicleid, x, y, z);
  2956.     #endif
  2957. }
  2958.  
  2959. #if defined _ALS_SetVehiclePos
  2960.     #undef SetVehiclePos
  2961. #else
  2962.     #define _ALS_SetVehiclePos
  2963. #endif
  2964. #define SetVehiclePos acc_SetVehiclePos
  2965.  
  2966. stock orig_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z) return SetVehicleVelocity(vehicleid, X, Y, Z);
  2967.  
  2968. stock acc_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  2969. {
  2970.     #if defined FILTERSCRIPT
  2971.         return CallRemoteFunction("ac_SetVehicleVelocity", "ifff", vehicleid, X, Y, Z);
  2972.     #else
  2973.         return ac_SetVehicleVelocity(vehicleid, X, Y, Z);
  2974.     #endif
  2975. }
  2976.  
  2977. #if defined _ALS_SetVehicleVelocity
  2978.     #undef SetVehicleVelocity
  2979. #else
  2980.     #define _ALS_SetVehicleVelocity
  2981. #endif
  2982. #define SetVehicleVelocity acc_SetVehicleVelocity
  2983.  
  2984. stock orig_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z) return SetVehicleAngularVelocity(vehicleid, X, Y, Z);
  2985.  
  2986. stock acc_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  2987. {
  2988.     #if defined FILTERSCRIPT
  2989.         return CallRemoteFunction("ac_SetVehicleAngularVelocity", "ifff", vehicleid, X, Y, Z);
  2990.     #else
  2991.         return ac_SetVehicleAngularVelocity(vehicleid, X, Y, Z);
  2992.     #endif
  2993. }
  2994.  
  2995. #if defined _ALS_SetVehicleAngularVelocity
  2996.     #undef SetVehicleAngularVelocity
  2997. #else
  2998.     #define _ALS_SetVehicleAngularVelocity
  2999. #endif
  3000. #define SetVehicleAngularVelocity acc_SetVehicleAngularVelocity
  3001.  
  3002. stock orig_LinkVehicleToInterior(vehicleid, interiorid) return LinkVehicleToInterior(vehicleid, interiorid);
  3003.  
  3004. stock acc_LinkVehicleToInterior(vehicleid, interiorid)
  3005. {
  3006.     #if defined FILTERSCRIPT
  3007.         return CallRemoteFunction("ac_LinkVehicleToInterior", "ii", vehicleid, interiorid);
  3008.     #else
  3009.         return ac_LinkVehicleToInterior(vehicleid, interiorid);
  3010.     #endif
  3011. }
  3012.  
  3013. #if defined _ALS_LinkVehicleToInterior
  3014.     #undef LinkVehicleToInterior
  3015. #else
  3016.     #define _ALS_LinkVehicleToInterior
  3017. #endif
  3018. #define LinkVehicleToInterior acc_LinkVehicleToInterior
  3019.  
  3020. stock orig_ChangeVehiclePaintjob(vehicleid, paintjobid) return ChangeVehiclePaintjob(vehicleid, paintjobid);
  3021.  
  3022. stock acc_ChangeVehiclePaintjob(vehicleid, paintjobid)
  3023. {
  3024.     if(GetVehicleModel(vehicleid) <= 0) return 1;
  3025.     #if defined FILTERSCRIPT
  3026.         return CallRemoteFunction("ac_ChangeVehiclePaintjob", "ii", vehicleid, paintjobid);
  3027.     #else
  3028.         return ac_ChangeVehiclePaintjob(vehicleid, paintjobid);
  3029.     #endif
  3030. }
  3031.  
  3032. #if defined _ALS_ChangeVehiclePaintjob
  3033.     #undef ChangeVehiclePaintjob
  3034. #else
  3035.     #define _ALS_ChangeVehiclePaintjob
  3036. #endif
  3037. #define ChangeVehiclePaintjob acc_ChangeVehiclePaintjob
  3038.  
  3039. stock orig_SetVehicleHealth(vehicleid, Float:health) return SetVehicleHealth(vehicleid, health);
  3040.  
  3041. stock acc_SetVehicleHealth(vehicleid, Float:health)
  3042. {
  3043.     if(health < 0.0) health = 0.0;
  3044.     #if defined FILTERSCRIPT
  3045.         return CallRemoteFunction("ac_SetVehicleHealth", "if", vehicleid, health);
  3046.     #else
  3047.         return ac_SetVehicleHealth(vehicleid, health);
  3048.     #endif
  3049. }
  3050.  
  3051. #if defined _ALS_SetVehicleHealth
  3052.     #undef SetVehicleHealth
  3053. #else
  3054.     #define _ALS_SetVehicleHealth
  3055. #endif
  3056. #define SetVehicleHealth acc_SetVehicleHealth
  3057.  
  3058. stock orig_RepairVehicle(vehicleid) return RepairVehicle(vehicleid);
  3059.  
  3060. stock acc_RepairVehicle(vehicleid)
  3061. {
  3062.     #if defined FILTERSCRIPT
  3063.         return CallRemoteFunction("ac_RepairVehicle", "i", vehicleid);
  3064.     #else
  3065.         return ac_RepairVehicle(vehicleid);
  3066.     #endif
  3067. }
  3068.  
  3069. #if defined _ALS_RepairVehicle
  3070.     #undef RepairVehicle
  3071. #else
  3072.     #define _ALS_RepairVehicle
  3073. #endif
  3074. #define RepairVehicle acc_RepairVehicle
  3075.  
  3076. stock orig_UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires) return UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
  3077.  
  3078. stock acc_UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires)
  3079. {
  3080.     #if defined FILTERSCRIPT
  3081.         return CallRemoteFunction("ac_UpdateVehicleDamageStatus", "iiiii", vehicleid, panels, doors, lights, tires);
  3082.     #else
  3083.         return ac_UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
  3084.     #endif
  3085. }
  3086.  
  3087. #if defined _ALS_UpdateVehicleDamageStatus
  3088.     #undef UpdateVehicleDamageStatus
  3089. #else
  3090.     #define _ALS_UpdateVehicleDamageStatus
  3091. #endif
  3092. #define UpdateVehicleDamageStatus acc_UpdateVehicleDamageStatus
  3093.  
  3094. stock orig_SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective) return SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  3095.  
  3096. stock acc_SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective)
  3097. {
  3098.     #if defined FILTERSCRIPT
  3099.         return CallRemoteFunction("ac_SetVehicleParamsEx", "iiiiiiii", vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  3100.     #else
  3101.         return ac_SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  3102.     #endif
  3103. }
  3104.  
  3105. #if defined _ALS_SetVehicleParamsEx
  3106.     #undef SetVehicleParamsEx
  3107. #else
  3108.     #define _ALS_SetVehicleParamsEx
  3109. #endif
  3110. #define SetVehicleParamsEx acc_SetVehicleParamsEx
  3111.  
  3112. stock orig_SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked) return SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked);
  3113.  
  3114. stock acc_SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked)
  3115. {
  3116.     #if defined FILTERSCRIPT
  3117.         return CallRemoteFunction("ac_SetVehicleParamsForPlayer", "iiii", vehicleid, playerid, objective, doorslocked);
  3118.     #else
  3119.         return ac_SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked);
  3120.     #endif
  3121. }
  3122.  
  3123. #if defined _ALS_SetVehicleParamsForPlayer
  3124.     #undef SetVehicleParamsForPlayer
  3125. #else
  3126.     #define _ALS_SetVehicleParamsForPlayer
  3127. #endif
  3128. #define SetVehicleParamsForPlayer acc_SetVehicleParamsForPlayer
  3129.  
  3130. stock orig_SetVehicleToRespawn(vehicleid) return SetVehicleToRespawn(vehicleid);
  3131.  
  3132. stock acc_SetVehicleToRespawn(vehicleid)
  3133. {
  3134.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  3135.     #if defined FILTERSCRIPT
  3136.         return CallRemoteFunction("ac_SetVehicleToRespawn", "i", vehicleid);
  3137.     #else
  3138.         return ac_SetVehicleToRespawn(vehicleid);
  3139.     #endif
  3140. }
  3141.  
  3142. #if defined _ALS_SetVehicleToRespawn
  3143.     #undef SetVehicleToRespawn
  3144. #else
  3145.     #define _ALS_SetVehicleToRespawn
  3146. #endif
  3147. #define SetVehicleToRespawn acc_SetVehicleToRespawn
  3148.  
  3149. stock orig_SetVehicleZAngle(vehicleid, Float:z_angle) return SetVehicleZAngle(vehicleid, z_angle);
  3150.  
  3151. stock acc_SetVehicleZAngle(vehicleid, Float:z_angle)
  3152. {
  3153.     #if defined FILTERSCRIPT
  3154.         return CallRemoteFunction("ac_SetVehicleZAngle", "if", vehicleid, z_angle);
  3155.     #else
  3156.         return ac_SetVehicleZAngle(vehicleid, z_angle);
  3157.     #endif
  3158. }
  3159.  
  3160. #if defined _ALS_SetVehicleZAngle
  3161.     #undef SetVehicleZAngle
  3162. #else
  3163.     #define _ALS_SetVehicleZAngle
  3164. #endif
  3165. #define SetVehicleZAngle acc_SetVehicleZAngle
  3166.  
  3167. stock EnableAntiCheat(code, enable)
  3168. {
  3169.     #if defined FILTERSCRIPT
  3170.         return CallRemoteFunction("ac_EnableAntiCheat", "ii", code, enable);
  3171.     #else
  3172.         return ac_EnableAntiCheat(code, enable);
  3173.     #endif
  3174. }
  3175.  
  3176. stock EnableAntiNOP(nopcode, enable)
  3177. {
  3178.     #if defined FILTERSCRIPT
  3179.         return CallRemoteFunction("ac_EnableAntiNOP", "ii", nopcode, enable);
  3180.     #else
  3181.         return ac_EnableAntiNOP(nopcode, enable);
  3182.     #endif
  3183. }
  3184.  
  3185. stock EnableAntiCheatForPlayer(playerid, code, enable)
  3186. {
  3187.     if(!IsPlayerConnected(playerid)) return 0;
  3188.     #if defined FILTERSCRIPT
  3189.         return CallRemoteFunction("ac_EnableAntiCheatForPlayer", "iii", playerid, code, enable);
  3190.     #else
  3191.         return ac_EnableAntiCheatForPlayer(playerid, code, enable);
  3192.     #endif
  3193. }
  3194.  
  3195. stock EnableAntiNOPForPlayer(playerid, nopcode, enable)
  3196. {
  3197.     if(!IsPlayerConnected(playerid)) return 0;
  3198.     #if defined FILTERSCRIPT
  3199.         return CallRemoteFunction("ac_EnableAntiNOPForPlayer", "iii", playerid, nopcode, enable);
  3200.     #else
  3201.         return ac_EnableAntiNOPForPlayer(playerid, nopcode, enable);
  3202.     #endif
  3203. }
  3204.  
  3205. stock IsAntiCheatEnabled(code)
  3206. {
  3207.     #if defined FILTERSCRIPT
  3208.         return CallRemoteFunction("ac_IsAntiCheatEnabled", "i", code);
  3209.     #else
  3210.         return ac_IsAntiCheatEnabled(code);
  3211.     #endif
  3212. }
  3213.  
  3214. stock IsAntiNOPEnabled(nopcode)
  3215. {
  3216.     #if defined FILTERSCRIPT
  3217.         return CallRemoteFunction("ac_IsAntiNOPEnabled", "i", nopcode);
  3218.     #else
  3219.         return ac_IsAntiNOPEnabled(nopcode);
  3220.     #endif
  3221. }
  3222.  
  3223. stock IsAntiCheatEnabledForPlayer(playerid, code)
  3224. {
  3225.     if(!IsPlayerConnected(playerid)) return 0;
  3226.     #if defined FILTERSCRIPT
  3227.         return CallRemoteFunction("ac_IsAntiCheatEnabledForPlayer", "ii", playerid, code);
  3228.     #else
  3229.         return ac_IsAntiCheatEnabledForPlayer(playerid, code);
  3230.     #endif
  3231. }
  3232.  
  3233. stock IsAntiNOPEnabledForPlayer(playerid, nopcode)
  3234. {
  3235.     if(!IsPlayerConnected(playerid)) return 0;
  3236.     #if defined FILTERSCRIPT
  3237.         return CallRemoteFunction("ac_IsAntiNOPEnabledForPlayer", "ii", playerid, nopcode);
  3238.     #else
  3239.         return ac_IsAntiNOPEnabledForPlayer(playerid, nopcode);
  3240.     #endif
  3241. }
  3242.  
  3243. stock AntiCheatGetSpeed(playerid)
  3244. {
  3245.     if(!IsPlayerConnected(playerid)) return 0;
  3246.     #if defined FILTERSCRIPT
  3247.         return CallRemoteFunction("ac_AntiCheatGetSpeed", "i", playerid);
  3248.     #else
  3249.         return ac_AntiCheatGetSpeed(playerid);
  3250.     #endif
  3251. }
  3252.  
  3253. stock AntiCheatGetAnimationIndex(playerid)
  3254. {
  3255.     if(!IsPlayerConnected(playerid)) return 0;
  3256.     #if defined FILTERSCRIPT
  3257.         return CallRemoteFunction("ac_AntiCheatGetAnimationIndex", "i", playerid);
  3258.     #else
  3259.         return ac_AntiCheatGetAnimationIndex(playerid);
  3260.     #endif
  3261. }
  3262.  
  3263. stock AntiCheatGetDialog(playerid)
  3264. {
  3265.     if(!IsPlayerConnected(playerid)) return -1;
  3266.     #if defined FILTERSCRIPT
  3267.         return CallRemoteFunction("ac_AntiCheatGetDialog", "i", playerid);
  3268.     #else
  3269.         return ac_AntiCheatGetDialog(playerid);
  3270.     #endif
  3271. }
  3272.  
  3273. stock AntiCheatGetInterior(playerid)
  3274. {
  3275.     if(!IsPlayerConnected(playerid)) return 0;
  3276.     #if defined FILTERSCRIPT
  3277.         return CallRemoteFunction("ac_AntiCheatGetInterior", "i", playerid);
  3278.     #else
  3279.         return ac_AntiCheatGetInterior(playerid);
  3280.     #endif
  3281. }
  3282.  
  3283. stock AntiCheatGetEnterVehicle(playerid)
  3284. {
  3285.     if(!IsPlayerConnected(playerid)) return 0;
  3286.     #if defined FILTERSCRIPT
  3287.         return CallRemoteFunction("ac_AntiCheatGetEnterVehicle", "i", playerid);
  3288.     #else
  3289.         return ac_AntiCheatGetEnterVehicle(playerid);
  3290.     #endif
  3291. }
  3292.  
  3293. stock AntiCheatGetEnterVehicleSeat(playerid)
  3294. {
  3295.     if(!IsPlayerConnected(playerid)) return -1;
  3296.     #if defined FILTERSCRIPT
  3297.         return CallRemoteFunction("ac_AntiCheatGetEnterVehicleSeat", "i", playerid);
  3298.     #else
  3299.         return ac_AntiCheatGetEnterVehicleSeat(playerid);
  3300.     #endif
  3301. }
  3302.  
  3303. stock AntiCheatGetVehicleID(playerid)
  3304. {
  3305.     if(!IsPlayerConnected(playerid)) return 0;
  3306.     #if defined FILTERSCRIPT
  3307.         return CallRemoteFunction("ac_AntiCheatGetVehicleID", "i", playerid);
  3308.     #else
  3309.         return ac_AntiCheatGetVehicleID(playerid);
  3310.     #endif
  3311. }
  3312.  
  3313. stock AntiCheatGetVehicleSeat(playerid)
  3314. {
  3315.     if(!IsPlayerConnected(playerid)) return -1;
  3316.     #if defined FILTERSCRIPT
  3317.         return CallRemoteFunction("ac_AntiCheatGetVehicleSeat", "i", playerid);
  3318.     #else
  3319.         return ac_AntiCheatGetVehicleSeat(playerid);
  3320.     #endif
  3321. }
  3322.  
  3323. stock AntiCheatGetWeapon(playerid)
  3324. {
  3325.     if(!IsPlayerConnected(playerid)) return -1;
  3326.     #if defined FILTERSCRIPT
  3327.         return CallRemoteFunction("ac_AntiCheatGetWeapon", "i", playerid);
  3328.     #else
  3329.         return ac_AntiCheatGetWeapon(playerid);
  3330.     #endif
  3331. }
  3332.  
  3333. stock AntiCheatGetWeaponInSlot(playerid, slot)
  3334. {
  3335.     if(!IsPlayerConnected(playerid)) return -1;
  3336.     if(!(0 <= slot <= 12)) return -2;
  3337.     #if defined FILTERSCRIPT
  3338.         return CallRemoteFunction("ac_AntiCheatGetWeaponInSlot", "ii", playerid, slot);
  3339.     #else
  3340.         return ac_AntiCheatGetWeaponInSlot(playerid, slot);
  3341.     #endif
  3342. }
  3343.  
  3344. stock AntiCheatGetAmmoInSlot(playerid, slot)
  3345. {
  3346.     if(!IsPlayerConnected(playerid)) return -1;
  3347.     if(!(0 <= slot <= 12)) return -2;
  3348.     #if defined FILTERSCRIPT
  3349.         return CallRemoteFunction("ac_AntiCheatGetAmmoInSlot", "ii", playerid, slot);
  3350.     #else
  3351.         return ac_AntiCheatGetAmmoInSlot(playerid, slot);
  3352.     #endif
  3353. }
  3354.  
  3355. stock AntiCheatGetSpecialAction(playerid)
  3356. {
  3357.     if(!IsPlayerConnected(playerid)) return 0;
  3358.     #if defined FILTERSCRIPT
  3359.         return CallRemoteFunction("ac_AntiCheatGetSpecialAction", "i", playerid);
  3360.     #else
  3361.         return ac_AntiCheatGetSpecialAction(playerid);
  3362.     #endif
  3363. }
  3364.  
  3365. stock AntiCheatGetLastSpecialAction(playerid)
  3366. {
  3367.     if(!IsPlayerConnected(playerid)) return 0;
  3368.     #if defined FILTERSCRIPT
  3369.         return CallRemoteFunction("ac_AntiCheatGetLastSpecialActio", "i", playerid);
  3370.     #else
  3371.         return ac_AntiCheatGetLastSpecialActio(playerid);
  3372.     #endif
  3373. }
  3374.  
  3375. stock AntiCheatGetLastShotWeapon(playerid)
  3376. {
  3377.     if(!IsPlayerConnected(playerid)) return -1;
  3378.     #if defined FILTERSCRIPT
  3379.         return CallRemoteFunction("ac_AntiCheatGetLastShotWeapon", "i", playerid);
  3380.     #else
  3381.         return ac_AntiCheatGetLastShotWeapon(playerid);
  3382.     #endif
  3383. }
  3384.  
  3385. stock AntiCheatGetLastPickup(playerid)
  3386. {
  3387.     if(!IsPlayerConnected(playerid)) return -1;
  3388.     #if defined FILTERSCRIPT
  3389.         return CallRemoteFunction("ac_AntiCheatGetLastPickup", "i", playerid);
  3390.     #else
  3391.         return ac_AntiCheatGetLastPickup(playerid);
  3392.     #endif
  3393. }
  3394.  
  3395. stock AntiCheatGetLastUpdateTime(playerid)
  3396. {
  3397.     if(!IsPlayerConnected(playerid)) return 0;
  3398.     #if defined FILTERSCRIPT
  3399.         return CallRemoteFunction("ac_AntiCheatGetLastUpdateTime", "i", playerid);
  3400.     #else
  3401.         return ac_AntiCheatGetLastUpdateTime(playerid);
  3402.     #endif
  3403. }
  3404.  
  3405. stock AntiCheatGetLastReloadTime(playerid)
  3406. {
  3407.     if(!IsPlayerConnected(playerid)) return 0;
  3408.     #if defined FILTERSCRIPT
  3409.         return CallRemoteFunction("ac_AntiCheatGetLastReloadTime", "i", playerid);
  3410.     #else
  3411.         return ac_AntiCheatGetLastReloadTime(playerid);
  3412.     #endif
  3413. }
  3414.  
  3415. stock AntiCheatGetLastEnteredVehTime(playerid)
  3416. {
  3417.     if(!IsPlayerConnected(playerid)) return 0;
  3418.     #if defined FILTERSCRIPT
  3419.         return CallRemoteFunction("ac_AntiCheatGetLastEnteredVehTi", "i", playerid);
  3420.     #else
  3421.         return ac_AntiCheatGetLastEnteredVehTi(playerid);
  3422.     #endif
  3423. }
  3424.  
  3425. stock AntiCheatGetLastShotTime(playerid)
  3426. {
  3427.     if(!IsPlayerConnected(playerid)) return 0;
  3428.     #if defined FILTERSCRIPT
  3429.         return CallRemoteFunction("ac_AntiCheatGetLastShotTime", "i", playerid);
  3430.     #else
  3431.         return ac_AntiCheatGetLastShotTime(playerid);
  3432.     #endif
  3433. }
  3434.  
  3435. stock AntiCheatGetLastSpawnTime(playerid)
  3436. {
  3437.     if(!IsPlayerConnected(playerid)) return 0;
  3438.     #if defined FILTERSCRIPT
  3439.         return CallRemoteFunction("ac_AntiCheatGetLastSpawnTime", "i", playerid);
  3440.     #else
  3441.         return ac_AntiCheatGetLastSpawnTime(playerid);
  3442.     #endif
  3443. }
  3444.  
  3445. stock AntiCheatIntEnterExitsIsEnabled(playerid)
  3446. {
  3447.     if(!IsPlayerConnected(playerid)) return 0;
  3448.     #if defined FILTERSCRIPT
  3449.         return CallRemoteFunction("ac_AntiCheatIntEnterExitsIsEnab", "i", playerid);
  3450.     #else
  3451.         return ac_AntiCheatIntEnterExitsIsEnab(playerid);
  3452.     #endif
  3453. }
  3454.  
  3455. stock AntiCheatStuntBonusIsEnabled(playerid)
  3456. {
  3457.     if(!IsPlayerConnected(playerid)) return 0;
  3458.     #if defined FILTERSCRIPT
  3459.         return CallRemoteFunction("ac_AntiCheatStuntBonusIsEnabled", "i", playerid);
  3460.     #else
  3461.         return ac_AntiCheatStuntBonusIsEnabled(playerid);
  3462.     #endif
  3463. }
  3464.  
  3465. stock AntiCheatIsInModShop(playerid)
  3466. {
  3467.     if(!IsPlayerConnected(playerid)) return 0;
  3468.     #if defined FILTERSCRIPT
  3469.         return CallRemoteFunction("ac_AntiCheatIsInModShop", "i", playerid);
  3470.     #else
  3471.         return ac_AntiCheatIsInModShop(playerid);
  3472.     #endif
  3473. }
  3474.  
  3475. stock AntiCheatIsInSpectate(playerid)
  3476. {
  3477.     if(!IsPlayerConnected(playerid)) return 0;
  3478.     #if defined FILTERSCRIPT
  3479.         return CallRemoteFunction("ac_AntiCheatIsInSpectate", "i", playerid);
  3480.     #else
  3481.         return ac_AntiCheatIsInSpectate(playerid);
  3482.     #endif
  3483. }
  3484.  
  3485. stock AntiCheatIsFrozen(playerid)
  3486. {
  3487.     if(!IsPlayerConnected(playerid)) return 0;
  3488.     #if defined FILTERSCRIPT
  3489.         return CallRemoteFunction("ac_AntiCheatIsFrozen", "i", playerid);
  3490.     #else
  3491.         return ac_AntiCheatIsFrozen(playerid);
  3492.     #endif
  3493. }
  3494.  
  3495. stock AntiCheatIsDead(playerid)
  3496. {
  3497.     if(!IsPlayerConnected(playerid)) return 0;
  3498.     #if defined FILTERSCRIPT
  3499.         return CallRemoteFunction("ac_AntiCheatIsDead", "i", playerid);
  3500.     #else
  3501.         return ac_AntiCheatIsDead(playerid);
  3502.     #endif
  3503. }
  3504.  
  3505. stock AntiCheatIsConnected(playerid)
  3506. {
  3507.     if(!IsPlayerConnected(playerid)) return 0;
  3508.     #if defined FILTERSCRIPT
  3509.         return CallRemoteFunction("ac_AntiCheatIsConnected", "i", playerid);
  3510.     #else
  3511.         return ac_AntiCheatIsConnected(playerid);
  3512.     #endif
  3513. }
  3514.  
  3515. stock AntiCheatKickWithDesync(playerid, code)
  3516. {
  3517.     if(!IsPlayerConnected(playerid)) return 0;
  3518.     #if defined FILTERSCRIPT
  3519.         return CallRemoteFunction("ac_AntiCheatKickWithDesync", "ii", playerid, code);
  3520.     #else
  3521.         return ac_AntiCheatKickWithDesync(playerid, code);
  3522.     #endif
  3523. }
  3524.  
  3525. stock AntiCheatIsKickedWithDesync(playerid)
  3526. {
  3527.     if(!IsPlayerConnected(playerid)) return 3;
  3528.     #if defined FILTERSCRIPT
  3529.         return CallRemoteFunction("ac_AntiCheatIsKickedWithDesync", "i", playerid);
  3530.     #else
  3531.         return ac_AntiCheatIsKickedWithDesync(playerid);
  3532.     #endif
  3533. }
  3534.  
  3535. stock AntiCheatGetVehicleDriver(vehicleid)
  3536. {
  3537.     if(GetVehicleModel(vehicleid) <= 0) return INVALID_PLAYER_ID;
  3538.     #if defined FILTERSCRIPT
  3539.         return CallRemoteFunction("ac_AntiCheatGetVehicleDriver", "i", vehicleid);
  3540.     #else
  3541.         return ac_AntiCheatGetVehicleDriver(vehicleid);
  3542.     #endif
  3543. }
  3544.  
  3545. stock AntiCheatGetVehicleInterior(vehicleid)
  3546. {
  3547.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  3548.     #if defined FILTERSCRIPT
  3549.         return CallRemoteFunction("ac_AntiCheatGetVehicleInterior", "i", vehicleid);
  3550.     #else
  3551.         return ac_AntiCheatGetVehicleInterior(vehicleid);
  3552.     #endif
  3553. }
  3554.  
  3555. stock AntiCheatGetVehiclePaintjob(vehicleid)
  3556. {
  3557.     if(GetVehicleModel(vehicleid) <= 0) return 3;
  3558.     #if defined FILTERSCRIPT
  3559.         return CallRemoteFunction("ac_AntiCheatGetVehiclePaintjob", "i", vehicleid);
  3560.     #else
  3561.         return ac_AntiCheatGetVehiclePaintjob(vehicleid);
  3562.     #endif
  3563. }
  3564.  
  3565. stock AntiCheatGetVehicleSpeed(vehicleid)
  3566. {
  3567.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  3568.     #if defined FILTERSCRIPT
  3569.         return CallRemoteFunction("ac_AntiCheatGetVehicleSpeed", "i", vehicleid);
  3570.     #else
  3571.         return ac_AntiCheatGetVehicleSpeed(vehicleid);
  3572.     #endif
  3573. }
  3574.  
  3575. stock AntiCheatIsVehicleSpawned(vehicleid)
  3576. {
  3577.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  3578.     #if defined FILTERSCRIPT
  3579.         return CallRemoteFunction("ac_AntiCheatIsVehicleSpawned", "i", vehicleid);
  3580.     #else
  3581.         return ac_AntiCheatIsVehicleSpawned(vehicleid);
  3582.     #endif
  3583. }
  3584.  
  3585. #if defined FILTERSCRIPT
  3586.  
  3587. static fs_AntiCheatGetNextDialog(playerid)
  3588. {
  3589.     if(!IsPlayerConnected(playerid)) return -1;
  3590.     return CallRemoteFunction("ac_AntiCheatGetNextDialog", "i", playerid);
  3591. }
  3592.  
  3593. static fs_AntiCheatSetDialog(playerid, dialogid)
  3594. {
  3595.     if(!(0 <= playerid < MAX_PLAYERS)) return 0;
  3596.     return CallRemoteFunction("ac_ShowPlayerDialog", "id", playerid, dialogid);
  3597. }
  3598.  
  3599. static fs_AntiCheatSetNextDialog(playerid, dialogid)
  3600. {
  3601.     if(!(0 <= playerid < MAX_PLAYERS)) return 0;
  3602.     return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
  3603. }
  3604.  
  3605. #else
  3606.  
  3607. public OnGameModeInit()
  3608. {
  3609.     #if AC_USE_CONFIG_FILES
  3610.         if(!ac_LoadCfg()) printf(CFG_OPENING_ERROR, AC_CONFIG_FILE);
  3611.         if(!ac_LoadNOPCfg()) printf(CFG_OPENING_ERROR, AC_NOP_CONFIG_FILE);
  3612.     #endif
  3613.     if(ac_ACAllow[42])
  3614.     {
  3615.         #if !AC_USE_QUERY
  3616.             #if defined GetConsoleVarAsBool
  3617.                 ac_QueryEnable = (GetConsoleVarAsBool("query") != 0);
  3618.             #else
  3619.                 ac_QueryEnable = (GetServerVarAsBool("query") != 0);
  3620.             #endif
  3621.             SendRconCommand("query 0");
  3622.         #endif
  3623.         #undef AC_USE_QUERY
  3624.         #if defined GetConsoleVarAsBool
  3625.             ac_RconEnable = (GetConsoleVarAsBool("rcon") != 0);
  3626.         #else
  3627.             ac_RconEnable = (GetServerVarAsBool("rcon") != 0);
  3628.         #endif
  3629.         SendRconCommand("rcon 0");
  3630.     }
  3631.     #if defined GetConsoleVarAsInt
  3632.         ac_LagCompMode = (GetConsoleVarAsInt("lagcompmode") != 0);
  3633.     #else
  3634.         ac_LagCompMode = (GetServerVarAsInt("lagcompmode") != 0);
  3635.     #endif
  3636.     print(BLANK);
  3637.     print(BORDER1);
  3638.     print(LOADED_MSG_1);
  3639.     printf(LOADED_MSG_2, NEX_AC_VERSION);
  3640.     print(LOADED_MSG_3);
  3641.     printf(LOADED_MSG_4, CS_TEAM_MODULE_VERSION);
  3642.     print(BORDER2);
  3643.     #if defined ac_OnGameModeInit
  3644.         new ac_a = ac_OnGameModeInit();
  3645.     #endif
  3646.     static ac_strtmp[10];
  3647.     #if defined GetConsoleVarAsString
  3648.         GetConsoleVarAsString("version", ac_strtmp, sizeof ac_strtmp);
  3649.     #else
  3650.         GetServerVarAsString("version", ac_strtmp, sizeof ac_strtmp);
  3651.     #endif
  3652.     if(strfind(ac_strtmp, AC_SERVER_VERSION) == -1 && strfind(ac_strtmp, AC_SERVER_DL_VERSION) == -1) print(VERSION_WARNING);
  3653.     #undef AC_SERVER_DL_VERSION
  3654.     #undef AC_SERVER_VERSION
  3655.     #if defined ac_OnGameModeInit
  3656.         return ac_a;
  3657.     #else
  3658.         return 1;
  3659.     #endif
  3660. }
  3661.  
  3662. #if defined _ALS_OnGameModeInit
  3663.     #undef OnGameModeInit
  3664. #else
  3665.     #define _ALS_OnGameModeInit
  3666. #endif
  3667. #define OnGameModeInit ac_OnGameModeInit
  3668. #if defined ac_OnGameModeInit
  3669.     forward ac_OnGameModeInit();
  3670. #endif
  3671.  
  3672. #if AC_USE_STATISTICS
  3673.     public OnGameModeExit()
  3674.     {
  3675.         #if defined ac_OnGameModeExit
  3676.             new ac_a = ac_OnGameModeExit();
  3677.         #endif
  3678.         print(" ");
  3679.         print("--------------------------------------");
  3680.         print(STATS_STRING_1);
  3681.         print(STATS_STRING_2);
  3682.         printf(STATS_STRING_3, ac_sInfo[0]);
  3683.         printf(STATS_STRING_4, ac_sInfo[1]);
  3684.         printf(STATS_STRING_5, ac_sInfo[2]);
  3685.         printf(STATS_STRING_6, ac_sInfo[3]);
  3686.         printf(STATS_STRING_7, ac_sInfo[4]);
  3687.         printf(STATS_STRING_8, ac_sInfo[5]);
  3688.         print("--------------------------------------\n");
  3689.         #if defined ac_OnGameModeExit
  3690.             return ac_a;
  3691.         #else
  3692.             return 1;
  3693.         #endif
  3694.     }
  3695.  
  3696.     #if defined _ALS_OnGameModeExit
  3697.         #undef OnGameModeExit
  3698.     #else
  3699.         #define _ALS_OnGameModeExit
  3700.     #endif
  3701.     #define OnGameModeExit ac_OnGameModeExit
  3702.     #if defined ac_OnGameModeExit
  3703.         forward ac_OnGameModeExit();
  3704.     #endif
  3705. #endif
  3706.  
  3707. public OnPlayerConnect(playerid)
  3708. {
  3709.     ACInfo[playerid][acVeh] =
  3710.     ACInfo[playerid][acKicked] =
  3711.     ACInfo[playerid][acKickVeh] = 0;
  3712.     GetPlayerIp(playerid, ACInfo[playerid][acIp], 16);
  3713.     #if AC_USE_NPC
  3714.         if(IsPlayerNPC(playerid))
  3715.         {
  3716.             if(ac_ACAllow[36])
  3717.             {
  3718.                 static ac_strtmp[16];
  3719.                 #if defined GetLocalIP
  3720.                     new ac_i, bool:ac_rslt;
  3721.                     ac_strtmp = "127.0.0.1";
  3722.                     while(ac_strtmp[0])
  3723.                     {
  3724.                         if(!strcmp(ACInfo[playerid][acIp], ac_strtmp))
  3725.                         {
  3726.                             ac_rslt = true;
  3727.                             break;
  3728.                         }
  3729.                         GetLocalIP(ac_i, ac_strtmp);
  3730.                         ac_i++;
  3731.                     }
  3732.                     if(!ac_rslt)
  3733.                     {
  3734.                         #if defined DEBUG
  3735.                             printf("[Nex-AC debug] NPC's IP: '%s'", ACInfo[playerid][acIp]);
  3736.                         #endif
  3737.                         ac_KickWithCode(playerid, "", 0, 36);
  3738.                     }
  3739.                 #else
  3740.                     #if defined GetConsoleVarAsString
  3741.                         GetConsoleVarAsString("bind", ac_strtmp, sizeof ac_strtmp);
  3742.                     #else
  3743.                         GetServerVarAsString("bind", ac_strtmp, sizeof ac_strtmp);
  3744.                     #endif
  3745.                     if(strcmp(ACInfo[playerid][acIp], "127.0.0.1") &&
  3746.                     (strlen(ac_strtmp) < 1 || strcmp(ACInfo[playerid][acIp], ac_strtmp))) ac_KickWithCode(playerid, "", 0, 36);
  3747.                 #endif
  3748.             }
  3749.             ACInfo[playerid][acTimerID] = 0;
  3750.         }
  3751.         else
  3752.         {
  3753.     #else
  3754.         if(ac_ACAllow[36] && IsPlayerNPC(playerid)) ac_KickWithCode(playerid, "", 0, 36);
  3755.     #endif
  3756.         if(ac_ACAllow[48] && ACInfo[playerid][acOnline]) ac_KickWithCode(playerid, "", 0, 48, 1);
  3757.         #if defined GetPlayerVersion
  3758.             if(ac_ACAllow[41])
  3759.             {
  3760.                 static ac_ver[24];
  3761.                 GetPlayerVersion(playerid, ac_ver, sizeof ac_ver);
  3762.                 if(strfind(ac_ver, AC_CLIENT_VERSION) == -1)
  3763.                 {
  3764.                     #if defined DEBUG
  3765.                         printf(DEBUG_CODE_2, playerid, ac_ver);
  3766.                     #endif
  3767.                     ac_KickWithCode(playerid, "", 0, 41);
  3768.                 }
  3769.             }
  3770.         #else
  3771.             #pragma unused DEBUG_CODE_2
  3772.         #endif
  3773.         #undef AC_CLIENT_VERSION
  3774.         new ac_i = AC_MAX_CONNECTS_FROM_IP;
  3775.         if(ac_ACAllow[40])
  3776.         {
  3777.             #if defined foreach
  3778.                 foreach(new ac_j : Player)
  3779.                 {
  3780.                     if(ac_j == playerid) continue;
  3781.             #else
  3782.                 #if defined GetPlayerPoolSize
  3783.                     for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j)
  3784.                 #else
  3785.                     for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j)
  3786.                 #endif
  3787.                 {
  3788.                     #if AC_USE_NPC
  3789.                         if(ac_j == playerid || !IsPlayerConnected(ac_j) || IsPlayerNPC(ac_j)) continue;
  3790.                     #else
  3791.                         if(ac_j == playerid || !IsPlayerConnected(ac_j)) continue;
  3792.                     #endif
  3793.             #endif
  3794.                 if(!strcmp(ACInfo[playerid][acIp], ACInfo[ac_j][acIp], false))
  3795.                 {
  3796.                     ac_i--;
  3797.                     if(ac_i < 1)
  3798.                     {
  3799.                         #if defined DEBUG
  3800.                             printf(DEBUG_CODE_3, playerid, AC_MAX_CONNECTS_FROM_IP);
  3801.                         #endif
  3802.                         ac_KickWithCode(playerid, "", 0, 40);
  3803.                         break;
  3804.                     }
  3805.                 }
  3806.             }
  3807.         }
  3808.         ACInfo[playerid][acSpec] =
  3809.         ACInfo[playerid][acForceClass] =
  3810.         ACInfo[playerid][acDeathRes] = false;
  3811.         ACInfo[playerid][acClassRes] =
  3812.         ACInfo[playerid][acDead] = true;
  3813.         ACInfo[playerid][acIntEnterExits] = ac_IntEnterExits;
  3814.         ACInfo[playerid][acStuntBonus] = ac_StuntBonus;
  3815.         ACInfo[playerid][acCheatCount][25] =
  3816.         ACInfo[playerid][acCheatCount][0] =
  3817.         ACInfo[playerid][acHoldWeapon] =
  3818.         ACInfo[playerid][acLastWeapon] =
  3819.         ACInfo[playerid][acSpawnRes] =
  3820.         ACInfo[playerid][acCamMode] =
  3821.         ACInfo[playerid][acMoney] =
  3822.         ACInfo[playerid][acAnim] =
  3823.         ACInfo[playerid][acPackets] =
  3824.         ACInfo[playerid][acLastPackets] =
  3825.         ACInfo[playerid][acInt] = 0;
  3826.         ACInfo[playerid][acSet][11] =
  3827.         ACInfo[playerid][acSet][10] =
  3828.         ACInfo[playerid][acSet][6] =
  3829.         ACInfo[playerid][acSet][5] =
  3830.         ACInfo[playerid][acSet][0] =
  3831.         ACInfo[playerid][acNextDialog] =
  3832.         ACInfo[playerid][acDialog] = -1;
  3833.         ACInfo[playerid][acDropJpX] =
  3834.         ACInfo[playerid][acDropJpY] =
  3835.         ACInfo[playerid][acDropJpZ] = 25000.0;
  3836.         for(ac_i = 12; ac_i >= 0; --ac_i)
  3837.         {
  3838.             ACInfo[playerid][acSetWeapon][ac_i] = -1;
  3839.             ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  3840.         }
  3841.         for(ac_i = sizeof(ac_Mtfc) - 1; ac_i >= 0; --ac_i) ACInfo[playerid][acFloodCount][ac_i] = 0;
  3842.         ACInfo[playerid][acNOPAllow] = ac_NOPAllow;
  3843.         ACInfo[playerid][acACAllow] = ac_ACAllow;
  3844.         if(ACInfo[playerid][acKicked] < 1)
  3845.         {
  3846.             ACInfo[playerid][acTimerTick] = ACInfo[playerid][acFiveSecTick] = GetTickCount();
  3847.             ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
  3848.         }
  3849.     #if AC_USE_NPC
  3850.         }
  3851.     #endif
  3852.     ACInfo[playerid][acOnline] = true;
  3853.     #if defined ac_OnPlayerConnect
  3854.         return ac_OnPlayerConnect(playerid);
  3855.     #else
  3856.         return 1;
  3857.     #endif
  3858. }
  3859.  
  3860. #if defined _ALS_OnPlayerConnect
  3861.     #undef OnPlayerConnect
  3862. #else
  3863.     #define _ALS_OnPlayerConnect
  3864. #endif
  3865. #define OnPlayerConnect ac_OnPlayerConnect
  3866. #if defined ac_OnPlayerConnect
  3867.     forward ac_OnPlayerConnect(playerid);
  3868. #endif
  3869.  
  3870. public OnPlayerDisconnect(playerid, reason)
  3871. {
  3872.     #if AC_USE_NPC
  3873.         if(!IsPlayerNPC(playerid))
  3874.         {
  3875.     #endif
  3876.         KillTimer(ACInfo[playerid][acTimerID]);
  3877.         #if defined BlockIpAddress && AC_MAX_CONNECTS_FROM_IP < 2
  3878.             if(ACInfo[playerid][acACAllow][37])
  3879.             {
  3880.                 #if defined GetConsoleVarAsInt
  3881.                     BlockIpAddress(ACInfo[playerid][acIp], (AC_MIN_TIME_RECONNECT * 1000) - (reason > 0 ? 0 : GetConsoleVarAsInt("playertimeout")));
  3882.                 #else
  3883.                     BlockIpAddress(ACInfo[playerid][acIp], (AC_MIN_TIME_RECONNECT * 1000) - (reason > 0 ? 0 : GetServerVarAsInt("playertimeout")));
  3884.                 #endif
  3885.             }
  3886.         #endif
  3887.         #undef AC_MAX_CONNECTS_FROM_IP
  3888.         #undef AC_MIN_TIME_RECONNECT
  3889.     #if AC_USE_NPC
  3890.         }
  3891.     #endif
  3892.     KillTimer(ACInfo[playerid][acKickTimerID]);
  3893.     new ac_vehid = ACInfo[playerid][acKickVeh];
  3894.     if(ac_vehid > 0)
  3895.     {
  3896.         if(ACVehInfo[ac_vehid][acDriver] == playerid) ACVehInfo[ac_vehid][acDriver] = INVALID_PLAYER_ID;
  3897.         if(ACInfo[playerid][acKicked] == 2)
  3898.         {
  3899.             LinkVehicleToInterior(ac_vehid, ACVehInfo[ac_vehid][acInt]);
  3900.             SetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
  3901.             SetVehiclePos(ac_vehid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]);
  3902.             SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
  3903.             ChangeVehiclePaintjob(ac_vehid, ACVehInfo[ac_vehid][acPaintJob]);
  3904.         }
  3905.     }
  3906.     if((ac_vehid = ACInfo[playerid][acVeh]) > 0)
  3907.     {
  3908.         if(ACVehInfo[ac_vehid][acDriver] == playerid) ACVehInfo[ac_vehid][acDriver] = INVALID_PLAYER_ID;
  3909.         if(ACInfo[playerid][acKicked] == 2)
  3910.         {
  3911.             LinkVehicleToInterior(ac_vehid, ACVehInfo[ac_vehid][acInt]);
  3912.             SetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
  3913.             SetVehiclePos(ac_vehid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]);
  3914.             SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
  3915.             ChangeVehiclePaintjob(ac_vehid, ACVehInfo[ac_vehid][acPaintJob]);
  3916.         }
  3917.     }
  3918.     ACInfo[playerid][acOnline] = false;
  3919.     if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acKicked] = 3;
  3920.     #if defined ac_OnPlayerDisconnect
  3921.         return ac_OnPlayerDisconnect(playerid, reason);
  3922.     #else
  3923.         return 1;
  3924.     #endif
  3925. }
  3926.  
  3927. #if defined _ALS_OnPlayerDisconnect
  3928.     #undef OnPlayerDisconnect
  3929. #else
  3930.     #define _ALS_OnPlayerDisconnect
  3931. #endif
  3932. #define OnPlayerDisconnect ac_OnPlayerDisconnect
  3933. #if defined ac_OnPlayerDisconnect
  3934.     forward ac_OnPlayerDisconnect(playerid, reason);
  3935. #endif
  3936.  
  3937. public OnPlayerSpawn(playerid)
  3938. {
  3939.     if(ACInfo[playerid][acKicked] > 0) return 0;
  3940.     new ac_i, bool:ac_ur;
  3941.     #if AC_USE_NPC
  3942.         if(!IsPlayerNPC(playerid))
  3943.         {
  3944.     #endif
  3945.         new ac_gtc = GetTickCount();
  3946.         if(ACInfo[playerid][acSpec] &&
  3947.         (ACInfo[playerid][acSet][6] <= 1 || ACInfo[playerid][acSet][6] == 4))
  3948.         {
  3949.             ACInfo[playerid][acSet][3] =
  3950.             ACInfo[playerid][acSet][7] =
  3951.             ACInfo[playerid][acSet][8] = -1;
  3952.             ACInfo[playerid][acSpec] = false;
  3953.         }
  3954.         else
  3955.         {
  3956.             if(ACInfo[playerid][acACAllow][27] &&
  3957.             (ACInfo[playerid][acSpawnRes] < 1 || ac_gtc - ACInfo[playerid][acSpawnTick] < 1000))
  3958.             {
  3959.                 #if defined DEBUG
  3960.                     printf("[Nex-AC debug] Spawn res: %d, respawn time: %d",
  3961.                     ACInfo[playerid][acSpawnRes], ac_gtc - ACInfo[playerid][acSpawnTick]);
  3962.                 #endif
  3963.                 ac_KickWithCode(playerid, "", 0, 27);
  3964.                 #if defined OnCheatDetected
  3965.                     ACInfo[playerid][acSpawnRes] = 1;
  3966.                 #endif
  3967.             }
  3968.             if(ACInfo[playerid][acSpawnRes] > 0) ACInfo[playerid][acSpawnRes]--;
  3969.             if(ACInfo[playerid][acSet][6] != 2 && ACInfo[playerid][acSet][6] != 5) ACInfo[playerid][acSpec] = false;
  3970.             if(!(1 <= ACInfo[playerid][acSet][6] <= 2))
  3971.             {
  3972.                 for(ac_i = 11; ac_i >= 0; --ac_i) ACInfo[playerid][acSet][ac_i] = -1;
  3973.                 ac_ur = true;
  3974.             }
  3975.         }
  3976.         if(!(1 <= ACInfo[playerid][acSet][6] <= 2))
  3977.         {
  3978.             for(ac_i = 12; ac_i >= 0; --ac_i)
  3979.             {
  3980.                 ACInfo[playerid][acSetWeapon][ac_i] = -1;
  3981.                 ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  3982.             }
  3983.             ACInfo[playerid][acNextSpecAct] = -1;
  3984.             ACInfo[playerid][acUnFrozen] = true;
  3985.             #if defined FreezeSyncPacket
  3986.                 FreezeSyncPacket(playerid, E_ALL_SYNC, false);
  3987.             #endif
  3988.         }
  3989.         for(ac_i = 12; ac_i >= 0; --ac_i)
  3990.         {
  3991.             ACInfo[playerid][acWeapon][ac_i] =
  3992.             ACInfo[playerid][acAmmo][ac_i] = 0;
  3993.         }
  3994.         ACInfo[playerid][acModShop] =
  3995.         ACInfo[playerid][acForceClass] =
  3996.         ACInfo[playerid][acClassRes] =
  3997.         ACInfo[playerid][acDeathRes] =
  3998.         ACInfo[playerid][acDmgRes] =
  3999.         ACInfo[playerid][acDead] = false;
  4000.         ACInfo[playerid][acLastPickup] =
  4001.         ACInfo[playerid][acSet][6] =
  4002.         ACInfo[playerid][acSet][12] =
  4003.         ACInfo[playerid][acSeat] = -1;
  4004.         ACInfo[playerid][acCheatCount][5] =
  4005.         ACInfo[playerid][acCheatCount][6] =
  4006.         ACInfo[playerid][acCheatCount][7] =
  4007.         ACInfo[playerid][acCheatCount][8] =
  4008.         ACInfo[playerid][acCheatCount][9] =
  4009.         ACInfo[playerid][acCheatCount][11] =
  4010.         ACInfo[playerid][acCheatCount][14] =
  4011.         ACInfo[playerid][acCheatCount][16] =
  4012.         ACInfo[playerid][acCheatCount][18] =
  4013.         ACInfo[playerid][acCheatCount][26] =
  4014.         ACInfo[playerid][acLastSpecAct] =
  4015.         ACInfo[playerid][acHoldWeapon] =
  4016.         ACInfo[playerid][acLastWeapon] =
  4017.         ACInfo[playerid][acParachute] =
  4018.         ACInfo[playerid][acShotWeapon] =
  4019.         ACInfo[playerid][acKickVeh] =
  4020.         ACInfo[playerid][acSpecAct] =
  4021.         ACInfo[playerid][acIntRet] =
  4022.         ACInfo[playerid][acSpeed] =
  4023.         ACInfo[playerid][acVeh] = 0;
  4024.         ACInfo[playerid][acVelZ] = 0.0;
  4025.         ACInfo[playerid][acSetPosTick] = ac_gtc + 2650;
  4026.         ACInfo[playerid][acGtc][6] = ac_gtc + 1650;
  4027.         if(ac_IsValidWeapon(ACInfo[playerid][acSpawnWeapon1]))
  4028.         {
  4029.             ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon1]];
  4030.             ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon1];
  4031.             ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo1];
  4032.         }
  4033.         if(ac_IsValidWeapon(ACInfo[playerid][acSpawnWeapon2]))
  4034.         {
  4035.             ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon2]];
  4036.             ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon2];
  4037.             ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo2];
  4038.         }
  4039.         if(ac_IsValidWeapon(ACInfo[playerid][acSpawnWeapon3]))
  4040.         {
  4041.             ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon3]];
  4042.             ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon3];
  4043.             ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo3];
  4044.         }
  4045.     #if AC_USE_NPC
  4046.         }
  4047.     #endif
  4048.     #if defined ac_OnPlayerSpawn
  4049.         ac_i = ac_OnPlayerSpawn(playerid);
  4050.     #endif
  4051.     if(ac_ur)
  4052.     {
  4053.         if(ACInfo[playerid][acSet][0] == -1) SetPlayerInterior(playerid, 0);
  4054.         if(ACInfo[playerid][acSet][1] == -1) SetPlayerHealth(playerid, 100.0);
  4055.         if(ACInfo[playerid][acSet][2] == -1) SetPlayerArmour(playerid, 0.0);
  4056.     }
  4057.     #if defined ac_OnPlayerSpawn
  4058.         return ac_i;
  4059.     #else
  4060.         return 1;
  4061.     #endif
  4062. }
  4063.  
  4064. #if defined _ALS_OnPlayerSpawn
  4065.     #undef OnPlayerSpawn
  4066. #else
  4067.     #define _ALS_OnPlayerSpawn
  4068. #endif
  4069. #define OnPlayerSpawn ac_OnPlayerSpawn
  4070. #if defined ac_OnPlayerSpawn
  4071.     forward ac_OnPlayerSpawn(playerid);
  4072. #endif
  4073.  
  4074. public OnPlayerDeath(playerid, killerid, reason)
  4075. {
  4076.     if(ACInfo[playerid][acKicked] > 0) return 0;
  4077.     if(ACInfo[playerid][acACAllow][28] &&
  4078.     (ACInfo[playerid][acDead] || !ACInfo[playerid][acDeathRes] &&
  4079.     (reason != WEAPON_COLLISION && reason != 255 || killerid != INVALID_PLAYER_ID)))
  4080.     {
  4081.         #if defined DEBUG
  4082.             printf("[Nex-AC debug] Is dead: %d, death res: %d, killerid: %d, reason: %d",
  4083.             ACInfo[playerid][acDead], ACInfo[playerid][acDeathRes], killerid, reason);
  4084.         #endif
  4085.         ac_KickWithCode(playerid, "", 0, 28);
  4086.     }
  4087.     ACInfo[playerid][acDead] = true;
  4088.     ACInfo[playerid][acDeathRes] = false;
  4089.     if(ACInfo[playerid][acSpawnRes] < 1) ACInfo[playerid][acSpawnTick] = GetTickCount();
  4090.     if(!ACInfo[playerid][acSpec]) ACInfo[playerid][acSpawnRes] = 1;
  4091.     #if defined ac_OnPlayerDeath
  4092.         return ac_OnPlayerDeath(playerid, killerid, reason);
  4093.     #else
  4094.         return 1;
  4095.     #endif
  4096. }
  4097.  
  4098. #if defined _ALS_OnPlayerDeath
  4099.     #undef OnPlayerDeath
  4100. #else
  4101.     #define _ALS_OnPlayerDeath
  4102. #endif
  4103. #define OnPlayerDeath ac_OnPlayerDeath
  4104. #if defined ac_OnPlayerDeath
  4105.     forward ac_OnPlayerDeath(playerid, killerid, reason);
  4106. #endif
  4107.  
  4108. #if defined OnPlayerWeaponShot
  4109.     public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  4110. #else
  4111.     public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
  4112. #endif
  4113. {
  4114.     if(ACInfo[playerid][acKicked] > 0) return 1;
  4115.     #if defined OnPlayerWeaponShot
  4116.     if(ACInfo[playerid][acACAllow][47] &&
  4117.     (amount < 0.0 || issuerid != INVALID_PLAYER_ID && !(0 <= issuerid < MAX_PLAYERS) || !(3 <= bodypart <= 9) || !ac_IsValidDamageReason(weaponid)))
  4118.     #else
  4119.     if(ACInfo[playerid][acACAllow][47] &&
  4120.     (amount < 0.0 || issuerid != INVALID_PLAYER_ID && !(0 <= issuerid < MAX_PLAYERS) || !ac_IsValidDamageReason(weaponid)))
  4121.     #endif
  4122.     {
  4123.         #if defined DEBUG
  4124.             #if defined OnPlayerWeaponShot
  4125.                 printf("[Nex-AC debug] Issuerid: %d, amount: %f, weaponid: %d, bodypart: %d",
  4126.                 issuerid, amount, weaponid, bodypart);
  4127.             #else
  4128.                 printf("[Nex-AC debug] Issuerid: %d, amount: %f, weaponid: %d", issuerid, amount, weaponid);
  4129.             #endif
  4130.         #endif
  4131.         ac_KickWithCode(playerid, "", 0, 47, 4);
  4132.         return 1;
  4133.     }
  4134.     #if defined IsPlayerDying
  4135.         if(!IsPlayerDying(playerid)) ACInfo[playerid][acDeathRes] = true;
  4136.     #else
  4137.         if(!ACInfo[playerid][acDead]) ACInfo[playerid][acDeathRes] = true;
  4138.     #endif
  4139.     #if defined ac_OnPlayerTakeDamage
  4140.         #if defined OnPlayerWeaponShot
  4141.             return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid, bodypart);
  4142.         #else
  4143.             return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid);
  4144.         #endif
  4145.     #else
  4146.         return 0;
  4147.     #endif
  4148. }
  4149.  
  4150. #if defined _ALS_OnPlayerTakeDamage
  4151.     #undef OnPlayerTakeDamage
  4152. #else
  4153.     #define _ALS_OnPlayerTakeDamage
  4154. #endif
  4155. #define OnPlayerTakeDamage ac_OnPlayerTakeDamage
  4156. #if defined ac_OnPlayerTakeDamage
  4157.     #if defined OnPlayerWeaponShot
  4158.         forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  4159.     #else
  4160.         forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid);
  4161.     #endif
  4162. #endif
  4163.  
  4164. #if defined OnPlayerWeaponShot
  4165.     public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  4166. #else
  4167.     public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
  4168. #endif
  4169. {
  4170.     if(ACInfo[playerid][acKicked] > 0) return 1;
  4171.     if(ACInfo[playerid][acACAllow][47])
  4172.     {
  4173.         #if defined OnPlayerWeaponShot
  4174.         if(amount < 0.0 || !(0 <= damagedid < MAX_PLAYERS) || !(3 <= bodypart <= 9) || !ac_IsValidWeapon(weaponid))
  4175.         #else
  4176.         if(amount < 0.0 || !(0 <= damagedid < MAX_PLAYERS) || !ac_IsValidWeapon(weaponid))
  4177.         #endif
  4178.         {
  4179.             #if defined DEBUG
  4180.                 #if defined OnPlayerWeaponShot
  4181.                     printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d, bodypart: %d",
  4182.                     damagedid, amount, weaponid, bodypart);
  4183.                 #else
  4184.                     printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d", damagedid, amount, weaponid);
  4185.                 #endif
  4186.             #endif
  4187.             ac_KickWithCode(playerid, "", 0, 47, 3);
  4188.             return 1;
  4189.         }
  4190.         new ac_s = ac_wSlot[weaponid];
  4191.         #if defined IsPlayerDying
  4192.             if(!IsPlayerDying(playerid))
  4193.         #else
  4194.             if(!ACInfo[playerid][acDead])
  4195.         #endif
  4196.         {
  4197.             if(ACInfo[playerid][acWeapon][ac_s] != weaponid &&
  4198.             ACInfo[playerid][acSetWeapon][ac_s] != weaponid && weaponid != WEAPON_FLAMETHROWER &&
  4199.             GetTickCount() - ACInfo[playerid][acGtc][6] > GetPlayerPing(playerid))
  4200.             {
  4201.                 #if defined DEBUG
  4202.                     #if defined OnPlayerWeaponShot
  4203.                         printf("[Nex-AC debug] Damagedid: %d, amount: %f, AC weapon: %d, weaponid: %d, bodypart: %d",
  4204.                         damagedid, amount, ACInfo[playerid][acWeapon][ac_s], weaponid, bodypart);
  4205.                     #else
  4206.                         printf("[Nex-AC debug] Damagedid: %d, amount: %f, AC weapon: %d, weaponid: %d",
  4207.                         damagedid, amount, ACInfo[playerid][acWeapon][ac_s], weaponid);
  4208.                     #endif
  4209.                 #endif
  4210.                 ac_KickWithCode(playerid, "", 0, 47, 5);
  4211.                 return 1;
  4212.             }
  4213.         }
  4214.     }
  4215.     #if defined ac_OnPlayerGiveDamage
  4216.         #if defined OnPlayerWeaponShot
  4217.             return ac_OnPlayerGiveDamage(playerid, damagedid, amount, weaponid, bodypart);
  4218.         #else
  4219.             return ac_OnPlayerGiveDamage(playerid, damagedid, amount, weaponid);
  4220.         #endif
  4221.     #else
  4222.         return 0;
  4223.     #endif
  4224. }
  4225.  
  4226. #if defined _ALS_OnPlayerGiveDamage
  4227.     #undef OnPlayerGiveDamage
  4228. #else
  4229.     #define _ALS_OnPlayerGiveDamage
  4230. #endif
  4231. #define OnPlayerGiveDamage ac_OnPlayerGiveDamage
  4232. #if defined ac_OnPlayerGiveDamage
  4233.     #if defined OnPlayerWeaponShot
  4234.         forward ac_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart);
  4235.     #else
  4236.         forward ac_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid);
  4237.     #endif
  4238. #endif
  4239.  
  4240. #endif
  4241.  
  4242. #if defined FILTERSCRIPT
  4243.  
  4244. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  4245. {
  4246.     if(dialogid != AntiCheatGetDialog(playerid))
  4247.     {
  4248.         new ac_nd = fs_AntiCheatGetNextDialog(playerid);
  4249.         if(dialogid == ac_nd) fs_AntiCheatSetDialog(playerid, ac_nd);
  4250.     }
  4251.     fs_AntiCheatSetNextDialog(playerid, -1);
  4252.     #if defined ac_fs_OnDialogResponse
  4253.         return ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  4254.     #else
  4255.         return 0;
  4256.     #endif
  4257. }
  4258.  
  4259. #if defined _ALS_OnDialogResponse
  4260.     #undef OnDialogResponse
  4261. #else
  4262.     #define _ALS_OnDialogResponse
  4263. #endif
  4264. #define OnDialogResponse ac_fs_OnDialogResponse
  4265. #if defined ac_fs_OnDialogResponse
  4266.     forward ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  4267. #endif
  4268.  
  4269. #else
  4270.  
  4271. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  4272. {
  4273.     if(ACInfo[playerid][acKicked] > 0) return 1;
  4274.     new ac_i = GetTickCount();
  4275.     if(ACInfo[playerid][acACAllow][49])
  4276.     {
  4277.         if(ac_i - ACInfo[playerid][acCall][0] < ac_Mtfc[0][0]) ac_FloodDetect(playerid, 0);
  4278.         else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4279.         else ACInfo[playerid][acFloodCount][0] = ACInfo[playerid][acFloodCount][27] = 0;
  4280.     }
  4281.     if(ACInfo[playerid][acACAllow][39] && (dialogid != ACInfo[playerid][acDialog] || listitem < -1))
  4282.     {
  4283.         #if defined DEBUG
  4284.             printf("[Nex-AC debug] AC dialog: %d, dialogid: %d, listitem: %d", ACInfo[playerid][acDialog], dialogid, listitem);
  4285.         #endif
  4286.         ac_KickWithCode(playerid, "", 0, 39);
  4287.         return 1;
  4288.     }
  4289.     ACInfo[playerid][acDialog] = -1;
  4290.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][0] = ac_i;
  4291.     if(ACInfo[playerid][acACAllow][45])
  4292.     {
  4293.         for(ac_i = strlen(inputtext) - 1; ac_i >= 0; --ac_i)
  4294.         {
  4295.             if(inputtext[ac_i] == '%') strdel(inputtext, ac_i, ac_i + 1);
  4296.         }
  4297.         while((ac_i = strfind(inputtext, "~k~")) != -1) strdel(inputtext, ac_i, ac_i + 3);
  4298.     }
  4299.     #if defined ac_OnDialogResponse
  4300.         return ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  4301.     #else
  4302.         return 0;
  4303.     #endif
  4304. }
  4305.  
  4306. #if defined _ALS_OnDialogResponse
  4307.     #undef OnDialogResponse
  4308. #else
  4309.     #define _ALS_OnDialogResponse
  4310. #endif
  4311. #define OnDialogResponse ac_OnDialogResponse
  4312. #if defined ac_OnDialogResponse
  4313.     forward ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  4314. #endif
  4315.  
  4316. public OnEnterExitModShop(playerid, enterexit, interiorid)
  4317. {
  4318.     if(ACInfo[playerid][acKicked] > 0) return 0;
  4319.     #if !AC_USE_TUNING_GARAGES
  4320.         if(ACInfo[playerid][acACAllow][23]) ac_KickWithCode(playerid, "", 0, 23, 1);
  4321.     #else
  4322.         if(ACInfo[playerid][acACAllow][23] &&
  4323.         (!(0 <= enterexit <= 1) || !(0 <= interiorid <= 3))) ac_KickWithCode(playerid, "", 0, 23, 1);
  4324.     #endif
  4325.     new ac_i = GetTickCount();
  4326.     if(ACInfo[playerid][acACAllow][49])
  4327.     {
  4328.         if(ac_i - ACInfo[playerid][acCall][1] < ac_Mtfc[1][0]) ac_FloodDetect(playerid, 1);
  4329.         else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4330.         else ACInfo[playerid][acFloodCount][1] = ACInfo[playerid][acFloodCount][27] = 0;
  4331.     }
  4332.     ACInfo[playerid][acModShop] = (enterexit != 0);
  4333.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][1] = ac_i;
  4334.     ACInfo[playerid][acSetPosTick] = ACInfo[playerid][acGtc][19] = ac_i + 3850;
  4335.     new ac_vehid = ACInfo[playerid][acVeh];
  4336.     if(ACInfo[playerid][acKicked] < 1)
  4337.     {
  4338.         ac_i = interiorid % 256;
  4339.         ACVehInfo[ac_vehid][acInt] = ac_i;
  4340.         #if defined foreach
  4341.             foreach(new ac_j : Player)
  4342.             {
  4343.                 if(ACInfo[ac_j][acVeh] != ac_vehid) continue;
  4344.         #else
  4345.             #if defined GetPlayerPoolSize
  4346.                 for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j)
  4347.             #else
  4348.                 for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j)
  4349.             #endif
  4350.             {
  4351.                 if(!IsPlayerInVehicle(ac_j, ac_vehid)) continue;
  4352.         #endif
  4353.             ACInfo[ac_j][acInt] = ac_i;
  4354.         }
  4355.     }
  4356.     else
  4357.     {
  4358.         #if defined foreach
  4359.             foreach(new ac_j : Player)
  4360.             {
  4361.                 if(ACInfo[ac_j][acVeh] != ac_vehid) continue;
  4362.         #else
  4363.             #if defined GetPlayerPoolSize
  4364.                 for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j)
  4365.             #else
  4366.                 for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j)
  4367.             #endif
  4368.             {
  4369.                 if(!IsPlayerInVehicle(ac_j, ac_vehid)) continue;
  4370.         #endif
  4371.             if(ACInfo[ac_j][acUnFrozen]) ACInfo[ac_j][acIntRet] = 2;
  4372.             else ACInfo[ac_j][acIntRet] = 1;
  4373.         }
  4374.     }
  4375.     #if defined ac_OnEnterExitModShop
  4376.         return ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  4377.     #else
  4378.         return 1;
  4379.     #endif
  4380. }
  4381.  
  4382. #if defined _ALS_OnEnterExitModShop
  4383.     #undef OnEnterExitModShop
  4384. #else
  4385.     #define _ALS_OnEnterExitModShop
  4386. #endif
  4387. #define OnEnterExitModShop ac_OnEnterExitModShop
  4388. #if defined ac_OnEnterExitModShop
  4389.     forward ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  4390. #endif
  4391.  
  4392. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  4393. {
  4394.     if(ACInfo[playerid][acKicked] > 0) return 0;
  4395.     if(ACInfo[playerid][acIntRet] > 0)
  4396.     {
  4397.         SetPlayerInterior(playerid, ACInfo[playerid][acInt]);
  4398.         if(ACInfo[playerid][acIntRet] == 2) TogglePlayerControllable(playerid, 1);
  4399.         ACInfo[playerid][acIntRet] = 0;
  4400.     }
  4401.     else if(newinteriorid != ACInfo[playerid][acSet][0])
  4402.     {
  4403.         if(ACInfo[playerid][acSet][0] == -1)
  4404.         {
  4405.             if(ACInfo[playerid][acVeh] > 0)
  4406.             {
  4407.                 if(ACInfo[playerid][acACAllow][3] && newinteriorid != ACInfo[playerid][acInt])
  4408.                 {
  4409.                     #if defined DEBUG
  4410.                         printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d, veh: %d",
  4411.                         ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid, ACInfo[playerid][acVeh]);
  4412.                     #endif
  4413.                     ac_KickWithCode(playerid, "", 0, 3, 1);
  4414.                 }
  4415.             }
  4416.             else if(ACInfo[playerid][acIntEnterExits]) ACInfo[playerid][acSetPosTick] = GetTickCount() + 3850;
  4417.             else if(ACInfo[playerid][acACAllow][2] && newinteriorid != ACInfo[playerid][acInt])
  4418.             {
  4419.                 #if defined DEBUG
  4420.                     printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d",
  4421.                     ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid);
  4422.                 #endif
  4423.                 ac_KickWithCode(playerid, "", 0, 2, 1);
  4424.             }
  4425.         }
  4426.     }
  4427.     else ACInfo[playerid][acSet][0] = -1;
  4428.     if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acInt] = newinteriorid % 256;
  4429.     #if defined ac_OnPlayerInteriorChange
  4430.         return ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  4431.     #else
  4432.         return 1;
  4433.     #endif
  4434. }
  4435.  
  4436. #if defined _ALS_OnPlayerInteriorChange
  4437.     #undef OnPlayerInteriorChange
  4438. #else
  4439.     #define _ALS_OnPlayerInteriorChange
  4440. #endif
  4441. #define OnPlayerInteriorChange ac_OnPlayerInteriorChange
  4442. #if defined ac_OnPlayerInteriorChange
  4443.     forward ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  4444. #endif
  4445.  
  4446. public OnRconLoginAttempt(ip[], password[], success)
  4447. {
  4448.     static ac_ipTables[MAX_PLAYERS][2], ac_ipIndex;
  4449.     new ac_i, ac_currentIp = ac_IpToInt(ip);
  4450.     for(; ac_i < sizeof ac_ipTables; ++ac_i)
  4451.     {
  4452.         if(ac_ipTables[ac_i][0] == ac_currentIp)
  4453.         {
  4454.             if(success) ac_ipTables[ac_i][1] = 0;
  4455.             else if(ac_ACAllow[42])
  4456.             {
  4457.                 if(++ac_ipTables[ac_i][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
  4458.                 {
  4459.                     #if defined DEBUG
  4460.                         printf(DEBUG_CODE_4, ip, password);
  4461.                     #endif
  4462.                     ac_ipTables[ac_i][1] = 0;
  4463.                     ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 1);
  4464.                 }
  4465.                 #if defined OnCheatWarning
  4466.                     else OnCheatWarning(INVALID_PLAYER_ID, ip, 1, 42, 1, ac_ipTables[ac_i][1]);
  4467.                 #endif
  4468.             }
  4469.             ac_i = -1;
  4470.             break;
  4471.         }
  4472.     }
  4473.     if(ac_i != -1 && !success)
  4474.     {
  4475.         ac_ipTables[ac_ipIndex][0] = ac_currentIp;
  4476.         if(ac_ACAllow[42])
  4477.         {
  4478.             if(++ac_ipTables[ac_ipIndex][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
  4479.             {
  4480.                 #undef AC_MAX_RCON_LOGIN_ATTEMPT
  4481.                 #if defined DEBUG
  4482.                     printf(DEBUG_CODE_4, ip, password, ac_ipTables[ac_ipIndex][1]);
  4483.                 #endif
  4484.                 ac_ipTables[ac_ipIndex][1] = 0;
  4485.                 ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 2);
  4486.             }
  4487.             #if defined OnCheatWarning
  4488.                 else OnCheatWarning(INVALID_PLAYER_ID, ip, 1, 42, 2, ac_ipTables[ac_ipIndex][1]);
  4489.             #endif
  4490.         }
  4491.         if(++ac_ipIndex >= sizeof ac_ipTables) ac_ipIndex = 0;
  4492.         ac_ipTables[ac_ipIndex][1] = 0;
  4493.     }
  4494.     #if defined ac_OnRconLoginAttempt
  4495.         return ac_OnRconLoginAttempt(ip, password, success);
  4496.     #else
  4497.         return 1;
  4498.     #endif
  4499. }
  4500.  
  4501. #if defined _ALS_OnRconLoginAttempt
  4502.     #undef OnRconLoginAttempt
  4503. #else
  4504.     #define _ALS_OnRconLoginAttempt
  4505. #endif
  4506. #define OnRconLoginAttempt ac_OnRconLoginAttempt
  4507. #if defined ac_OnRconLoginAttempt
  4508.     forward ac_OnRconLoginAttempt(ip[], password[], success);
  4509. #endif
  4510.  
  4511. public OnPlayerUpdate(playerid)
  4512. {
  4513.     if(ACInfo[playerid][acKicked] > 0) return 0;
  4514.     new ac_gtc = GetTickCount(), ac_gpp;
  4515.     #if AC_USE_NPC && defined IsPlayerDying
  4516.         if(!IsPlayerNPC(playerid) && !IsPlayerDying(playerid))
  4517.         {
  4518.     #elseif AC_USE_NPC
  4519.         if(!IsPlayerNPC(playerid))
  4520.         {
  4521.     #elseif defined IsPlayerDying
  4522.         if(!IsPlayerDying(playerid))
  4523.         {
  4524.     #endif
  4525.         new ac_w = GetPlayerWeapon(playerid);
  4526.         if(ac_w != -1)
  4527.         {
  4528.             ac_gpp = GetPlayerPing(playerid);
  4529.             if(ACInfo[playerid][acSet][6] != -1 && ac_gtc - ACInfo[playerid][acGtc][12] > ac_gpp)
  4530.             {
  4531.                 if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][9])
  4532.                 {
  4533.                     if(++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS)
  4534.                     {
  4535.                         #if defined DEBUG
  4536.                             printf(DEBUG_CODE_5, playerid, "SpawnPlayer");
  4537.                             printf("[Nex-AC debug] acSet[6]: %d", ACInfo[playerid][acSet][6]);
  4538.                         #endif
  4539.                         #if defined OnCheatDetected
  4540.                             ac_KickWithCode(playerid, "", 0, 52, 7);
  4541.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4542.                             ACInfo[playerid][acSet][6] = -1;
  4543.                         #else
  4544.                             return ac_KickWithCode(playerid, "", 0, 52, 7);
  4545.                         #endif
  4546.                     }
  4547.                     #if defined OnNOPWarning
  4548.                         else OnNOPWarning(playerid, 7, ACInfo[playerid][acNOPCount][9]);
  4549.                     #endif
  4550.                 }
  4551.                 else if(++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][6] = -1;
  4552.             }
  4553.             new ac_sa;
  4554.             if(!ACInfo[playerid][acSpec] && (ac_sa = GetPlayerState(playerid)) != PLAYER_STATE_SPECTATING)
  4555.             {
  4556.                 new ac_s = ac_wSlot[ac_w];
  4557.                 if(ACInfo[playerid][acSetWeapon][ac_s] > 0)
  4558.                 {
  4559.                     if(ACInfo[playerid][acSetWeapon][ac_s] == ac_w)
  4560.                     {
  4561.                         ACInfo[playerid][acSetWeapon][ac_s] = -1;
  4562.                         ACInfo[playerid][acWeapon][ac_s] = ac_w;
  4563.                     }
  4564.                     else if(!(PLAYER_STATE_DRIVER <= ac_sa <= PLAYER_STATE_PASSENGER) &&
  4565.                     ac_gtc - ACInfo[playerid][acGtcSetWeapon][ac_s] > ac_gpp)
  4566.                     {
  4567.                         #if defined FreezeSyncPacket
  4568.                             if(!ACInfo[playerid][acACAllow][33] || ACInfo[playerid][acUnFrozen])
  4569.                             {
  4570.                         #endif
  4571.                             if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][0])
  4572.                             {
  4573.                                 if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
  4574.                                 {
  4575.                                     #if defined DEBUG
  4576.                                         printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  4577.                                         printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSetWeapon][ac_s], ac_w);
  4578.                                     #endif
  4579.                                     #if defined OnCheatDetected
  4580.                                         ac_KickWithCode(playerid, "", 0, 52, 1);
  4581.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  4582.                                         ACInfo[playerid][acSetWeapon][ac_s] = -1;
  4583.                                     #else
  4584.                                         return ac_KickWithCode(playerid, "", 0, 52, 1);
  4585.                                     #endif
  4586.                                 }
  4587.                                 #if defined OnNOPWarning
  4588.                                     else OnNOPWarning(playerid, 1, ACInfo[playerid][acNOPCount][0]);
  4589.                                 #endif
  4590.                             }
  4591.                             else if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSetWeapon][ac_s] = -1;
  4592.                         #if defined FreezeSyncPacket
  4593.                             }
  4594.                         #endif
  4595.                     }
  4596.                 }
  4597.                 new ac_a = GetPlayerAmmo(playerid);
  4598.                 if(ACInfo[playerid][acGiveAmmo][ac_s] != -65535)
  4599.                 {
  4600.                     if(ACInfo[playerid][acGiveAmmo][ac_s] == ac_a ||
  4601.                     ACInfo[playerid][acGiveAmmo][ac_s] > ac_a && !(ac_a < 0 <= ACInfo[playerid][acGiveAmmo][ac_s]) &&
  4602.                     ac_gtc - ACInfo[playerid][acGtcGiveAmmo][ac_s] > ac_gpp)
  4603.                     {
  4604.                         ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  4605.                         ACInfo[playerid][acAmmo][ac_s] = ac_a;
  4606.                     }
  4607.                     else if(ac_gtc - ACInfo[playerid][acGtcGiveAmmo][ac_s] > ac_gpp)
  4608.                     {
  4609.                         if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][1])
  4610.                         {
  4611.                             if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS)
  4612.                             {
  4613.                                 #if defined DEBUG
  4614.                                     printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  4615.                                     printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  4616.                                     ACInfo[playerid][acGiveAmmo][ac_s], ac_a, ac_w);
  4617.                                 #endif
  4618.                                 #if defined OnCheatDetected
  4619.                                     ac_KickWithCode(playerid, "", 0, 52, 2);
  4620.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4621.                                     ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  4622.                                 #else
  4623.                                     return ac_KickWithCode(playerid, "", 0, 52, 2);
  4624.                                 #endif
  4625.                             }
  4626.                             #if defined OnNOPWarning
  4627.                                 else OnNOPWarning(playerid, 2, ACInfo[playerid][acNOPCount][1]);
  4628.                             #endif
  4629.                         }
  4630.                         else if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  4631.                     }
  4632.                 }
  4633.                 #if AC_USE_AMMUNATIONS || AC_USE_TUNING_GARAGES
  4634.                     new ac_money = orig_GetPlayerMoney(playerid);
  4635.                 #endif
  4636.                 #if AC_USE_AMMUNATIONS
  4637.                     if(ACInfo[playerid][acSet][10] != -1)
  4638.                     {
  4639.                         if(ac_money < ACInfo[playerid][acMoney] &&
  4640.                         ACInfo[playerid][acMoney] - ac_money >= ACInfo[playerid][acSet][10]) ACInfo[playerid][acSet][10] = -1;
  4641.                         else if(ac_gtc - ACInfo[playerid][acGtc][17] > ac_gpp)
  4642.                         {
  4643.                             if(ACInfo[playerid][acACAllow][15])
  4644.                             {
  4645.                                 if(++ACInfo[playerid][acCheatCount][20] > AC_MAX_NOP_WARNINGS)
  4646.                                 {
  4647.                                     #if defined DEBUG
  4648.                                         printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
  4649.                                         ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
  4650.                                     #endif
  4651.                                     #if defined OnCheatDetected
  4652.                                         ac_KickWithCode(playerid, "", 0, 15, 3);
  4653.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  4654.                                         ACInfo[playerid][acSet][10] = -1;
  4655.                                     #else
  4656.                                         return ac_KickWithCode(playerid, "", 0, 15, 3);
  4657.                                     #endif
  4658.                                 }
  4659.                                 #if defined OnCheatWarning
  4660.                                     else OnCheatWarning(playerid, "", 0, 15, 3, ACInfo[playerid][acCheatCount][20]);
  4661.                                 #endif
  4662.                             }
  4663.                             else if(++ACInfo[playerid][acCheatCount][20] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][10] = -1;
  4664.                         }
  4665.                     }
  4666.                 #endif
  4667.                 new ac_i = GetPlayerInterior(playerid), Float:ac_pX, Float:ac_pY, Float:ac_pZ, Float:ac_tmp;
  4668.                 GetPlayerPos(playerid, ac_pX, ac_pY, ac_pZ);
  4669.                 if(ACInfo[playerid][acHoldWeapon] != ac_w)
  4670.                 {
  4671.                     if(ACInfo[playerid][acWeapon][ac_s] != ac_w && ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp)
  4672.                     {
  4673.                         #if AC_USE_PICKUP_WEAPONS
  4674.                             #if defined Streamer_GetDistanceToItem\
  4675.                                 && defined Streamer_GetIntData
  4676.                             if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS) Streamer_GetDistanceToItem(ac_pX, ac_pY, ac_pZ, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_tmp);
  4677.                             if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  4678.                             ac_a <= (ac_IsAmmoSharingInSlot(ac_s) ? (ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) &&
  4679.                             IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  4680.                             ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) ||
  4681.                             ACInfo[playerid][acLastPickup] > MAX_PICKUPS &&
  4682.                             Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) == ac_w + 100 &&
  4683.                             ac_a <= (ac_IsAmmoSharingInSlot(ac_s) ? (ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) && ac_tmp <= 15.0)
  4684.                             #else
  4685.                             if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  4686.                             ac_a <= (ac_IsAmmoSharingInSlot(ac_s) ? (ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) &&
  4687.                             IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  4688.                             ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
  4689.                             #endif
  4690.                             {
  4691.                                 ACInfo[playerid][acWeapon][ac_s] = ac_w;
  4692.                                 ACInfo[playerid][acAmmo][ac_s] = ac_a;
  4693.                             }
  4694.                             else
  4695.                             {
  4696.                         #endif
  4697.                             #if AC_USE_AMMUNATIONS
  4698.                                 if(2 <= ac_s <= 5 && ac_InAmmuNation(playerid, ac_i))
  4699.                                 {
  4700.                                     ACInfo[playerid][acCheatCount][20] = 0;
  4701.                                     if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0];
  4702.                                     else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0];
  4703.                                     if(ac_s != 2) ACInfo[playerid][acAmmo][ac_s] += ac_AmmuNationInfo[ac_w - 22][1];
  4704.                                     else ACInfo[playerid][acAmmo][ac_s] = ac_AmmuNationInfo[ac_w - 22][1];
  4705.                                     ACInfo[playerid][acWeapon][ac_s] = ac_w;
  4706.                                     ACInfo[playerid][acGtc][17] = ac_gtc + 2650;
  4707.                                 }
  4708.                                 else
  4709.                                 {
  4710.                             #endif
  4711.                                 if(ac_w == 0 || ac_w == WEAPON_BOMB ||
  4712.                                 ac_w == WEAPON_PARACHUTE && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute] > 0)
  4713.                                 {
  4714.                                     if(ac_w == WEAPON_PARACHUTE) ACInfo[playerid][acParachute] = 0;
  4715.                                     ACInfo[playerid][acWeapon][ac_s] = ac_w;
  4716.                                     ACInfo[playerid][acAmmo][ac_s] = ac_a;
  4717.                                 }
  4718.                                 else if(ACInfo[playerid][acACAllow][15] && ACInfo[playerid][acSetWeapon][ac_s] == -1)
  4719.                                 {
  4720.                                     #if defined DEBUG
  4721.                                         printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
  4722.                                         ACInfo[playerid][acWeapon][ac_s], ACInfo[playerid][acAmmo][ac_s], ac_w, ac_a);
  4723.                                     #endif
  4724.                                     #if defined OnCheatDetected
  4725.                                         ac_KickWithCode(playerid, "", 0, 15, 1);
  4726.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  4727.                                         ACInfo[playerid][acWeapon][ac_s] = ac_w;
  4728.                                         ACInfo[playerid][acAmmo][ac_s] = ac_a;
  4729.                                     #else
  4730.                                         return ac_KickWithCode(playerid, "", 0, 15, 1);
  4731.                                     #endif
  4732.                                 }
  4733.                             #if AC_USE_AMMUNATIONS
  4734.                                 }
  4735.                             #endif
  4736.                         #if AC_USE_PICKUP_WEAPONS
  4737.                             }
  4738.                         #endif
  4739.                     }
  4740.                 }
  4741.                 else if(ACInfo[playerid][acAmmo][ac_s] != ac_a &&
  4742.                 !(PLAYER_STATE_DRIVER <= ac_sa <= PLAYER_STATE_PASSENGER) &&
  4743.                 7 <= ac_s <= 9 && ac_w != WEAPON_MINIGUN && ACInfo[playerid][acGiveAmmo][ac_s] == -65535 &&
  4744.                 ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp)
  4745.                 {
  4746.                     if(ACInfo[playerid][acACAllow][16] &&
  4747.                     (ACInfo[playerid][acAmmo][ac_s] == 0 || ac_a > ACInfo[playerid][acAmmo][ac_s] ||
  4748.                     ac_a < 0 < ACInfo[playerid][acAmmo][ac_s]))
  4749.                     {
  4750.                         #if defined DEBUG
  4751.                             printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  4752.                             ACInfo[playerid][acAmmo][ac_s], ac_a, ac_w);
  4753.                         #endif
  4754.                         #if defined OnCheatDetected
  4755.                             ac_KickWithCode(playerid, "", 0, 16, 1);
  4756.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4757.                         #else
  4758.                             return ac_KickWithCode(playerid, "", 0, 16, 1);
  4759.                         #endif
  4760.                     }
  4761.                     ACInfo[playerid][acAmmo][ac_s] = ac_a;
  4762.                 }
  4763.                 GetPlayerHealth(playerid, ac_tmp);
  4764.                 new ac_health = floatround(ac_tmp, floatround_tozero);
  4765.                 if(ACInfo[playerid][acSet][1] != -1)
  4766.                 {
  4767.                     if(ACInfo[playerid][acSet][1] > 255)
  4768.                     {
  4769.                         ac_health += 256 * (((ACInfo[playerid][acSet][1] - (ACInfo[playerid][acSet][1] % 256)) / 256) - 1);
  4770.                         if(ACInfo[playerid][acSet][1] - ac_health > 255) ac_health += 256;
  4771.                     }
  4772.                     if(ACInfo[playerid][acSet][1] == ac_health || ACInfo[playerid][acDmgRes] ||
  4773.                     ACInfo[playerid][acSet][1] > ac_health && ac_gtc - ACInfo[playerid][acGtc][2] > ac_gpp)
  4774.                     {
  4775.                         ACInfo[playerid][acSet][1] = -1;
  4776.                         ACInfo[playerid][acCheatCount][9] = 0;
  4777.                         ACInfo[playerid][acDmgRes] = false;
  4778.                         #if defined FreezeSyncPacket
  4779.                             if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  4780.                         #endif
  4781.                     }
  4782.                     else if(ac_gtc - ACInfo[playerid][acGtc][2] > ac_gpp)
  4783.                     {
  4784.                         if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][3])
  4785.                         {
  4786.                             if(++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS)
  4787.                             {
  4788.                                 #if defined DEBUG
  4789.                                     printf(DEBUG_CODE_5, playerid, "SetPlayerHealth");
  4790.                                     printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acSet][1], ac_health);
  4791.                                 #endif
  4792.                                 #if defined OnCheatDetected
  4793.                                     ac_KickWithCode(playerid, "", 0, 52, 3);
  4794.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4795.                                     #if defined FreezeSyncPacket
  4796.                                         else if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  4797.                                     #endif
  4798.                                     ACInfo[playerid][acSet][1] = -1;
  4799.                                 #else
  4800.                                     return ac_KickWithCode(playerid, "", 0, 52, 3);
  4801.                                 #endif
  4802.                             }
  4803.                             #if defined OnNOPWarning
  4804.                                 else OnNOPWarning(playerid, 3, ACInfo[playerid][acNOPCount][3]);
  4805.                             #endif
  4806.                         }
  4807.                         else if(++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS)
  4808.                         {
  4809.                             ACInfo[playerid][acSet][1] = -1;
  4810.                             #if defined FreezeSyncPacket
  4811.                                 if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  4812.                             #endif
  4813.                         }
  4814.                     }
  4815.                 }
  4816.                 else if(ACInfo[playerid][acACAllow][12])
  4817.                 {
  4818.                     if(ACInfo[playerid][acHealth] > 255)
  4819.                     {
  4820.                         ac_health += 256 * (((ACInfo[playerid][acHealth] - (ACInfo[playerid][acHealth] % 256)) / 256) - 1);
  4821.                         if(ACInfo[playerid][acHealth] - ac_health > 255) ac_health += 256;
  4822.                     }
  4823.                     if(ac_health > ACInfo[playerid][acHealth])
  4824.                     {
  4825.                         #if AC_USE_RESTAURANTS
  4826.                             if(ac_health - ACInfo[playerid][acHealth] > 70 || !ac_InRestaurant(playerid, ac_i))
  4827.                             {
  4828.                         #endif
  4829.                             #if AC_USE_VENDING_MACHINES
  4830.                                 if(ac_health - ACInfo[playerid][acHealth] > 35 || !ac_NearVendingMachine(playerid, ac_i))
  4831.                                 {
  4832.                             #endif
  4833.                                 #if defined DEBUG
  4834.                                     printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acHealth], ac_health);
  4835.                                 #endif
  4836.                                 #if defined OnCheatDetected
  4837.                                     ac_KickWithCode(playerid, "", 0, 12);
  4838.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4839.                                 #else
  4840.                                     return ac_KickWithCode(playerid, "", 0, 12);
  4841.                                 #endif
  4842.                             #if AC_USE_VENDING_MACHINES
  4843.                                 }
  4844.                             #endif
  4845.                         #if AC_USE_RESTAURANTS
  4846.                             }
  4847.                         #endif
  4848.                     }
  4849.                 }
  4850.                 GetPlayerArmour(playerid, ac_tmp);
  4851.                 new ac_armour = floatround(ac_tmp, floatround_tozero);
  4852.                 if(ACInfo[playerid][acSet][2] != -1)
  4853.                 {
  4854.                     if(ACInfo[playerid][acSet][2] > 255)
  4855.                     {
  4856.                         ac_armour += 256 * (((ACInfo[playerid][acSet][2] - (ACInfo[playerid][acSet][2] % 256)) / 256) - 1);
  4857.                         if(ACInfo[playerid][acSet][2] - ac_armour > 255) ac_armour += 256;
  4858.                     }
  4859.                     if(ACInfo[playerid][acSet][2] == ac_armour || ACInfo[playerid][acDmgRes] ||
  4860.                     ACInfo[playerid][acSet][2] > ac_armour && ac_gtc - ACInfo[playerid][acGtc][4] > ac_gpp)
  4861.                     {
  4862.                         ACInfo[playerid][acSet][2] = -1;
  4863.                         ACInfo[playerid][acCheatCount][9] = 0;
  4864.                         ACInfo[playerid][acDmgRes] = false;
  4865.                         #if defined FreezeSyncPacket
  4866.                             if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  4867.                         #endif
  4868.                     }
  4869.                     else if(ac_gtc - ACInfo[playerid][acGtc][4] > ac_gpp)
  4870.                     {
  4871.                         if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][5])
  4872.                         {
  4873.                             if(++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS)
  4874.                             {
  4875.                                 #if defined DEBUG
  4876.                                     printf(DEBUG_CODE_5, playerid, "SetPlayerArmour");
  4877.                                     printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acSet][2], ac_armour);
  4878.                                 #endif
  4879.                                 #if defined OnCheatDetected
  4880.                                     ac_KickWithCode(playerid, "", 0, 52, 4);
  4881.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4882.                                     #if defined FreezeSyncPacket
  4883.                                         else if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  4884.                                     #endif
  4885.                                     ACInfo[playerid][acSet][2] = -1;
  4886.                                 #else
  4887.                                     return ac_KickWithCode(playerid, "", 0, 52, 4);
  4888.                                 #endif
  4889.                             }
  4890.                             #if defined OnNOPWarning
  4891.                                 else OnNOPWarning(playerid, 4, ACInfo[playerid][acNOPCount][5]);
  4892.                             #endif
  4893.                         }
  4894.                         else if(++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS)
  4895.                         {
  4896.                             ACInfo[playerid][acSet][2] = -1;
  4897.                             #if defined FreezeSyncPacket
  4898.                                 if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  4899.                             #endif
  4900.                         }
  4901.                     }
  4902.                 }
  4903.                 else if(ACInfo[playerid][acACAllow][13])
  4904.                 {
  4905.                     if(ACInfo[playerid][acArmour] > 255)
  4906.                     {
  4907.                         ac_armour += 256 * (((ACInfo[playerid][acArmour] - (ACInfo[playerid][acArmour] % 256)) / 256) - 1);
  4908.                         if(ACInfo[playerid][acArmour] - ac_armour > 255) ac_armour += 256;
  4909.                     }
  4910.                     if(ac_armour > ACInfo[playerid][acArmour])
  4911.                     {
  4912.                         #if AC_USE_AMMUNATIONS
  4913.                             if(ac_armour == 100 && ac_InAmmuNation(playerid, ac_i))
  4914.                             {
  4915.                                 ACInfo[playerid][acCheatCount][20] = 0;
  4916.                                 if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += 200;
  4917.                                 else ACInfo[playerid][acSet][10] = 200;
  4918.                                 ACInfo[playerid][acGtc][17] = ac_gtc + 2650;
  4919.                             }
  4920.                             else
  4921.                             {
  4922.                         #endif
  4923.                             #if defined DEBUG
  4924.                                 printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acArmour], ac_armour);
  4925.                             #endif
  4926.                             #if defined OnCheatDetected
  4927.                                 ac_KickWithCode(playerid, "", 0, 13);
  4928.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  4929.                             #else
  4930.                                 return ac_KickWithCode(playerid, "", 0, 13);
  4931.                             #endif
  4932.                         #if AC_USE_AMMUNATIONS
  4933.                             }
  4934.                         #endif
  4935.                     }
  4936.                 }
  4937.                 if(ac_health < ACInfo[playerid][acHealth] || ac_armour < ACInfo[playerid][acArmour])
  4938.                 {
  4939.                     ACInfo[playerid][acDmgRes] = ACInfo[playerid][acVehDmgRes] = false;
  4940.                     ACInfo[playerid][acCheatCount][9] = 0;
  4941.                 }
  4942.                 else if(ACInfo[playerid][acACAllow][19] &&
  4943.                 ACInfo[playerid][acDmgRes] && ac_gtc - ACInfo[playerid][acGtc][13] > ac_gpp)
  4944.                 {
  4945.                     ACInfo[playerid][acDmgRes] = ACInfo[playerid][acVehDmgRes] = false;
  4946.                     if(++ACInfo[playerid][acCheatCount][9] > AC_MAX_GODMODE_WARNINGS)
  4947.                     {
  4948.                         #undef AC_MAX_GODMODE_WARNINGS
  4949.                         #if defined DEBUG
  4950.                             printf("[Nex-AC debug] AC health: %d, health: %d, AC armour: %d, armour: %d",
  4951.                             ACInfo[playerid][acHealth], ac_health, ACInfo[playerid][acArmour], ac_armour);
  4952.                         #endif
  4953.                         #if defined OnCheatDetected
  4954.                             ac_KickWithCode(playerid, "", 0, 19);
  4955.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  4956.                             ACInfo[playerid][acCheatCount][9] = 0;
  4957.                         #else
  4958.                             return ac_KickWithCode(playerid, "", 0, 19);
  4959.                         #endif
  4960.                     }
  4961.                     #if defined OnCheatWarning
  4962.                         else OnCheatWarning(playerid, "", 0, 19, 0, ACInfo[playerid][acCheatCount][9]);
  4963.                     #endif
  4964.                 }
  4965.                 #if AC_USE_TUNING_GARAGES
  4966.                 if(ACInfo[playerid][acSet][11] != -1)
  4967.                 {
  4968.                     if(ac_money < ACInfo[playerid][acMoney] &&
  4969.                     ACInfo[playerid][acMoney] - ac_money >= ACInfo[playerid][acSet][11]) ACInfo[playerid][acSet][11] = -1;
  4970.                     else if(ac_gtc - ACInfo[playerid][acGtc][18] > ac_gpp)
  4971.                     {
  4972.                         if(ACInfo[playerid][acACAllow][23])
  4973.                         {
  4974.                             if(++ACInfo[playerid][acCheatCount][21] > AC_MAX_NOP_WARNINGS)
  4975.                             {
  4976.                                 #if defined DEBUG
  4977.                                     printf("[Nex-AC debug] Money: %d, old money: %d, components price: %d",
  4978.                                     ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][11]);
  4979.                                 #endif
  4980.                                 #if defined OnCheatDetected
  4981.                                     ac_KickWithCode(playerid, "", 0, 23, 3);
  4982.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  4983.                                     ACInfo[playerid][acSet][11] = -1;
  4984.                                 #else
  4985.                                     return ac_KickWithCode(playerid, "", 0, 23, 3);
  4986.                                 #endif
  4987.                             }
  4988.                             #if defined OnCheatWarning
  4989.                                 else OnCheatWarning(playerid, "", 0, 23, 3, ACInfo[playerid][acCheatCount][21]);
  4990.                             #endif
  4991.                         }
  4992.                         else if(++ACInfo[playerid][acCheatCount][21] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][11] = -1;
  4993.                     }
  4994.                 }
  4995.                 #endif
  4996.                 if(ACInfo[playerid][acSet][0] != -1 && ac_gtc - ACInfo[playerid][acGtc][0] > ac_gpp)
  4997.                 {
  4998.                     if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][2] && ac_i != ACInfo[playerid][acSet][0])
  4999.                     {
  5000.                         if(++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS)
  5001.                         {
  5002.                             #if defined DEBUG
  5003.                                 printf(DEBUG_CODE_5, playerid, "SetPlayerInterior");
  5004.                                 printf("[Nex-AC debug] AC interior: %d, interiorid: %d", ACInfo[playerid][acSet][0], ac_i);
  5005.                             #endif
  5006.                             #if defined OnCheatDetected
  5007.                                 ac_KickWithCode(playerid, "", 0, 52, 5);
  5008.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5009.                                 ACInfo[playerid][acSet][0] = -1;
  5010.                             #else
  5011.                                 return ac_KickWithCode(playerid, "", 0, 52, 5);
  5012.                             #endif
  5013.                         }
  5014.                         #if defined OnNOPWarning
  5015.                             else OnNOPWarning(playerid, 5, ACInfo[playerid][acNOPCount][2]);
  5016.                         #endif
  5017.                     }
  5018.                     else if(++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][0] = -1;
  5019.                 }
  5020.                 if(ACInfo[playerid][acSet][5] != -1 && ac_gtc - ACInfo[playerid][acGtc][11] > ac_gpp)
  5021.                 {
  5022.                     if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][8])
  5023.                     {
  5024.                         if(++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS)
  5025.                         {
  5026.                             #if defined DEBUG
  5027.                                 printf(DEBUG_CODE_5, playerid, "TogglePlayerSpectating");
  5028.                             #endif
  5029.                             #if defined OnCheatDetected
  5030.                                 ac_KickWithCode(playerid, "", 0, 52, 6);
  5031.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5032.                                 ACInfo[playerid][acSet][5] = -1;
  5033.                             #else
  5034.                                 return ac_KickWithCode(playerid, "", 0, 52, 6);
  5035.                             #endif
  5036.                         }
  5037.                         #if defined OnNOPWarning
  5038.                             else OnNOPWarning(playerid, 6, ACInfo[playerid][acNOPCount][8]);
  5039.                         #endif
  5040.                     }
  5041.                     else if(++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][5] = -1;
  5042.                 }
  5043.                 new ac_vehid = GetPlayerVehicleID(playerid);
  5044.                 if(ACInfo[playerid][acSet][9] != -1 && ac_vehid > 0 && ac_gtc - ACInfo[playerid][acGtc][7] > ac_gpp)
  5045.                 {
  5046.                     if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][11])
  5047.                     {
  5048.                         new Float:ac_vX, Float:ac_vY, Float:ac_vZ;
  5049.                         GetVehicleVelocity(ac_vehid, ac_vX, ac_vY, ac_vZ);
  5050.                         if(ac_GetSpeed(ac_vX, ac_vY, ac_vZ) > 30) ACInfo[playerid][acGtc][7] = ac_gpp + 1650;
  5051.                         else
  5052.                         {
  5053.                             #if defined DEBUG
  5054.                                 printf(DEBUG_CODE_5, playerid, "RemovePlayerFromVehicle");
  5055.                                 printf("[Nex-AC debug] Veh model: %d, veh: %d", GetVehicleModel(ac_vehid), ac_vehid);
  5056.                             #endif
  5057.                             #if defined OnCheatDetected
  5058.                                 ac_KickWithCode(playerid, "", 0, 52, 8);
  5059.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5060.                                 ACInfo[playerid][acSet][9] = -1;
  5061.                             #else
  5062.                                 return ac_KickWithCode(playerid, "", 0, 52, 8);
  5063.                             #endif
  5064.                         }
  5065.                     }
  5066.                     else ACInfo[playerid][acSet][9] = -1;
  5067.                 }
  5068.                 ac_s = GetPlayerVehicleSeat(playerid);
  5069.                 if(ACInfo[playerid][acSet][8] != -1)
  5070.                 {
  5071.                     if(ACInfo[playerid][acSet][8] == ac_vehid &&
  5072.                     (ACInfo[playerid][acSet][4] == ac_s || ACInfo[playerid][acSet][4] == -1))
  5073.                     {
  5074.                         if(ACInfo[playerid][acVeh] > 0)
  5075.                         {
  5076.                             new ac_t = ACInfo[playerid][acVeh];
  5077.                             if(ACVehInfo[ac_t][acDriver] == playerid) ACVehInfo[ac_t][acDriver] = INVALID_PLAYER_ID;
  5078.                             if(ac_IsAnAircraftEx(GetVehicleModel(ac_t))) ACInfo[playerid][acParachute] = 2;
  5079.                         }
  5080.                         if(ac_sa == PLAYER_STATE_DRIVER)
  5081.                         {
  5082.                             ACVehInfo[ac_vehid][acDriver] = playerid;
  5083.                             GetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
  5084.                             ACInfo[playerid][acGtc][8] = ac_gtc + 1650;
  5085.                             ACInfo[playerid][acSetVehHealth] = -1.0;
  5086.                             ACInfo[playerid][acLastPosX] = ac_pX;
  5087.                             ACInfo[playerid][acLastPosY] = ac_pY;
  5088.                         }
  5089.                         ACInfo[playerid][acEnterVeh] =
  5090.                         ACInfo[playerid][acCheatCount][10] = 0;
  5091.                         ACInfo[playerid][acVehDmgRes] = false;
  5092.                         ACInfo[playerid][acEnterSeat] =
  5093.                         ACInfo[playerid][acSet][9] =
  5094.                         ACInfo[playerid][acSet][8] =
  5095.                         ACInfo[playerid][acSet][7] =
  5096.                         ACInfo[playerid][acSet][12] = -1;
  5097.                         ACInfo[playerid][acSeat] = ac_s;
  5098.                         ACInfo[playerid][acLastFivePosX] = ac_pX;
  5099.                         ACInfo[playerid][acLastFivePosY] = ac_pY;
  5100.                     }
  5101.                     else if(ac_gtc - ACInfo[playerid][acGtc][1] > ac_gpp)
  5102.                     {
  5103.                         if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][7] &&
  5104.                         ACInfo[playerid][acSet][4] != -1 && ACVehInfo[ACInfo[playerid][acSet][8]][acSpawned] &&
  5105.                         IsVehicleStreamedIn(ACInfo[playerid][acSet][8], playerid))
  5106.                         {
  5107.                             if(++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS)
  5108.                             {
  5109.                                 #if defined DEBUG
  5110.                                     printf(DEBUG_CODE_5, playerid, "PutPlayerInVehicle");
  5111.                                     printf("[Nex-AC debug] AC veh: %d, veh: %d, AC seat: %d, seatid: %d",
  5112.                                     ACInfo[playerid][acSet][8], ac_vehid, ACInfo[playerid][acSet][4], ac_s);
  5113.                                 #endif
  5114.                                 #if defined OnCheatDetected
  5115.                                     ac_KickWithCode(playerid, "", 0, 52, 9);
  5116.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5117.                                     ACInfo[playerid][acSet][8] = -1;
  5118.                                 #else
  5119.                                     return ac_KickWithCode(playerid, "", 0, 52, 9);
  5120.                                 #endif
  5121.                             }
  5122.                             #if defined OnNOPWarning
  5123.                                 else OnNOPWarning(playerid, 9, ACInfo[playerid][acNOPCount][7]);
  5124.                             #endif
  5125.                         }
  5126.                         else if(++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][8] = -1;
  5127.                     }
  5128.                 }
  5129.                 else
  5130.                 {
  5131.                     new Float:ac_dist_set = 25000.0;
  5132.                     if(ACInfo[playerid][acSet][7] != -1)
  5133.                     {
  5134.                         ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_pZ : ACInfo[playerid][acSetPosZ]));
  5135.                         if(ac_dist_set < 15.0)
  5136.                         {
  5137.                             ACInfo[playerid][acSet][7] =
  5138.                             ACInfo[playerid][acSet][12] = -1;
  5139.                             ACInfo[playerid][acCheatCount][1] =
  5140.                             ACInfo[playerid][acCheatCount][2] =
  5141.                             ACInfo[playerid][acGtc][10] = 0;
  5142.                             ACInfo[playerid][acPosX] =
  5143.                             ACInfo[playerid][acLastPosX] =
  5144.                             ACInfo[playerid][acLastFivePosX] = ac_pX;
  5145.                             ACInfo[playerid][acPosY] =
  5146.                             ACInfo[playerid][acLastPosY] =
  5147.                             ACInfo[playerid][acLastFivePosY] = ac_pY;
  5148.                             ACInfo[playerid][acPosZ] = ac_pZ;
  5149.                             #if defined FreezeSyncPacket
  5150.                                 if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  5151.                             #endif
  5152.                         }
  5153.                         else if(ac_gtc - ACInfo[playerid][acGtc][10] > ac_gpp)
  5154.                         {
  5155.                             if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][10])
  5156.                             {
  5157.                                 if(++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS)
  5158.                                 {
  5159.                                     #if defined DEBUG
  5160.                                         printf(DEBUG_CODE_5, playerid, "SetPlayerPos");
  5161.                                         printf("[Nex-AC debug] Dist: %f, acSet[7]: %d", ac_dist_set, ACInfo[playerid][acSet][7]);
  5162.                                     #endif
  5163.                                     #if defined OnCheatDetected
  5164.                                         ac_KickWithCode(playerid, "", 0, 52, 10);
  5165.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5166.                                         #if defined FreezeSyncPacket
  5167.                                             else if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  5168.                                         #endif
  5169.                                         ACInfo[playerid][acSet][7] = -1;
  5170.                                     #else
  5171.                                         return ac_KickWithCode(playerid, "", 0, 52, 10);
  5172.                                     #endif
  5173.                                 }
  5174.                                 #if defined OnNOPWarning
  5175.                                     else OnNOPWarning(playerid, 10, ACInfo[playerid][acNOPCount][10]);
  5176.                                 #endif
  5177.                             }
  5178.                             else if(++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS)
  5179.                             {
  5180.                                 ACInfo[playerid][acSet][7] = -1;
  5181.                                 #if defined FreezeSyncPacket
  5182.                                     if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  5183.                                 #endif
  5184.                             }
  5185.                         }
  5186.                     }
  5187.                     new Float:ac_vX, Float:ac_vY, Float:ac_vZ, ac_specact = GetPlayerSpecialAction(playerid),
  5188.                     Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5189.                     if(ac_vehid > 0)
  5190.                     {
  5191.                         if(ACInfo[playerid][acVeh] > 0)
  5192.                         {
  5193.                             if(ACInfo[playerid][acVeh] != ac_vehid)
  5194.                             {
  5195.                                 if(ACInfo[playerid][acACAllow][4])
  5196.                                 {
  5197.                                     #if defined DEBUG
  5198.                                         printf("[Nex-AC debug] AC veh: %d, veh: %d", ACInfo[playerid][acVeh], ac_vehid);
  5199.                                     #endif
  5200.                                     #if defined OnCheatDetected
  5201.                                         ac_KickWithCode(playerid, "", 0, 4, 2);
  5202.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5203.                                     #else
  5204.                                         return ac_KickWithCode(playerid, "", 0, 4, 2);
  5205.                                     #endif
  5206.                                 }
  5207.                             }
  5208.                             else if(ACInfo[playerid][acACAllow][50] && ACInfo[playerid][acSeat] != ac_s)
  5209.                             {
  5210.                                 #if defined DEBUG
  5211.                                     printf("[Nex-AC debug] AC seat: %d, seatid: %d, veh model: %d, veh: %d",
  5212.                                     ACInfo[playerid][acSeat], ac_s, GetVehicleModel(ac_vehid), ac_vehid);
  5213.                                 #endif
  5214.                                 #if defined OnCheatDetected
  5215.                                     ac_KickWithCode(playerid, "", 0, 50);
  5216.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5217.                                 #else
  5218.                                     return ac_KickWithCode(playerid, "", 0, 50);
  5219.                                 #endif
  5220.                             }
  5221.                         }
  5222.                         if(ac_sa == PLAYER_STATE_DRIVER)
  5223.                         {
  5224.                             if(ACInfo[playerid][acACAllow][32] && ACVehInfo[ac_vehid][acDriver] != playerid &&
  5225.                             ACVehInfo[ac_vehid][acDriver] != INVALID_PLAYER_ID)
  5226.                             {
  5227.                                 #if defined DEBUG
  5228.                                     printf("[Nex-AC debug] AC driver: %d, driver: %d, veh: %d",
  5229.                                     ACVehInfo[ac_vehid][acDriver], playerid, ac_vehid);
  5230.                                 #endif
  5231.                                 #if defined OnCheatDetected
  5232.                                     ac_KickWithCode(playerid, "", 0, 32);
  5233.                                 #endif
  5234.                                 ClearAnimations(playerid, 1);
  5235.                                 return 0;
  5236.                             }
  5237.                             new Float:ac_vHealth;
  5238.                             GetVehicleHealth(ac_vehid, ac_vHealth);
  5239.                             if(ACInfo[playerid][acSetVehHealth] != -1.0)
  5240.                             {
  5241.                                 if(ACInfo[playerid][acSetVehHealth] == ac_vHealth ||
  5242.                                 ACInfo[playerid][acSetVehHealth] > ac_vHealth && ac_gtc - ACInfo[playerid][acGtc][3] > ac_gpp)
  5243.                                 {
  5244.                                     ACInfo[playerid][acSetVehHealth] = -1.0;
  5245.                                     ACInfo[playerid][acCheatCount][10] = 0;
  5246.                                     ACInfo[playerid][acVehDmgRes] = false;
  5247.                                     #if defined FreezeSyncPacket
  5248.                                         if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  5249.                                     #endif
  5250.                                 }
  5251.                                 else if(ac_gtc - ACInfo[playerid][acGtc][3] > ac_gpp)
  5252.                                 {
  5253.                                     if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][4])
  5254.                                     {
  5255.                                         if(++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS)
  5256.                                         {
  5257.                                             #if defined DEBUG
  5258.                                                 printf(DEBUG_CODE_5, playerid, "SetVehicleHealth");
  5259.                                                 printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d",
  5260.                                                 ACInfo[playerid][acSetVehHealth], ac_vHealth, ac_vehid);
  5261.                                             #endif
  5262.                                             #if defined OnCheatDetected
  5263.                                                 ac_KickWithCode(playerid, "", 0, 52, 11);
  5264.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5265.                                                 #if defined FreezeSyncPacket
  5266.                                                     else if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  5267.                                                 #endif
  5268.                                                 ACInfo[playerid][acSetVehHealth] = -1.0;
  5269.                                             #else
  5270.                                                 return ac_KickWithCode(playerid, "", 0, 52, 11);
  5271.                                             #endif
  5272.                                         }
  5273.                                         #if defined OnNOPWarning
  5274.                                             else OnNOPWarning(playerid, 11, ACInfo[playerid][acNOPCount][4]);
  5275.                                         #endif
  5276.                                     }
  5277.                                     else if(++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS)
  5278.                                     {
  5279.                                         ACInfo[playerid][acSetVehHealth] = -1.0;
  5280.                                         #if defined FreezeSyncPacket
  5281.                                             if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  5282.                                         #endif
  5283.                                     }
  5284.                                 }
  5285.                             }
  5286.                             else if(ACInfo[playerid][acACAllow][11] &&
  5287.                             (!ac_IsValidFloat(ac_vHealth) || ac_vHealth > ACVehInfo[ac_vehid][acHealth] &&
  5288.                             !ACInfo[playerid][acModShop] && ac_vHealth))
  5289.                             {
  5290.                                 #if AC_USE_PAYNSPRAY
  5291.                                     if(!ac_InPayNSpray(playerid, ac_i))
  5292.                                     {
  5293.                                 #endif
  5294.                                     #if defined DEBUG
  5295.                                         printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d, playerid: %d",
  5296.                                         ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid, playerid);
  5297.                                     #endif
  5298.                                     #if defined OnCheatDetected
  5299.                                         ac_KickWithCode(playerid, "", 0, 11);
  5300.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5301.                                     #endif
  5302.                                     SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
  5303.                                 #if AC_USE_PAYNSPRAY
  5304.                                     }
  5305.                                 #endif
  5306.                             }
  5307.                             if(ACInfo[playerid][acVehDmgRes])
  5308.                             {
  5309.                                 if(ac_vHealth < ACVehInfo[ac_vehid][acHealth])
  5310.                                 {
  5311.                                     ACInfo[playerid][acDmgRes] = ACInfo[playerid][acVehDmgRes] = false;
  5312.                                     ACInfo[playerid][acCheatCount][10] = 0;
  5313.                                 }
  5314.                                 else if(ACInfo[playerid][acACAllow][20] && ac_gtc - ACInfo[playerid][acGtc][14] > ac_gpp)
  5315.                                 {
  5316.                                     ACInfo[playerid][acDmgRes] = ACInfo[playerid][acVehDmgRes] = false;
  5317.                                     if(++ACInfo[playerid][acCheatCount][10] > AC_MAX_GODMODE_VEH_WARNINGS)
  5318.                                     {
  5319.                                         #undef AC_MAX_GODMODE_VEH_WARNINGS
  5320.                                         #if defined DEBUG
  5321.                                             printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d",
  5322.                                             ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid);
  5323.                                         #endif
  5324.                                         #if defined OnCheatDetected
  5325.                                             ac_KickWithCode(playerid, "", 0, 20);
  5326.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5327.                                             ACInfo[playerid][acCheatCount][10] = 0;
  5328.                                         #else
  5329.                                             return ac_KickWithCode(playerid, "", 0, 20);
  5330.                                         #endif
  5331.                                     }
  5332.                                     #if defined OnCheatWarning
  5333.                                         else OnCheatWarning(playerid, "", 0, 20, 0, ACInfo[playerid][acCheatCount][10]);
  5334.                                     #endif
  5335.                                 }
  5336.                             }
  5337.                             GetVehicleVelocity(ac_vehid, ac_vX, ac_vY, ac_vZ);
  5338.                             new Float:ac_zAngle, ac_vsp = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  5339.                             GetVehicleZAngle(ac_vehid, ac_zAngle);
  5340.                             if(ac_dist > 0.8)
  5341.                             {
  5342.                                 if(ac_dist >= 80.0 && ac_dist - ACVehInfo[ac_vehid][acPosDiff] > (ac_dist / 2.6) * 1.8 &&
  5343.                                 ac_dist_set >= 80.0 && ac_dist_set - ACVehInfo[ac_vehid][acPosDiff] > (ac_dist_set / 2.6) * 1.8)
  5344.                                 {
  5345.                                     #if defined VectorSize
  5346.                                     if(ACInfo[playerid][acACAllow][3] && ac_gtc - ACInfo[playerid][acGtc][19] > ac_gpp &&
  5347.                                     (ACInfo[playerid][acPosZ] >= -90.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
  5348.                                     VectorSize(ac_pX - ACInfo[playerid][acPosX], ac_pY - ACInfo[playerid][acPosY], 0.0) >= 180.0 ||
  5349.                                     ++ACInfo[playerid][acCheatCount][19] > AC_MAX_TELEPORT_GLITCH_WARNINGS))
  5350.                                     #else
  5351.                                     if(ACInfo[playerid][acACAllow][3] && ac_gtc - ACInfo[playerid][acGtc][19] > ac_gpp &&
  5352.                                     (ACInfo[playerid][acPosZ] >= -90.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
  5353.                                     floatsqroot(floatpower(ac_pX - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_pY - ACInfo[playerid][acPosY], 2.0)) >= 180.0 ||
  5354.                                     ++ACInfo[playerid][acCheatCount][19] > AC_MAX_TELEPORT_GLITCH_WARNINGS))
  5355.                                     #endif
  5356.                                     {
  5357.                                         #if defined DEBUG
  5358.                                             printf("[Nex-AC debug] Dist: %f, dist set: %f, old pos diff: %f, speed: %d, veh: %d",
  5359.                                             ac_dist, ac_dist_set, ACVehInfo[ac_vehid][acPosDiff], ac_vsp, ac_vehid);
  5360.                                         #endif
  5361.                                         #if defined OnCheatDetected
  5362.                                             ac_KickWithCode(playerid, "", 0, 3, 2);
  5363.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5364.                                             ACInfo[playerid][acCheatCount][19] = 0;
  5365.                                         #else
  5366.                                             return ac_KickWithCode(playerid, "", 0, 3, 2);
  5367.                                         #endif
  5368.                                     }
  5369.                                     ACInfo[playerid][acLastPosX] = ac_pX;
  5370.                                     ACInfo[playerid][acLastPosY] = ac_pY;
  5371.                                 }
  5372.                                 else if(ac_vsp < 12 && ac_gtc - ACInfo[playerid][acGtc][10] > ac_gpp)
  5373.                                 {
  5374.                                     if(ac_dist >= 40.0 && ac_dist_set >= 40.0)
  5375.                                     {
  5376.                                         if(ACInfo[playerid][acACAllow][3])
  5377.                                         {
  5378.                                             #if defined DEBUG
  5379.                                                 printf("[Nex-AC debug] Speed: %d, dist: %f, dist set: %f", ac_vsp, ac_dist, ac_dist_set);
  5380.                                             #endif
  5381.                                             #if defined OnCheatDetected
  5382.                                                 ac_KickWithCode(playerid, "", 0, 3, 4);
  5383.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5384.                                             #else
  5385.                                                 return ac_KickWithCode(playerid, "", 0, 3, 4);
  5386.                                             #endif
  5387.                                         }
  5388.                                     }
  5389.                                     else if(ACInfo[playerid][acACAllow][1])
  5390.                                     {
  5391.                                         if(++ACInfo[playerid][acCheatCount][2] > AC_MAX_AIR_VEH_WARNINGS)
  5392.                                         {
  5393.                                             #if defined DEBUG
  5394.                                                 printf("[Nex-AC debug] Speed: %d, dist: %f, veh: %d", ac_vsp, ac_dist, ac_vehid);
  5395.                                             #endif
  5396.                                             #if defined OnCheatDetected
  5397.                                                 ac_KickWithCode(playerid, "", 0, 1, 1);
  5398.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5399.                                                 ACInfo[playerid][acCheatCount][2] = 0;
  5400.                                             #else
  5401.                                                 return ac_KickWithCode(playerid, "", 0, 1, 1);
  5402.                                             #endif
  5403.                                         }
  5404.                                         #if defined OnCheatWarning
  5405.                                             else OnCheatWarning(playerid, "", 0, 1, 1, ACInfo[playerid][acCheatCount][2]);
  5406.                                         #endif
  5407.                                     }
  5408.                                 }
  5409.                             }
  5410.                             ac_i = GetVehicleModel(ac_vehid);
  5411.                             new ac_spDiff = ac_vsp - ACVehInfo[ac_vehid][acSpeed];
  5412.                             if(ac_gtc - ACInfo[playerid][acGtc][8] > ac_gpp)
  5413.                             {
  5414.                                 if(ACInfo[playerid][acACAllow][10])
  5415.                                 {
  5416.                                     if(ac_spDiff > 220 || ac_vsp > 620)
  5417.                                     {
  5418.                                         #if defined DEBUG
  5419.                                             printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d, veh: %d",
  5420.                                             ac_vsp, ACVehInfo[ac_vehid][acSpeed], ac_i, ac_vehid);
  5421.                                         #endif
  5422.                                         #if defined OnCheatDetected
  5423.                                             ac_KickWithCode(playerid, "", 0, 10, 3);
  5424.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5425.                                         #else
  5426.                                             return ac_KickWithCode(playerid, "", 0, 10, 3);
  5427.                                         #endif
  5428.                                     }
  5429.                                     else if(ac_spDiff >= 20 &&
  5430.                                     ACVehInfo[ac_vehid][acSpeedDiff] <= ac_spDiff && ACVehInfo[ac_vehid][acHealth] <= ac_vHealth &&
  5431.                                     !(ac_IsValidVehicleModel(ac_i) && (ac_spDiff < 65 && (ac_i == 432 || ac_IsATrainLoco(ac_i)) ||
  5432.                                     ac_spDiff < 45 && ac_IsABmx(ac_i) && floatabs(ac_vX) <= 0.76 && floatabs(ac_vY) <= 0.76 && floatabs(ac_vZ) <= 0.76 ||
  5433.                                     !ac_IsATrainLoco(ac_i) && !ac_IsABmx(ac_i) && ACVehInfo[ac_vehid][acHealth] < 250.0)))
  5434.                                     {
  5435.                                         ACInfo[playerid][acCheatCount][14] += (1 * AC_SPEEDHACK_VEH_RESET_DELAY);
  5436.                                         if(ACInfo[playerid][acCheatCount][14] > AC_MAX_SPEEDHACK_VEH_WARNINGS)
  5437.                                         {
  5438.                                             #if defined DEBUG
  5439.                                                 printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d, veh: %d",
  5440.                                                 ac_vsp, ACVehInfo[ac_vehid][acSpeed], ac_i, ac_vehid);
  5441.                                             #endif
  5442.                                             #if defined OnCheatDetected
  5443.                                                 ac_KickWithCode(playerid, "", 0, 10, 1);
  5444.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5445.                                                 ACInfo[playerid][acCheatCount][14] = 0;
  5446.                                             #else
  5447.                                                 return ac_KickWithCode(playerid, "", 0, 10, 1);
  5448.                                             #endif
  5449.                                         }
  5450.                                         #if defined OnCheatWarning
  5451.                                             else OnCheatWarning(playerid, "", 0, 10, 1, floatround(ACInfo[playerid][acCheatCount][14] / AC_SPEEDHACK_VEH_RESET_DELAY));
  5452.                                         #endif
  5453.                                     }
  5454.                                 }
  5455.                                 if(ACInfo[playerid][acACAllow][25] &&
  5456.                                 ac_vsp > 15 && ac_abs(ac_spDiff) < 25 &&
  5457.                                 floatround(floatabs(ac_zAngle - ACVehInfo[ac_vehid][acZAngle])) == 180 &&
  5458.                                 (ac_vX < 0.0) != (ACVehInfo[ac_vehid][acVelX] < 0.0) &&
  5459.                                 (ac_vY < 0.0) != (ACVehInfo[ac_vehid][acVelY] < 0.0) &&
  5460.                                 (ac_vZ < 0.0) != (ACVehInfo[ac_vehid][acVelZ] < 0.0))
  5461.                                 {
  5462.                                     #undef ac_abs
  5463.                                     #if defined DEBUG
  5464.                                         printf("[Nex-AC debug] Speed: %d, speed diff: %d, z angle: %f, old z angle: %f, veh: %d",
  5465.                                         ac_vsp, ac_spDiff, ac_zAngle, ACVehInfo[ac_vehid][acZAngle], ac_vehid);
  5466.                                     #endif
  5467.                                     #if defined OnCheatDetected
  5468.                                         ac_KickWithCode(playerid, "", 0, 25, 1);
  5469.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5470.                                     #else
  5471.                                         return ac_KickWithCode(playerid, "", 0, 25, 1);
  5472.                                     #endif
  5473.                                 }
  5474.                                 if(ac_IsAnAircraftEx(ac_i))
  5475.                                 {
  5476.                                     if(ACInfo[playerid][acACAllow][10] && (ac_sa = ac_GetSpeed(ac_vX, ac_vY)) > 270)
  5477.                                     {
  5478.                                         #if defined DEBUG
  5479.                                             printf("[Nex-AC debug] Speed (x, y): %d, veh model: %d, veh: %d", ac_sa, ac_i, ac_vehid);
  5480.                                         #endif
  5481.                                         #if defined OnCheatDetected
  5482.                                             ac_KickWithCode(playerid, "", 0, 10, 2);
  5483.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5484.                                         #else
  5485.                                             return ac_KickWithCode(playerid, "", 0, 10, 2);
  5486.                                         #endif
  5487.                                     }
  5488.                                 }
  5489.                                 else if(ACInfo[playerid][acACAllow][8])
  5490.                                 {
  5491.                                     ac_tmp = ac_pZ - ACInfo[playerid][acPosZ];
  5492.                                     if(ac_vZ >= 0.1 && ac_vZ > ACVehInfo[ac_vehid][acVelZ] &&
  5493.                                     floatabs(ACInfo[playerid][acPosX] - ac_pX) < ac_tmp / 2.0 &&
  5494.                                     floatabs(ACInfo[playerid][acPosY] - ac_pY) < ac_tmp / 2.0 ||
  5495.                                     ac_vZ >= 0.0 && ac_tmp <= -1.0 || ac_vZ <= 0.0 && ac_tmp >= 1.0)
  5496.                                     {
  5497.                                         if(++ACInfo[playerid][acCheatCount][3] > (ac_IsABmxEx(ac_i) ? AC_MAX_FLYHACK_BIKE_WARNINGS : AC_MAX_FLYHACK_VEH_WARNINGS))
  5498.                                         {
  5499.                                             #undef AC_MAX_FLYHACK_BIKE_WARNINGS
  5500.                                             #if defined DEBUG
  5501.                                                 printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, veh: %d",
  5502.                                                 ac_vZ, ACVehInfo[ac_vehid][acVelZ], ACInfo[playerid][acPosX] - ac_pX, ACInfo[playerid][acPosY] - ac_pY, ac_tmp, ac_vehid);
  5503.                                             #endif
  5504.                                             #if defined OnCheatDetected
  5505.                                                 ac_KickWithCode(playerid, "", 0, 8, 1);
  5506.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5507.                                                 ACInfo[playerid][acCheatCount][3] = 0;
  5508.                                             #else
  5509.                                                 return ac_KickWithCode(playerid, "", 0, 8, 1);
  5510.                                             #endif
  5511.                                         }
  5512.                                         #if defined OnCheatWarning
  5513.                                             else OnCheatWarning(playerid, "", 0, 8, 1, ACInfo[playerid][acCheatCount][3]);
  5514.                                         #endif
  5515.                                     }
  5516.                                 }
  5517.                                 ACVehInfo[ac_vehid][acSpeedDiff] = ac_spDiff;
  5518.                             }
  5519.                             else if(ACInfo[playerid][acACAllow][10] &&
  5520.                             ACVehInfo[ac_vehid][acSpeed] < ac_vsp && (ac_spDiff > 220 || ac_vsp > 620))
  5521.                             {
  5522.                                 #if defined DEBUG
  5523.                                     printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d, veh: %d",
  5524.                                     ac_vsp, ACVehInfo[ac_vehid][acSpeed], ac_i, ac_vehid);
  5525.                                 #endif
  5526.                                 #if defined OnCheatDetected
  5527.                                     ac_KickWithCode(playerid, "", 0, 10, 5);
  5528.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5529.                                 #else
  5530.                                     return ac_KickWithCode(playerid, "", 0, 10, 5);
  5531.                                 #endif
  5532.                             }
  5533.                             ACVehInfo[ac_vehid][acPosX] = ac_pX;
  5534.                             ACVehInfo[ac_vehid][acPosY] = ac_pY;
  5535.                             ACVehInfo[ac_vehid][acPosZ] = ac_pZ;
  5536.                             ACVehInfo[ac_vehid][acVelX] = ac_vX;
  5537.                             ACVehInfo[ac_vehid][acVelY] = ac_vY;
  5538.                             ACVehInfo[ac_vehid][acVelZ] = ac_vZ;
  5539.                             ACVehInfo[ac_vehid][acSpeed] = ac_vsp;
  5540.                             ACVehInfo[ac_vehid][acPosDiff] = ac_dist;
  5541.                             if(ACInfo[playerid][acSetVehHealth] == -1.0) ACVehInfo[ac_vehid][acHealth] = ac_vHealth;
  5542.                             ACVehInfo[ac_vehid][acZAngle] = ac_zAngle;
  5543.                         }
  5544.                         ACInfo[playerid][acSeat] = ac_s;
  5545.                     }
  5546.                     else
  5547.                     {
  5548.                         GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  5549.                         ac_s = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  5550.                         if(ACInfo[playerid][acAnim] != (ac_sa = GetPlayerAnimationIndex(playerid)))
  5551.                         {
  5552.                             if(ac_sa == -1)
  5553.                             {
  5554.                                 if(ACInfo[playerid][acACAllow][24])
  5555.                                 {
  5556.                                     #if defined OnCheatDetected
  5557.                                         ac_KickWithCode(playerid, "", 0, 24, 1);
  5558.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5559.                                     #else
  5560.                                         return ac_KickWithCode(playerid, "", 0, 24, 1);
  5561.                                     #endif
  5562.                                 }
  5563.                             }
  5564.                             else if(ACInfo[playerid][acACAllow][30] && !ac_PedAnims)
  5565.                             {
  5566.                                 ac_i = GetPlayerSkin(playerid);
  5567.                                 if(ac_sa == 1231 && ac_w != WEAPON_PARACHUTE && ac_IsValidSkin(ac_i) && ac_i != 0)
  5568.                                 {
  5569.                                     if(++ACInfo[playerid][acCheatCount][17] > AC_MAX_CJ_RUN_WARNINGS)
  5570.                                     {
  5571.                                         #undef AC_MAX_CJ_RUN_WARNINGS
  5572.                                         #if defined DEBUG
  5573.                                             printf("[Nex-AC debug] Skin: %d, old anim: %d, weaponid: %d",
  5574.                                             ac_i, ACInfo[playerid][acAnim], ac_w);
  5575.                                         #endif
  5576.                                         #if defined OnCheatDetected
  5577.                                             ac_KickWithCode(playerid, "", 0, 30);
  5578.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5579.                                             ACInfo[playerid][acCheatCount][17] = 0;
  5580.                                         #else
  5581.                                             return ac_KickWithCode(playerid, "", 0, 30);
  5582.                                         #endif
  5583.                                     }
  5584.                                     #if defined OnCheatWarning
  5585.                                         else OnCheatWarning(playerid, "", 0, 30, 0, ACInfo[playerid][acCheatCount][17]);
  5586.                                     #endif
  5587.                                 }
  5588.                                 else ACInfo[playerid][acCheatCount][17] = 0;
  5589.                             }
  5590.                         }
  5591.                         else if(ACInfo[playerid][acACAllow][7])
  5592.                         {
  5593.                             if(ac_sa == 157 || ac_sa == 159 || ac_sa == 161 || ac_sa == 1058)
  5594.                             {
  5595.                                 if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_FLYHACK_WARNINGS)
  5596.                                 {
  5597.                                     #if defined DEBUG
  5598.                                         printf("[Nex-AC debug] Anim: %d, old anim: %d, old veh: %d",
  5599.                                         ac_sa, ACInfo[playerid][acAnim], ACInfo[playerid][acVeh]);
  5600.                                     #endif
  5601.                                     #if defined OnCheatDetected
  5602.                                         ac_KickWithCode(playerid, "", 0, 7, 2);
  5603.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5604.                                         ACInfo[playerid][acCheatCount][13] = 0;
  5605.                                     #else
  5606.                                         return ac_KickWithCode(playerid, "", 0, 7, 2);
  5607.                                     #endif
  5608.                                 }
  5609.                                 #if defined OnCheatWarning
  5610.                                     else OnCheatWarning(playerid, "", 0, 7, 2, ACInfo[playerid][acCheatCount][13]);
  5611.                                 #endif
  5612.                             }
  5613.                             else if(1538 <= ac_sa <= 1544 && ac_s > 42 && ACInfo[playerid][acSpeed] < ac_s)
  5614.                             {
  5615.                                 if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_FLYHACK_WARNINGS)
  5616.                                 {
  5617.                                     #if defined DEBUG
  5618.                                         printf("[Nex-AC debug] Speed: %d, old speed: %d, anim: %d",
  5619.                                         ac_s, ACInfo[playerid][acSpeed], ac_sa);
  5620.                                     #endif
  5621.                                     #if defined OnCheatDetected
  5622.                                         ac_KickWithCode(playerid, "", 0, 7, 3);
  5623.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5624.                                         ACInfo[playerid][acCheatCount][13] = 0;
  5625.                                     #else
  5626.                                         return ac_KickWithCode(playerid, "", 0, 7, 3);
  5627.                                     #endif
  5628.                                 }
  5629.                                 #if defined OnCheatWarning
  5630.                                     else OnCheatWarning(playerid, "", 0, 7, 3, ACInfo[playerid][acCheatCount][13]);
  5631.                                 #endif
  5632.                             }
  5633.                             else
  5634.                             {
  5635.                                 #if defined VectorSize
  5636.                                     ac_tmp = VectorSize(ac_vX, ac_vY, 0.0);
  5637.                                 #else
  5638.                                     ac_tmp = floatsqroot(floatpower(ac_vX, 2.0) + floatpower(ac_vY, 2.0));
  5639.                                 #endif
  5640.                                 if(958 <= ac_sa <= 979 && (ac_vZ > 0.1 || ac_tmp > 0.9))
  5641.                                 {
  5642.                                     if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_FLYHACK_WARNINGS)
  5643.                                     {
  5644.                                         #if defined DEBUG
  5645.                                             printf("[Nex-AC debug] Anim: %d, old anim: %d, weaponid: %d, spec act: %d, vel x, y: %f, vel z: %f",
  5646.                                             ac_sa, ACInfo[playerid][acAnim], ac_w, ac_specact, ac_tmp, ac_vZ);
  5647.                                         #endif
  5648.                                         #if defined OnCheatDetected
  5649.                                             ac_KickWithCode(playerid, "", 0, 7, 1);
  5650.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5651.                                             ACInfo[playerid][acCheatCount][13] = 0;
  5652.                                         #else
  5653.                                             return ac_KickWithCode(playerid, "", 0, 7, 1);
  5654.                                         #endif
  5655.                                     }
  5656.                                     #if defined OnCheatWarning
  5657.                                         else OnCheatWarning(playerid, "", 0, 7, 1, ACInfo[playerid][acCheatCount][13]);
  5658.                                     #endif
  5659.                                 }
  5660.                                 else ACInfo[playerid][acCheatCount][13] = 0;
  5661.                             }
  5662.                         }
  5663.                         if(ACInfo[playerid][acSet][3] != -1)
  5664.                         {
  5665.                             if(ac_specact == ACInfo[playerid][acSet][3])
  5666.                             {
  5667.                                 ACInfo[playerid][acSet][3] = -1;
  5668.                                 #if defined FreezeSyncPacket
  5669.                                     if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  5670.                                 #endif
  5671.                             }
  5672.                             else if(ac_gtc - ACInfo[playerid][acGtc][5] > ac_gpp)
  5673.                             {
  5674.                                 if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][6] &&
  5675.                                 ac_specact != SPECIAL_ACTION_DUCK &&
  5676.                                 !(SPECIAL_ACTION_ENTER_VEHICLE <= ac_specact <= SPECIAL_ACTION_EXIT_VEHICLE))
  5677.                                 {
  5678.                                     if(++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS)
  5679.                                     {
  5680.                                         #if defined DEBUG
  5681.                                             printf(DEBUG_CODE_5, playerid, "SetPlayerSpecialAction");
  5682.                                             printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSet][3], ac_specact);
  5683.                                         #endif
  5684.                                         #if defined OnCheatDetected
  5685.                                             ac_KickWithCode(playerid, "", 0, 52, 12);
  5686.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5687.                                             #if defined FreezeSyncPacket
  5688.                                                 else if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  5689.                                             #endif
  5690.                                             ACInfo[playerid][acSet][3] = -1;
  5691.                                         #else
  5692.                                             return ac_KickWithCode(playerid, "", 0, 52, 12);
  5693.                                         #endif
  5694.                                     }
  5695.                                     #if defined OnNOPWarning
  5696.                                         else OnNOPWarning(playerid, 12, ACInfo[playerid][acNOPCount][6]);
  5697.                                     #endif
  5698.                                 }
  5699.                                 else if(++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS)
  5700.                                 {
  5701.                                     ACInfo[playerid][acSet][3] = -1;
  5702.                                     #if defined FreezeSyncPacket
  5703.                                         if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  5704.                                     #endif
  5705.                                 }
  5706.                                 #undef AC_MAX_NOP_WARNINGS
  5707.                             }
  5708.                         }
  5709.                         else if(ac_specact != ACInfo[playerid][acSpecAct])
  5710.                         {
  5711.                             if(ac_specact == ACInfo[playerid][acNextSpecAct]) ACInfo[playerid][acNextSpecAct] = -1;
  5712.                             else if(ACInfo[playerid][acACAllow][18])
  5713.                             {
  5714.                                 switch(ac_specact)
  5715.                                 {
  5716.                                     case SPECIAL_ACTION_NONE:
  5717.                                     {
  5718.                                         switch(ACInfo[playerid][acSpecAct])
  5719.                                         {
  5720.                                             case SPECIAL_ACTION_USECELLPHONE, 24, 25:
  5721.                                             {
  5722.                                                 #if defined OnCheatDetected
  5723.                                                     ac_KickWithCode(playerid, "", 0, 18, 1);
  5724.                                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5725.                                                 #else
  5726.                                                     return ac_KickWithCode(playerid, "", 0, 18, 1);
  5727.                                                 #endif
  5728.                                             }
  5729.                                         }
  5730.                                     }
  5731.                                     case SPECIAL_ACTION_DUCK:
  5732.                                     {
  5733.                                         if(ACInfo[playerid][acSpecAct] > SPECIAL_ACTION_NONE &&
  5734.                                         !(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= 24))
  5735.                                         {
  5736.                                             #if defined DEBUG
  5737.                                                 printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSpecAct], ac_specact);
  5738.                                             #endif
  5739.                                             #if defined OnCheatDetected
  5740.                                                 ac_KickWithCode(playerid, "", 0, 18, 2);
  5741.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5742.                                             #else
  5743.                                                 return ac_KickWithCode(playerid, "", 0, 18, 2);
  5744.                                             #endif
  5745.                                         }
  5746.                                     }
  5747.                                     case SPECIAL_ACTION_USEJETPACK:
  5748.                                     {
  5749.                                         if((ac_tmp = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acDropJpX], ACInfo[playerid][acDropJpY], ACInfo[playerid][acDropJpZ])) >= 15.0)
  5750.                                         {
  5751.                                             #if defined DEBUG
  5752.                                                 printf("[Nex-AC debug] AC spec act: %d, spec act: %d, dist: %f",
  5753.                                                 ACInfo[playerid][acSpecAct], ac_specact, ac_tmp);
  5754.                                             #endif
  5755.                                             #if defined OnCheatDetected
  5756.                                                 ac_KickWithCode(playerid, "", 0, 18, 3);
  5757.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5758.                                             #else
  5759.                                                 return ac_KickWithCode(playerid, "", 0, 18, 3);
  5760.                                             #endif
  5761.                                         }
  5762.                                         else ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct];
  5763.                                         ACInfo[playerid][acDropJpX] =
  5764.                                         ACInfo[playerid][acDropJpY] =
  5765.                                         ACInfo[playerid][acDropJpZ] = 25000.0;
  5766.                                     }
  5767.                                     case SPECIAL_ACTION_ENTER_VEHICLE:
  5768.                                     {
  5769.                                         switch(ACInfo[playerid][acSpecAct])
  5770.                                         {
  5771.                                             case SPECIAL_ACTION_DANCE1, SPECIAL_ACTION_DANCE2, SPECIAL_ACTION_DANCE3, SPECIAL_ACTION_DANCE4, SPECIAL_ACTION_USECELLPHONE, 68:
  5772.                                             {
  5773.                                                 #if defined OnCheatDetected
  5774.                                                     ac_KickWithCode(playerid, "", 0, 18, 4);
  5775.                                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5776.                                                 #else
  5777.                                                     return ac_KickWithCode(playerid, "", 0, 18, 4);
  5778.                                                 #endif
  5779.                                             }
  5780.                                         }
  5781.                                     }
  5782.                                     default:
  5783.                                     {
  5784.                                         if(!((SPECIAL_ACTION_DRINK_BEER <= ac_specact <= 24 &&
  5785.                                         ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK ||
  5786.                                         ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) &&
  5787.                                         ac_specact == ACInfo[playerid][acLastSpecAct]) &&
  5788.                                         (ACInfo[playerid][acVeh] == 0 || ac_specact != SPECIAL_ACTION_EXIT_VEHICLE &&
  5789.                                         !(24 <= ac_specact <= 25) && ac_specact != SPECIAL_ACTION_USECELLPHONE))
  5790.                                         {
  5791.                                             #if defined DEBUG
  5792.                                                 printf("[Nex-AC debug] AC spec act: %d, spec act: %d, last spec act: %d, old veh: %d",
  5793.                                                 ACInfo[playerid][acSpecAct], ac_specact, ACInfo[playerid][acLastSpecAct], ACInfo[playerid][acVeh]);
  5794.                                             #endif
  5795.                                             #if defined OnCheatDetected
  5796.                                                 ac_KickWithCode(playerid, "", 0, 18, 5);
  5797.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5798.                                             #else
  5799.                                                 return ac_KickWithCode(playerid, "", 0, 18, 5);
  5800.                                             #endif
  5801.                                         }
  5802.                                     }
  5803.                                 }
  5804.                             }
  5805.                             ACInfo[playerid][acLastSpecAct] = ACInfo[playerid][acSpecAct];
  5806.                         }
  5807.                         ac_a = GetPlayerSurfingVehicleID(playerid);
  5808.                         if(!IsVehicleStreamedIn(ac_a, playerid) && GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
  5809.                         {
  5810.                             if(ac_dist > 0.7)
  5811.                             {
  5812.                                 if(ac_dist >= 40.0 && ac_dist_set >= 40.0)
  5813.                                 {
  5814.                                     #if defined VectorSize
  5815.                                     if(ACInfo[playerid][acACAllow][2] && !ACInfo[playerid][acIntEnterExits] &&
  5816.                                     (ACInfo[playerid][acPosZ] >= -90.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
  5817.                                     VectorSize(ac_pX - ACInfo[playerid][acPosX], ac_pY - ACInfo[playerid][acPosY], 0.0) >= 180.0 ||
  5818.                                     ++ACInfo[playerid][acCheatCount][19] > AC_MAX_TELEPORT_GLITCH_WARNINGS))
  5819.                                     #else
  5820.                                     if(ACInfo[playerid][acACAllow][2] && !ACInfo[playerid][acIntEnterExits] &&
  5821.                                     (ACInfo[playerid][acPosZ] >= -90.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 ||
  5822.                                     floatsqroot(floatpower(ac_pX - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_pY - ACInfo[playerid][acPosY], 2.0)) >= 180.0 ||
  5823.                                     ++ACInfo[playerid][acCheatCount][19] > AC_MAX_TELEPORT_GLITCH_WARNINGS))
  5824.                                     #endif
  5825.                                     {
  5826.                                         #undef AC_MAX_TELEPORT_GLITCH_WARNINGS
  5827.                                         #if defined DEBUG
  5828.                                             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",
  5829.                                             ac_dist, ac_dist_set, ac_s, ac_pX, ac_pY, ac_pZ, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5830.                                         #endif
  5831.                                         #if defined OnCheatDetected
  5832.                                             ac_KickWithCode(playerid, "", 0, 2, 2);
  5833.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  5834.                                             ACInfo[playerid][acCheatCount][19] = 0;
  5835.                                         #else
  5836.                                             return ac_KickWithCode(playerid, "", 0, 2, 2);
  5837.                                         #endif
  5838.                                     }
  5839.                                     ACInfo[playerid][acLastPosX] = ac_pX;
  5840.                                     ACInfo[playerid][acLastPosY] = ac_pY;
  5841.                                 }
  5842.                                 else if(ac_s < ac_dist * (ac_dist < 1.0 ? 12.0 : 5.0) && ac_gtc - ACInfo[playerid][acGtc][10] > ac_gpp)
  5843.                                 {
  5844.                                     if(ac_s < 3 && (ac_dist >= 30.0 && ac_dist_set >= 30.0 ||
  5845.                                     ac_dist >= 20.0 && ac_dist_set >= 20.0 && ac_gtc - ACInfo[playerid][acUpdateTick] < 1500))
  5846.                                     {
  5847.                                         if(ACInfo[playerid][acACAllow][2])
  5848.                                         {
  5849.                                             #if defined DEBUG
  5850.                                                 printf("[Nex-AC debug] Speed: %d, dist: %f, dist set: %f", ac_s, ac_dist, ac_dist_set);
  5851.                                             #endif
  5852.                                             #if defined OnCheatDetected
  5853.                                                 ac_KickWithCode(playerid, "", 0, 2, 3);
  5854.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5855.                                             #else
  5856.                                                 return ac_KickWithCode(playerid, "", 0, 2, 3);
  5857.                                             #endif
  5858.                                         }
  5859.                                     }
  5860.                                     else if(ACInfo[playerid][acACAllow][0] && (ac_s || ac_dist >= 3.0))
  5861.                                     {
  5862.                                         if(++ACInfo[playerid][acCheatCount][1] > AC_MAX_AIR_WARNINGS)
  5863.                                         {
  5864.                                             #undef AC_MAX_AIR_WARNINGS
  5865.                                             #if defined DEBUG
  5866.                                                 printf("[Nex-AC debug] Speed: %d, dist: %f", ac_s, ac_dist);
  5867.                                             #endif
  5868.                                             #if defined OnCheatDetected
  5869.                                                 ac_KickWithCode(playerid, "", 0, 0);
  5870.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5871.                                                 ACInfo[playerid][acCheatCount][1] = 0;
  5872.                                             #else
  5873.                                                 return ac_KickWithCode(playerid, "", 0, 0);
  5874.                                             #endif
  5875.                                         }
  5876.                                         #if defined OnCheatWarning
  5877.                                             else OnCheatWarning(playerid, "", 0, 0, 0, ACInfo[playerid][acCheatCount][1]);
  5878.                                         #endif
  5879.                                     }
  5880.                                 }
  5881.                             }
  5882.                             if(ACInfo[playerid][acACAllow][9])
  5883.                             {
  5884.                                 if(ACInfo[playerid][acSpeed] < ac_s && ac_s > 518)
  5885.                                 {
  5886.                                     #if defined DEBUG
  5887.                                         printf("[Nex-AC debug] Speed: %d, old speed: %d", ac_s, ACInfo[playerid][acSpeed]);
  5888.                                     #endif
  5889.                                     #if defined OnCheatDetected
  5890.                                         ac_KickWithCode(playerid, "", 0, 9, 1);
  5891.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5892.                                     #else
  5893.                                         return ac_KickWithCode(playerid, "", 0, 9, 1);
  5894.                                     #endif
  5895.                                 }
  5896.                                 else if(ac_gtc - ACInfo[playerid][acGtc][9] > ac_gpp)
  5897.                                 {
  5898.                                     ac_i = ac_GetSpeed(ac_vX, ac_vY);
  5899.                                     ac_tmp = ac_pZ - ACInfo[playerid][acPosZ];
  5900.                                     if((ac_s >= 258 || ac_i > 180 || floatabs(ac_vZ) > 1.0 && floatabs(ac_tmp) < 2.0) &&
  5901.                                     ACInfo[playerid][acHealth] <= ac_health)
  5902.                                     {
  5903.                                         if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_SPEEDHACK_WARNINGS)
  5904.                                         {
  5905.                                             #if defined DEBUG
  5906.                                                 printf("[Nex-AC debug] Speed: %d, speed x, y: %d, vel z: %f, pos diff z: %f, old speed: %d",
  5907.                                                 ac_s, ac_i, ac_vZ, ac_tmp, ACInfo[playerid][acSpeed]);
  5908.                                             #endif
  5909.                                             #if defined OnCheatDetected
  5910.                                                 ac_KickWithCode(playerid, "", 0, 9, 2);
  5911.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5912.                                                 ACInfo[playerid][acCheatCount][15] = 0;
  5913.                                             #else
  5914.                                                 return ac_KickWithCode(playerid, "", 0, 9, 2);
  5915.                                             #endif
  5916.                                         }
  5917.                                         #if defined OnCheatWarning
  5918.                                             else OnCheatWarning(playerid, "", 0, 9, 2, ACInfo[playerid][acCheatCount][15]);
  5919.                                         #endif
  5920.                                     }
  5921.                                     else ACInfo[playerid][acCheatCount][15] = 0;
  5922.                                 }
  5923.                             }
  5924.                             if(ac_gtc - ACInfo[playerid][acGtc][9] > ac_gpp)
  5925.                             {
  5926.                                 ACInfo[playerid][acSpeed] = ac_s;
  5927.                                 ACInfo[playerid][acVelZ] = ac_vZ;
  5928.                             }
  5929.                         }
  5930.                         else
  5931.                         {
  5932.                             if(ACInfo[playerid][acACAllow][2] && ac_gtc - ACInfo[playerid][acGtc][10] > ac_gpp &&
  5933.                             (ac_dist >= AC_STREAM_DISTANCE || ac_dist >= AC_MIN_STREAM_DISTANCE && (ac_a == INVALID_VEHICLE_ID || ACVehInfo[ac_a][acDriver] == INVALID_PLAYER_ID)))
  5934.                             {
  5935.                                 #undef AC_MIN_STREAM_DISTANCE
  5936.                                 #if defined DEBUG
  5937.                                     printf("[Nex-AC debug] Dist: %f, dist set: %f, speed: %d, pos x, y, z: %f, %f, %f, surfing veh: %d",
  5938.                                     ac_dist, ac_dist_set, ac_s, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ], ac_a);
  5939.                                 #endif
  5940.                                 #if defined OnCheatDetected
  5941.                                     ac_KickWithCode(playerid, "", 0, 2, 7);
  5942.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  5943.                                 #else
  5944.                                     return ac_KickWithCode(playerid, "", 0, 2, 7);
  5945.                                 #endif
  5946.                             }
  5947.                             if(ACInfo[playerid][acACAllow][9])
  5948.                             {
  5949.                                 if(ac_a != INVALID_VEHICLE_ID)
  5950.                                 {
  5951.                                     GetVehicleVelocity(ac_a, ac_vX, ac_vY, ac_vZ);
  5952.                                     new ac_vsp = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  5953.                                     if(ac_s - ac_vsp > 220)
  5954.                                     {
  5955.                                         if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_SPEEDHACK_WARNINGS)
  5956.                                         {
  5957.                                             #undef AC_MAX_SPEEDHACK_WARNINGS
  5958.                                             #if defined DEBUG
  5959.                                                 printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d, veh speed: %d",
  5960.                                                 ac_s, ACInfo[playerid][acSpeed], GetVehicleModel(ac_a), ac_vsp);
  5961.                                             #endif
  5962.                                             #if defined OnCheatDetected
  5963.                                                 ac_KickWithCode(playerid, "", 0, 9, 3);
  5964.                                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  5965.                                                 ACInfo[playerid][acCheatCount][15] = 0;
  5966.                                             #else
  5967.                                                 return ac_KickWithCode(playerid, "", 0, 9, 3);
  5968.                                             #endif
  5969.                                         }
  5970.                                         #if defined OnCheatWarning
  5971.                                             else OnCheatWarning(playerid, "", 0, 9, 3, ACInfo[playerid][acCheatCount][15]);
  5972.                                         #endif
  5973.                                     }
  5974.                                     else ACInfo[playerid][acCheatCount][15] = 0;
  5975.                                 }
  5976.                                 else if(ACInfo[playerid][acSpeed] < ac_s && ac_s > 518)
  5977.                                 {
  5978.                                     #if defined DEBUG
  5979.                                         printf("[Nex-AC debug] Speed: %d, old speed: %d", ac_s, ACInfo[playerid][acSpeed]);
  5980.                                     #endif
  5981.                                     #if defined OnCheatDetected
  5982.                                         ac_KickWithCode(playerid, "", 0, 9, 4);
  5983.                                         if(ACInfo[playerid][acKicked] > 0) return 0;
  5984.                                     #else
  5985.                                         return ac_KickWithCode(playerid, "", 0, 9, 4);
  5986.                                     #endif
  5987.                                 }
  5988.                             }
  5989.                             ACInfo[playerid][acSpeed] = ac_s;
  5990.                             ACInfo[playerid][acVelZ] = ac_vZ;
  5991.                         }
  5992.                         ACInfo[playerid][acSpecAct] = ac_specact;
  5993.                         ACInfo[playerid][acAnim] = ac_sa;
  5994.                     }
  5995.                 }
  5996.                 ACInfo[playerid][acVeh] = ac_vehid;
  5997.                 ACInfo[playerid][acHealth] = ac_health;
  5998.                 ACInfo[playerid][acArmour] = ac_armour;
  5999.                 if(ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp) ACInfo[playerid][acHoldWeapon] = ac_w;
  6000.                 ACInfo[playerid][acLastWeapon] = ac_w;
  6001.                 ACInfo[playerid][acPosX] = ac_pX;
  6002.                 ACInfo[playerid][acPosY] = ac_pY;
  6003.                 ACInfo[playerid][acPosZ] = ac_pZ;
  6004.                 ACInfo[playerid][acPackets]++;
  6005.             }
  6006.         }
  6007.     #if AC_USE_NPC || defined IsPlayerDying
  6008.         }
  6009.     #endif
  6010.     ACInfo[playerid][acUpdateTick] = ac_gtc;
  6011.     #if defined ac_OnPlayerUpdate
  6012.         ac_gpp = ac_OnPlayerUpdate(playerid);
  6013.     #endif
  6014.     #if !defined FreezeSyncPacket
  6015.         if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) return 0;
  6016.     #endif
  6017.     #if defined ac_OnPlayerUpdate
  6018.         return ac_gpp;
  6019.     #else
  6020.         return 1;
  6021.     #endif
  6022. }
  6023.  
  6024. #if defined _ALS_OnPlayerUpdate
  6025.     #undef OnPlayerUpdate
  6026. #else
  6027.     #define _ALS_OnPlayerUpdate
  6028. #endif
  6029. #define OnPlayerUpdate ac_OnPlayerUpdate
  6030. #if defined ac_OnPlayerUpdate
  6031.     forward ac_OnPlayerUpdate(playerid);
  6032. #endif
  6033.  
  6034. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  6035. {
  6036.     if(ACInfo[playerid][acKicked] > 0) return 0;
  6037.     #if AC_USE_NPC
  6038.         if(!IsPlayerNPC(playerid))
  6039.         {
  6040.     #endif
  6041.         if((newkeys & KEY_SECONDARY_ATTACK) && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USEJETPACK &&
  6042.         GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_USEJETPACK)
  6043.         {
  6044.             ACInfo[playerid][acDropJpX] = ACInfo[playerid][acPosX];
  6045.             ACInfo[playerid][acDropJpY] = ACInfo[playerid][acPosY];
  6046.             ACInfo[playerid][acDropJpZ] = ACInfo[playerid][acPosZ];
  6047.         }
  6048.         new ac_w = GetPlayerWeapon(playerid);
  6049.         if((newkeys & KEY_CROUCH) && (24 <= ac_w <= 25 || 33 <= ac_w <= 34)) ACInfo[playerid][acCheatCount][12] = 0;
  6050.     #if AC_USE_NPC
  6051.         }
  6052.     #endif
  6053.     #if defined ac_OnPlayerKeyStateChange
  6054.         return ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  6055.     #else
  6056.         return 1;
  6057.     #endif
  6058. }
  6059.  
  6060. #if defined _ALS_OnPlayerKeyStateChange
  6061.     #undef OnPlayerKeyStateChange
  6062. #else
  6063.     #define _ALS_OnPlayerKeyStateChange
  6064. #endif
  6065. #define OnPlayerKeyStateChange ac_OnPlayerKeyStateChange
  6066. #if defined ac_OnPlayerKeyStateChange
  6067.     forward ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  6068. #endif
  6069.  
  6070. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  6071. {
  6072.     if(ACInfo[playerid][acKicked] > 0) return 1;
  6073.     new ac_gtc = GetTickCount();
  6074.     if(ACInfo[playerid][acACAllow][49])
  6075.     {
  6076.         if(ac_gtc - ACInfo[playerid][acCall][2] < ac_Mtfc[2][0]) ac_FloodDetect(playerid, 2);
  6077.         else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6078.         else ACInfo[playerid][acFloodCount][2] = ACInfo[playerid][acFloodCount][27] = 0;
  6079.     }
  6080.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][2] = ac_gtc;
  6081.     #if defined ac_OnPlayerClickMap
  6082.         return ac_OnPlayerClickMap(playerid, fX, fY, fZ);
  6083.     #else
  6084.         return 0;
  6085.     #endif
  6086. }
  6087.  
  6088. #if defined _ALS_OnPlayerClickMap
  6089.     #undef OnPlayerClickMap
  6090. #else
  6091.     #define _ALS_OnPlayerClickMap
  6092. #endif
  6093. #define OnPlayerClickMap ac_OnPlayerClickMap
  6094. #if defined ac_OnPlayerClickMap
  6095.     forward ac_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
  6096. #endif
  6097.  
  6098. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  6099. {
  6100.     if(ACInfo[playerid][acKicked] > 0) return 1;
  6101.     new ac_gtc = GetTickCount();
  6102.     if(ACInfo[playerid][acACAllow][49])
  6103.     {
  6104.         if(ac_gtc - ACInfo[playerid][acCall][3] < ac_Mtfc[3][0])
  6105.         {
  6106.             ac_FloodDetect(playerid, 3);
  6107.             return 1;
  6108.         }
  6109.         if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6110.         else ACInfo[playerid][acFloodCount][3] = ACInfo[playerid][acFloodCount][27] = 0;
  6111.     }
  6112.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][3] = ac_gtc;
  6113.     #if defined ac_OnPlayerClickPlayer
  6114.         return ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  6115.     #else
  6116.         return 0;
  6117.     #endif
  6118. }
  6119.  
  6120. #if defined _ALS_OnPlayerClickPlayer
  6121.     #undef OnPlayerClickPlayer
  6122. #else
  6123.     #define _ALS_OnPlayerClickPlayer
  6124. #endif
  6125. #define OnPlayerClickPlayer ac_OnPlayerClickPlayer
  6126. #if defined ac_OnPlayerClickPlayer
  6127.     forward ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  6128. #endif
  6129.  
  6130. #if defined OnPlayerClickTextDraw
  6131.     public OnPlayerClickTextDraw(playerid, Text:clickedid)
  6132.     {
  6133.         if(ACInfo[playerid][acKicked] > 0) return 1;
  6134.         new ac_gtc = GetTickCount();
  6135.         if(ACInfo[playerid][acACAllow][49])
  6136.         {
  6137.             if(ac_gtc - ACInfo[playerid][acCall][4] < ac_Mtfc[4][0])
  6138.             {
  6139.                 ac_FloodDetect(playerid, 4);
  6140.                 return 1;
  6141.             }
  6142.             if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6143.             else ACInfo[playerid][acFloodCount][4] = ACInfo[playerid][acFloodCount][27] = 0;
  6144.         }
  6145.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][4] = ac_gtc;
  6146.         #if defined ac_OnPlayerClickTextDraw
  6147.             return ac_OnPlayerClickTextDraw(playerid, clickedid);
  6148.         #else
  6149.             return 0;
  6150.         #endif
  6151.     }
  6152.  
  6153.     #if defined _ALS_OnPlayerClickTextDraw
  6154.         #undef OnPlayerClickTextDraw
  6155.     #else
  6156.         #define _ALS_OnPlayerClickTextDraw
  6157.     #endif
  6158.     #define OnPlayerClickTextDraw ac_OnPlayerClickTextDraw
  6159.     #if defined ac_OnPlayerClickTextDraw
  6160.         forward ac_OnPlayerClickTextDraw(playerid, Text:clickedid);
  6161.     #endif
  6162. #endif
  6163.  
  6164. public OnPlayerCommandText(playerid, cmdtext[])
  6165. {
  6166.     if(ACInfo[playerid][acKicked] > 0) return 1;
  6167.     #if AC_USE_NPC
  6168.         if(!IsPlayerNPC(playerid))
  6169.         {
  6170.     #endif
  6171.         new ac_gtc = GetTickCount();
  6172.         if(ACInfo[playerid][acACAllow][49])
  6173.         {
  6174.             if(ac_gtc - ACInfo[playerid][acCall][5] < ac_Mtfc[5][0])
  6175.             {
  6176.                 ac_FloodDetect(playerid, 5);
  6177.                 return 1;
  6178.             }
  6179.             if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6180.             else ACInfo[playerid][acFloodCount][5] = ACInfo[playerid][acFloodCount][27] = 0;
  6181.         }
  6182.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][5] = ac_gtc;
  6183.     #if AC_USE_NPC
  6184.         }
  6185.     #endif
  6186.     #if defined ac_OnPlayerCommandText
  6187.         return ac_OnPlayerCommandText(playerid, cmdtext);
  6188.     #else
  6189.         return 0;
  6190.     #endif
  6191. }
  6192.  
  6193. #if defined _ALS_OnPlayerCommandText
  6194.     #undef OnPlayerCommandText
  6195. #else
  6196.     #define _ALS_OnPlayerCommandText
  6197. #endif
  6198. #define OnPlayerCommandText ac_OnPlayerCommandText
  6199. #if defined ac_OnPlayerCommandText
  6200.     forward ac_OnPlayerCommandText(playerid, cmdtext[]);
  6201. #endif
  6202.  
  6203. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  6204. {
  6205.     if(ACInfo[playerid][acKicked] > 0) return 0;
  6206.     new ac_gtc = GetTickCount();
  6207.     if(ACInfo[playerid][acACAllow][49])
  6208.     {
  6209.         if(ac_gtc - ACInfo[playerid][acCall][6] < ac_Mtfc[6][0]) ac_FloodDetect(playerid, 6);
  6210.         else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6211.         else ACInfo[playerid][acFloodCount][6] = ACInfo[playerid][acFloodCount][27] = 0;
  6212.     }
  6213.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][6] = ac_gtc;
  6214.     new ac_model = GetVehicleModel(vehicleid);
  6215.     if(ACInfo[playerid][acACAllow][44] &&
  6216.     (ac_model <= 0 || !IsVehicleStreamedIn(vehicleid, playerid) && !ac_IsATrainCarriageEx(ac_model)))
  6217.     {
  6218.         #if defined DEBUG
  6219.             printf("[Nex-AC debug] Veh: %d, veh model: %d, ispassenger: %d", vehicleid, ac_model, ispassenger);
  6220.         #endif
  6221.         return ac_KickWithCode(playerid, "", 0, 44, 1);
  6222.     }
  6223.     #if defined SetVehicleFakePosForPlayer\
  6224.         && defined SetVehicleFakeZAngleForPlayer
  6225.         if(ACInfo[playerid][acACAllow][5] && !ac_IsATrainPartEx(ac_model))
  6226.         {
  6227.             new Float:ac_dist = GetVehicleDistanceFromPoint(vehicleid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  6228.             if(ac_dist >= 30.0 || ac_dist >= 20.0 && ac_model != 553 && ac_model != 577 && ac_model != 592)
  6229.             {
  6230.                 #if defined DEBUG
  6231.                     printf("[Nex-AC debug] Veh model: %d, veh: %d, dist: %f, ispassenger: %d, playerid: %d",
  6232.                     ac_model, vehicleid, ac_dist, ispassenger, playerid);
  6233.                 #endif
  6234.                 #if defined OnCheatDetected
  6235.                     ac_KickWithCode(playerid, "", 0, 5, 3);
  6236.                 #endif
  6237.                 SetVehicleFakePosForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]);
  6238.                 SetVehicleFakeZAngleForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acZAngle]);
  6239.                 ClearAnimations(playerid, 1);
  6240.             }
  6241.         }
  6242.     #endif
  6243.     new ac_doors = ACVehInfo[vehicleid][acLocked][playerid];
  6244.     if(ispassenger || ac_doors != VEHICLE_PARAMS_ON)
  6245.     {
  6246.         if(ac_doors != VEHICLE_PARAMS_ON) ACInfo[playerid][acEnterSeat] = -1;
  6247.         else ACInfo[playerid][acEnterSeat] = ispassenger;
  6248.         if(ACInfo[playerid][acEnterVeh] != vehicleid)
  6249.         {
  6250.             ACInfo[playerid][acEnterVeh] = vehicleid;
  6251.             if(ac_model == 570 || ac_IsABoatEx(ac_model)) ACInfo[playerid][acEnterVehTick] = 0;
  6252.             else ACInfo[playerid][acEnterVehTick] = ac_gtc;
  6253.         }
  6254.     }
  6255.     else if(ACInfo[playerid][acEnterVeh] != vehicleid ||
  6256.     ACInfo[playerid][acEnterSeat] != -1 && ACInfo[playerid][acEnterSeat] != ispassenger)
  6257.     {
  6258.         ACInfo[playerid][acEnterSeat] = -1;
  6259.         ACInfo[playerid][acEnterVeh] = 0;
  6260.     }
  6261.     #if defined ac_OnPlayerEnterVehicle
  6262.         return ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  6263.     #else
  6264.         return 1;
  6265.     #endif
  6266. }
  6267.  
  6268. #if defined _ALS_OnPlayerEnterVehicle
  6269.     #undef OnPlayerEnterVehicle
  6270. #else
  6271.     #define _ALS_OnPlayerEnterVehicle
  6272. #endif
  6273. #define OnPlayerEnterVehicle ac_OnPlayerEnterVehicle
  6274. #if defined ac_OnPlayerEnterVehicle
  6275.     forward ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  6276. #endif
  6277.  
  6278. public OnPlayerExitVehicle(playerid, vehicleid)
  6279. {
  6280.     #if defined IsPlayerDying
  6281.         if(ACInfo[playerid][acKicked] > 0 || IsPlayerDying(playerid)) return 0;
  6282.     #else
  6283.         if(ACInfo[playerid][acKicked] > 0 || ACInfo[playerid][acDead]) return 0;
  6284.     #endif
  6285.     new ac_gtc = GetTickCount();
  6286.     if(ACInfo[playerid][acACAllow][49])
  6287.     {
  6288.         if(ac_gtc - ACInfo[playerid][acCall][7] < ac_Mtfc[7][0]) ac_FloodDetect(playerid, 7);
  6289.         else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6290.         else ACInfo[playerid][acFloodCount][7] = ACInfo[playerid][acFloodCount][27] = 0;
  6291.     }
  6292.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][7] = ac_gtc;
  6293.     if(ACInfo[playerid][acACAllow][44] && !IsVehicleStreamedIn(vehicleid, playerid))
  6294.     {
  6295.         #if defined DEBUG
  6296.             printf("[Nex-AC debug] Veh: %d, veh model: %d", vehicleid, GetVehicleModel(vehicleid));
  6297.         #endif
  6298.         return ac_KickWithCode(playerid, "", 0, 44, 5);
  6299.     }
  6300.     if(ac_IsAnAircraftEx(GetVehicleModel(ACInfo[playerid][acVeh]))) ACInfo[playerid][acParachute] = 1;
  6301.     else if(ACInfo[playerid][acParachute] != 2) ACInfo[playerid][acParachute] = 0;
  6302.     #if defined ac_OnPlayerExitVehicle
  6303.         return ac_OnPlayerExitVehicle(playerid, vehicleid);
  6304.     #else
  6305.         return 1;
  6306.     #endif
  6307. }
  6308.  
  6309. #if defined _ALS_OnPlayerExitVehicle
  6310.     #undef OnPlayerExitVehicle
  6311. #else
  6312.     #define _ALS_OnPlayerExitVehicle
  6313. #endif
  6314. #define OnPlayerExitVehicle ac_OnPlayerExitVehicle
  6315. #if defined ac_OnPlayerExitVehicle
  6316.     forward ac_OnPlayerExitVehicle(playerid, vehicleid);
  6317. #endif
  6318.  
  6319. #if defined OnPlayerPickUpDynamicPickup
  6320.     #if defined STREAMER_ENABLE_TAGS
  6321.         public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP:pickupid)
  6322.     #else
  6323.         public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  6324.     #endif
  6325.     {
  6326.         if(ACInfo[playerid][acKicked] > 0) return 0;
  6327.         new ac_i = GetTickCount();
  6328.         if(ACInfo[playerid][acACAllow][49])
  6329.         {
  6330.             if(ac_i - ACInfo[playerid][acCall][8] < ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
  6331.             else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6332.             else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
  6333.         }
  6334.         #if defined Streamer_GetDistanceToItem
  6335.             if(ACInfo[playerid][acACAllow][6])
  6336.             {
  6337.                 new Float:ac_dist, Float:ac_dist_set;
  6338.                 Streamer_GetDistanceToItem(ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ], STREAMER_TYPE_PICKUP, pickupid, ac_dist);
  6339.                 Streamer_GetDistanceToItem(ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ACInfo[playerid][acPosZ] : ACInfo[playerid][acSetPosZ]), STREAMER_TYPE_PICKUP, pickupid, ac_dist_set);
  6340.                 if(ac_dist >= 15.0 && (ACInfo[playerid][acSet][7] == -1 || ac_dist_set >= 15.0))
  6341.                 {
  6342.                     #if defined DEBUG
  6343.                         printf("[Nex-AC debug] Dyn pickupid: %d, dist: %f, dist set: %f, acSet[7]: %d, playerid: %d",
  6344.                         _:pickupid, ac_dist, ac_dist_set, ACInfo[playerid][acSet][7], playerid);
  6345.                     #endif
  6346.                     #if defined OnCheatDetected
  6347.                         ac_KickWithCode(playerid, "", 0, 6, 2);
  6348.                     #endif
  6349.                     return 0;
  6350.                 }
  6351.             }
  6352.         #endif
  6353.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
  6354.         #if AC_USE_PICKUP_WEAPONS\
  6355.             && defined Streamer_GetIntData
  6356.             switch((ac_i = Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID)))
  6357.             {
  6358.                 case 1: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK;
  6359.                 case 2: ACInfo[playerid][acHealth] = 100;
  6360.                 case 3: ACInfo[playerid][acArmour] = 100;
  6361.                 default:
  6362.                 {
  6363.                     if(1 <= (ac_i - 100) <= 46)
  6364.                     {
  6365.                         ac_i -= 100;
  6366.                         new ac_s = ac_wSlot[ac_i];
  6367.                         if(ACInfo[playerid][acWeapon][ac_s] == ac_i ||
  6368.                         ac_IsAmmoSharingInSlot(ac_s) &&
  6369.                         ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i];
  6370.                     }
  6371.                 }
  6372.             }
  6373.         #endif
  6374.         ACInfo[playerid][acLastPickup] = _:pickupid + MAX_PICKUPS;
  6375.         #if defined ac_OnPlayerPickUpDynamicPickup
  6376.             return ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  6377.         #else
  6378.             return 1;
  6379.         #endif
  6380.     }
  6381.  
  6382.     #if defined _ALS_OnPlayerPickUpDynamicPicku\
  6383.         || defined _ALS_OnPlayerPickUpDynPickup\
  6384.         || defined _ALS_OnPlayerPickUpDynamicPick || defined _ALS_OnPlayerPickUpDynamicPUp
  6385.         #undef OnPlayerPickUpDynamicPickup
  6386.     #else
  6387.         #define _ALS_OnPlayerPickUpDynamicPicku
  6388.         #define _ALS_OnPlayerPickUpDynPickup
  6389.         #define _ALS_OnPlayerPickUpDynamicPick
  6390.         #define _ALS_OnPlayerPickUpDynamicPUp
  6391.     #endif
  6392.     #define OnPlayerPickUpDynamicPickup ac_OnPlayerPickUpDynamicPickup
  6393.     #if defined ac_OnPlayerPickUpDynamicPickup
  6394.         #if defined STREAMER_ENABLE_TAGS
  6395.             forward ac_OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP:pickupid);
  6396.         #else
  6397.             forward ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  6398.         #endif
  6399.     #endif
  6400. #endif
  6401.  
  6402. public OnPlayerPickUpPickup(playerid, pickupid)
  6403. {
  6404.     if(ACInfo[playerid][acKicked] > 0 || !(0 <= pickupid < MAX_PICKUPS)) return 0;
  6405.     #if defined Streamer_GetItemStreamerID\
  6406.         && defined IsValidDynamicPickup
  6407.         #if defined STREAMER_ENABLE_TAGS
  6408.             new STREAMER_TAG_PICKUP:streamerid = STREAMER_TAG_PICKUP:Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
  6409.         #else
  6410.             new streamerid = Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
  6411.         #endif
  6412.         if(!IsValidDynamicPickup(streamerid))
  6413.         {
  6414.     #endif
  6415.         new ac_i = GetTickCount();
  6416.         if(ACInfo[playerid][acACAllow][49])
  6417.         {
  6418.             if(ac_i - ACInfo[playerid][acCall][8] < ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
  6419.             else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6420.             else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
  6421.         }
  6422.         if(ACInfo[playerid][acACAllow][6])
  6423.         {
  6424.             #if defined VectorSize
  6425.                 new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]),
  6426.                 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]);
  6427.             #else
  6428.                 new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]),
  6429.                 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));
  6430.             #endif
  6431.             if(ac_dist >= 15.0 && (ACInfo[playerid][acSet][7] == -1 || ac_dist_set >= 15.0))
  6432.             {
  6433.                 #if defined DEBUG
  6434.                     printf("[Nex-AC debug] Pickupid: %d, dist: %f, dist set: %f, acSet[7]: %d, playerid: %d",
  6435.                     pickupid, ac_dist, ac_dist_set, ACInfo[playerid][acSet][7], playerid);
  6436.                 #endif
  6437.                 #if defined OnCheatDetected
  6438.                     ac_KickWithCode(playerid, "", 0, 6, 1);
  6439.                 #endif
  6440.                 return 0;
  6441.             }
  6442.         }
  6443.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
  6444.         #if AC_USE_PICKUP_WEAPONS
  6445.             switch(ACPickInfo[pickupid][acType])
  6446.             {
  6447.                 case 1: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK;
  6448.                 case 2: ACInfo[playerid][acHealth] = 100;
  6449.                 case 3: ACInfo[playerid][acArmour] = 100;
  6450.                 case 4:
  6451.                 {
  6452.                     ac_i = ACPickInfo[pickupid][acWeapon];
  6453.                     new ac_s = ac_wSlot[ac_i];
  6454.                     if(ACInfo[playerid][acWeapon][ac_s] == ac_i ||
  6455.                     ac_IsAmmoSharingInSlot(ac_s) &&
  6456.                     ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i];
  6457.                 }
  6458.             }
  6459.         #endif
  6460.         ACInfo[playerid][acLastPickup] = pickupid;
  6461.     #if defined Streamer_GetItemStreamerID\
  6462.         && defined IsValidDynamicPickup
  6463.         }
  6464.     #endif
  6465.     #if defined ac_OnPlayerPickUpPickup
  6466.         return ac_OnPlayerPickUpPickup(playerid, pickupid);
  6467.     #else
  6468.         return 1;
  6469.     #endif
  6470. }
  6471.  
  6472. #if defined _ALS_OnPlayerPickUpPickup
  6473.     #undef OnPlayerPickUpPickup
  6474. #else
  6475.     #define _ALS_OnPlayerPickUpPickup
  6476. #endif
  6477. #define OnPlayerPickUpPickup ac_OnPlayerPickUpPickup
  6478. #if defined ac_OnPlayerPickUpPickup
  6479.     forward ac_OnPlayerPickUpPickup(playerid, pickupid);
  6480. #endif
  6481.  
  6482. public OnPlayerRequestClass(playerid, classid)
  6483. {
  6484.     if(ACInfo[playerid][acKicked] > 0) return 0;
  6485.     new ac_i;
  6486.     #if !defined PAWNRAKNET_INC_
  6487.         if(!ACInfo[playerid][acForceClass])
  6488.         {
  6489.             #if defined WC_IsPlayerSpawned
  6490.                 if(WC_IsPlayerSpawned(playerid)) return 0;
  6491.             #elseif defined IsPlayerSpawned
  6492.                 if(IsPlayerSpawned(playerid)) return 0;
  6493.             #else
  6494.                 ac_i = GetPlayerState(playerid);
  6495.                 if(PLAYER_STATE_ONFOOT <= ac_i < PLAYER_STATE_WASTED || ac_i == PLAYER_STATE_SPAWNED) return 0;
  6496.             #endif
  6497.         }
  6498.     #endif
  6499.     #if AC_USE_NPC
  6500.         if(!IsPlayerNPC(playerid))
  6501.         {
  6502.     #endif
  6503.         ac_i = GetTickCount();
  6504.         if(ACInfo[playerid][acACAllow][49])
  6505.         {
  6506.             if(ac_i - ACInfo[playerid][acCall][9] < ac_Mtfc[9][0]) ac_FloodDetect(playerid, 9);
  6507.             else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6508.             else ACInfo[playerid][acFloodCount][9] = ACInfo[playerid][acFloodCount][27] = 0;
  6509.         }
  6510.         ACInfo[playerid][acClassRes] = true;
  6511.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][9] = ac_i;
  6512.         ACInfo[playerid][acSpawnPosX] = ac_ClassPos[classid][0];
  6513.         ACInfo[playerid][acSpawnPosY] = ac_ClassPos[classid][1];
  6514.         ACInfo[playerid][acSpawnPosZ] = ac_ClassPos[classid][2];
  6515.         ACInfo[playerid][acSpawnWeapon1] = ac_ClassWeapon[classid][0];
  6516.         ACInfo[playerid][acSpawnAmmo1] = ac_ClassAmmo[classid][0];
  6517.         ACInfo[playerid][acSpawnWeapon2] = ac_ClassWeapon[classid][1];
  6518.         ACInfo[playerid][acSpawnAmmo2] = ac_ClassAmmo[classid][1];
  6519.         ACInfo[playerid][acSpawnWeapon3] = ac_ClassWeapon[classid][2];
  6520.         ACInfo[playerid][acSpawnAmmo3] = ac_ClassAmmo[classid][2];
  6521.     #if AC_USE_NPC
  6522.         }
  6523.     #endif
  6524.     #if defined ac_OnPlayerRequestClass
  6525.         return ac_OnPlayerRequestClass(playerid, classid);
  6526.     #else
  6527.         return 1;
  6528.     #endif
  6529. }
  6530.  
  6531. #if defined _ALS_OnPlayerRequestClass
  6532.     #undef OnPlayerRequestClass
  6533. #else
  6534.     #define _ALS_OnPlayerRequestClass
  6535. #endif
  6536. #define OnPlayerRequestClass ac_OnPlayerRequestClass
  6537. #if defined ac_OnPlayerRequestClass
  6538.     forward ac_OnPlayerRequestClass(playerid, classid);
  6539. #endif
  6540.  
  6541. public OnPlayerSelectedMenuRow(playerid, row)
  6542. {
  6543.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
  6544.     new ac_gtc = GetTickCount();
  6545.     if(ACInfo[playerid][acACAllow][49])
  6546.     {
  6547.         if(ac_gtc - ACInfo[playerid][acCall][10] < ac_Mtfc[10][0]) ac_FloodDetect(playerid, 10);
  6548.         else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6549.         else ACInfo[playerid][acFloodCount][10] = ACInfo[playerid][acFloodCount][27] = 0;
  6550.     }
  6551.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][10] = ac_gtc;
  6552.     #if defined ac_OnPlayerSelectedMenuRow
  6553.         return ac_OnPlayerSelectedMenuRow(playerid, row);
  6554.     #else
  6555.         return 1;
  6556.     #endif
  6557. }
  6558.  
  6559. #if defined _ALS_OnPlayerSelectedMenuRow
  6560.     #undef OnPlayerSelectedMenuRow
  6561. #else
  6562.     #define _ALS_OnPlayerSelectedMenuRow
  6563. #endif
  6564. #define OnPlayerSelectedMenuRow ac_OnPlayerSelectedMenuRow
  6565. #if defined ac_OnPlayerSelectedMenuRow
  6566.     forward ac_OnPlayerSelectedMenuRow(playerid, row);
  6567. #endif
  6568.  
  6569. public OnPlayerStateChange(playerid, newstate, oldstate)
  6570. {
  6571.     if(ACInfo[playerid][acKicked] > 0) return 0;
  6572.     #if AC_USE_NPC
  6573.         if(!IsPlayerNPC(playerid))
  6574.         {
  6575.     #endif
  6576.         new ac_gtc = GetTickCount(), ac_s = GetPlayerPing(playerid);
  6577.         if(ACInfo[playerid][acACAllow][49])
  6578.         {
  6579.             if(ac_gtc - ACInfo[playerid][acCall][11] < ac_Mtfc[11][0])
  6580.             {
  6581.                 if(newstate != PLAYER_STATE_ONFOOT || oldstate != PLAYER_STATE_SPAWNED)
  6582.                 {
  6583.                     new ac_model;
  6584.                     if(oldstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(ACInfo[playerid][acVeh]);
  6585.                     else if(newstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(GetPlayerVehicleID(playerid));
  6586.                     if(!ac_IsABoatEx(ac_model)) ac_FloodDetect(playerid, 11);
  6587.                 }
  6588.             }
  6589.             else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6590.             else ACInfo[playerid][acFloodCount][11] = ACInfo[playerid][acFloodCount][27] = 0;
  6591.         }
  6592.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][11] = ac_gtc;
  6593.         switch(oldstate)
  6594.         {
  6595.             case PLAYER_STATE_NONE, PLAYER_STATE_WASTED:
  6596.             {
  6597.                 if(ACInfo[playerid][acACAllow][48] && !(PLAYER_STATE_SPAWNED <= newstate <= PLAYER_STATE_SPECTATING))
  6598.                 {
  6599.                     #if defined DEBUG
  6600.                         printf("[Nex-AC debug] Newstate: %d, oldstate: %d", newstate, oldstate);
  6601.                     #endif
  6602.                     ac_KickWithCode(playerid, "", 0, 48, 2);
  6603.                 }
  6604.             }
  6605.             case PLAYER_STATE_DRIVER:
  6606.             {
  6607.                 new ac_t = ACInfo[playerid][acVeh];
  6608.                 if(ACVehInfo[ac_t][acDriver] == playerid) ACVehInfo[ac_t][acDriver] = INVALID_PLAYER_ID;
  6609.                 ac_t = GetVehicleModel(ac_t);
  6610.                 if(1 <= ACInfo[playerid][acHealth] < 5 && ac_IsABikeEx(ac_t)) ACInfo[playerid][acHealth] = 5;
  6611.                 new Float:ac_x, Float:ac_y, Float:ac_z;
  6612.                 GetPlayerPos(playerid, ac_x, ac_y, ac_z);
  6613.                 #if defined VectorSize
  6614.                 if(ACInfo[playerid][acACAllow][2] &&
  6615.                 newstate == PLAYER_STATE_ONFOOT && ac_gtc - ACInfo[playerid][acGtc][10] > ac_s &&
  6616.                 (ACInfo[playerid][acPosZ] >= -90.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
  6617.                 VectorSize(ac_x - ACInfo[playerid][acPosX], ac_y - ACInfo[playerid][acPosY], 0.0) >= 180.0))
  6618.                 #else
  6619.                 if(ACInfo[playerid][acACAllow][2] &&
  6620.                 newstate == PLAYER_STATE_ONFOOT && ac_gtc - ACInfo[playerid][acGtc][10] > ac_s &&
  6621.                 (ACInfo[playerid][acPosZ] >= -90.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
  6622.                 floatsqroot(floatpower(ac_x - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_y - ACInfo[playerid][acPosY], 2.0)) >= 180.0))
  6623.                 #endif
  6624.                 {
  6625.                     if(!ac_IsAnAircraftEx(ac_t)) ac_z = ACInfo[playerid][acPosZ];
  6626.                     if((ac_x = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ac_z)) >= 50.0)
  6627.                     {
  6628.                         #if defined DEBUG
  6629.                             printf("[Nex-AC debug] Veh model: %d, veh: %d, dist: %f", ac_t, ACInfo[playerid][acVeh], ac_x);
  6630.                         #endif
  6631.                         ac_KickWithCode(playerid, "", 0, 2, 4);
  6632.                     }
  6633.                 }
  6634.                 GetPlayerVelocity(playerid, ac_x, ac_y, ac_z);
  6635.                 ACInfo[playerid][acVelZ] = ac_z;
  6636.                 ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_x, ac_y, ac_z);
  6637.                 if(ACInfo[playerid][acSet][7] == 3) ACInfo[playerid][acSet][7] = -1;
  6638.                 ACInfo[playerid][acGtc][15] = ACInfo[playerid][acGtc][9] = ac_gtc + 1650;
  6639.                 ACVehInfo[ACInfo[playerid][acVeh]][acExitTick] = ac_gtc + 4650;
  6640.             }
  6641.             case PLAYER_STATE_PASSENGER:
  6642.             {
  6643.                 new Float:ac_x, Float:ac_y, Float:ac_z;
  6644.                 GetPlayerPos(playerid, ac_x, ac_y, ac_z);
  6645.                 #if defined VectorSize
  6646.                 if(ACInfo[playerid][acACAllow][2] &&
  6647.                 newstate == PLAYER_STATE_ONFOOT && ac_gtc - ACInfo[playerid][acGtc][10] > ac_s &&
  6648.                 (ACInfo[playerid][acPosZ] >= -90.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
  6649.                 VectorSize(ac_x - ACInfo[playerid][acPosX], ac_y - ACInfo[playerid][acPosY], 0.0) >= 180.0))
  6650.                 #else
  6651.                 if(ACInfo[playerid][acACAllow][2] &&
  6652.                 newstate == PLAYER_STATE_ONFOOT && ac_gtc - ACInfo[playerid][acGtc][10] > ac_s &&
  6653.                 (ACInfo[playerid][acPosZ] >= -90.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 ||
  6654.                 floatsqroot(floatpower(ac_x - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_y - ACInfo[playerid][acPosY], 2.0)) >= 180.0))
  6655.                 #endif
  6656.                 {
  6657.                     new ac_vehid = ACInfo[playerid][acVeh], ac_model = GetVehicleModel(ac_vehid);
  6658.                     ac_s = ACVehInfo[ac_vehid][acDriver];
  6659.                     ac_x = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  6660.                     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))
  6661.                     {
  6662.                         #if defined DEBUG
  6663.                             if(ac_s == INVALID_PLAYER_ID) printf("[Nex-AC debug] Veh model: %d, veh: %d, dist: %f", ac_model, ac_vehid, ac_x);
  6664.                             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);
  6665.                         #endif
  6666.                         ac_KickWithCode(playerid, "", 0, 2, 5);
  6667.                     }
  6668.                 }
  6669.                 GetPlayerVelocity(playerid, ac_x, ac_y, ac_z);
  6670.                 ACInfo[playerid][acVelZ] = ac_z;
  6671.                 ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_x, ac_y, ac_z);
  6672.                 ACInfo[playerid][acGtc][15] = ACInfo[playerid][acGtc][9] = ac_gtc + 1650;
  6673.                 ACVehInfo[ACInfo[playerid][acVeh]][acExitTick] = ac_gtc + 4650;
  6674.             }
  6675.             case PLAYER_STATE_SPECTATING:
  6676.             {
  6677.                 if(ACInfo[playerid][acACAllow][48] &&
  6678.                 !(PLAYER_STATE_WASTED <= newstate <= PLAYER_STATE_SPAWNED) && ac_gtc - ACInfo[playerid][acGtc][16] > ac_s)
  6679.                 {
  6680.                     #if defined DEBUG
  6681.                         printf("[Nex-AC debug] Newstate: %d", newstate);
  6682.                     #endif
  6683.                     ac_KickWithCode(playerid, "", 0, 48, 3);
  6684.                 }
  6685.             }
  6686.         }
  6687.         switch(newstate)
  6688.         {
  6689.             case PLAYER_STATE_ONFOOT:
  6690.             {
  6691.                 ACInfo[playerid][acSet][9] =
  6692.                 ACInfo[playerid][acEnterSeat] = -1;
  6693.                 ACInfo[playerid][acCheatCount][12] =
  6694.                 ACInfo[playerid][acEnterVeh] = 0;
  6695.                 if(PLAYER_STATE_DRIVER <= oldstate <= PLAYER_STATE_PASSENGER)
  6696.                 {
  6697.                     GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  6698.                     ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX];
  6699.                     ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY];
  6700.                     if(GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastFivePosX], ACInfo[playerid][acLastFivePosY], ACInfo[playerid][acPosZ]) < AC_STREAM_DISTANCE)
  6701.                     {
  6702.                         ACInfo[playerid][acLastFivePosX] = ACInfo[playerid][acPosX];
  6703.                         ACInfo[playerid][acLastFivePosY] = ACInfo[playerid][acPosY];
  6704.                     }
  6705.                 }
  6706.             }
  6707.             case PLAYER_STATE_DRIVER, PLAYER_STATE_PASSENGER:
  6708.             {
  6709.                 ACInfo[playerid][acSet][9] = -1;
  6710.                 new ac_vehid = GetPlayerVehicleID(playerid), ac_seat = GetPlayerVehicleSeat(playerid);
  6711.                 ac_s = GetVehicleModel(ac_vehid);
  6712.                 if(ac_s <= 0)
  6713.                 {
  6714.                     if(ACInfo[playerid][acACAllow][44])
  6715.                     {
  6716.                         #if defined DEBUG
  6717.                             printf("[Nex-AC debug] Veh model: %d, veh: %d, seatid: %d", ac_s, ac_vehid, ac_seat);
  6718.                         #endif
  6719.                         ac_KickWithCode(playerid, "", 0, 44, 2);
  6720.                     }
  6721.                 }
  6722.                 else if(ACInfo[playerid][acSet][8] == -1)
  6723.                 {
  6724.                     if(ACInfo[playerid][acACAllow][44])
  6725.                     {
  6726.                         new ac_maxseats = ac_GetMaxPassengers(ac_s);
  6727.                         if(newstate == PLAYER_STATE_DRIVER)
  6728.                         {
  6729.                             if(ac_seat != 0 || ac_maxseats == 15)
  6730.                             {
  6731.                                 #if defined DEBUG
  6732.                                     printf("[Nex-AC debug] Veh model: %d, veh: %d, seatid: %d", ac_s, ac_vehid, ac_seat);
  6733.                                 #endif
  6734.                                 ac_KickWithCode(playerid, "", 0, 44, 3);
  6735.                             }
  6736.                         }
  6737.                         else if(ac_seat < 1 || ac_maxseats == 15 || ac_seat > ac_maxseats && !ac_IsABusEx(ac_s) && ac_s != 570)
  6738.                         {
  6739.                             #if defined DEBUG
  6740.                                 printf("[Nex-AC debug] Veh model: %d, veh: %d, max seats: %d, seatid: %d",
  6741.                                 ac_s, ac_vehid, ac_maxseats, ac_seat);
  6742.                             #endif
  6743.                             ac_KickWithCode(playerid, "", 0, 44, 4);
  6744.                         }
  6745.                     }
  6746.                     if(ACInfo[playerid][acACAllow][4] && !ACInfo[playerid][acSpec])
  6747.                     {
  6748.                         if(ACInfo[playerid][acEnterVeh] != ac_vehid ||
  6749.                         ACInfo[playerid][acEnterSeat] != -1 && ACInfo[playerid][acEnterSeat] != _:!!ac_seat ||
  6750.                         ac_gtc - ACInfo[playerid][acEnterVehTick] < (ac_IsABikeEx(ac_s) ? 100 : 300))
  6751.                         {
  6752.                             #if defined DEBUG
  6753.                                 printf("[Nex-AC debug] Entered veh: %d, veh: %d, entered seat: %d, seat: %d, veh model: %d, enter time: %d",
  6754.                                 ACInfo[playerid][acEnterVeh], ac_vehid, ACInfo[playerid][acEnterSeat], ac_seat, ac_s, ac_gtc - ACInfo[playerid][acEnterVehTick]);
  6755.                             #endif
  6756.                             ac_KickWithCode(playerid, "", 0, 4, 1);
  6757.                         }
  6758.                         else
  6759.                         {
  6760.                             new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  6761.                             if(newstate == PLAYER_STATE_DRIVER)
  6762.                             {
  6763.                                 if(ac_dist >= 30.0 || ac_dist >= 20.0 && ac_s != 553 && ac_s != 577 && ac_s != 592)
  6764.                                 {
  6765.                                     #if defined DEBUG
  6766.                                         printf("[Nex-AC debug] Veh model: %d, veh: %d, dist: %f", ac_s, ac_vehid, ac_dist);
  6767.                                     #endif
  6768.                                     ac_KickWithCode(playerid, "", 0, 4, 3);
  6769.                                 }
  6770.                             }
  6771.                             else if(ac_dist >= 80.0 || ac_dist >= 30.0 && ac_gtc - ACInfo[playerid][acUpdateTick] >= 1500)
  6772.                             {
  6773.                                 #if defined DEBUG
  6774.                                     printf("[Nex-AC debug] Veh model: %d, veh: %d, AFK time: %d, dist: %f",
  6775.                                     ac_s, ac_vehid, ac_gtc - ACInfo[playerid][acUpdateTick], ac_dist);
  6776.                                 #endif
  6777.                                 ac_KickWithCode(playerid, "", 0, 4, 4);
  6778.                             }
  6779.                             #if defined SetVehicleFakePosForPlayer\
  6780.                                 && defined SetVehicleFakeZAngleForPlayer
  6781.                                 if(ACInfo[playerid][acKicked] < 1 && !ac_IsATrainPartEx(ac_s))
  6782.                                 {
  6783.                                     ac_dist = GetPlayerDistanceFromPoint(playerid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]);
  6784.                                     if(newstate == PLAYER_STATE_DRIVER)
  6785.                                     {
  6786.                                         if(ac_dist >= 30.0 || ac_dist >= 20.0 && ac_s != 553 && ac_s != 577 && ac_s != 592)
  6787.                                         {
  6788.                                             #if defined DEBUG
  6789.                                                 printf("[Nex-AC debug] Veh model: %d, veh: %d, dist: %f", ac_s, ac_vehid, ac_dist);
  6790.                                             #endif
  6791.                                             ac_KickWithCode(playerid, "", 0, 4, 5);
  6792.                                         }
  6793.                                     }
  6794.                                     else if(ac_dist >= 80.0 || ac_dist >= 30.0 && ac_gtc - ACInfo[playerid][acUpdateTick] >= 1500)
  6795.                                     {
  6796.                                         #if defined DEBUG
  6797.                                             printf("[Nex-AC debug] Veh model: %d, veh: %d, AFK time: %d, dist: %f",
  6798.                                             ac_s, ac_vehid, ac_gtc - ACInfo[playerid][acUpdateTick], ac_dist);
  6799.                                         #endif
  6800.                                         ac_KickWithCode(playerid, "", 0, 4, 6);
  6801.                                     }
  6802.                                 }
  6803.                             #endif
  6804.                         }
  6805.                     }
  6806.                     if(newstate == PLAYER_STATE_DRIVER && ACInfo[playerid][acKicked] < 1)
  6807.                     {
  6808.                         ACVehInfo[ac_vehid][acDriver] = playerid;
  6809.                         GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  6810.                         ACInfo[playerid][acLastPosX] = ACInfo[playerid][acLastFivePosX] = ACInfo[playerid][acPosX];
  6811.                         ACInfo[playerid][acLastPosY] = ACInfo[playerid][acLastFivePosY] = ACInfo[playerid][acPosY];
  6812.                         ACInfo[playerid][acSetVehHealth] = -1.0;
  6813.                         ACInfo[playerid][acCheatCount][10] = 0;
  6814.                         ACInfo[playerid][acVehDmgRes] = false;
  6815.                     }
  6816.                     ACInfo[playerid][acEnterSeat] = -1;
  6817.                     ACInfo[playerid][acEnterVeh] = 0;
  6818.                 }
  6819.             }
  6820.             case PLAYER_STATE_SPAWNED:
  6821.             {
  6822.                 ACInfo[playerid][acPosX] = ACInfo[playerid][acSpawnPosX];
  6823.                 ACInfo[playerid][acPosY] = ACInfo[playerid][acSpawnPosY];
  6824.                 ACInfo[playerid][acPosZ] = ACInfo[playerid][acSpawnPosZ];
  6825.                 ACInfo[playerid][acLastPosX] = ACInfo[playerid][acLastFivePosX] = ACInfo[playerid][acPosX];
  6826.                 ACInfo[playerid][acLastPosY] = ACInfo[playerid][acLastFivePosY] = ACInfo[playerid][acPosY];
  6827.             }
  6828.             case PLAYER_STATE_SPECTATING:
  6829.             {
  6830.                 if(ACInfo[playerid][acACAllow][21] && !ACInfo[playerid][acSpec] &&
  6831.                 ACInfo[playerid][acSet][5] == -1) ac_KickWithCode(playerid, "", 0, 21);
  6832.                 if(ACInfo[playerid][acKicked] < 1)
  6833.                 {
  6834.                     ACInfo[playerid][acHealth] = 100;
  6835.                     ACInfo[playerid][acSet][5] = -1;
  6836.                     ACInfo[playerid][acSpec] = true;
  6837.                 }
  6838.             }
  6839.         }
  6840.     #if AC_USE_NPC
  6841.         }
  6842.     #endif
  6843.     #if defined ac_OnPlayerStateChange
  6844.         return ac_OnPlayerStateChange(playerid, newstate, oldstate);
  6845.     #else
  6846.         return 1;
  6847.     #endif
  6848. }
  6849.  
  6850. #if defined _ALS_OnPlayerStateChange
  6851.     #undef OnPlayerStateChange
  6852. #else
  6853.     #define _ALS_OnPlayerStateChange
  6854. #endif
  6855. #define OnPlayerStateChange ac_OnPlayerStateChange
  6856. #if defined ac_OnPlayerStateChange
  6857.     forward ac_OnPlayerStateChange(playerid, newstate, oldstate);
  6858. #endif
  6859.  
  6860. #if defined OnPlayerWeaponShot
  6861.     public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  6862.     {
  6863.         #if defined IsPlayerDying
  6864.             if(ACInfo[playerid][acKicked] > 0 || IsPlayerDying(playerid)) return 0;
  6865.         #else
  6866.             if(ACInfo[playerid][acKicked] > 0 || ACInfo[playerid][acDead]) return 0;
  6867.         #endif
  6868.         if(ACInfo[playerid][acACAllow][22] && !ac_LagCompMode)
  6869.         {
  6870.             #if defined OnCheatDetected
  6871.                 ac_KickWithCode(playerid, "", 0, 22);
  6872.             #endif
  6873.             return 0;
  6874.         }
  6875.         if(ACInfo[playerid][acACAllow][47] &&
  6876.         (!(BULLET_HIT_TYPE_NONE <= hittype <= BULLET_HIT_TYPE_PLAYER_OBJECT) ||
  6877.         hittype == BULLET_HIT_TYPE_PLAYER && !(0 <= hitid < MAX_PLAYERS) ||
  6878.         hittype == BULLET_HIT_TYPE_VEHICLE && !(1 <= hitid < MAX_VEHICLES) ||
  6879.         hittype == BULLET_HIT_TYPE_OBJECT && !(1 <= hitid < MAX_OBJECTS) ||
  6880.         hittype == BULLET_HIT_TYPE_PLAYER_OBJECT && !(1 <= hitid < MAX_OBJECTS) ||
  6881.         !ac_IsBulletWeapon(weaponid)))
  6882.         {
  6883.             #if defined DEBUG
  6884.                 printf("[Nex-AC debug] Hittype: %d, hitid: %d, weaponid: %d", hittype, hitid, weaponid);
  6885.             #endif
  6886.             return ac_KickWithCode(playerid, "", 0, 47, 1);
  6887.         }
  6888.         new Float:ac_oX, Float:ac_oY, Float:ac_oZ, Float:ac_hX, Float:ac_hY, Float:ac_hZ;
  6889.         GetPlayerLastShotVectors(playerid, ac_oX, ac_oY, ac_oZ, ac_hX, ac_hY, ac_hZ);
  6890.         if(ACInfo[playerid][acACAllow][34])
  6891.         {
  6892.             new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ac_oX, ac_oY, ac_oZ);
  6893.             if(ac_dist >= 80.0 || ac_dist >= 15.0 && ACInfo[playerid][acVeh] == 0 &&
  6894.             !IsVehicleStreamedIn(GetPlayerSurfingVehicleID(playerid), playerid) &&
  6895.             GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
  6896.             {
  6897.                 if(++ACInfo[playerid][acCheatCount][5] > AC_MAX_AFK_GHOST_WARNINGS)
  6898.                 {
  6899.                     #undef AC_MAX_AFK_GHOST_WARNINGS
  6900.                     #if defined DEBUG
  6901.                         printf("[Nex-AC debug] Weaponid: %d, origin dist: %f", weaponid, ac_dist);
  6902.                     #endif
  6903.                     #if defined OnCheatDetected
  6904.                         ac_KickWithCode(playerid, "", 0, 34);
  6905.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  6906.                         ACInfo[playerid][acCheatCount][5] = 0;
  6907.                     #else
  6908.                         return ac_KickWithCode(playerid, "", 0, 34);
  6909.                     #endif
  6910.                 }
  6911.                 #if defined OnCheatWarning
  6912.                     else OnCheatWarning(playerid, "", 0, 34, 0, ACInfo[playerid][acCheatCount][5]);
  6913.                 #endif
  6914.             }
  6915.             else ACInfo[playerid][acCheatCount][5] = 0;
  6916.         }
  6917.         new ac_gtc = GetTickCount(), ac_gpp = GetPlayerPing(playerid);
  6918.         if(ACInfo[playerid][acACAllow][29])
  6919.         {
  6920.             if(hittype > BULLET_HIT_TYPE_NONE)
  6921.             {
  6922.                 if(fX == 0.0 && fY == 0.0 && fZ == 0.0 || ac_oX == ac_hX && ac_oY == ac_hY ||
  6923.                 ac_oX == ACInfo[playerid][acPosX] || ac_oY == ACInfo[playerid][acPosY] || ac_oZ == ACInfo[playerid][acPosZ])
  6924.                 {
  6925.                     if(++ACInfo[playerid][acCheatCount][11] > AC_MAX_SILENT_AIM_WARNINGS)
  6926.                     {
  6927.                         #undef AC_MAX_SILENT_AIM_WARNINGS
  6928.                         #if defined DEBUG
  6929.                             printf("[Nex-AC debug] Hittype: %d, weaponid: %d, pZ: %f, oZ: %f, fX, fY, fZ: %f, %f, %f",
  6930.                             hittype, weaponid, ACInfo[playerid][acPosZ], ac_oZ, fX, fY, fZ);
  6931.                         #endif
  6932.                         #if defined OnCheatDetected
  6933.                             ac_KickWithCode(playerid, "", 0, 29, 1);
  6934.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  6935.                             ACInfo[playerid][acCheatCount][11] = 0;
  6936.                         #else
  6937.                             return ac_KickWithCode(playerid, "", 0, 29, 1);
  6938.                         #endif
  6939.                     }
  6940.                     #if defined OnCheatWarning
  6941.                         else OnCheatWarning(playerid, "", 0, 29, 1, ACInfo[playerid][acCheatCount][11]);
  6942.                     #endif
  6943.                 }
  6944.                 else
  6945.                 {
  6946.                     if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID)
  6947.                     {
  6948.                         #if defined IsPlayerDying
  6949.                             if(!IsPlayerDying(hitid))
  6950.                         #else
  6951.                             if(!ACInfo[hitid][acDead])
  6952.                         #endif
  6953.                         {
  6954.                             if(ac_gtc - ACInfo[hitid][acSetPosTick] > ac_gpp && ac_gtc - ACInfo[hitid][acUpdateTick] < 1500)
  6955.                             {
  6956.                                 new Float:ac_dist = GetPlayerDistanceFromPoint(hitid, ac_hX, ac_hY, ac_hZ);
  6957.                                 if(ac_dist >= 50.0 || ac_dist >= 20.0 && ACInfo[hitid][acVeh] == 0 &&
  6958.                                 !IsVehicleStreamedIn(GetPlayerSurfingVehicleID(hitid), hitid) &&
  6959.                                 GetPlayerSurfingObjectID(hitid) == INVALID_OBJECT_ID)
  6960.                                 {
  6961.                                     if(++ACInfo[playerid][acCheatCount][6] > AC_MAX_PRO_AIM_WARNINGS)
  6962.                                     {
  6963.                                         #undef AC_MAX_PRO_AIM_WARNINGS
  6964.                                         #if defined DEBUG
  6965.                                             printf("[Nex-AC debug] Weaponid: %d, hit dist: %f", weaponid, ac_dist);
  6966.                                         #endif
  6967.                                         #if defined OnCheatDetected
  6968.                                             ac_KickWithCode(playerid, "", 0, 29, 2);
  6969.                                             if(ACInfo[playerid][acKicked] > 0) return 0;
  6970.                                             ACInfo[playerid][acCheatCount][6] = 0;
  6971.                                         #else
  6972.                                             return ac_KickWithCode(playerid, "", 0, 29, 2);
  6973.                                         #endif
  6974.                                     }
  6975.                                     #if defined OnCheatWarning
  6976.                                         else OnCheatWarning(playerid, "", 0, 29, 2, ACInfo[playerid][acCheatCount][6]);
  6977.                                     #endif
  6978.                                 }
  6979.                                 else ACInfo[playerid][acCheatCount][6] = 0;
  6980.                             }
  6981.                         }
  6982.                     }
  6983.                     ACInfo[playerid][acCheatCount][11] = 0;
  6984.                 }
  6985.             }
  6986.             else ACInfo[playerid][acCheatCount][11] = 0;
  6987.         }
  6988.         new ac_i, ac_t, bool:ac_ur, bool:ac_ur2;
  6989.         switch(hittype)
  6990.         {
  6991.             case BULLET_HIT_TYPE_PLAYER:
  6992.             {
  6993.                 if(hitid != INVALID_PLAYER_ID && ACInfo[hitid][acACAllow][19] && ACInfo[hitid][acUnFrozen])
  6994.                 {
  6995.                     #if AC_USE_NPC && defined IsPlayerDying
  6996.                         if(!IsPlayerNPC(hitid) && !IsPlayerDying(hitid))
  6997.                     #elseif AC_USE_NPC
  6998.                         if(!IsPlayerNPC(hitid) && !ACInfo[hitid][acDead])
  6999.                     #elseif defined IsPlayerDying
  7000.                         if(!IsPlayerDying(hitid))
  7001.                     #else
  7002.                         if(!ACInfo[hitid][acDead])
  7003.                     #endif
  7004.                     {
  7005.                         if(ac_gtc - ACInfo[hitid][acSetPosTick] > ac_gpp &&
  7006.                         IsPlayerInRangeOfPoint(hitid, ac_wMinRange[weaponid - 22], ac_oX, ac_oY, ac_oZ) &&
  7007.                         !(SPECIAL_ACTION_ENTER_VEHICLE <= ACInfo[hitid][acSpecAct] <= SPECIAL_ACTION_EXIT_VEHICLE))
  7008.                         {
  7009.                             ac_t = GetPlayerTeam(playerid);
  7010.                             if(ac_t == NO_TEAM || ac_t != GetPlayerTeam(hitid))
  7011.                             {
  7012.                                 #if AC_USE_RESTAURANTS
  7013.                                     if(!ac_InRestaurant(hitid, ACInfo[hitid][acInt]))
  7014.                                     {
  7015.                                 #endif
  7016.                                     #if AC_USE_AMMUNATIONS
  7017.                                         if(!ac_InAmmuNation(hitid, ACInfo[hitid][acInt]))
  7018.                                         {
  7019.                                     #endif
  7020.                                         #if AC_USE_CASINOS
  7021.                                             if(!ac_InCasino(hitid, ACInfo[hitid][acInt]))
  7022.                                             {
  7023.                                         #endif
  7024.                                             ac_ur = true;
  7025.                                         #if AC_USE_CASINOS
  7026.                                             }
  7027.                                         #endif
  7028.                                     #if AC_USE_AMMUNATIONS
  7029.                                         }
  7030.                                     #endif
  7031.                                 #if AC_USE_RESTAURANTS
  7032.                                     }
  7033.                                 #endif
  7034.                             }
  7035.                         }
  7036.                     }
  7037.                 }
  7038.             }
  7039.             case BULLET_HIT_TYPE_VEHICLE:
  7040.             {
  7041.                 if(hitid != INVALID_VEHICLE_ID)
  7042.                 {
  7043.                     ac_i = ACVehInfo[hitid][acDriver];
  7044.                     #if AC_USE_NPC
  7045.                         if(ac_i != INVALID_PLAYER_ID && !IsPlayerNPC(ac_i))
  7046.                     #else
  7047.                         if(ac_i != INVALID_PLAYER_ID)
  7048.                     #endif
  7049.                     {
  7050.                         if(ACInfo[ac_i][acACAllow][20] && ACInfo[ac_i][acUnFrozen] &&
  7051.                         ACVehInfo[hitid][acHealth] >= 250.0 && ac_gtc - ACInfo[ac_i][acSetPosTick] > ac_gpp)
  7052.                         {
  7053.                             ac_t = GetPlayerTeam(playerid);
  7054.                             if(!ac_VehFriendlyFire || ac_t == NO_TEAM || ac_t != GetPlayerTeam(ac_i))
  7055.                             {
  7056.                                 ac_t = GetVehicleModel(hitid);
  7057.                                 new Float:ac_wX, Float:ac_wY, Float:ac_wZ;
  7058.                                 GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSFRONT, ac_hX, ac_hY, ac_hZ);
  7059.                                 GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSREAR, ac_oX, ac_oY, ac_oZ);
  7060.                                 GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSMID, ac_wX, ac_wY, ac_wZ);
  7061.                                 #if defined VectorSize
  7062.                                     if(VectorSize(ac_hX - fX, ac_hY - fY, ac_hZ - fZ) > 1.2 &&
  7063.                                     VectorSize(-ac_hX - fX, ac_hY - fY, ac_hZ - fZ) > 1.2 &&
  7064.                                     VectorSize(ac_oX - fX, ac_oY - fY, ac_oZ - fZ) > 1.2 &&
  7065.                                     VectorSize(-ac_oX - fX, ac_oY - fY, ac_oZ - fZ) > 1.2 &&
  7066.                                     (ac_wX == 0.0 && ac_wY == 0.0 && ac_wZ == 0.0 || VectorSize(ac_wX - fX, ac_wY - fY, ac_wZ - fZ) > 1.2 &&
  7067.                                     VectorSize(-ac_wX - fX, ac_wY - fY, ac_wZ - fZ) > 1.2)) ac_ur2 = true;
  7068.                                 #else
  7069.                                     if(floatsqroot(floatpower(ac_hX - fX, 2.0) + floatpower(ac_hY - fY, 2.0) + floatpower(ac_hZ - fZ, 2.0)) > 1.2 &&
  7070.                                     floatsqroot(floatpower(-ac_hX - fX, 2.0) + floatpower(ac_hY - fY, 2.0) + floatpower(ac_hZ - fZ, 2.0)) > 1.2 &&
  7071.                                     floatsqroot(floatpower(ac_oX - fX, 2.0) + floatpower(ac_oY - fY, 2.0) + floatpower(ac_oZ - fZ, 2.0)) > 1.2 &&
  7072.                                     floatsqroot(floatpower(-ac_oX - fX, 2.0) + floatpower(ac_oY - fY, 2.0) + floatpower(ac_oZ - fZ, 2.0)) > 1.2 &&
  7073.                                     (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 &&
  7074.                                     floatsqroot(floatpower(-ac_wX - fX, 2.0) + floatpower(ac_wY - fY, 2.0) + floatpower(ac_wZ - fZ, 2.0)) > 1.2)) ac_ur2 = true;
  7075.                                 #endif
  7076.                             }
  7077.                         }
  7078.                     }
  7079.                 }
  7080.             }
  7081.         }
  7082.         new ac_s = ac_wSlot[weaponid];
  7083.         ac_t = GetPlayerState(playerid);
  7084.         if(ACInfo[playerid][acACAllow][47])
  7085.         {
  7086.             if(ac_t == PLAYER_STATE_DRIVER)
  7087.             {
  7088.                 #if defined DEBUG
  7089.                     printf("[Nex-AC debug] Weaponid: %d, state: %d, veh model: %d, veh: %d",
  7090.                     weaponid, ac_t, GetVehicleModel(ACInfo[playerid][acVeh]), ACInfo[playerid][acVeh]);
  7091.                 #endif
  7092.                 return ac_KickWithCode(playerid, "", 0, 47, 6);
  7093.             }
  7094.             else
  7095.             {
  7096.                 if(ACInfo[playerid][acLastWeapon] != weaponid && ac_t != PLAYER_STATE_PASSENGER ||
  7097.                 ACInfo[playerid][acWeapon][ac_s] != weaponid && ACInfo[playerid][acSetWeapon][ac_s] != weaponid)
  7098.                 {
  7099.                     if(++ACInfo[playerid][acCheatCount][16] > AC_MAX_FAKE_WEAPON_WARNINGS)
  7100.                     {
  7101.                         #undef AC_MAX_FAKE_WEAPON_WARNINGS
  7102.                         #if defined DEBUG
  7103.                             printf("[Nex-AC debug] Armed weapon: %d, AC weapon: %d, weaponid: %d, state: %d",
  7104.                             ACInfo[playerid][acLastWeapon], ACInfo[playerid][acWeapon][ac_s], weaponid, ac_t);
  7105.                         #endif
  7106.                         ac_KickWithCode(playerid, "", 0, 47, 2);
  7107.                         #if defined OnCheatDetected
  7108.                             ACInfo[playerid][acCheatCount][16] = 0;
  7109.                         #endif
  7110.                     }
  7111.                     #if defined OnCheatWarning
  7112.                         else OnCheatWarning(playerid, "", 0, 47, 2, ACInfo[playerid][acCheatCount][16]);
  7113.                     #endif
  7114.                     return 0;
  7115.                 }
  7116.                 else ACInfo[playerid][acCheatCount][16] = 0;
  7117.             }
  7118.         }
  7119.         if(ACInfo[playerid][acACAllow][26])
  7120.         {
  7121.             ac_i = ac_gtc - ACInfo[playerid][acShotTick];
  7122.             if(ACInfo[playerid][acShotWeapon] == weaponid)
  7123.             {
  7124.                 if(weaponid != WEAPON_MINIGUN && ac_t != PLAYER_STATE_PASSENGER)
  7125.                 {
  7126.                     if(ac_gtc - ACInfo[playerid][acReloadTick] < 110)
  7127.                     {
  7128.                         #if defined DEBUG
  7129.                             printf("[Nex-AC debug] Weaponid: %d, reload time: %d, state: %d",
  7130.                             weaponid, ac_gtc - ACInfo[playerid][acReloadTick], ac_t);
  7131.                         #endif
  7132.                         #if defined OnCheatDetected
  7133.                             ac_KickWithCode(playerid, "", 0, 26, 4);
  7134.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  7135.                             ACInfo[playerid][acReloadTick] = 0;
  7136.                         #else
  7137.                             return ac_KickWithCode(playerid, "", 0, 26, 4);
  7138.                         #endif
  7139.                     }
  7140.                     else if(ac_i < 30 || ac_i < 50 && ac_s != 4)
  7141.                     {
  7142.                         if(++ACInfo[playerid][acCheatCount][8] > AC_MAX_RAPID_FIRE_WARNINGS)
  7143.                         {
  7144.                             #undef AC_MAX_RAPID_FIRE_WARNINGS
  7145.                             #if defined DEBUG
  7146.                                 printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
  7147.                             #endif
  7148.                             #if defined OnCheatDetected
  7149.                                 ac_KickWithCode(playerid, "", 0, 26, 1);
  7150.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  7151.                                 ACInfo[playerid][acCheatCount][8] = 0;
  7152.                             #else
  7153.                                 return ac_KickWithCode(playerid, "", 0, 26, 1);
  7154.                             #endif
  7155.                         }
  7156.                         #if defined OnCheatWarning
  7157.                             else OnCheatWarning(playerid, "", 0, 26, 1, ACInfo[playerid][acCheatCount][8]);
  7158.                         #endif
  7159.                     }
  7160.                     else ACInfo[playerid][acCheatCount][8] = 0;
  7161.                     if(weaponid == 25 && ac_i < 600 || (weaponid == 24 || 33 <= weaponid <= 34) && ac_i < 380)
  7162.                     {
  7163.                         if(++ACInfo[playerid][acCheatCount][12] > AC_MAX_AUTO_C_WARNINGS)
  7164.                         {
  7165.                             #undef AC_MAX_AUTO_C_WARNINGS
  7166.                             #if defined DEBUG
  7167.                                 printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
  7168.                             #endif
  7169.                             #if defined OnCheatDetected
  7170.                                 ac_KickWithCode(playerid, "", 0, 26, 2);
  7171.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  7172.                                 ACInfo[playerid][acCheatCount][12] = 0;
  7173.                             #else
  7174.                                 return ac_KickWithCode(playerid, "", 0, 26, 2);
  7175.                             #endif
  7176.                         }
  7177.                         #if defined OnCheatWarning
  7178.                             else OnCheatWarning(playerid, "", 0, 26, 2, ACInfo[playerid][acCheatCount][12]);
  7179.                         #endif
  7180.                     }
  7181.                 }
  7182.             }
  7183.             else if(ac_i < 30)
  7184.             {
  7185.                 #if defined DEBUG
  7186.                     printf("[Nex-AC debug] Fire rate: %d, weaponid: %d, last weapon: %d",
  7187.                     ac_i, weaponid, ACInfo[playerid][acShotWeapon]);
  7188.                 #endif
  7189.                 #if defined OnCheatDetected
  7190.                     ac_KickWithCode(playerid, "", 0, 26, 3);
  7191.                     if(ACInfo[playerid][acKicked] > 0) return 0;
  7192.                 #else
  7193.                     return ac_KickWithCode(playerid, "", 0, 26, 3);
  7194.                 #endif
  7195.             }
  7196.             if(GetPlayerWeaponState(playerid) == WEAPONSTATE_LAST_BULLET) ACInfo[playerid][acReloadTick] = ac_gtc;
  7197.         }
  7198.         if(ACInfo[playerid][acACAllow][17] && ac_t != PLAYER_STATE_PASSENGER &&
  7199.         ACInfo[playerid][acGiveAmmo][ac_s] == -65535 && ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp)
  7200.         {
  7201.             ac_t = GetPlayerAmmo(playerid);
  7202.             if(ACInfo[playerid][acAmmo][ac_s] == 0)
  7203.             {
  7204.                 #if defined DEBUG
  7205.                     printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d", weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  7206.                 #endif
  7207.                 #if defined OnCheatDetected
  7208.                     ac_KickWithCode(playerid, "", 0, 17, 1);
  7209.                     if(ACInfo[playerid][acKicked] > 0) return 0;
  7210.                     ACInfo[playerid][acAmmo][ac_s] = ac_t;
  7211.                 #else
  7212.                     return ac_KickWithCode(playerid, "", 0, 17, 1);
  7213.                 #endif
  7214.             }
  7215.             if(ACInfo[playerid][acAmmo][ac_s] < ac_t)
  7216.             {
  7217.                 switch(weaponid)
  7218.                 {
  7219.                     case WEAPON_MINIGUN:
  7220.                     {
  7221.                         if(++ACInfo[playerid][acCheatCount][7] > 9)
  7222.                         {
  7223.                             #if defined DEBUG
  7224.                                 printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d, acCheatCount[7]: %d",
  7225.                                 weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t, ACInfo[playerid][acCheatCount][7]);
  7226.                             #endif
  7227.                             #if defined OnCheatDetected
  7228.                                 ac_KickWithCode(playerid, "", 0, 17, 2);
  7229.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  7230.                                 ACInfo[playerid][acCheatCount][7] = 0;
  7231.                                 ACInfo[playerid][acAmmo][ac_s] = ac_t;
  7232.                             #else
  7233.                                 return ac_KickWithCode(playerid, "", 0, 17, 2);
  7234.                             #endif
  7235.                         }
  7236.                         #if defined OnCheatWarning
  7237.                             else OnCheatWarning(playerid, "", 0, 17, 2, ACInfo[playerid][acCheatCount][7]);
  7238.                         #endif
  7239.                     }
  7240.                     default:
  7241.                     {
  7242.                         if(ac_t - ACInfo[playerid][acAmmo][ac_s] > 6)
  7243.                         {
  7244.                             #if defined DEBUG
  7245.                                 printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  7246.                                 weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  7247.                             #endif
  7248.                             #if defined OnCheatDetected
  7249.                                 ac_KickWithCode(playerid, "", 0, 17, 3);
  7250.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  7251.                                 ACInfo[playerid][acCheatCount][7] = 0;
  7252.                                 ACInfo[playerid][acAmmo][ac_s] = ac_t;
  7253.                             #else
  7254.                                 return ac_KickWithCode(playerid, "", 0, 17, 3);
  7255.                             #endif
  7256.                         }
  7257.                     }
  7258.                 }
  7259.             }
  7260.             else ACInfo[playerid][acCheatCount][7] = 0;
  7261.         }
  7262.         if(ACInfo[playerid][acAmmo][ac_s] != 0) ACInfo[playerid][acAmmo][ac_s]--;
  7263.         if(ACInfo[playerid][acAmmo][ac_s] < -32768) ACInfo[playerid][acAmmo][ac_s] += 65536;
  7264.         ACInfo[playerid][acShotWeapon] = weaponid;
  7265.         ACInfo[playerid][acShotTick] = ac_gtc;
  7266.         #if defined ac_OnPlayerWeaponShot
  7267.             ac_i = ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
  7268.             if(ac_i)
  7269.             {
  7270.         #endif
  7271.             if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) return 0;
  7272.             if(ac_ur)
  7273.             {
  7274.                 ACInfo[hitid][acDmgRes] = true;
  7275.                 ACInfo[hitid][acGtc][13] = ac_gtc + 165;
  7276.             }
  7277.             if(ac_ur2)
  7278.             {
  7279.                 ac_t = ACVehInfo[hitid][acDriver];
  7280.                 ACInfo[ac_t][acVehDmgRes] = true;
  7281.                 ACInfo[ac_t][acGtc][14] = ac_gtc + 165;
  7282.             }
  7283.         #if defined ac_OnPlayerWeaponShot
  7284.             }
  7285.             return ac_i;
  7286.         #else
  7287.             return 1;
  7288.         #endif
  7289.     }
  7290.  
  7291.     #if defined _ALS_OnPlayerWeaponShot
  7292.         #undef OnPlayerWeaponShot
  7293.     #else
  7294.         #define _ALS_OnPlayerWeaponShot
  7295.     #endif
  7296.     #define OnPlayerWeaponShot ac_OnPlayerWeaponShot
  7297.     #if defined ac_OnPlayerWeaponShot
  7298.         forward ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  7299.     #endif
  7300. #endif
  7301.  
  7302. public OnVehicleMod(playerid, vehicleid, componentid)
  7303. {
  7304.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7305.     new ac_i = GetTickCount();
  7306.     if(ACInfo[playerid][acACAllow][49])
  7307.     {
  7308.         if(ac_i - ACInfo[playerid][acCall][12] < ac_Mtfc[12][0]) return ac_FloodDetect(playerid, 12);
  7309.         if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7310.         else ACInfo[playerid][acFloodCount][12] = ACInfo[playerid][acFloodCount][27] = 0;
  7311.     }
  7312.     if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop])
  7313.     {
  7314.         #if defined OnCheatDetected
  7315.             ac_KickWithCode(playerid, "", 0, 23, 2);
  7316.             if(ACInfo[playerid][acKicked] > 0) return 0;
  7317.         #else
  7318.             return ac_KickWithCode(playerid, "", 0, 23, 2);
  7319.         #endif
  7320.     }
  7321.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][12] = ac_i;
  7322.     #if AC_USE_TUNING_GARAGES
  7323.         ACInfo[playerid][acGtc][18] = ac_i + 3250;
  7324.     #endif
  7325.     if(ACInfo[playerid][acACAllow][43] && !ac_IsCompatible((ac_i = GetVehicleModel(vehicleid)), componentid))
  7326.     {
  7327.         #if defined DEBUG
  7328.             printf("[Nex-AC debug] Veh model: %d, veh: %d, componentid: %d", ac_i, vehicleid, componentid);
  7329.         #endif
  7330.         return ac_KickWithCode(playerid, "", 0, 43, 1);
  7331.     }
  7332.     #if AC_USE_TUNING_GARAGES
  7333.         ac_i = componentid - 1000;
  7334.         if(ACInfo[playerid][acSet][11] != -1) ACInfo[playerid][acSet][11] += ac_cPrice[ac_i];
  7335.         else ACInfo[playerid][acSet][11] = ac_cPrice[ac_i];
  7336.         ACInfo[playerid][acCheatCount][21] = 0;
  7337.     #endif
  7338.     #if defined ac_OnVehicleMod
  7339.         return ac_OnVehicleMod(playerid, vehicleid, componentid);
  7340.     #else
  7341.         return 1;
  7342.     #endif
  7343. }
  7344.  
  7345. #if defined _ALS_OnVehicleMod
  7346.     #undef OnVehicleMod
  7347. #else
  7348.     #define _ALS_OnVehicleMod
  7349. #endif
  7350. #define OnVehicleMod ac_OnVehicleMod
  7351. #if defined ac_OnVehicleMod
  7352.     forward ac_OnVehicleMod(playerid, vehicleid, componentid);
  7353. #endif
  7354.  
  7355. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  7356. {
  7357.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7358.     new ac_gtc = GetTickCount();
  7359.     if(ACInfo[playerid][acACAllow][49])
  7360.     {
  7361.         if(ac_gtc - ACInfo[playerid][acCall][13] < ac_Mtfc[13][0]) ac_FloodDetect(playerid, 13);
  7362.         else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7363.         else ACInfo[playerid][acFloodCount][13] = ACInfo[playerid][acFloodCount][27] = 0;
  7364.     }
  7365.     if(ACInfo[playerid][acACAllow][43] && !(0 <= paintjobid <= 2) && paintjobid != 255)
  7366.     {
  7367.         #if defined DEBUG
  7368.             printf("[Nex-AC debug] Veh model: %d, veh: %d, paintjobid: %d", GetVehicleModel(vehicleid), vehicleid, paintjobid);
  7369.         #endif
  7370.         ac_KickWithCode(playerid, "", 0, 43, 2);
  7371.     }
  7372.     else if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop]) ac_KickWithCode(playerid, "", 0, 23, 4);
  7373.     if(ACInfo[playerid][acKicked] < 1)
  7374.     {
  7375.         if(paintjobid == 255) ACVehInfo[vehicleid][acPaintJob] = 3;
  7376.         else ACVehInfo[vehicleid][acPaintJob] = paintjobid;
  7377.     }
  7378.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][13] = ac_gtc;
  7379.     #if defined ac_OnVehiclePaintjob
  7380.         return ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  7381.     #else
  7382.         return 1;
  7383.     #endif
  7384. }
  7385.  
  7386. #if defined _ALS_OnVehiclePaintjob
  7387.     #undef OnVehiclePaintjob
  7388. #else
  7389.     #define _ALS_OnVehiclePaintjob
  7390. #endif
  7391. #define OnVehiclePaintjob ac_OnVehiclePaintjob
  7392. #if defined ac_OnVehiclePaintjob
  7393.     forward ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  7394. #endif
  7395.  
  7396. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  7397. {
  7398.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7399.     new ac_gtc = GetTickCount();
  7400.     if(ACInfo[playerid][acACAllow][49])
  7401.     {
  7402.         if(ac_gtc - ACInfo[playerid][acCall][14] < ac_Mtfc[14][0]) return ac_FloodDetect(playerid, 14);
  7403.         if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7404.         else ACInfo[playerid][acFloodCount][14] = ACInfo[playerid][acFloodCount][27] = 0;
  7405.     }
  7406.     #if !AC_USE_TUNING_GARAGES && !AC_USE_PAYNSPRAY
  7407.         if(ACInfo[playerid][acACAllow][23])
  7408.         {
  7409.             #if defined DEBUG
  7410.                 printf("[Nex-AC debug] Veh model: %d, veh: %d, color1: %d, color2: %d",
  7411.                 GetVehicleModel(vehicleid), vehicleid, color1, color2);
  7412.             #endif
  7413.             #if defined OnCheatDetected
  7414.                 ac_KickWithCode(playerid, "", 0, 23, 5);
  7415.                 if(ACInfo[playerid][acKicked] > 0) return 0;
  7416.             #else
  7417.                 return ac_KickWithCode(playerid, "", 0, 23, 5);
  7418.             #endif
  7419.         }
  7420.     #endif
  7421.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][14] = ac_gtc;
  7422.     #if defined ac_OnVehicleRespray
  7423.         return ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  7424.     #else
  7425.         return 1;
  7426.     #endif
  7427. }
  7428.  
  7429. #if defined _ALS_OnVehicleRespray
  7430.     #undef OnVehicleRespray
  7431. #else
  7432.     #define _ALS_OnVehicleRespray
  7433. #endif
  7434. #define OnVehicleRespray ac_OnVehicleRespray
  7435. #if defined ac_OnVehicleRespray
  7436.     forward ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  7437. #endif
  7438.  
  7439. public OnVehicleSpawn(vehicleid)
  7440. {
  7441.     ACVehInfo[vehicleid][acPaintJob] = 3;
  7442.     ACVehInfo[vehicleid][acHealth] = 1000.0;
  7443.     ACVehInfo[vehicleid][acSpawned] = true;
  7444.     ACVehInfo[vehicleid][acTrSpeed] = -1;
  7445.     ACVehInfo[vehicleid][acPosDiff] =
  7446.     ACVehInfo[vehicleid][acVelX] =
  7447.     ACVehInfo[vehicleid][acVelY] =
  7448.     ACVehInfo[vehicleid][acVelZ] = 0.0;
  7449.     ACVehInfo[vehicleid][acSpeed] =
  7450.     ACVehInfo[vehicleid][acTires] =
  7451.     ACVehInfo[vehicleid][acLights] =
  7452.     ACVehInfo[vehicleid][acDoors] =
  7453.     ACVehInfo[vehicleid][acPanels] =
  7454.     ACVehInfo[vehicleid][acLastSpeed] =
  7455.     ACVehInfo[vehicleid][acSpeedDiff] = 0;
  7456.     ACVehInfo[vehicleid][acPosX] = ACVehInfo[vehicleid][acSpawnPosX];
  7457.     ACVehInfo[vehicleid][acPosY] = ACVehInfo[vehicleid][acSpawnPosY];
  7458.     ACVehInfo[vehicleid][acPosZ] = ACVehInfo[vehicleid][acSpawnPosZ];
  7459.     ACVehInfo[vehicleid][acZAngle] = ACVehInfo[vehicleid][acSpawnZAngle];
  7460.     ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  7461.     new ac_gtc = GetTickCount() + 2650;
  7462.     #if defined foreach
  7463.         foreach(new ac_i : Player)
  7464.         {
  7465.             if(ACInfo[ac_i][acVeh] != vehicleid) continue;
  7466.     #else
  7467.         #if defined GetPlayerPoolSize
  7468.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  7469.         #else
  7470.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  7471.         #endif
  7472.         {
  7473.             if(!IsPlayerInVehicle(ac_i, vehicleid)) continue;
  7474.     #endif
  7475.         ACInfo[ac_i][acSetPosTick] = ACInfo[ac_i][acGtc][10] = ac_gtc;
  7476.     }
  7477.     #if defined ac_OnVehicleSpawn
  7478.         return ac_OnVehicleSpawn(vehicleid);
  7479.     #else
  7480.         return 1;
  7481.     #endif
  7482. }
  7483.  
  7484. #if defined _ALS_OnVehicleSpawn
  7485.     #undef OnVehicleSpawn
  7486. #else
  7487.     #define _ALS_OnVehicleSpawn
  7488. #endif
  7489. #define OnVehicleSpawn ac_OnVehicleSpawn
  7490. #if defined ac_OnVehicleSpawn
  7491.     forward ac_OnVehicleSpawn(vehicleid);
  7492. #endif
  7493.  
  7494. public OnVehicleDeath(vehicleid, killerid)
  7495. {
  7496.     #if AC_USE_NPC
  7497.     if(0 <= killerid < MAX_PLAYERS && !IsPlayerNPC(killerid))
  7498.     #else
  7499.     if(0 <= killerid < MAX_PLAYERS)
  7500.     #endif
  7501.     {
  7502.         new ac_gtc = GetTickCount();
  7503.         if(ACInfo[killerid][acACAllow][49])
  7504.         {
  7505.             if(ac_gtc - ACInfo[killerid][acCall][15] < ac_Mtfc[15][0]) ac_FloodDetect(killerid, 15);
  7506.             else if(ac_gtc - ACInfo[killerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(killerid, 27);
  7507.             else ACInfo[killerid][acFloodCount][15] = ACInfo[killerid][acFloodCount][27] = 0;
  7508.         }
  7509.         ACInfo[killerid][acCall][27] = ACInfo[killerid][acCall][15] = ac_gtc;
  7510.     }
  7511.     new Float:ac_vHealth;
  7512.     GetVehicleHealth(vehicleid, ac_vHealth);
  7513.     if(ac_vHealth < 250.0) ACVehInfo[vehicleid][acSpawned] = false;
  7514.     #if defined ac_OnVehicleDeath
  7515.         return ac_OnVehicleDeath(vehicleid, killerid);
  7516.     #else
  7517.         return 1;
  7518.     #endif
  7519. }
  7520.  
  7521. #if defined _ALS_OnVehicleDeath
  7522.     #undef OnVehicleDeath
  7523. #else
  7524.     #define _ALS_OnVehicleDeath
  7525. #endif
  7526. #define OnVehicleDeath ac_OnVehicleDeath
  7527. #if defined ac_OnVehicleDeath
  7528.     forward ac_OnVehicleDeath(vehicleid, killerid);
  7529. #endif
  7530.  
  7531. public OnPlayerText(playerid, text[])
  7532. {
  7533.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7534.     #if AC_USE_NPC
  7535.         if(!IsPlayerNPC(playerid))
  7536.         {
  7537.     #endif
  7538.         new ac_gtc = GetTickCount();
  7539.         if(ACInfo[playerid][acACAllow][49])
  7540.         {
  7541.             if(ac_gtc - ACInfo[playerid][acCall][16] < ac_Mtfc[16][0]) return ac_FloodDetect(playerid, 16);
  7542.             if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7543.             else ACInfo[playerid][acFloodCount][16] = ACInfo[playerid][acFloodCount][27] = 0;
  7544.         }
  7545.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][16] = ac_gtc;
  7546.     #if AC_USE_NPC
  7547.         }
  7548.     #endif
  7549.     #if defined ac_OnPlayerText
  7550.         return ac_OnPlayerText(playerid, text);
  7551.     #else
  7552.         return 1;
  7553.     #endif
  7554. }
  7555.  
  7556. #if defined _ALS_OnPlayerText
  7557.     #undef OnPlayerText
  7558. #else
  7559.     #define _ALS_OnPlayerText
  7560. #endif
  7561. #define OnPlayerText ac_OnPlayerText
  7562. #if defined ac_OnPlayerText
  7563.     forward ac_OnPlayerText(playerid, text[]);
  7564. #endif
  7565.  
  7566. public OnPlayerEnterCheckpoint(playerid)
  7567. {
  7568.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7569.     #if AC_USE_NPC
  7570.         if(!IsPlayerNPC(playerid))
  7571.         {
  7572.     #endif
  7573.         new ac_gtc = GetTickCount();
  7574.         if(ACInfo[playerid][acACAllow][49])
  7575.         {
  7576.             if(ac_gtc - ACInfo[playerid][acCall][17] < ac_Mtfc[17][0]) ac_FloodDetect(playerid, 17);
  7577.             else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7578.             else ACInfo[playerid][acFloodCount][17] = ACInfo[playerid][acFloodCount][27] = 0;
  7579.         }
  7580.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][17] = ac_gtc;
  7581.     #if AC_USE_NPC
  7582.         }
  7583.     #endif
  7584.     #if defined ac_OnPlayerEnterCheckpoint
  7585.         return ac_OnPlayerEnterCheckpoint(playerid);
  7586.     #else
  7587.         return 1;
  7588.     #endif
  7589. }
  7590.  
  7591. #if defined _ALS_OnPlayerEnterCheckpoint
  7592.     #undef OnPlayerEnterCheckpoint
  7593. #else
  7594.     #define _ALS_OnPlayerEnterCheckpoint
  7595. #endif
  7596. #define OnPlayerEnterCheckpoint ac_OnPlayerEnterCheckpoint
  7597. #if defined ac_OnPlayerEnterCheckpoint
  7598.     forward ac_OnPlayerEnterCheckpoint(playerid);
  7599. #endif
  7600.  
  7601. public OnPlayerLeaveCheckpoint(playerid)
  7602. {
  7603.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7604.     #if AC_USE_NPC
  7605.         if(!IsPlayerNPC(playerid))
  7606.         {
  7607.     #endif
  7608.         new ac_gtc = GetTickCount();
  7609.         if(ACInfo[playerid][acACAllow][49])
  7610.         {
  7611.             if(ac_gtc - ACInfo[playerid][acCall][18] < ac_Mtfc[18][0]) ac_FloodDetect(playerid, 18);
  7612.             else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7613.             else ACInfo[playerid][acFloodCount][18] = ACInfo[playerid][acFloodCount][27] = 0;
  7614.         }
  7615.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][18] = ac_gtc;
  7616.     #if AC_USE_NPC
  7617.         }
  7618.     #endif
  7619.     #if defined ac_OnPlayerLeaveCheckpoint
  7620.         return ac_OnPlayerLeaveCheckpoint(playerid);
  7621.     #else
  7622.         return 1;
  7623.     #endif
  7624. }
  7625.  
  7626. #if defined _ALS_OnPlayerLeaveCheckpoint
  7627.     #undef OnPlayerLeaveCheckpoint
  7628. #else
  7629.     #define _ALS_OnPlayerLeaveCheckpoint
  7630. #endif
  7631. #define OnPlayerLeaveCheckpoint ac_OnPlayerLeaveCheckpoint
  7632. #if defined ac_OnPlayerLeaveCheckpoint
  7633.     forward ac_OnPlayerLeaveCheckpoint(playerid);
  7634. #endif
  7635.  
  7636. public OnPlayerRequestSpawn(playerid)
  7637. {
  7638.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7639.     new ac_gtc;
  7640.     #if AC_USE_NPC
  7641.         if(!IsPlayerNPC(playerid))
  7642.         {
  7643.     #endif
  7644.         ac_gtc = GetTickCount();
  7645.         if(ACInfo[playerid][acACAllow][49])
  7646.         {
  7647.             if(ac_gtc - ACInfo[playerid][acCall][19] < ac_Mtfc[19][0]) ac_FloodDetect(playerid, 19);
  7648.             else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7649.             else ACInfo[playerid][acFloodCount][19] = ACInfo[playerid][acFloodCount][27] = 0;
  7650.         }
  7651.         if(!ACInfo[playerid][acClassRes])
  7652.         {
  7653.             ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][19] = ac_gtc;
  7654.             return 0;
  7655.         }
  7656.     #if AC_USE_NPC
  7657.         }
  7658.     #endif
  7659.     #if defined ac_OnPlayerRequestSpawn
  7660.         new ac_i = ac_OnPlayerRequestSpawn(playerid);
  7661.         if(ac_i)
  7662.         {
  7663.     #endif
  7664.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][19] = ac_gtc;
  7665.         ACInfo[playerid][acSpawnTick] = ACInfo[playerid][acNOPCount][9] = 0;
  7666.         ACInfo[playerid][acSpawnRes] = 1;
  7667.         ACInfo[playerid][acSet][6] = 3;
  7668.     #if defined ac_OnPlayerRequestSpawn
  7669.         }
  7670.         return ac_i;
  7671.     #else
  7672.         return 1;
  7673.     #endif
  7674. }
  7675.  
  7676. #if defined _ALS_OnPlayerRequestSpawn
  7677.     #undef OnPlayerRequestSpawn
  7678. #else
  7679.     #define _ALS_OnPlayerRequestSpawn
  7680. #endif
  7681. #define OnPlayerRequestSpawn ac_OnPlayerRequestSpawn
  7682. #if defined ac_OnPlayerRequestSpawn
  7683.     forward ac_OnPlayerRequestSpawn(playerid);
  7684. #endif
  7685.  
  7686. public OnPlayerExitedMenu(playerid)
  7687. {
  7688.     if(!(0 <= playerid < MAX_PLAYERS) || ACInfo[playerid][acKicked] > 0) return 0;
  7689.     new ac_gtc = GetTickCount();
  7690.     if(ACInfo[playerid][acACAllow][49])
  7691.     {
  7692.         if(ac_gtc - ACInfo[playerid][acCall][20] < ac_Mtfc[20][0]) ac_FloodDetect(playerid, 20);
  7693.         else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7694.         else ACInfo[playerid][acFloodCount][20] = ACInfo[playerid][acFloodCount][27] = 0;
  7695.     }
  7696.     ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][20] = ac_gtc;
  7697.     #if defined ac_OnPlayerExitedMenu
  7698.         return ac_OnPlayerExitedMenu(playerid);
  7699.     #else
  7700.         return 1;
  7701.     #endif
  7702. }
  7703.  
  7704. #if defined _ALS_OnPlayerExitedMenu
  7705.     #undef OnPlayerExitedMenu
  7706. #else
  7707.     #define _ALS_OnPlayerExitedMenu
  7708. #endif
  7709. #define OnPlayerExitedMenu ac_OnPlayerExitedMenu
  7710. #if defined ac_OnPlayerExitedMenu
  7711.     forward ac_OnPlayerExitedMenu(playerid);
  7712. #endif
  7713.  
  7714. public OnPlayerEnterRaceCheckpoint(playerid)
  7715. {
  7716.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7717.     #if AC_USE_NPC
  7718.         if(!IsPlayerNPC(playerid))
  7719.         {
  7720.     #endif
  7721.         new ac_gtc = GetTickCount();
  7722.         if(ACInfo[playerid][acACAllow][49])
  7723.         {
  7724.             if(ac_gtc - ACInfo[playerid][acCall][21] < ac_Mtfc[21][0]) ac_FloodDetect(playerid, 21);
  7725.             else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7726.             else ACInfo[playerid][acFloodCount][21] = ACInfo[playerid][acFloodCount][27] = 0;
  7727.         }
  7728.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][21] = ac_gtc;
  7729.     #if AC_USE_NPC
  7730.         }
  7731.     #endif
  7732.     #if defined ac_OnPlayerEnterRaceCheckpoint
  7733.         return ac_OnPlayerEnterRaceCheckpoint(playerid);
  7734.     #else
  7735.         return 1;
  7736.     #endif
  7737. }
  7738.  
  7739. #if defined _ALS_OnPlayerEnterRaceCheckpoin\
  7740.     || defined _ALS_OnPlayerEnterRaceCP
  7741.     #undef OnPlayerEnterRaceCheckpoint
  7742. #else
  7743.     #define _ALS_OnPlayerEnterRaceCheckpoin
  7744.     #define _ALS_OnPlayerEnterRaceCP
  7745. #endif
  7746. #define OnPlayerEnterRaceCheckpoint ac_OnPlayerEnterRaceCheckpoint
  7747. #if defined ac_OnPlayerEnterRaceCheckpoint
  7748.     forward ac_OnPlayerEnterRaceCheckpoint(playerid);
  7749. #endif
  7750.  
  7751. public OnPlayerLeaveRaceCheckpoint(playerid)
  7752. {
  7753.     if(ACInfo[playerid][acKicked] > 0) return 0;
  7754.     #if AC_USE_NPC
  7755.         if(!IsPlayerNPC(playerid))
  7756.         {
  7757.     #endif
  7758.         new ac_gtc = GetTickCount();
  7759.         if(ACInfo[playerid][acACAllow][49])
  7760.         {
  7761.             if(ac_gtc - ACInfo[playerid][acCall][22] < ac_Mtfc[22][0]) ac_FloodDetect(playerid, 22);
  7762.             else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7763.             else ACInfo[playerid][acFloodCount][22] = ACInfo[playerid][acFloodCount][27] = 0;
  7764.         }
  7765.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][22] = ac_gtc;
  7766.     #if AC_USE_NPC
  7767.         }
  7768.     #endif
  7769.     #if defined ac_OnPlayerLeaveRaceCheckpoint
  7770.         return ac_OnPlayerLeaveRaceCheckpoint(playerid);
  7771.     #else
  7772.         return 1;
  7773.     #endif
  7774. }
  7775.  
  7776. #if defined _ALS_OnPlayerLeaveRaceCheckpoin\
  7777.     || defined _ALS_OnPlayerLeaveRaceCP
  7778.     #undef OnPlayerLeaveRaceCheckpoint
  7779. #else
  7780.     #define _ALS_OnPlayerLeaveRaceCheckpoin
  7781.     #define _ALS_OnPlayerLeaveRaceCP
  7782. #endif
  7783. #define OnPlayerLeaveRaceCheckpoint ac_OnPlayerLeaveRaceCheckpoint
  7784. #if defined ac_OnPlayerLeaveRaceCheckpoint
  7785.     forward ac_OnPlayerLeaveRaceCheckpoint(playerid);
  7786. #endif
  7787.  
  7788. #if defined OnPlayerClickPlayerTextDraw
  7789.     public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  7790.     {
  7791.         if(ACInfo[playerid][acKicked] > 0) return 1;
  7792.         new ac_gtc = GetTickCount();
  7793.         if(ACInfo[playerid][acACAllow][49])
  7794.         {
  7795.             if(ac_gtc - ACInfo[playerid][acCall][23] < ac_Mtfc[23][0])
  7796.             {
  7797.                 ac_FloodDetect(playerid, 23);
  7798.                 return 1;
  7799.             }
  7800.             if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7801.             else ACInfo[playerid][acFloodCount][23] = ACInfo[playerid][acFloodCount][27] = 0;
  7802.         }
  7803.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][23] = ac_gtc;
  7804.         #if defined ac_OnPlayerClickPlayerTextDraw
  7805.             return ac_OnPlayerClickPlayerTextDraw(playerid, playertextid);
  7806.         #else
  7807.             return 0;
  7808.         #endif
  7809.     }
  7810.  
  7811.     #if defined _ALS_OnPlayerClickPlayerTextDra\
  7812.         || defined _ALS_OnPlayerClickPlayerTD
  7813.         #undef OnPlayerClickPlayerTextDraw
  7814.     #else
  7815.         #define _ALS_OnPlayerClickPlayerTextDra
  7816.         #define _ALS_OnPlayerClickPlayerTD
  7817.     #endif
  7818.     #define OnPlayerClickPlayerTextDraw ac_OnPlayerClickPlayerTextDraw
  7819.     #if defined ac_OnPlayerClickPlayerTextDraw
  7820.         forward ac_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
  7821.     #endif
  7822. #endif
  7823.  
  7824. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  7825. {
  7826.     if(ACInfo[playerid][acKicked] > 0) return 1;
  7827.     new ac_panels, ac_doors, ac_lights, ac_tires;
  7828.     #if !defined PAWNRAKNET_INC_
  7829.     if(ACVehInfo[vehicleid][acDriver] != playerid)
  7830.     {
  7831.         ac_panels = ACVehInfo[vehicleid][acPanels];
  7832.         ac_doors = ACVehInfo[vehicleid][acDoors];
  7833.         ac_lights = ACVehInfo[vehicleid][acLights];
  7834.         ac_tires = ACVehInfo[vehicleid][acTires];
  7835.         UpdateVehicleDamageStatus(vehicleid, ac_panels, ac_doors, ac_lights, ac_tires);
  7836.         return 1;
  7837.     }
  7838.     #endif
  7839.     GetVehicleDamageStatus(vehicleid, ac_panels, ac_doors, ac_lights, ac_tires);
  7840.     if(ACVehInfo[vehicleid][acPanels] != ac_panels || ACVehInfo[vehicleid][acDoors] != ac_doors ||
  7841.     ACVehInfo[vehicleid][acTires] != ac_tires)
  7842.     {
  7843.         new ac_gtc = GetTickCount();
  7844.         if(ACInfo[playerid][acACAllow][49])
  7845.         {
  7846.             if(ac_gtc - ACInfo[playerid][acCall][24] < ac_Mtfc[24][0]) ac_FloodDetect(playerid, 24);
  7847.             else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7848.             else
  7849.             {
  7850.                 if(ACInfo[playerid][acFloodCount][24] > 0) ACInfo[playerid][acFloodCount][24]--;
  7851.                 ACInfo[playerid][acFloodCount][27] = 0;
  7852.             }
  7853.         }
  7854.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][24] = ac_gtc;
  7855.     }
  7856.     ACVehInfo[vehicleid][acTires] = ac_tires;
  7857.     ACVehInfo[vehicleid][acLights] = ac_lights;
  7858.     ACVehInfo[vehicleid][acDoors] = ac_doors;
  7859.     ACVehInfo[vehicleid][acPanels] = ac_panels;
  7860.     #if defined ac_OnVehicleDamageStatusUpdate
  7861.         return ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  7862.     #else
  7863.         return 0;
  7864.     #endif
  7865. }
  7866.  
  7867. #if defined _ALS_OnVehicleDamageStatusUpdat\
  7868.     || defined _ALS_OnVehicleDamageStatusUpd
  7869.     #undef OnVehicleDamageStatusUpdate
  7870. #else
  7871.     #define _ALS_OnVehicleDamageStatusUpdat
  7872.     #define _ALS_OnVehicleDamageStatusUpd
  7873. #endif
  7874. #define OnVehicleDamageStatusUpdate ac_OnVehicleDamageStatusUpdate
  7875. #if defined ac_OnVehicleDamageStatusUpdate
  7876.     forward ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  7877. #endif
  7878.  
  7879. public OnVehicleStreamIn(vehicleid, forplayerid)
  7880. {
  7881.     new ac_doors, ac_tmp;
  7882.     GetVehicleParamsEx(vehicleid, ac_tmp, ac_tmp, ac_tmp, ac_doors, ac_tmp, ac_tmp, ac_tmp);
  7883.     ACVehInfo[vehicleid][acLocked][forplayerid] = ac_doors;
  7884.     #if defined ac_OnVehicleStreamIn
  7885.         return ac_OnVehicleStreamIn(vehicleid, forplayerid);
  7886.     #else
  7887.         return 1;
  7888.     #endif
  7889. }
  7890.  
  7891. #if defined _ALS_OnVehicleStreamIn
  7892.     #undef OnVehicleStreamIn
  7893. #else
  7894.     #define _ALS_OnVehicleStreamIn
  7895. #endif
  7896. #define OnVehicleStreamIn ac_OnVehicleStreamIn
  7897. #if defined ac_OnVehicleStreamIn
  7898.     forward ac_OnVehicleStreamIn(vehicleid, forplayerid);
  7899. #endif
  7900.  
  7901. #if defined OnVehicleSirenStateChange
  7902.     public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
  7903.     {
  7904.         if(ACInfo[playerid][acKicked] > 0) return 1;
  7905.         #if AC_USE_NPC
  7906.             if(!IsPlayerNPC(playerid))
  7907.             {
  7908.         #endif
  7909.             new ac_gtc = GetTickCount();
  7910.             if(ACInfo[playerid][acACAllow][49])
  7911.             {
  7912.                 if(ac_gtc - ACInfo[playerid][acCall][25] < ac_Mtfc[25][0]) ac_FloodDetect(playerid, 25);
  7913.                 else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7914.                 else ACInfo[playerid][acFloodCount][25] = ACInfo[playerid][acFloodCount][27] = 0;
  7915.             }
  7916.             ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][25] = ac_gtc;
  7917.         #if AC_USE_NPC
  7918.             }
  7919.         #endif
  7920.         #undef AC_USE_NPC
  7921.         #if defined ac_OnVehicleSirenStateChange
  7922.             return ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  7923.         #else
  7924.             return 0;
  7925.         #endif
  7926.     }
  7927.  
  7928.     #if defined _ALS_OnVehicleSirenStateChange
  7929.         #undef OnVehicleSirenStateChange
  7930.     #else
  7931.         #define _ALS_OnVehicleSirenStateChange
  7932.     #endif
  7933.     #define OnVehicleSirenStateChange ac_OnVehicleSirenStateChange
  7934.     #if defined ac_OnVehicleSirenStateChange
  7935.         forward ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  7936.     #endif
  7937. #endif
  7938.  
  7939. #if defined OnPlayerSelectDynamicObject
  7940.     #if defined STREAMER_ENABLE_TAGS
  7941.         public OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z)
  7942.     #else
  7943.         public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  7944.     #endif
  7945.     {
  7946.         if(ACInfo[playerid][acKicked] > 0) return 0;
  7947.         new ac_i = GetTickCount();
  7948.         if(ACInfo[playerid][acACAllow][49])
  7949.         {
  7950.             if(ac_i - ACInfo[playerid][acCall][26] < ac_Mtfc[26][0]) ac_FloodDetect(playerid, 26);
  7951.             else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  7952.             else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
  7953.         }
  7954.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_i;
  7955.         #if defined Streamer_GetIntData
  7956.             if(ACInfo[playerid][acACAllow][46] &&
  7957.             (ac_i = Streamer_GetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_MODEL_ID)) != modelid)
  7958.             {
  7959.                 #if defined DEBUG
  7960.                     printf("[Nex-AC debug] Dyn object model: %d, modelid: %d", ac_i, modelid);
  7961.                 #endif
  7962.                 return ac_KickWithCode(playerid, "", 0, 46, 3);
  7963.             }
  7964.         #endif
  7965.         #if defined ac_OnPlayerSelectDynamicObject
  7966.             return ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, x, y, z);
  7967.         #else
  7968.             return 1;
  7969.         #endif
  7970.     }
  7971.  
  7972.     #if defined _ALS_OnPlayerSelectDynamicObjec\
  7973.         || defined _ALS_OnPlayerSelectDynObject || defined _ALS_OnPlayerSelectDynamicObj
  7974.         #undef OnPlayerSelectDynamicObject
  7975.     #else
  7976.         #define _ALS_OnPlayerSelectDynamicObjec
  7977.         #define _ALS_OnPlayerSelectDynObject
  7978.         #define _ALS_OnPlayerSelectDynamicObj
  7979.     #endif
  7980.     #define OnPlayerSelectDynamicObject ac_OnPlayerSelectDynamicObject
  7981.     #if defined ac_OnPlayerSelectDynamicObject
  7982.         #if defined STREAMER_ENABLE_TAGS
  7983.             forward ac_OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z);
  7984.         #else
  7985.             forward ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z);
  7986.         #endif
  7987.     #endif
  7988. #endif
  7989.  
  7990. #if defined OnPlayerSelectObject
  7991.     public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  7992.     {
  7993.         if(ACInfo[playerid][acKicked] > 0) return 1;
  7994.         new ac_i = GetTickCount();
  7995.         if(ACInfo[playerid][acACAllow][49])
  7996.         {
  7997.             if(ac_i - ACInfo[playerid][acCall][26] < ac_Mtfc[26][0])
  7998.             {
  7999.                 ac_FloodDetect(playerid, 26);
  8000.                 return 1;
  8001.             }
  8002.             if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  8003.             else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
  8004.         }
  8005.         ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_i;
  8006.         #if defined GetObjectModel\
  8007.             && defined GetPlayerObjectModel
  8008.             if(ACInfo[playerid][acACAllow][46])
  8009.             {
  8010.                 if(type == SELECT_OBJECT_GLOBAL_OBJECT) ac_i = GetObjectModel(objectid);
  8011.                 else ac_i = GetPlayerObjectModel(playerid, objectid);
  8012.                 if(ac_i != modelid)
  8013.                 {
  8014.                     #if defined DEBUG
  8015.                         printf("[Nex-AC debug] Object model: %d, modelid: %d", ac_i, modelid);
  8016.                     #endif
  8017.                     ac_KickWithCode(playerid, "", 0, 46, 2);
  8018.                     return 1;
  8019.                 }
  8020.             }
  8021.         #endif
  8022.         #if defined ac_OnPlayerSelectObject
  8023.             return ac_OnPlayerSelectObject(playerid, type, objectid, modelid, fX, fY, fZ);
  8024.         #else
  8025.             return 0;
  8026.         #endif
  8027.     }
  8028.  
  8029.     #if defined _ALS_OnPlayerSelectObject
  8030.         #undef OnPlayerSelectObject
  8031.     #else
  8032.         #define _ALS_OnPlayerSelectObject
  8033.     #endif
  8034.     #define OnPlayerSelectObject ac_OnPlayerSelectObject
  8035.     #if defined ac_OnPlayerSelectObject
  8036.         forward ac_OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
  8037.     #endif
  8038. #endif
  8039.  
  8040. #if defined OnTrailerUpdate
  8041.     public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  8042. #elseif defined GetServerTickRate
  8043.     public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z)
  8044. #else
  8045.     public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
  8046. #endif
  8047. {
  8048.     if(ACInfo[playerid][acKicked] > 0) return 0;
  8049.     #if defined OnTrailerUpdate
  8050.         if(ACInfo[playerid][acACAllow][31] &&
  8051.         (new_x != new_x || new_y != new_y || new_z != new_z || vel_x != vel_x || vel_y != vel_y || vel_z != vel_z ||
  8052.         floatabs(new_x) >= 25000.0 || floatabs(new_y) >= 25000.0 || floatabs(new_z) >= 25000.0 ||
  8053.         floatabs(vel_x) >= 100.0 || floatabs(vel_y) >= 100.0 || floatabs(vel_z) >= 100.0 ||
  8054.         floatabs(vel_x - ACVehInfo[vehicleid][acVelX]) >= 2.6 && floatabs(vel_x) >= floatabs(ACVehInfo[vehicleid][acVelX]) ||
  8055.         floatabs(vel_y - ACVehInfo[vehicleid][acVelY]) >= 2.6 && floatabs(vel_y) >= floatabs(ACVehInfo[vehicleid][acVelY]) ||
  8056.         floatabs(vel_z - ACVehInfo[vehicleid][acVelZ]) >= 2.6 && floatabs(vel_z) >= floatabs(ACVehInfo[vehicleid][acVelZ])))
  8057.         {
  8058.             #if defined DEBUG
  8059.                 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);
  8060.             #endif
  8061.             return ac_KickWithCode(playerid, "", 0, 31, 2);
  8062.         }
  8063.         new ac_vsp = ac_GetSpeed(vel_x, vel_y, vel_z);
  8064.     #elseif defined GetServerTickRate
  8065.         if(ACInfo[playerid][acACAllow][31] &&
  8066.         (new_x != new_x || new_y != new_y || new_z != new_z ||
  8067.         floatabs(new_x) >= 25000.0 || floatabs(new_y) >= 25000.0 || floatabs(new_z) >= 25000.0))
  8068.         {
  8069.             #if defined DEBUG
  8070.                 printf("[Nex-AC debug] Pos x, y, z: %f, %f, %f", new_x, new_y, new_z);
  8071.             #endif
  8072.             return ac_KickWithCode(playerid, "", 0, 31, 2);
  8073.         }
  8074.     #endif
  8075.     new ac_gtc = GetTickCount(), ac_gpp = GetPlayerPing(playerid), Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_dist;
  8076.     #if defined GetServerTickRate
  8077.         GetVehiclePos(vehicleid, ac_x, ac_y, ac_z);
  8078.         if(ACInfo[playerid][acACAllow][5])
  8079.         {
  8080.             ac_dist = GetPlayerDistanceFromPoint(playerid, new_x, new_y, new_z);
  8081.             if(ac_dist >= 120.0)
  8082.             {
  8083.                 #if defined DEBUG
  8084.                     printf("[Nex-AC debug] Dist: %f, veh: %d, seat: %d, playerid: %d", ac_dist, vehicleid, passenger_seat, playerid);
  8085.                 #endif
  8086.                 #if defined OnCheatDetected
  8087.                     ac_KickWithCode(playerid, "", 0, 5, 4);
  8088.                 #endif
  8089.                 GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  8090.                 #if defined SetVehicleFakeZAngleForPlayer
  8091.                     SetVehicleFakeZAngleForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acZAngle]);
  8092.                 #else
  8093.                     SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  8094.                 #endif
  8095.                 #if defined SetVehicleFakePosForPlayer
  8096.                     SetVehicleFakePosForPlayer(playerid, vehicleid, ac_x, ac_y, ac_z);
  8097.                 #else
  8098.                     SetVehiclePos(vehicleid, ac_x, ac_y, ac_z);
  8099.                 #endif
  8100.                 return 0;
  8101.             }
  8102.         }
  8103.         ac_dist = GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z);
  8104.         if(passenger_seat > 0)
  8105.         {
  8106.             new Float:ac_zDiff;
  8107.             if(ACInfo[playerid][acACAllow][53])
  8108.             {
  8109.                 ac_zDiff = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastFivePosX], ACInfo[playerid][acLastFivePosY], new_z);
  8110.                 if(ac_zDiff >= AC_STREAM_DISTANCE)
  8111.                 {
  8112.                     #if defined DEBUG
  8113.                         printf("[Nex-AC debug] Dist: %f, acSet[7]: %d, pos x, y: %f, %f",
  8114.                         ac_zDiff, ACInfo[playerid][acSet][7], ACInfo[playerid][acLastFivePosX], ACInfo[playerid][acLastFivePosY]);
  8115.                     #endif
  8116.                     #if defined OnCheatDetected
  8117.                         ac_KickWithCode(playerid, "", 0, 53, 3);
  8118.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8119.                     #else
  8120.                         return ac_KickWithCode(playerid, "", 0, 53, 3);
  8121.                     #endif
  8122.                 }
  8123.             }
  8124.             ac_zDiff = new_z - ac_z;
  8125.             #if defined OnTrailerUpdate
  8126.             if(ACInfo[playerid][acACAllow][31] &&
  8127.             ((vel_z >= ACVehInfo[vehicleid][acVelZ] || ac_zDiff >= -0.8) &&
  8128.             (floatabs(vel_x - ACVehInfo[vehicleid][acVelX]) >= 1.0 ||
  8129.             floatabs(vel_y - ACVehInfo[vehicleid][acVelY]) >= 1.0 ||
  8130.             VectorSize(ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], 0.0) >= 0.3 &&
  8131.             (floatabs(vel_x) >= floatabs(ACVehInfo[vehicleid][acVelX]) || floatabs(vel_y) >= floatabs(ACVehInfo[vehicleid][acVelY]))) ||
  8132.             ac_zDiff >= -5.0 && (floatabs(new_x - ac_x) >= 8.0 || floatabs(new_y - ac_y) >= 8.0)))
  8133.             {
  8134.                 if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
  8135.                 {
  8136.                     #if defined DEBUG
  8137.                         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",
  8138.                         vel_x, vel_y, vel_z, ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], new_x - ac_x, new_y - ac_y, ac_zDiff, vehicleid);
  8139.                     #endif
  8140.                     #if defined OnCheatDetected
  8141.                         ac_KickWithCode(playerid, "", 0, 31, 1);
  8142.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8143.                         ACInfo[playerid][acCheatCount][4] = 0;
  8144.                     #else
  8145.                         return ac_KickWithCode(playerid, "", 0, 31, 1);
  8146.                     #endif
  8147.                 }
  8148.                 #if defined OnCheatWarning
  8149.                     else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]);
  8150.                 #endif
  8151.             }
  8152.             else if(ACInfo[playerid][acACAllow][8] &&
  8153.             (vel_z >= 0.1 && vel_z > ACVehInfo[vehicleid][acVelZ] &&
  8154.             floatabs(ac_x - new_x) < ac_zDiff / 2.0 && floatabs(ac_y - new_y) < ac_zDiff / 2.0 ||
  8155.             vel_z >= 0.0 && ac_zDiff <= -1.0 || vel_z <= 0.0 && ac_zDiff >= 1.0 ||
  8156.             ac_zDiff >= 0.0 && vel_z <= -0.5 || ac_zDiff <= 0.0 && vel_z >= 0.5))
  8157.             {
  8158.                 if(++ACInfo[playerid][acCheatCount][3] > AC_MAX_FLYHACK_VEH_WARNINGS)
  8159.                 {
  8160.                     #if defined DEBUG
  8161.                         printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, veh: %d",
  8162.                         vel_z, ACVehInfo[vehicleid][acVelZ], ac_x - new_x, ac_y - new_y, ac_zDiff, vehicleid);
  8163.                     #endif
  8164.                     #if defined OnCheatDetected
  8165.                         ac_KickWithCode(playerid, "", 0, 8, 2);
  8166.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8167.                         ACInfo[playerid][acCheatCount][3] = 0;
  8168.                     #else
  8169.                         return ac_KickWithCode(playerid, "", 0, 8, 2);
  8170.                     #endif
  8171.                 }
  8172.                 #if defined OnCheatWarning
  8173.                     else OnCheatWarning(playerid, "", 0, 8, 2, ACInfo[playerid][acCheatCount][3]);
  8174.                 #endif
  8175.             }
  8176.             else if(ACInfo[playerid][acACAllow][1] && ac_dist >= 2.6 && ac_vsp < 63)
  8177.             {
  8178.                 if(++ACInfo[playerid][acCheatCount][2] > AC_MAX_AIR_VEH_WARNINGS)
  8179.                 {
  8180.                     #undef AC_MAX_AIR_VEH_WARNINGS
  8181.                     #if defined DEBUG
  8182.                         printf("[Nex-AC debug] Speed: %d, dist: %f, old pos diff: %f, veh: %d, seat: %d",
  8183.                         ac_vsp, ac_dist, ACVehInfo[vehicleid][acPosDiff], vehicleid, passenger_seat);
  8184.                     #endif
  8185.                     #if defined OnCheatDetected
  8186.                         ac_KickWithCode(playerid, "", 0, 1, 2);
  8187.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8188.                         ACInfo[playerid][acCheatCount][2] = 0;
  8189.                     #else
  8190.                         return ac_KickWithCode(playerid, "", 0, 1, 2);
  8191.                     #endif
  8192.                 }
  8193.                 #if defined OnCheatWarning
  8194.                     else OnCheatWarning(playerid, "", 0, 1, 2, ACInfo[playerid][acCheatCount][2]);
  8195.                 #endif
  8196.             }
  8197.             #else
  8198.             if(ACInfo[playerid][acACAllow][31] &&
  8199.             ac_zDiff >= -5.0 && (floatabs(new_x - ac_x) >= 8.0 || floatabs(new_y - ac_y) >= 8.0))
  8200.             {
  8201.                 if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
  8202.                 {
  8203.                     #if defined DEBUG
  8204.                         printf("[Nex-AC debug] Pos diff x, y, z: %f, %f, %f, veh: %d",
  8205.                         new_x - ac_x, new_y - ac_y, ac_zDiff, vehicleid);
  8206.                     #endif
  8207.                     #if defined OnCheatDetected
  8208.                         ac_KickWithCode(playerid, "", 0, 31, 1);
  8209.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8210.                         ACInfo[playerid][acCheatCount][4] = 0;
  8211.                     #else
  8212.                         return ac_KickWithCode(playerid, "", 0, 31, 1);
  8213.                     #endif
  8214.                 }
  8215.                 #if defined OnCheatWarning
  8216.                     else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]);
  8217.                 #endif
  8218.             }
  8219.             #endif
  8220.         }
  8221.         if(ACInfo[playerid][acACAllow][5] &&
  8222.         (ac_dist >= 25.0 || ac_dist >= 15.0 && ac_gtc - ACInfo[playerid][acGtc][15] > ac_gpp) &&
  8223.         ac_dist - ACVehInfo[vehicleid][acPosDiff] > (ac_dist / 3.0) * 1.6 &&
  8224.         (ac_z >= -45.0 || VectorSize(new_x - ac_x, new_y - ac_y, 0.0) >= 180.0))
  8225.         {
  8226.             #if defined DEBUG
  8227.                 printf("[Nex-AC debug] Dist: %f, old pos diff: %f, old pos z: %f, veh: %d, seat: %d, playerid: %d",
  8228.                 ac_dist, ACVehInfo[vehicleid][acPosDiff], ac_z, vehicleid, passenger_seat, playerid);
  8229.             #endif
  8230.             #if defined OnCheatDetected
  8231.                 ac_KickWithCode(playerid, "", 0, 5, 1);
  8232.             #endif
  8233.             GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  8234.             #if defined SetVehicleFakeZAngleForPlayer
  8235.                 SetVehicleFakeZAngleForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acZAngle]);
  8236.             #else
  8237.                 SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  8238.             #endif
  8239.             #if defined SetVehicleFakePosForPlayer
  8240.                 SetVehicleFakePosForPlayer(playerid, vehicleid, ac_x, ac_y, ac_z);
  8241.             #else
  8242.                 SetVehiclePos(vehicleid, ac_x, ac_y, ac_z);
  8243.             #endif
  8244.             return 0;
  8245.         }
  8246.     #else
  8247.         GetVehiclePos(vehicleid, ac_x, ac_y, ac_z);
  8248.         if(ACInfo[playerid][acACAllow][5])
  8249.         {
  8250.             ac_dist = GetPlayerDistanceFromPoint(playerid, ac_x, ac_y, ac_z);
  8251.             if(ac_dist >= 120.0)
  8252.             {
  8253.                 #if defined DEBUG
  8254.                     printf("[Nex-AC debug] Dist: %f, veh: %d, seat: %d, playerid: %d", ac_dist, vehicleid, passenger_seat, playerid);
  8255.                 #endif
  8256.                 #if defined OnCheatDetected
  8257.                     ac_KickWithCode(playerid, "", 0, 5, 4);
  8258.                 #endif
  8259.                 SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  8260.                 SetVehiclePos(vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]);
  8261.                 return 0;
  8262.             }
  8263.         }
  8264.         ac_dist = GetVehicleDistanceFromPoint(vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]);
  8265.         if(passenger_seat > 0)
  8266.         {
  8267.             new Float:ac_zDiff;
  8268.             if(ACInfo[playerid][acACAllow][53])
  8269.             {
  8270.                 ac_zDiff = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastFivePosX], ACInfo[playerid][acLastFivePosY], ac_z);
  8271.                 if(ac_zDiff >= AC_STREAM_DISTANCE)
  8272.                 {
  8273.                     #if defined DEBUG
  8274.                         printf("[Nex-AC debug] Dist: %f, acSet[7]: %d, pos x, y: %f, %f",
  8275.                         ac_zDiff, ACInfo[playerid][acSet][7], ACInfo[playerid][acLastFivePosX], ACInfo[playerid][acLastFivePosY]);
  8276.                     #endif
  8277.                     #if defined OnCheatDetected
  8278.                         ac_KickWithCode(playerid, "", 0, 53, 3);
  8279.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8280.                     #else
  8281.                         return ac_KickWithCode(playerid, "", 0, 53, 3);
  8282.                     #endif
  8283.                 }
  8284.             }
  8285.             ac_zDiff = ac_z - ACVehInfo[vehicleid][acPosZ];
  8286.             if(ACInfo[playerid][acACAllow][31] && ac_zDiff >= -5.0 &&
  8287.             (floatabs(ac_x - ACVehInfo[vehicleid][acPosX]) >= 8.0 || floatabs(ac_y - ACVehInfo[vehicleid][acPosY]) >= 8.0))
  8288.             {
  8289.                 if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
  8290.                 {
  8291.                     #if defined DEBUG
  8292.                         printf("[Nex-AC debug] Pos diff x, y, z: %f, %f, %f, veh: %d",
  8293.                         ac_x - ACVehInfo[vehicleid][acPosX], ac_y - ACVehInfo[vehicleid][acPosY], ac_zDiff, vehicleid);
  8294.                     #endif
  8295.                     #if defined OnCheatDetected
  8296.                         ac_KickWithCode(playerid, "", 0, 31, 1);
  8297.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8298.                         ACInfo[playerid][acCheatCount][4] = 0;
  8299.                     #else
  8300.                         return ac_KickWithCode(playerid, "", 0, 31, 1);
  8301.                     #endif
  8302.                 }
  8303.                 #if defined OnCheatWarning
  8304.                     else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]);
  8305.                 #endif
  8306.             }
  8307.         }
  8308.         #if defined VectorSize
  8309.         if(ACInfo[playerid][acACAllow][5] &&
  8310.         (ac_dist >= 25.0 || ac_dist >= 15.0 && ac_gtc - ACInfo[playerid][acGtc][15] > ac_gpp) &&
  8311.         ac_dist - ACVehInfo[vehicleid][acPosDiff] > (ac_dist / 3.0) * 1.6 &&
  8312.         (ACVehInfo[vehicleid][acPosZ] >= -45.0 || VectorSize(ac_x - ACVehInfo[vehicleid][acPosX], ac_y - ACVehInfo[vehicleid][acPosY], 0.0) >= 180.0))
  8313.         #else
  8314.         if(ACInfo[playerid][acACAllow][5] &&
  8315.         (ac_dist >= 25.0 || ac_dist >= 15.0 && ac_gtc - ACInfo[playerid][acGtc][15] > ac_gpp) &&
  8316.         ac_dist - ACVehInfo[vehicleid][acPosDiff] > (ac_dist / 3.0) * 1.6 &&
  8317.         (ACVehInfo[vehicleid][acPosZ] >= -45.0 || floatsqroot(floatpower(ac_x - ACVehInfo[vehicleid][acPosX], 2.0) + floatpower(ac_y - ACVehInfo[vehicleid][acPosY], 2.0)) >= 180.0))
  8318.         #endif
  8319.         {
  8320.             #if defined DEBUG
  8321.                 printf("[Nex-AC debug] Dist: %f, old pos diff: %f, old pos z: %f, veh: %d, seat: %d, playerid: %d",
  8322.                 ac_dist, ACVehInfo[vehicleid][acPosDiff], ACVehInfo[vehicleid][acPosZ], vehicleid, passenger_seat, playerid);
  8323.             #endif
  8324.             #if defined OnCheatDetected
  8325.                 ac_KickWithCode(playerid, "", 0, 5, 1);
  8326.             #endif
  8327.             SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  8328.             SetVehiclePos(vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]);
  8329.             return 0;
  8330.         }
  8331.     #endif
  8332.     #undef AC_MAX_FLYHACK_VEH_WARNINGS
  8333.     #undef AC_MAX_CARSHOT_WARNINGS
  8334.     #if defined ac_OnUnoccupiedVehicleUpdate
  8335.         #if defined OnTrailerUpdate
  8336.             new ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z, vel_x, vel_y, vel_z);
  8337.         #elseif defined GetServerTickRate
  8338.             new ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z);
  8339.         #else
  8340.             new ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat);
  8341.         #endif
  8342.     #endif
  8343.     #if defined OnTrailerUpdate
  8344.         #if defined ac_OnUnoccupiedVehicleUpdate
  8345.             if(ac_a)
  8346.             {
  8347.         #endif
  8348.             ACVehInfo[vehicleid][acPosDiff] = ac_dist;
  8349.             ACVehInfo[vehicleid][acSpeedDiff] = ac_vsp - ACVehInfo[vehicleid][acSpeed];
  8350.             ACVehInfo[vehicleid][acSpeed] = ac_vsp;
  8351.             ACVehInfo[vehicleid][acPosX] = new_x;
  8352.             ACVehInfo[vehicleid][acPosY] = new_y;
  8353.             ACVehInfo[vehicleid][acPosZ] = new_z;
  8354.             ACVehInfo[vehicleid][acVelX] = vel_x;
  8355.             ACVehInfo[vehicleid][acVelY] = vel_y;
  8356.             ACVehInfo[vehicleid][acVelZ] = vel_z;
  8357.         #if defined ac_OnUnoccupiedVehicleUpdate
  8358.             }
  8359.         #endif
  8360.     #elseif defined GetServerTickRate
  8361.         #if defined ac_OnUnoccupiedVehicleUpdate
  8362.             if(ac_a)
  8363.             {
  8364.         #endif
  8365.             ACVehInfo[vehicleid][acPosDiff] = ac_dist;
  8366.             ACVehInfo[vehicleid][acPosX] = new_x;
  8367.             ACVehInfo[vehicleid][acPosY] = new_y;
  8368.             ACVehInfo[vehicleid][acPosZ] = new_z;
  8369.         #if defined ac_OnUnoccupiedVehicleUpdate
  8370.             }
  8371.         #endif
  8372.     #else
  8373.         GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  8374.         ACVehInfo[vehicleid][acPosDiff] = ac_dist;
  8375.         ACVehInfo[vehicleid][acPosX] = ac_x;
  8376.         ACVehInfo[vehicleid][acPosY] = ac_y;
  8377.         ACVehInfo[vehicleid][acPosZ] = ac_z;
  8378.     #endif
  8379.     #if defined ac_OnUnoccupiedVehicleUpdate
  8380.         return ac_a;
  8381.     #else
  8382.         return 1;
  8383.     #endif
  8384. }
  8385.  
  8386. #if defined _ALS_OnUnoccupiedVehicleUpdate
  8387.     #undef OnUnoccupiedVehicleUpdate
  8388. #else
  8389.     #define _ALS_OnUnoccupiedVehicleUpdate
  8390. #endif
  8391. #define OnUnoccupiedVehicleUpdate ac_OnUnoccupiedVehicleUpdate
  8392. #if defined ac_OnUnoccupiedVehicleUpdate
  8393.     #if defined OnTrailerUpdate
  8394.         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);
  8395.     #elseif defined GetServerTickRate
  8396.         forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z);
  8397.     #else
  8398.         forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat);
  8399.     #endif
  8400. #endif
  8401.  
  8402. #if defined OnTrailerUpdate
  8403.     public OnTrailerUpdate(playerid, vehicleid)
  8404.     {
  8405.         if(ACInfo[playerid][acKicked] > 0) return 0;
  8406.         #if defined PAWNRAKNET_INC_
  8407.             #if defined ac_OnTrailerUpdate
  8408.                 new ac_a = ac_OnTrailerUpdate(playerid, vehicleid);
  8409.                 if(ac_a)
  8410.                 {
  8411.             #endif
  8412.                 if(ACVehInfo[vehicleid][acTrSpeed] != -1)
  8413.                 {
  8414.                     ACVehInfo[vehicleid][acSpeedDiff] = ACVehInfo[vehicleid][acTrSpeedDiff];
  8415.                     ACVehInfo[vehicleid][acVelX] = ACVehInfo[vehicleid][acTrVelX];
  8416.                     ACVehInfo[vehicleid][acVelY] = ACVehInfo[vehicleid][acTrVelY];
  8417.                     ACVehInfo[vehicleid][acVelZ] = ACVehInfo[vehicleid][acTrVelZ];
  8418.                     ACVehInfo[vehicleid][acSpeed] = ACVehInfo[vehicleid][acTrSpeed];
  8419.                     ACVehInfo[vehicleid][acTrSpeed] = -1;
  8420.                 }
  8421.             #if defined ac_OnTrailerUpdate
  8422.                 }
  8423.                 return ac_a;
  8424.             #else
  8425.                 return 1;
  8426.             #endif
  8427.         #elseif defined ac_OnTrailerUpdate
  8428.             return ac_OnTrailerUpdate(playerid, vehicleid);
  8429.         #else
  8430.             return 1;
  8431.         #endif
  8432.     }
  8433.  
  8434.     #if defined _ALS_OnTrailerUpdate
  8435.         #undef OnTrailerUpdate
  8436.     #else
  8437.         #define _ALS_OnTrailerUpdate
  8438.     #endif
  8439.     #define OnTrailerUpdate ac_OnTrailerUpdate
  8440.     #if defined ac_OnTrailerUpdate
  8441.         forward ac_OnTrailerUpdate(playerid, vehicleid);
  8442.     #endif
  8443. #endif
  8444.  
  8445. #if defined OnPlayerGiveDamageDynamicActor
  8446.     #if defined STREAMER_ENABLE_TAGS
  8447.         public OnPlayerGiveDamageDynamicActor(playerid, STREAMER_TAG_ACTOR:actorid, Float:amount, weaponid, bodypart)
  8448.     #else
  8449.         public OnPlayerGiveDamageDynamicActor(playerid, actorid, Float:amount, weaponid, bodypart)
  8450.     #endif
  8451.     {
  8452.         if(ACInfo[playerid][acKicked] > 0) return 0;
  8453.         if(ACInfo[playerid][acACAllow][47] &&
  8454.         amount < 0.0 || !(3 <= bodypart <= 9) || !ac_IsValidDamageReason(weaponid))
  8455.         {
  8456.             #if defined DEBUG
  8457.                 printf("[Nex-AC debug] Dyn actorid: %d, amount: %f, weaponid: %d, bodypart: %d",
  8458.                 actorid, amount, weaponid, bodypart);
  8459.             #endif
  8460.             return ac_KickWithCode(playerid, "", 0, 47, 8);
  8461.         }
  8462.         #if defined ac_OnPlayerGiveDamageDynActor
  8463.             return ac_OnPlayerGiveDamageDynActor(playerid, actorid, amount, weaponid, bodypart);
  8464.         #else
  8465.             return 1;
  8466.         #endif
  8467.     }
  8468.  
  8469.     #if defined _ALS_OnPlayerGiveDamageDynamicA\
  8470.         || defined _ALS_OnPlayerGiveDamageDynActor
  8471.         #undef OnPlayerGiveDamageDynamicActor
  8472.     #else
  8473.         #define _ALS_OnPlayerGiveDamageDynamicA
  8474.         #define _ALS_OnPlayerGiveDamageDynActor
  8475.     #endif
  8476.     #define OnPlayerGiveDamageDynamicActor ac_OnPlayerGiveDamageDynActor
  8477.     #if defined ac_OnPlayerGiveDamageDynActor
  8478.         #if defined STREAMER_ENABLE_TAGS
  8479.             forward ac_OnPlayerGiveDamageDynActor(playerid, STREAMER_TAG_ACTOR:actorid, Float:amount, weaponid, bodypart);
  8480.         #else
  8481.             forward ac_OnPlayerGiveDamageDynActor(playerid, actorid, Float:amount, weaponid, bodypart);
  8482.         #endif
  8483.     #endif
  8484. #endif
  8485.  
  8486. #if defined OnPlayerGiveDamageActor
  8487.     public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart)
  8488.     {
  8489.         if(ACInfo[playerid][acKicked] > 0) return 1;
  8490.         if(ACInfo[playerid][acACAllow][47] &&
  8491.         amount < 0.0 || !(0 <= damaged_actorid < MAX_ACTORS) || !(3 <= bodypart <= 9) || !ac_IsValidDamageReason(weaponid))
  8492.         {
  8493.             #if defined DEBUG
  8494.                 printf("[Nex-AC debug] Actorid: %d, amount: %f, weaponid: %d, bodypart: %d",
  8495.                 damaged_actorid, amount, weaponid, bodypart);
  8496.             #endif
  8497.             ac_KickWithCode(playerid, "", 0, 47, 7);
  8498.             return 1;
  8499.         }
  8500.         #if defined ac_OnPlayerGiveDamageActor
  8501.             return ac_OnPlayerGiveDamageActor(playerid, damaged_actorid, amount, weaponid, bodypart);
  8502.         #else
  8503.             return 0;
  8504.         #endif
  8505.     }
  8506.  
  8507.     #if defined _ALS_OnPlayerGiveDamageActor
  8508.         #undef OnPlayerGiveDamageActor
  8509.     #else
  8510.         #define _ALS_OnPlayerGiveDamageActor
  8511.     #endif
  8512.     #define OnPlayerGiveDamageActor ac_OnPlayerGiveDamageActor
  8513.     #if defined ac_OnPlayerGiveDamageActor
  8514.         forward ac_OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart);
  8515.     #endif
  8516. #endif
  8517.  
  8518. #if defined OnPlayerEditAttachedObject
  8519.     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)
  8520.     {
  8521.         if(ACInfo[playerid][acKicked] > 0) return 1;
  8522.         if(ACInfo[playerid][acACAllow][46] && (384 <= modelid <= 393 || !(0 <= index <= 9) || !(1 <= boneid <= 18)))
  8523.         {
  8524.             #if defined DEBUG
  8525.                 printf("[Nex-AC debug] Object modelid: %d, index: %d, boneid %d", modelid, index, boneid);
  8526.             #endif
  8527.             ac_KickWithCode(playerid, "", 0, 46, 1);
  8528.             return 1;
  8529.         }
  8530.         #if defined ac_OnPlayerEditAttachedObject
  8531.             return ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  8532.         #else
  8533.             return 0;
  8534.         #endif
  8535.     }
  8536.  
  8537.     #if defined _ALS_OnPlayerEditAttachedObject
  8538.         #undef OnPlayerEditAttachedObject
  8539.     #else
  8540.         #define _ALS_OnPlayerEditAttachedObject
  8541.     #endif
  8542.     #define OnPlayerEditAttachedObject ac_OnPlayerEditAttachedObject
  8543.     #if defined ac_OnPlayerEditAttachedObject
  8544.         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);
  8545.     #endif
  8546. #endif
  8547.  
  8548. #if defined OnPlayerEnterDynamicArea
  8549.     #if defined STREAMER_ENABLE_TAGS
  8550.         public OnPlayerEnterDynamicArea(playerid, STREAMER_TAG_AREA:areaid)
  8551.     #else
  8552.         public OnPlayerEnterDynamicArea(playerid, areaid)
  8553.     #endif
  8554.     {
  8555.         if(ACInfo[playerid][acKicked] > 0) return 0;
  8556.         #if defined ac_OnPlayerEnterDynamicArea
  8557.             return ac_OnPlayerEnterDynamicArea(playerid, areaid);
  8558.         #else
  8559.             return 1;
  8560.         #endif
  8561.     }
  8562.  
  8563.     #if defined _ALS_OnPlayerEnterDynamicArea
  8564.         #undef OnPlayerEnterDynamicArea
  8565.     #else
  8566.         #define _ALS_OnPlayerEnterDynamicArea
  8567.     #endif
  8568.     #define OnPlayerEnterDynamicArea ac_OnPlayerEnterDynamicArea
  8569.     #if defined ac_OnPlayerEnterDynamicArea
  8570.         #if defined STREAMER_ENABLE_TAGS
  8571.             forward ac_OnPlayerEnterDynamicArea(playerid, STREAMER_TAG_AREA:areaid);
  8572.         #else
  8573.             forward ac_OnPlayerEnterDynamicArea(playerid, areaid);
  8574.         #endif
  8575.     #endif
  8576. #endif
  8577.  
  8578. #if defined OnPlayerLeaveDynamicArea
  8579.     #if defined STREAMER_ENABLE_TAGS
  8580.         public OnPlayerLeaveDynamicArea(playerid, STREAMER_TAG_AREA:areaid)
  8581.     #else
  8582.         public OnPlayerLeaveDynamicArea(playerid, areaid)
  8583.     #endif
  8584.     {
  8585.         if(ACInfo[playerid][acKicked] > 0) return 0;
  8586.         #if defined ac_OnPlayerLeaveDynamicArea
  8587.             return ac_OnPlayerLeaveDynamicArea(playerid, areaid);
  8588.         #else
  8589.             return 1;
  8590.         #endif
  8591.     }
  8592.  
  8593.     #if defined _ALS_OnPlayerLeaveDynamicArea
  8594.         #undef OnPlayerLeaveDynamicArea
  8595.     #else
  8596.         #define _ALS_OnPlayerLeaveDynamicArea
  8597.     #endif
  8598.     #define OnPlayerLeaveDynamicArea ac_OnPlayerLeaveDynamicArea
  8599.     #if defined ac_OnPlayerLeaveDynamicArea
  8600.         #if defined STREAMER_ENABLE_TAGS
  8601.             forward ac_OnPlayerLeaveDynamicArea(playerid, STREAMER_TAG_AREA:areaid);
  8602.         #else
  8603.             forward ac_OnPlayerLeaveDynamicArea(playerid, areaid);
  8604.         #endif
  8605.     #endif
  8606. #endif
  8607.  
  8608. #if defined PAWNRAKNET_INC_
  8609.     public OnIncomingPacket(playerid, packetid, BitStream:bs)
  8610.     {
  8611.         if(ACInfo[playerid][acKicked] > 0 && ACInfo[playerid][acOnline]) return 0;
  8612.         #if defined ac_OnIncomingPacket
  8613.             return ac_OnIncomingPacket(playerid, packetid, bs);
  8614.         #else
  8615.             return 1;
  8616.         #endif
  8617.     }
  8618.  
  8619.     #if defined _ALS_OnIncomingPacket
  8620.         #undef OnIncomingPacket
  8621.     #else
  8622.         #define _ALS_OnIncomingPacket
  8623.     #endif
  8624.     #define OnIncomingPacket ac_OnIncomingPacket
  8625.     #if defined ac_OnIncomingPacket
  8626.         forward ac_OnIncomingPacket(playerid, packetid, BitStream:bs);
  8627.     #endif
  8628.  
  8629.     public OnIncomingRPC(playerid, rpcid, BitStream:bs)
  8630.     {
  8631.         if(ACInfo[playerid][acKicked] > 0 && ACInfo[playerid][acOnline]) return 0;
  8632.         #if defined ac_OnIncomingRPC
  8633.             return ac_OnIncomingRPC(playerid, rpcid, bs);
  8634.         #else
  8635.             return 1;
  8636.         #endif
  8637.     }
  8638.  
  8639.     #if defined _ALS_OnIncomingRPC
  8640.         #undef OnIncomingRPC
  8641.     #else
  8642.         #define _ALS_OnIncomingRPC
  8643.     #endif
  8644.     #define OnIncomingRPC ac_OnIncomingRPC
  8645.     #if defined ac_OnIncomingRPC
  8646.         forward ac_OnIncomingRPC(playerid, rpcid, BitStream:bs);
  8647.     #endif
  8648.  
  8649.     #if defined OnPlayerWeaponShot
  8650.         const AC_DRIVER_SYNC = 200;
  8651.     #else
  8652.         const AC_DRIVER_SYNC = 118;
  8653.     #endif
  8654.  
  8655.     IPacket:AC_DRIVER_SYNC(playerid, BitStream:bs)
  8656.     {
  8657.         new ac_cData[PR_InCarSync];
  8658.         BS_IgnoreBits(bs, 8);
  8659.         BS_ReadInCarSync(bs, ac_cData);
  8660.         if(!ac_IsValidFloat(ac_cData[PR_quaternion][0]) || !ac_IsValidFloat(ac_cData[PR_quaternion][1]) ||
  8661.         !ac_IsValidFloat(ac_cData[PR_quaternion][2]) || !ac_IsValidFloat(ac_cData[PR_quaternion][3])) return 0;
  8662.         if(ACInfo[playerid][acACAllow][44] && !(1 <= ac_cData[PR_vehicleId] < MAX_VEHICLES))
  8663.         {
  8664.             #if defined DEBUG
  8665.                 printf("[Nex-AC debug] Veh: %d", ac_cData[PR_vehicleId]);
  8666.             #endif
  8667.             return ac_KickWithCode(playerid, "", 0, 44, 7);
  8668.         }
  8669.         new ac_gtc = GetTickCount(), ac_gpp = GetPlayerPing(playerid),
  8670.         Float:ac_zAngle = floatabs(atan2(2.0 * ((ac_cData[PR_quaternion][2] * ac_cData[PR_quaternion][3]) + (ac_cData[PR_quaternion][0] * ac_cData[PR_quaternion][1])),
  8671.         (ac_cData[PR_quaternion][0] * ac_cData[PR_quaternion][0]) - (ac_cData[PR_quaternion][1] * ac_cData[PR_quaternion][1]) -
  8672.         (ac_cData[PR_quaternion][2] * ac_cData[PR_quaternion][2]) + (ac_cData[PR_quaternion][3] * ac_cData[PR_quaternion][3])));
  8673.         if(ACInfo[playerid][acACAllow][25] && ac_zAngle - ACInfo[playerid][acQuaternion] > 90.0 &&
  8674.         ac_gtc - ACInfo[playerid][acGtc][20] > ac_gpp)
  8675.         {
  8676.             if(++ACInfo[playerid][acCheatCount][22] > AC_MAX_QUATERN_VEH_WARNINGS)
  8677.             {
  8678.                 #undef AC_MAX_QUATERN_VEH_WARNINGS
  8679.                 #if defined DEBUG
  8680.                     printf("[Nex-AC debug] Quaternion w, x, y, z: %f, %f, %f, %f, last angle: %f, angle diff: %f",
  8681.                     ac_cData[PR_quaternion][0], ac_cData[PR_quaternion][1], ac_cData[PR_quaternion][2], ac_cData[PR_quaternion][3], ACInfo[playerid][acQuaternion], ac_zAngle - ACInfo[playerid][acQuaternion]);
  8682.                 #endif
  8683.                 #if defined OnCheatDetected
  8684.                     ac_KickWithCode(playerid, "", 0, 25, 2);
  8685.                     if(ACInfo[playerid][acKicked] > 0) return 0;
  8686.                     ACInfo[playerid][acCheatCount][22] = 0;
  8687.                 #else
  8688.                     return ac_KickWithCode(playerid, "", 0, 25, 2);
  8689.                 #endif
  8690.             }
  8691.             #if defined OnCheatWarning
  8692.                 else OnCheatWarning(playerid, "", 0, 25, 2, ACInfo[playerid][acCheatCount][22]);
  8693.             #endif
  8694.         }
  8695.         else ACInfo[playerid][acCheatCount][22] = 0;
  8696.         if(ACInfo[playerid][acACAllow][3] && ac_cData[PR_trailerId] != 0 && GetVehicleModel(ac_cData[PR_trailerId]) <= 0 &&
  8697.         (!(1 <= ac_cData[PR_trailerId] < MAX_VEHICLES) || ac_gtc - ACVehInfo[ac_cData[PR_trailerId]][acDestroyTick] > ac_gpp))
  8698.         {
  8699.             #if defined DEBUG
  8700.                 printf("[Nex-AC debug] Veh: %d, trailerid: %d", ac_cData[PR_vehicleId], ac_cData[PR_trailerId]);
  8701.             #endif
  8702.             #if defined OnCheatDetected
  8703.                 ac_KickWithCode(playerid, "", 0, 3, 5);
  8704.                 if(ACInfo[playerid][acKicked] > 0) return 0;
  8705.             #else
  8706.                 return ac_KickWithCode(playerid, "", 0, 3, 5);
  8707.             #endif
  8708.         }
  8709.         if(!ac_IsValidFloat(ac_cData[PR_trainSpeed]))
  8710.         {
  8711.             ac_cData[PR_trainSpeed] = 0.0;
  8712.             BS_SetWriteOffset(bs, 8);
  8713.             BS_WriteInCarSync(bs, ac_cData);
  8714.         }
  8715.         ACInfo[playerid][acQuaternion] = ac_zAngle;
  8716.         return 1;
  8717.     }
  8718.  
  8719.     #if defined OnPlayerWeaponShot
  8720.         const AC_AIM_SYNC = 203;
  8721.     #else
  8722.         const AC_AIM_SYNC = 117;
  8723.     #endif
  8724.  
  8725.     IPacket:AC_AIM_SYNC(playerid, BitStream:bs)
  8726.     {
  8727.         new ac_aData[PR_AimSync];
  8728.         BS_IgnoreBits(bs, 8);
  8729.         BS_ReadAimSync(bs, ac_aData);
  8730.         if(ACInfo[playerid][acLastWeapon] == WEAPON_BOMB && ac_aData[PR_camMode] != 4) return 0;
  8731.         if(ACInfo[playerid][acACAllow][47])
  8732.         {
  8733.             if(!(0 <= ac_aData[PR_camMode] <= 65))
  8734.             {
  8735.                 #if defined DEBUG
  8736.                     printf("[Nex-AC debug] Cammode: %d", ac_aData[PR_camMode]);
  8737.                 #endif
  8738.                 #if defined OnCheatDetected
  8739.                     ac_KickWithCode(playerid, "", 0, 47, 9);
  8740.                     if(ACInfo[playerid][acKicked] > 0) return 0;
  8741.                 #else
  8742.                     return ac_KickWithCode(playerid, "", 0, 47, 9);
  8743.                 #endif
  8744.             }
  8745.             else
  8746.             {
  8747.                 switch(ac_aData[PR_camMode])
  8748.                 {
  8749.                     case 0..2, 5, 6, 9..13, 17, 19..21, 23..28, 30..45, 48..50, 52, 54, 60, 61, 65:
  8750.                     {
  8751.                         #if defined DEBUG
  8752.                             printf("[Nex-AC debug] Cammode: %d", ac_aData[PR_camMode]);
  8753.                         #endif
  8754.                         #if defined OnCheatDetected
  8755.                             ac_KickWithCode(playerid, "", 0, 47, 9);
  8756.                             if(ACInfo[playerid][acKicked] > 0) return 0;
  8757.                         #else
  8758.                             return ac_KickWithCode(playerid, "", 0, 47, 9);
  8759.                         #endif
  8760.                     }
  8761.                 }
  8762.             }
  8763.         }
  8764.         if(!ac_IsValidFloat(ac_aData[PR_aimZ]))
  8765.         {
  8766.             ac_aData[PR_aimZ] = 0.0;
  8767.             BS_SetWriteOffset(bs, 8);
  8768.             BS_WriteAimSync(bs, ac_aData);
  8769.         }
  8770.         ACInfo[playerid][acCamMode] = ac_aData[PR_camMode];
  8771.         return 1;
  8772.     }
  8773.  
  8774.     #if defined OnPlayerWeaponShot
  8775.         const AC_BULLET_SYNC = 206;
  8776.  
  8777.         IPacket:AC_BULLET_SYNC(playerid, BitStream:bs)
  8778.         {
  8779.             new ac_bData[PR_BulletSync];
  8780.             BS_IgnoreBits(bs, 8);
  8781.             BS_ReadBulletSync(bs, ac_bData);
  8782.             switch(ac_bData[PR_hitType])
  8783.             {
  8784.                 case BULLET_HIT_TYPE_PLAYER:
  8785.                 {
  8786.                     if(ac_bData[PR_hitId] == playerid ||
  8787.                     floatabs(ac_bData[PR_offsets][0]) > 10.0 ||
  8788.                     floatabs(ac_bData[PR_offsets][1]) > 10.0 ||
  8789.                     floatabs(ac_bData[PR_offsets][2]) > 10.0) return 0;
  8790.                 }
  8791.                 case BULLET_HIT_TYPE_VEHICLE:
  8792.                 {
  8793.                     if(floatabs(ac_bData[PR_offsets][0]) > 300.0 ||
  8794.                     floatabs(ac_bData[PR_offsets][1]) > 300.0 ||
  8795.                     floatabs(ac_bData[PR_offsets][2]) > 300.0) return 0;
  8796.                 }
  8797.                 case BULLET_HIT_TYPE_OBJECT, BULLET_HIT_TYPE_PLAYER_OBJECT:
  8798.                 {
  8799.                     if(floatabs(ac_bData[PR_offsets][0]) > 1000.0 ||
  8800.                     floatabs(ac_bData[PR_offsets][1]) > 1000.0 ||
  8801.                     floatabs(ac_bData[PR_offsets][2]) > 1000.0) return 0;
  8802.                 }
  8803.                 default:
  8804.                 {
  8805.                     if(floatabs(ac_bData[PR_offsets][0]) > 20000.0 ||
  8806.                     floatabs(ac_bData[PR_offsets][1]) > 20000.0 ||
  8807.                     floatabs(ac_bData[PR_offsets][2]) > 20000.0) return 0;
  8808.                 }
  8809.             }
  8810.             return 1;
  8811.         }
  8812.     #endif
  8813.  
  8814.     #if defined OnPlayerWeaponShot
  8815.         const AC_ONFOOT_SYNC = 207;
  8816.     #else
  8817.         const AC_ONFOOT_SYNC = 116;
  8818.     #endif
  8819.  
  8820.     IPacket:AC_ONFOOT_SYNC(playerid, BitStream:bs)
  8821.     {
  8822.         new ac_fData[PR_OnFootSync];
  8823.         BS_IgnoreBits(bs, 8);
  8824.         BS_ReadOnFootSync(bs, ac_fData);
  8825.         if(!ac_IsValidFloat(ac_fData[PR_quaternion][0]) || !ac_IsValidFloat(ac_fData[PR_quaternion][1]) ||
  8826.         !ac_IsValidFloat(ac_fData[PR_quaternion][2]) || !ac_IsValidFloat(ac_fData[PR_quaternion][3])) return 0;
  8827.         new Float:ac_zAngle;
  8828.         if(ACInfo[playerid][acACAllow][25] && ac_fData[PR_specialAction] == SPECIAL_ACTION_NONE &&
  8829.         (ac_zAngle = floatabs(atan2(2.0 * ((ac_fData[PR_quaternion][2] * ac_fData[PR_quaternion][3]) + (ac_fData[PR_quaternion][0] * ac_fData[PR_quaternion][1])),
  8830.         (ac_fData[PR_quaternion][0] * ac_fData[PR_quaternion][0]) - (ac_fData[PR_quaternion][1] * ac_fData[PR_quaternion][1]) -
  8831.         (ac_fData[PR_quaternion][2] * ac_fData[PR_quaternion][2]) + (ac_fData[PR_quaternion][3] * ac_fData[PR_quaternion][3])))) > 85.0)
  8832.         {
  8833.             if(++ACInfo[playerid][acCheatCount][22] > AC_MAX_QUATERN_WARNINGS)
  8834.             {
  8835.                 #undef AC_MAX_QUATERN_WARNINGS
  8836.                 #if defined DEBUG
  8837.                     printf("[Nex-AC debug] Quaternion w, x, y, z: %f, %f, %f, %f, angle: %f",
  8838.                     ac_fData[PR_quaternion][0], ac_fData[PR_quaternion][1], ac_fData[PR_quaternion][2], ac_fData[PR_quaternion][3], ac_zAngle);
  8839.                 #endif
  8840.                 #if defined OnCheatDetected
  8841.                     ac_KickWithCode(playerid, "", 0, 25, 3);
  8842.                     if(ACInfo[playerid][acKicked] > 0) return 0;
  8843.                     ACInfo[playerid][acCheatCount][22] = 0;
  8844.                 #else
  8845.                     return ac_KickWithCode(playerid, "", 0, 25, 3);
  8846.                 #endif
  8847.             }
  8848.             #if defined OnCheatWarning
  8849.                 else OnCheatWarning(playerid, "", 0, 25, 3, ACInfo[playerid][acCheatCount][22]);
  8850.             #endif
  8851.         }
  8852.         else ACInfo[playerid][acCheatCount][22] = 0;
  8853.         new ac_gtc = GetTickCount(), ac_gpp = GetPlayerPing(playerid);
  8854.         #if !defined IsPlayerDying
  8855.         if(ACInfo[playerid][acACAllow][7] && ACInfo[playerid][acSet][7] == -1 &&
  8856.         ac_gtc - ACInfo[playerid][acGtc][9] > ac_gpp)
  8857.         #else
  8858.         if(ACInfo[playerid][acACAllow][7] &&
  8859.         !IsPlayerDying(playerid) && ACInfo[playerid][acSet][7] == -1 &&
  8860.         ac_gtc - ACInfo[playerid][acGtc][9] > ac_gpp)
  8861.         #endif
  8862.         {
  8863.             new Float:ac_zDiff = ac_fData[PR_position][2] - ACInfo[playerid][acPosZ];
  8864.             #if defined VectorSize
  8865.                 ac_zAngle = VectorSize(ac_fData[PR_position][0] - ACInfo[playerid][acPosX], ac_fData[PR_position][1] - ACInfo[playerid][acPosY], 0.0);
  8866.             #else
  8867.                 ac_zAngle = floatsqroot(floatpower(ac_fData[PR_position][0] - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_fData[PR_position][1] - ACInfo[playerid][acPosY], 2.0));
  8868.             #endif
  8869.             if((floatabs(ac_fData[PR_quaternion][1]) > 0.01 || floatabs(ac_fData[PR_quaternion][2]) > 0.01) &&
  8870.             ac_fData[PR_weaponId] != WEAPON_PARACHUTE && ac_fData[PR_specialAction] == SPECIAL_ACTION_NONE &&
  8871.             ACInfo[playerid][acEnterVeh] == 0)
  8872.             {
  8873.                 if(ac_fData[PR_animationId] != 1130 && ac_fData[PR_animationId] != 1132)
  8874.                 {
  8875.                     #if defined DEBUG
  8876.                         printf("[Nex-AC debug] Quaternion x, y: %f, %f, weaponid: %d, spec act: %d, anim: %d",
  8877.                         ac_fData[PR_quaternion][1], ac_fData[PR_quaternion][2], ac_fData[PR_weaponId], ac_fData[PR_specialAction], ac_fData[PR_animationId]);
  8878.                     #endif
  8879.                     #if defined OnCheatDetected
  8880.                         ac_KickWithCode(playerid, "", 0, 7, 4);
  8881.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8882.                     #else
  8883.                         return ac_KickWithCode(playerid, "", 0, 7, 4);
  8884.                     #endif
  8885.                 }
  8886.                 else if(ac_zDiff >= 1.0)
  8887.                 {
  8888.                     #if defined DEBUG
  8889.                         printf("[Nex-AC debug] Quaternion x, y: %f, %f, weaponid: %d, spec act: %d, anim: %d, pos z: %f, last pos z: %f, dist: %f",
  8890.                         ac_fData[PR_quaternion][1], ac_fData[PR_quaternion][2], ac_fData[PR_weaponId], ac_fData[PR_specialAction],
  8891.                         ac_fData[PR_animationId], ac_fData[PR_position][2], ACInfo[playerid][acPosZ], ac_zAngle);
  8892.                     #endif
  8893.                     #if defined OnCheatDetected
  8894.                         ac_KickWithCode(playerid, "", 0, 7, 4);
  8895.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8896.                     #else
  8897.                         return ac_KickWithCode(playerid, "", 0, 7, 4);
  8898.                     #endif
  8899.                 }
  8900.             }
  8901.             if(ac_zAngle >= 1.0 && ac_fData[PR_surfingVehicleId] == 0 &&
  8902.             (ac_fData[PR_velocity][2] > 0.0 && ac_zDiff <= -2.0 ||
  8903.             ac_fData[PR_velocity][2] < 0.0 && ac_zDiff >= 2.0 && ac_fData[PR_position][2] >= -90.0 ||
  8904.             (ac_fData[PR_animationId] == 1130 || ac_fData[PR_animationId] == 1132) && ac_zDiff >= 2.0 ||
  8905.             ac_zDiff == 0.0 && ac_fData[PR_velocity][2] != 0.0 && ac_fData[PR_velocity][2] >= ACInfo[playerid][acVelZ]))
  8906.             {
  8907.                 ACInfo[playerid][acCheatCount][26] += (1 * AC_FLYHACK_RESET_DELAY);
  8908.                 if(ACInfo[playerid][acCheatCount][26] > AC_MAX_FLYHACK_WARNINGS)
  8909.                 {
  8910.                     #undef AC_MAX_FLYHACK_WARNINGS
  8911.                     #if defined DEBUG
  8912.                         printf("[Nex-AC debug] Dist: %f, pos diff z: %f, vel z: %f, old vel z: %f, anim: %d, pos z: %f, old pos z: %f",
  8913.                         ac_zAngle, ac_zDiff, ac_fData[PR_velocity][2], ACInfo[playerid][acVelZ], ac_fData[PR_animationId], ac_fData[PR_position][2], ACInfo[playerid][acPosZ]);
  8914.                     #endif
  8915.                     #if defined OnCheatDetected
  8916.                         ac_KickWithCode(playerid, "", 0, 7, 5);
  8917.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8918.                         ACInfo[playerid][acCheatCount][26] = 0;
  8919.                     #else
  8920.                         return ac_KickWithCode(playerid, "", 0, 7, 5);
  8921.                     #endif
  8922.                 }
  8923.                 #if defined OnCheatWarning
  8924.                     else OnCheatWarning(playerid, "", 0, 7, 5, floatround(ACInfo[playerid][acCheatCount][26] / AC_FLYHACK_RESET_DELAY));
  8925.                 #endif
  8926.                 #undef AC_FLYHACK_RESET_DELAY
  8927.             }
  8928.         }
  8929.         if(ACInfo[playerid][acACAllow][2] && ac_fData[PR_surfingVehicleId] != 0)
  8930.         {
  8931.             new ac_t = ac_fData[PR_surfingVehicleId];
  8932.             if(0 < ac_t < MAX_VEHICLES)
  8933.             {
  8934.                 new ac_model = GetVehicleModel(ac_t);
  8935.                 if(ac_model == 0 && ac_gtc - ACVehInfo[ac_t][acDestroyTick] > ac_gpp)
  8936.                 {
  8937.                     #if defined DEBUG
  8938.                         printf("[Nex-AC debug] Veh model: %d, veh: %d", ac_model, ac_t);
  8939.                     #endif
  8940.                     #if defined OnCheatDetected
  8941.                         ac_KickWithCode(playerid, "", 0, 2, 8);
  8942.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  8943.                     #else
  8944.                         return ac_KickWithCode(playerid, "", 0, 2, 8);
  8945.                     #endif
  8946.                 }
  8947.                 else
  8948.                 {
  8949.                     new Float:ac_x, Float:ac_y, Float:ac_z;
  8950.                     GetVehicleModelInfo(ac_model, VEHICLE_MODEL_INFO_SIZE, ac_x, ac_y, ac_z);
  8951.                     if(floatabs(ac_fData[PR_surfingOffsets][0]) >= ac_x + 50.0 || floatabs(ac_fData[PR_surfingOffsets][1]) >= ac_y + 50.0 ||
  8952.                     floatabs(ac_fData[PR_surfingOffsets][2]) >= ac_z + 50.0)
  8953.                     {
  8954.                         if(++ACInfo[playerid][acCheatCount][23] > AC_MAX_SURF_WARNINGS)
  8955.                         {
  8956.                             #if defined DEBUG
  8957.                                 printf("[Nex-AC debug] Surfing offsets x, y, z: %f, %f, %f, veh size x, y, z: %f, %f, %f",
  8958.                                 ac_fData[PR_surfingOffsets][0], ac_fData[PR_surfingOffsets][1], ac_fData[PR_surfingOffsets][2], ac_x, ac_y, ac_z);
  8959.                             #endif
  8960.                             #if defined OnCheatDetected
  8961.                                 ac_KickWithCode(playerid, "", 0, 2, 9);
  8962.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  8963.                                 ACInfo[playerid][acCheatCount][23] = 0;
  8964.                             #else
  8965.                                 return ac_KickWithCode(playerid, "", 0, 2, 9);
  8966.                             #endif
  8967.                         }
  8968.                         #if defined OnCheatWarning
  8969.                             else OnCheatWarning(playerid, "", 0, 2, 9, ACInfo[playerid][acCheatCount][23]);
  8970.                         #endif
  8971.                     }
  8972.                     else
  8973.                     {
  8974.                         ACInfo[playerid][acCheatCount][23] = 0;
  8975.                         #if defined VectorSize
  8976.                             ac_zAngle = VectorSize(ac_fData[PR_position][0] - ACVehInfo[ac_t][acPosX], ac_fData[PR_position][1] - ACVehInfo[ac_t][acPosY],
  8977.                             ac_fData[PR_position][2] - ACVehInfo[ac_t][acPosZ]);
  8978.                         #else
  8979.                             ac_zAngle = floatsqroot(floatpower(ac_fData[PR_position][0] - ACVehInfo[ac_t][acPosX], 2.0) + floatpower(ac_fData[PR_position][1] - ACVehInfo[ac_t][acPosY], 2.0) +
  8980.                             floatpower(ac_fData[PR_position][2] - ACVehInfo[ac_t][acPosZ], 2.0));
  8981.                         #endif
  8982.                         new Float:ac_maxdist = 50.0 + floatround(ACVehInfo[ac_t][acSpeed] / 5);
  8983.                         if(ac_IsATrainPartEx(ac_model)) ac_maxdist += 80.0;
  8984.                         if((ac_zAngle >= AC_STREAM_DISTANCE || ac_zAngle >= ac_maxdist && ACVehInfo[ac_t][acDriver] == INVALID_PLAYER_ID)
  8985.                         && ac_gtc - ACVehInfo[ac_t][acExitTick] > ac_gpp && ACVehInfo[ac_t][acPosZ] > -90.0)
  8986.                         {
  8987.                             if(++ACInfo[playerid][acCheatCount][24] > AC_MAX_STREAM_SURF_WARNINGS)
  8988.                             {
  8989.                                 #undef AC_MAX_STREAM_SURF_WARNINGS
  8990.                                 #if defined DEBUG
  8991.                                     printf("[Nex-AC debug] Veh x, y, z: %f, %f, %f, player x, y, z: %f, %f, %f, dist: %f, max dist: %f",
  8992.                                     ACVehInfo[ac_t][acPosX], ACVehInfo[ac_t][acPosY], ACVehInfo[ac_t][acPosZ], ac_fData[PR_position][0],
  8993.                                     ac_fData[PR_position][1], ac_fData[PR_position][2], ac_zAngle, ac_maxdist);
  8994.                                 #endif
  8995.                                 #if defined OnCheatDetected
  8996.                                     ac_KickWithCode(playerid, "", 0, 2, 10);
  8997.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  8998.                                     ACInfo[playerid][acCheatCount][24] = 0;
  8999.                                 #else
  9000.                                     return ac_KickWithCode(playerid, "", 0, 2, 10);
  9001.                                 #endif
  9002.                             }
  9003.                             #if defined OnCheatWarning
  9004.                                 else OnCheatWarning(playerid, "", 0, 2, 10, ACInfo[playerid][acCheatCount][24]);
  9005.                             #endif
  9006.                         }
  9007.                         else ACInfo[playerid][acCheatCount][24] = 0;
  9008.                     }
  9009.                 }
  9010.             }
  9011.             else if(MAX_VEHICLES < ac_t < MAX_OBJECTS + MAX_VEHICLES)
  9012.             {
  9013.                 ac_t -= 2000;
  9014.                 new ac_tmp = IsValidObject(ac_t);
  9015.                 if(!ac_tmp && !IsValidPlayerObject(playerid, ac_t) && ac_gtc - ac_ObjDelTick[ac_t] > ac_gpp)
  9016.                 {
  9017.                     #if defined DEBUG
  9018.                         printf("[Nex-AC debug] Object: %d", ac_t);
  9019.                     #endif
  9020.                     #if defined OnCheatDetected
  9021.                         ac_KickWithCode(playerid, "", 0, 2, 11);
  9022.                         if(ACInfo[playerid][acKicked] > 0) return 0;
  9023.                     #else
  9024.                         return ac_KickWithCode(playerid, "", 0, 2, 11);
  9025.                     #endif
  9026.                 }
  9027.                 else
  9028.                 {
  9029.                     if(floatabs(ac_fData[PR_surfingOffsets][0]) >= 150.0 || floatabs(ac_fData[PR_surfingOffsets][1]) >= 150.0 ||
  9030.                     floatabs(ac_fData[PR_surfingOffsets][2]) >= 150.0)
  9031.                     {
  9032.                         if(++ACInfo[playerid][acCheatCount][23] > AC_MAX_SURF_WARNINGS)
  9033.                         {
  9034.                             #undef AC_MAX_SURF_WARNINGS
  9035.                             #if defined DEBUG
  9036.                                 printf("[Nex-AC debug] Surfing offsets x, y, z: %f, %f, %f",
  9037.                                 ac_fData[PR_surfingOffsets][0], ac_fData[PR_surfingOffsets][1], ac_fData[PR_surfingOffsets][2]);
  9038.                             #endif
  9039.                             #if defined OnCheatDetected
  9040.                                 ac_KickWithCode(playerid, "", 0, 2, 12);
  9041.                                 if(ACInfo[playerid][acKicked] > 0) return 0;
  9042.                                 ACInfo[playerid][acCheatCount][23] = 0;
  9043.                             #else
  9044.                                 return ac_KickWithCode(playerid, "", 0, 2, 12);
  9045.                             #endif
  9046.                         }
  9047.                         #if defined OnCheatWarning
  9048.                             else OnCheatWarning(playerid, "", 0, 2, 12, ACInfo[playerid][acCheatCount][23]);
  9049.                         #endif
  9050.                     }
  9051.                     else
  9052.                     {
  9053.                         ACInfo[playerid][acCheatCount][23] = 0;
  9054.                         new Float:ac_x, Float:ac_y, Float:ac_z;
  9055.                         if(ac_tmp) GetObjectPos(ac_t, ac_x, ac_y, ac_z);
  9056.                         #if defined Streamer_GetItemStreamerID\
  9057.                             && defined IsValidDynamicObject\
  9058.                             && defined Streamer_GetIntData\
  9059.                             && defined GetDynamicObjectPos
  9060.                             else
  9061.                             {
  9062.                                 ac_tmp = Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_OBJECT, ac_t);
  9063.                                 if(!IsValidDynamicObject(ac_tmp)) GetPlayerObjectPos(playerid, ac_t, ac_x, ac_y, ac_z);
  9064.                                 else
  9065.                                 {
  9066.                                     new ac_apid, ac_avid;
  9067.                                     attached_surf_case:
  9068.                                     ac_avid = Streamer_GetIntData(STREAMER_TYPE_OBJECT, ac_tmp, E_STREAMER_ATTACHED_VEHICLE);
  9069.                                     if(ac_avid != INVALID_VEHICLE_ID) GetVehiclePos(ac_avid, ac_x, ac_y, ac_z);
  9070.                                     else
  9071.                                     {
  9072.                                         ac_t = Streamer_GetIntData(STREAMER_TYPE_OBJECT, ac_tmp, E_STREAMER_ATTACHED_OBJECT);
  9073.                                         if(ac_t != INVALID_STREAMER_ID)
  9074.                                         {
  9075.                                             ac_tmp = ac_t;
  9076.                                             goto attached_surf_case;
  9077.                                         }
  9078.                                         else
  9079.                                         {
  9080.                                             ac_apid = Streamer_GetIntData(STREAMER_TYPE_OBJECT, ac_tmp, E_STREAMER_ATTACHED_PLAYER);
  9081.                                             if(ac_apid != INVALID_PLAYER_ID) GetPlayerPos(ac_apid, ac_x, ac_y, ac_z);
  9082.                                             else GetDynamicObjectPos(ac_tmp, ac_x, ac_y, ac_z);
  9083.                                         }
  9084.                                     }
  9085.                                 }
  9086.                             }
  9087.                         #else
  9088.                             else GetPlayerObjectPos(playerid, ac_t, ac_x, ac_y, ac_z);
  9089.                         #endif
  9090.                         #if defined VectorSize
  9091.                             ac_zAngle = VectorSize(ac_fData[PR_position][0] - ac_x, ac_fData[PR_position][1] - ac_y,
  9092.                             ac_fData[PR_position][2] - ac_z);
  9093.                         #else
  9094.                             ac_zAngle = floatsqroot(floatpower(ac_fData[PR_position][0] - ac_x, 2.0) + floatpower(ac_fData[PR_position][1] - ac_y, 2.0) +
  9095.                             floatpower(ac_fData[PR_position][2] - ac_z, 2.0));
  9096.                         #endif
  9097.                         if(ac_zAngle >= 150.0)
  9098.                         {
  9099.                             if(++ACInfo[playerid][acCheatCount][24] > AC_MAX_DIST_SURF_WARNINGS)
  9100.                             {
  9101.                                 #undef AC_MAX_DIST_SURF_WARNINGS
  9102.                                 #if defined DEBUG
  9103.                                     printf("[Nex-AC debug] Object x, y, z: %f, %f, %f, player x, y, z: %f, %f, %f, dist: %f",
  9104.                                     ac_x, ac_y, ac_z, ac_fData[PR_position][0], ac_fData[PR_position][1], ac_fData[PR_position][2], ac_zAngle);
  9105.                                 #endif
  9106.                                 #if defined OnCheatDetected
  9107.                                     ac_KickWithCode(playerid, "", 0, 2, 13);
  9108.                                     if(ACInfo[playerid][acKicked] > 0) return 0;
  9109.                                     ACInfo[playerid][acCheatCount][24] = 0;
  9110.                                 #else
  9111.                                     return ac_KickWithCode(playerid, "", 0, 2, 13);
  9112.                                 #endif
  9113.                             }
  9114.                             #if defined OnCheatWarning
  9115.                                 else OnCheatWarning(playerid, "", 0, 2, 13, ACInfo[playerid][acCheatCount][24]);
  9116.                             #endif
  9117.                         }
  9118.                         else ACInfo[playerid][acCheatCount][24] = 0;
  9119.                     }
  9120.                 }
  9121.             }
  9122.             else
  9123.             {
  9124.                 #if defined DEBUG
  9125.                     printf("[Nex-AC debug] Surfing: %d", ac_t);
  9126.                 #endif
  9127.                 #if defined OnCheatDetected
  9128.                     ac_KickWithCode(playerid, "", 0, 2, 14);
  9129.                     if(ACInfo[playerid][acKicked] > 0) return 0;
  9130.                 #else
  9131.                     return ac_KickWithCode(playerid, "", 0, 2, 14);
  9132.                 #endif
  9133.             }
  9134.         }
  9135.         if(ACInfo[playerid][acACAllow][24] && ac_fData[PR_animationFlags] == 0)
  9136.         {
  9137.             #if defined DEBUG
  9138.                 printf("[Nex-AC debug] Anim flags: %d", ac_fData[PR_animationFlags]);
  9139.             #endif
  9140.             #if defined OnCheatDetected
  9141.                 ac_KickWithCode(playerid, "", 0, 24, 2);
  9142.                 if(ACInfo[playerid][acKicked] > 0) return 0;
  9143.             #else
  9144.                 return ac_KickWithCode(playerid, "", 0, 24, 2);
  9145.             #endif
  9146.         }
  9147.         if(!ac_IsValidFloat(ac_fData[PR_surfingOffsets][0]) ||
  9148.         !ac_IsValidFloat(ac_fData[PR_surfingOffsets][1]) ||
  9149.         !ac_IsValidFloat(ac_fData[PR_surfingOffsets][2]))
  9150.         {
  9151.             ac_fData[PR_surfingOffsets][0] =
  9152.             ac_fData[PR_surfingOffsets][1] =
  9153.             ac_fData[PR_surfingOffsets][2] = 0.0;
  9154.             ac_fData[PR_surfingVehicleId] = 0;
  9155.             BS_SetWriteOffset(bs, 8);
  9156.             BS_WriteOnFootSync(bs, ac_fData);
  9157.         }
  9158.         else if(ac_fData[PR_surfingVehicleId] != 0 &&
  9159.         ac_fData[PR_surfingOffsets][0] == 0.0 && ac_fData[PR_surfingOffsets][1] == 0.0 &&
  9160.         ac_fData[PR_surfingOffsets][2] == 0.0)
  9161.         {
  9162.             ac_fData[PR_surfingVehicleId] = 0;
  9163.             BS_SetWriteOffset(bs, 8);
  9164.             BS_WriteOnFootSync(bs, ac_fData);
  9165.         }
  9166.         if(ac_fData[PR_weaponId] == WEAPON_BOMB && ACInfo[playerid][acCamMode] != 4)
  9167.         {
  9168.             ac_fData[PR_weaponId] = 0;
  9169.             BS_SetWriteOffset(bs, 8);
  9170.             BS_WriteOnFootSync(bs, ac_fData);
  9171.         }
  9172.         return 1;
  9173.     }
  9174.  
  9175.     #if defined OnPlayerWeaponShot
  9176.         const AC_UNOCCUPIED_SYNC = 209;
  9177.     #else
  9178.         const AC_UNOCCUPIED_SYNC = 110;
  9179.     #endif
  9180.  
  9181.     IPacket:AC_UNOCCUPIED_SYNC(playerid, BitStream:bs)
  9182.     {
  9183.         new ac_uData[PR_UnoccupiedSync];
  9184.         BS_IgnoreBits(bs, 8);
  9185.         BS_ReadUnoccupiedSync(bs, ac_uData);
  9186.         if(ac_uData[PR_seatId] > 0 && (ACInfo[playerid][acSeat] < 1 ||
  9187.         ac_uData[PR_vehicleId] == ACInfo[playerid][acVeh] && ac_uData[PR_seatId] != ACInfo[playerid][acSeat]) ||
  9188.         ac_uData[PR_angularVelocity][0] != ac_uData[PR_angularVelocity][0] ||
  9189.         ac_uData[PR_angularVelocity][1] != ac_uData[PR_angularVelocity][1] ||
  9190.         ac_uData[PR_angularVelocity][2] != ac_uData[PR_angularVelocity][2] ||
  9191.         !ac_IsValidFloat(ac_uData[PR_vehicleHealth]) ||
  9192.         floatabs(ac_uData[PR_angularVelocity][0]) >= 1.0 ||
  9193.         floatabs(ac_uData[PR_angularVelocity][1]) >= 1.0 ||
  9194.         floatabs(ac_uData[PR_angularVelocity][2]) >= 1.0) return 0;
  9195.         #if defined VectorSize
  9196.             if((ac_uData[PR_roll][0] * ac_uData[PR_direction][0]) +
  9197.             (ac_uData[PR_roll][1] * ac_uData[PR_direction][1]) +
  9198.             (ac_uData[PR_roll][2] * ac_uData[PR_direction][2]) >= 0.000001 ||
  9199.             floatabs(1.0 - VectorSize(ac_uData[PR_direction][0], ac_uData[PR_direction][1], ac_uData[PR_direction][2])) >= 0.000001 ||
  9200.             floatabs(1.0 - VectorSize(ac_uData[PR_roll][0], ac_uData[PR_roll][1], ac_uData[PR_roll][2])) >= 0.000001) return 0;
  9201.         #else
  9202.             if((ac_uData[PR_roll][0] * ac_uData[PR_direction][0]) +
  9203.             (ac_uData[PR_roll][1] * ac_uData[PR_direction][1]) +
  9204.             (ac_uData[PR_roll][2] * ac_uData[PR_direction][2]) >= 0.000001 ||
  9205.             floatabs(1.0 - floatsqroot(floatpower(ac_uData[PR_direction][0], 2.0) +
  9206.             floatpower(ac_uData[PR_direction][1], 2.0) + floatpower(ac_uData[PR_direction][2], 2.0))) >= 0.000001 ||
  9207.             floatabs(1.0 - floatsqroot(floatpower(ac_uData[PR_roll][0], 2.0) +
  9208.             floatpower(ac_uData[PR_roll][1], 2.0) + floatpower(ac_uData[PR_roll][2], 2.0))) >= 0.000001) return 0;
  9209.         #endif
  9210.         return 1;
  9211.     }
  9212.  
  9213.     #if defined OnPlayerWeaponShot
  9214.         const AC_TRAILER_SYNC = 210;
  9215.     #else
  9216.         const AC_TRAILER_SYNC = 114;
  9217.     #endif
  9218.  
  9219.     IPacket:AC_TRAILER_SYNC(playerid, BitStream:bs)
  9220.     {
  9221.         new ac_tData[PR_TrailerSync], trailerid;
  9222.         BS_IgnoreBits(bs, 8);
  9223.         BS_ReadTrailerSync(bs, ac_tData);
  9224.         trailerid = ac_tData[PR_trailerId];
  9225.         if(!(1 <= trailerid < MAX_VEHICLES) || ACVehInfo[trailerid][acDriver] != INVALID_PLAYER_ID ||
  9226.         !ac_IsValidFloat(ac_tData[PR_quaternion][0]) || !ac_IsValidFloat(ac_tData[PR_quaternion][1]) ||
  9227.         !ac_IsValidFloat(ac_tData[PR_quaternion][2]) || !ac_IsValidFloat(ac_tData[PR_quaternion][3])) return 0;
  9228.         if(ACInfo[playerid][acACAllow][31] &&
  9229.         (floatabs(ac_tData[PR_velocity][0] - ACVehInfo[trailerid][acVelX]) >= 2.6 &&
  9230.         floatabs(ac_tData[PR_velocity][0]) >= floatabs(ACVehInfo[trailerid][acVelX]) ||
  9231.         floatabs(ac_tData[PR_velocity][1] - ACVehInfo[trailerid][acVelY]) >= 2.6 &&
  9232.         floatabs(ac_tData[PR_velocity][1]) >= floatabs(ACVehInfo[trailerid][acVelY]) ||
  9233.         floatabs(ac_tData[PR_velocity][2] - ACVehInfo[trailerid][acVelZ]) >= 2.6 &&
  9234.         floatabs(ac_tData[PR_velocity][2]) >= floatabs(ACVehInfo[trailerid][acVelZ])))
  9235.         {
  9236.             #if defined DEBUG
  9237.                 printf("[Nex-AC debug] Pos x, y, z: %f, %f, %f, vel x, y, z: %f, %f, %f",
  9238.                 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]);
  9239.             #endif
  9240.             return ac_KickWithCode(playerid, "", 0, 31, 3);
  9241.         }
  9242.         if(ACInfo[playerid][acACAllow][5])
  9243.         {
  9244.             new Float:ac_dist = GetVehicleDistanceFromPoint(trailerid, ac_tData[PR_position][0], ac_tData[PR_position][1], ac_tData[PR_position][2]),
  9245.             Float:ac_dist2 = GetPlayerDistanceFromPoint(playerid, ac_tData[PR_position][0], ac_tData[PR_position][1], ac_tData[PR_position][2]);
  9246.             if(ac_dist >= 80.0 || ac_dist2 >= 40.0)
  9247.             {
  9248.                 new Float:ac_x, Float:ac_y, Float:ac_z;
  9249.                 GetVehiclePos(trailerid, ac_x, ac_y, ac_z);
  9250.                 #if defined DEBUG
  9251.                     printf("[Nex-AC debug] Dist: %f, player dist: %f, old pos z: %f, veh: %d, playerid: %d", ac_dist, ac_dist2, ac_z, trailerid, playerid);
  9252.                 #endif
  9253.                 #if defined OnCheatDetected
  9254.                     ac_KickWithCode(playerid, "", 0, 5, 2);
  9255.                 #endif
  9256.                 GetVehicleZAngle(trailerid, ACVehInfo[trailerid][acZAngle]);
  9257.                 SetVehicleFakeZAngleForPlayer(playerid, trailerid, ACVehInfo[trailerid][acZAngle]);
  9258.                 SetVehicleFakePosForPlayer(playerid, trailerid, ac_x, ac_y, ac_z);
  9259.                 return 0;
  9260.             }
  9261.         }
  9262.         new ac_vsp = ac_GetSpeed(ac_tData[PR_velocity][0], ac_tData[PR_velocity][1], ac_tData[PR_velocity][2]);
  9263.         ACVehInfo[trailerid][acTrSpeedDiff] = ac_vsp - ACVehInfo[trailerid][acSpeed];
  9264.         ACVehInfo[trailerid][acTrVelX] = ac_tData[PR_velocity][0];
  9265.         ACVehInfo[trailerid][acTrVelY] = ac_tData[PR_velocity][1];
  9266.         ACVehInfo[trailerid][acTrVelZ] = ac_tData[PR_velocity][2];
  9267.         ACVehInfo[trailerid][acTrSpeed] = ac_vsp;
  9268.         return 1;
  9269.     }
  9270.  
  9271.     #if defined OnPlayerWeaponShot
  9272.         const AC_PASSENGER_SYNC = 211;
  9273.     #else
  9274.         const AC_PASSENGER_SYNC = 115;
  9275.     #endif
  9276.  
  9277.     IPacket:AC_PASSENGER_SYNC(playerid, BitStream:bs)
  9278.     {
  9279.         if(ACInfo[playerid][acACAllow][44])
  9280.         {
  9281.             new ac_pData[PR_PassengerSync];
  9282.             BS_IgnoreBits(bs, 8);
  9283.             BS_ReadPassengerSync(bs, ac_pData);
  9284.             if(ac_pData[PR_seatId] < 1 || !(1 <= ac_pData[PR_vehicleId] < MAX_VEHICLES))
  9285.             {
  9286.                 #if defined DEBUG
  9287.                     printf("[Nex-AC debug] AC seat: %d, seat: %d, veh: %d",
  9288.                     ACInfo[playerid][acSeat], ac_pData[PR_seatId], ac_pData[PR_vehicleId]);
  9289.                 #endif
  9290.                 return ac_KickWithCode(playerid, "", 0, 44, 6);
  9291.             }
  9292.         }
  9293.         return 1;
  9294.     }
  9295.  
  9296.     #if defined OnPlayerWeaponShot
  9297.         const AC_RPC_RequestClass = 128;
  9298.     #else
  9299.         const AC_RPC_RequestClass = 101;
  9300.     #endif
  9301.  
  9302.     IRPC:AC_RPC_RequestClass(playerid, BitStream:bs)
  9303.     {
  9304.         if(!ACInfo[playerid][acForceClass])
  9305.         {
  9306.             #if defined WC_IsPlayerSpawned
  9307.                 if(WC_IsPlayerSpawned(playerid)) return 0;
  9308.             #elseif defined IsPlayerSpawned
  9309.                 if(IsPlayerSpawned(playerid)) return 0;
  9310.             #else
  9311.                 new ac_i = GetPlayerState(playerid);
  9312.                 if(PLAYER_STATE_ONFOOT <= ac_i < PLAYER_STATE_WASTED || ac_i == PLAYER_STATE_SPAWNED) return 0;
  9313.             #endif
  9314.         }
  9315.         return 1;
  9316.     }
  9317.  
  9318.     #if defined OnPlayerWeaponShot
  9319.         const AC_RPC_DamageVehicle = 106;
  9320.     #else
  9321.         const AC_RPC_DamageVehicle = 131;
  9322.     #endif
  9323.  
  9324.     IRPC:AC_RPC_DamageVehicle(playerid, BitStream:bs)
  9325.     {
  9326.         new vehicleid;
  9327.         BS_ReadValue(bs, PR_UINT16, vehicleid);
  9328.         if(GetVehicleModel(vehicleid) <= 0 || ACVehInfo[vehicleid][acDriver] != playerid) return 0;
  9329.         return 1;
  9330.     }
  9331.  
  9332.     #if defined OnPlayerWeaponShot
  9333.         const AC_RPC_DestroyObject = 47;
  9334.     #else
  9335.         const AC_RPC_DestroyObject = 51;
  9336.     #endif
  9337.  
  9338.     ORPC:AC_RPC_DestroyObject(playerid, BitStream:bs)
  9339.     {
  9340.         new ac_tmp;
  9341.         BS_ReadValue(bs, PR_UINT16, ac_tmp);
  9342.         if((0 <= ac_tmp < MAX_OBJECTS)) ac_ObjDelTick[ac_tmp] = GetTickCount() + 2650;
  9343.         return 1;
  9344.     }
  9345. #endif
  9346.  
  9347. #if defined PAWNRAKNET_INC_ || defined SendRPC
  9348.     #if defined OnPlayerWeaponShot
  9349.         const AC_RPC_SetVehiclePos = 159;
  9350.         const AC_RPC_SetVehicleZAngle = 160;
  9351.     #else
  9352.         const AC_RPC_SetVehiclePos = 109;
  9353.         const AC_RPC_SetVehicleZAngle = 110;
  9354.     #endif
  9355.  
  9356.     static SetVehicleFakePosForPlayer(playerid, vehicleid, Float:x, Float:y, Float:z)
  9357.     {
  9358.         if(!IsPlayerConnected(playerid) || GetVehicleModel(vehicleid) <= 0) return 0;
  9359.         #if defined PAWNRAKNET_INC_
  9360.             new BitStream:bs = BS_New();
  9361.             BS_WriteValue(bs, PR_UINT16, vehicleid, PR_FLOAT, x, PR_FLOAT, y, PR_FLOAT, z);
  9362.             #if defined PR_SendRPC
  9363.                 PR_SendRPC(bs, playerid, AC_RPC_SetVehiclePos);
  9364.             #else
  9365.                 BS_RPC(bs, playerid, AC_RPC_SetVehiclePos);
  9366.             #endif
  9367.             BS_Delete(bs);
  9368.         #else
  9369.             SendRPC(playerid, AC_RPC_SetVehiclePos, BS_UNSIGNEDSHORT, vehicleid, BS_FLOAT, x, BS_FLOAT, y, BS_FLOAT, z);
  9370.         #endif
  9371.         return 1;
  9372.     }
  9373.  
  9374.     static SetVehicleFakeZAngleForPlayer(playerid, vehicleid, Float:z_angle)
  9375.     {
  9376.         if(!IsPlayerConnected(playerid) || GetVehicleModel(vehicleid) <= 0) return 0;
  9377.         #if defined PAWNRAKNET_INC_
  9378.             new BitStream:bs = BS_New();
  9379.             BS_WriteValue(bs, PR_UINT16, vehicleid, PR_FLOAT, z_angle);
  9380.             #if defined PR_SendRPC
  9381.                 PR_SendRPC(bs, playerid, AC_RPC_SetVehicleZAngle);
  9382.             #else
  9383.                 BS_RPC(bs, playerid, AC_RPC_SetVehicleZAngle);
  9384.             #endif
  9385.             BS_Delete(bs);
  9386.         #else
  9387.             SendRPC(playerid, AC_RPC_SetVehicleZAngle, BS_UNSIGNEDSHORT, vehicleid, BS_FLOAT, z_angle);
  9388.         #endif
  9389.         return 1;
  9390.     }
  9391. #endif
  9392.  
  9393. ac_fpublic ac_Timer(playerid)
  9394. {
  9395.     if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked] > 0) return 0;
  9396.     new ac_gpp;
  9397.     #if defined NetStats_MessagesRecvPerSecond
  9398.         if(ACInfo[playerid][acACAllow][51] && (ac_gpp = NetStats_MessagesRecvPerSecond(playerid)) > AC_MAX_MSGS_REC_DIFF)
  9399.         {
  9400.             #if defined DEBUG
  9401.                 printf("[Nex-AC debug] Max msgs per sec: %d, msgs per sec: %d", AC_MAX_MSGS_REC_DIFF, ac_gpp);
  9402.             #endif
  9403.             ac_KickWithCode(playerid, "", 0, 51, 1);
  9404.         }
  9405.     #endif
  9406.     #undef AC_MAX_MSGS_REC_DIFF
  9407.     ac_gpp = GetPlayerPing(playerid);
  9408.     if(ACInfo[playerid][acACAllow][38])
  9409.     {
  9410.         if(ac_gpp > AC_MAX_PING)
  9411.         {
  9412.             if(++ACInfo[playerid][acCheatCount][0] > AC_MAX_PING_WARNINGS)
  9413.             {
  9414.                 #if defined DEBUG
  9415.                     printf("[Nex-AC debug] Max ping: %d, ping: %d", AC_MAX_PING, ac_gpp);
  9416.                 #endif
  9417.                 #undef AC_MAX_PING
  9418.                 #undef AC_MAX_PING_WARNINGS
  9419.                 ac_KickWithCode(playerid, "", 0, 38);
  9420.                 #if defined OnCheatDetected
  9421.                     ACInfo[playerid][acCheatCount][0] = 0;
  9422.                 #endif
  9423.             }
  9424.             #if defined OnCheatWarning
  9425.                 else OnCheatWarning(playerid, "", 0, 38, 0, ACInfo[playerid][acCheatCount][0]);
  9426.             #endif
  9427.         }
  9428.         else ACInfo[playerid][acCheatCount][0] = 0;
  9429.     }
  9430.     new ac_gtc = GetTickCount();
  9431.     #if defined IsPlayerDying
  9432.     if(!IsPlayerDying(playerid))
  9433.     #else
  9434.     if(!ACInfo[playerid][acDead])
  9435.     #endif
  9436.     {
  9437.         if(ac_gtc - ACInfo[playerid][acUpdateTick] < 1500)
  9438.         {
  9439.             new ac_t, ac_s = ACInfo[playerid][acLastWeapon];
  9440.             if(ac_s != -1 && ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp)
  9441.             {
  9442.                 #if AC_USE_AMMUNATIONS
  9443.                     new ac_m;
  9444.                 #endif
  9445.                 #if AC_USE_PICKUP_WEAPONS\
  9446.                     && defined Streamer_GetDistanceToItem\
  9447.                     && defined Streamer_GetIntData
  9448.                     new Float:ac_pick_dist;
  9449.                     if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS)
  9450.                     {
  9451.                         Streamer_GetDistanceToItem(ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ], STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_pick_dist);
  9452.                         ac_t = Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) - 100;
  9453.                     }
  9454.                 #endif
  9455.                 ac_s = ac_wSlot[ac_s];
  9456.                 for(new ac_i, ac_w, ac_a, bool:ac_cw; ac_i <= 12; ++ac_i)
  9457.                 {
  9458.                     GetPlayerWeaponData(playerid, ac_i, ac_w, ac_a);
  9459.                     if(ac_w == WEAPON_SATCHEL) ac_cw = true;
  9460.                     if(ac_s != ac_i)
  9461.                     {
  9462.                         if(ACInfo[playerid][acSetWeapon][ac_i] > 0)
  9463.                         {
  9464.                             if(ACInfo[playerid][acSetWeapon][ac_i] == ac_w)
  9465.                             {
  9466.                                 ACInfo[playerid][acSetWeapon][ac_i] = -1;
  9467.                                 ACInfo[playerid][acWeapon][ac_i] = ac_w;
  9468.                             }
  9469.                             else if(ac_gtc - ACInfo[playerid][acGtcSetWeapon][ac_i] > ac_gpp)
  9470.                             {
  9471.                                 if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][0])
  9472.                                 {
  9473.                                     if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_TIMER_WARNINGS)
  9474.                                     {
  9475.                                         #if defined DEBUG
  9476.                                             printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  9477.                                             printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSetWeapon][ac_i], ac_w);
  9478.                                         #endif
  9479.                                         ac_KickWithCode(playerid, "", 0, 52, 13);
  9480.                                         #if defined OnCheatDetected
  9481.                                             ACInfo[playerid][acSetWeapon][ac_i] = -1;
  9482.                                         #endif
  9483.                                     }
  9484.                                     #if defined OnNOPWarning
  9485.                                         else OnNOPWarning(playerid, 13, ACInfo[playerid][acNOPCount][0]);
  9486.                                     #endif
  9487.                                 }
  9488.                                 else if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSetWeapon][ac_i] = -1;
  9489.                             }
  9490.                         }
  9491.                         else
  9492.                         {
  9493.                             if(ACInfo[playerid][acWeapon][ac_i] != ac_w)
  9494.                             {
  9495.                                 #if AC_USE_PICKUP_WEAPONS
  9496.                                     #if defined Streamer_GetDistanceToItem\
  9497.                                         && defined Streamer_GetIntData
  9498.                                     if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
  9499.                                     ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  9500.                                     ac_a <= (ac_IsAmmoSharingInSlot(ac_i) ? (ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) &&
  9501.                                     IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  9502.                                     ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) ||
  9503.                                     ACInfo[playerid][acLastPickup] > MAX_PICKUPS && ac_t == ac_w &&
  9504.                                     ac_a <= (ac_IsAmmoSharingInSlot(ac_i) ? (ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) && ac_pick_dist <= 15.0)
  9505.                                     #else
  9506.                                     if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
  9507.                                     ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  9508.                                     ac_a <= (ac_IsAmmoSharingInSlot(ac_i) ? (ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) &&
  9509.                                     IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  9510.                                     ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
  9511.                                     #endif
  9512.                                     {
  9513.                                         ACInfo[playerid][acWeapon][ac_i] = ac_w;
  9514.                                         ACInfo[playerid][acAmmo][ac_i] = ac_a;
  9515.                                     }
  9516.                                     else
  9517.                                     {
  9518.                                 #endif
  9519.                                     if(ac_w == 0 || ac_w == WEAPON_BOMB && ac_cw ||
  9520.                                     ac_w == WEAPON_PARACHUTE && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute] > 0)
  9521.                                     {
  9522.                                         if(ac_w == WEAPON_PARACHUTE) ACInfo[playerid][acParachute] = 0;
  9523.                                         ACInfo[playerid][acWeapon][ac_i] = ac_w;
  9524.                                         ACInfo[playerid][acAmmo][ac_i] = ac_a;
  9525.                                     }
  9526.                                     else if(ACInfo[playerid][acACAllow][15] && (!ac_IsWeaponWithAmmo(ac_w) || ac_a != 0))
  9527.                                     {
  9528.                                         #if defined DEBUG
  9529.                                             printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
  9530.                                             ACInfo[playerid][acWeapon][ac_i], ACInfo[playerid][acAmmo][ac_i], ac_w, ac_a);
  9531.                                         #endif
  9532.                                         ac_KickWithCode(playerid, "", 0, 15, 2);
  9533.                                         #if defined OnCheatDetected
  9534.                                             if(ACInfo[playerid][acKicked] < 1)
  9535.                                             {
  9536.                                                 ACInfo[playerid][acWeapon][ac_i] = ac_w;
  9537.                                                 ACInfo[playerid][acAmmo][ac_i] = ac_a;
  9538.                                             }
  9539.                                         #endif
  9540.                                     }
  9541.                                 #if AC_USE_PICKUP_WEAPONS
  9542.                                     }
  9543.                                 #endif
  9544.                                 #undef AC_USE_PICKUP_WEAPONS
  9545.                             }
  9546.                             if(ACInfo[playerid][acGiveAmmo][ac_i] != -65535)
  9547.                             {
  9548.                                 if(ACInfo[playerid][acGiveAmmo][ac_i] == ac_a ||
  9549.                                 ACInfo[playerid][acGiveAmmo][ac_i] > ac_a && !(ac_a < 0 <= ACInfo[playerid][acGiveAmmo][ac_i]) &&
  9550.                                 ac_gtc - ACInfo[playerid][acGtcGiveAmmo][ac_i] > ac_gpp)
  9551.                                 {
  9552.                                     ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  9553.                                     ACInfo[playerid][acAmmo][ac_i] = ac_a;
  9554.                                 }
  9555.                                 else if(ac_gtc - ACInfo[playerid][acGtcGiveAmmo][ac_i] > ac_gpp)
  9556.                                 {
  9557.                                     if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][1])
  9558.                                     {
  9559.                                         if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_TIMER_WARNINGS)
  9560.                                         {
  9561.                                             #if defined DEBUG
  9562.                                                 printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  9563.                                                 printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  9564.                                                 ACInfo[playerid][acGiveAmmo][ac_i], ac_a, ac_w);
  9565.                                             #endif
  9566.                                             ac_KickWithCode(playerid, "", 0, 52, 14);
  9567.                                             #if defined OnCheatDetected
  9568.                                                 ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  9569.                                             #endif
  9570.                                         }
  9571.                                         #if defined OnNOPWarning
  9572.                                             else OnNOPWarning(playerid, 14, ACInfo[playerid][acNOPCount][1]);
  9573.                                         #endif
  9574.                                     }
  9575.                                     else if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  9576.                                 }
  9577.                             }
  9578.                             else if(ac_IsWeaponWithAmmo(ac_w))
  9579.                             {
  9580.                                 if(ac_a == 0) ACInfo[playerid][acAmmo][ac_i] = 0;
  9581.                                 else if(ACInfo[playerid][acACAllow][16] &&
  9582.                                 (ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i]) &&
  9583.                                 (!ac_LagCompMode || !ac_IsBulletWeapon(ac_w) || ac_gtc - ACInfo[playerid][acShotTick] > 3850))
  9584.                                 {
  9585.                                     #if defined DEBUG
  9586.                                         printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  9587.                                         ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
  9588.                                     #endif
  9589.                                     ac_KickWithCode(playerid, "", 0, 16, 2);
  9590.                                     #if defined OnCheatDetected
  9591.                                         if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acAmmo][ac_i] = ac_a;
  9592.                                     #endif
  9593.                                 }
  9594.                             }
  9595.                         }
  9596.                     }
  9597.                     else if(ac_IsBulletWeapon(ac_w))
  9598.                     {
  9599.                         if(ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i])
  9600.                         {
  9601.                             if(ACInfo[playerid][acGiveAmmo][ac_i] == -65535)
  9602.                             {
  9603.                                 #if AC_USE_AMMUNATIONS
  9604.                                     if(2 <= ac_i <= 5 && ac_InAmmuNation(playerid, ACInfo[playerid][acInt]) &&
  9605.                                     (ac_m = ac_a - ACInfo[playerid][acAmmo][ac_i]) % ac_AmmuNationInfo[ac_w - 22][1] == 0)
  9606.                                     {
  9607.                                         if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0] * (ac_m / ac_AmmuNationInfo[ac_w - 22][1]);
  9608.                                         else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0] * (ac_m / ac_AmmuNationInfo[ac_w - 22][1]);
  9609.                                         ACInfo[playerid][acAmmo][ac_i] += ac_m;
  9610.                                         ACInfo[playerid][acGtc][17] = ac_gtc + 2650;
  9611.                                         ACInfo[playerid][acCheatCount][20] = 0;
  9612.                                     }
  9613.                                     else
  9614.                                     {
  9615.                                 #endif
  9616.                                     if(ACInfo[playerid][acACAllow][16] && (!ac_LagCompMode || ac_gtc - ACInfo[playerid][acShotTick] > 3850))
  9617.                                     {
  9618.                                         #if defined DEBUG
  9619.                                             printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  9620.                                             ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
  9621.                                         #endif
  9622.                                         ac_KickWithCode(playerid, "", 0, 16, 3);
  9623.                                         #if defined OnCheatDetected
  9624.                                             if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acAmmo][ac_i] = ac_a;
  9625.                                         #endif
  9626.                                     }
  9627.                                 #if AC_USE_AMMUNATIONS
  9628.                                     }
  9629.                                 #endif
  9630.                             }
  9631.                         }
  9632.                         else if(ACInfo[playerid][acAmmo][ac_i] != 0) ACInfo[playerid][acAmmo][ac_i] = ac_a;
  9633.                     }
  9634.                 }
  9635.             }
  9636.             ac_s = GetPlayerState(playerid);
  9637.             if(PLAYER_STATE_ONFOOT <= ac_s <= PLAYER_STATE_PASSENGER)
  9638.             {
  9639.                 if(ACInfo[playerid][acACAllow][53] && ac_gtc - ACInfo[playerid][acFiveSecTick] >= 5000)
  9640.                 {
  9641.                     new Float:ac_x, Float:ac_y, Float:ac_z;
  9642.                     GetPlayerPos(playerid, ac_x, ac_y, ac_z);
  9643.                     if(ACInfo[playerid][acSet][12] != -1)
  9644.                     {
  9645.                         new Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], ac_z);
  9646.                         if(ac_dist_set < AC_STREAM_DISTANCE || ACInfo[playerid][acSet][7] != -1)
  9647.                         {
  9648.                             ACInfo[playerid][acSet][12] = -1;
  9649.                             #if defined FreezeSyncPacket
  9650.                                 if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true);
  9651.                             #endif
  9652.                         }
  9653.                         else
  9654.                         {
  9655.                             #if defined DEBUG
  9656.                                 printf("[Nex-AC debug] Dist set: %f, acSet[12]: %d, state: %d, old pos x, y: %f, %f",
  9657.                                 ac_dist_set, ACInfo[playerid][acSet][12], ac_s, ACInfo[playerid][acLastFivePosX], ACInfo[playerid][acLastFivePosY]);
  9658.                             #endif
  9659.                             ac_KickWithCode(playerid, "", 0, 53, 1);
  9660.                             #if defined OnCheatDetected
  9661.                                 ACInfo[playerid][acSet][12] = -1;
  9662.                             #endif
  9663.                         }
  9664.                     }
  9665.                     else if(ACInfo[playerid][acSet][8] == -1)
  9666.                     {
  9667.                         new Float:ac_time, Float:ac_maxdist = AC_STREAM_DISTANCE,
  9668.                         Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastFivePosX], ACInfo[playerid][acLastFivePosY], ac_z),
  9669.                         Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], ac_z);
  9670.                         if((ac_time = (ac_gtc - ACInfo[playerid][acFiveSecTick]) / 5000.0) > 1.0) ac_maxdist *= ac_time;
  9671.                         if(ac_s != PLAYER_STATE_ONFOOT) ac_maxdist += floatround(ACVehInfo[ACInfo[playerid][acVeh]][acSpeed] / 5);
  9672.                         else if((ac_t = GetPlayerSurfingVehicleID(playerid)) != INVALID_VEHICLE_ID) ac_maxdist += floatround(ACVehInfo[ac_t][acSpeed] / 5);
  9673.                         if(ac_dist >= ac_maxdist && (ACInfo[playerid][acSet][7] == -1 || ac_dist_set >= ac_maxdist))
  9674.                         {
  9675.                             #undef AC_STREAM_DISTANCE
  9676.                             #if defined DEBUG
  9677.                                 printf("[Nex-AC debug] Dist: %f, dist set: %f, acSet[7]: %d, state: %d, old pos x, y: %f, %f, max dist: %f",
  9678.                                 ac_dist, ac_dist_set, ACInfo[playerid][acSet][7], ac_s, ACInfo[playerid][acLastFivePosX], ACInfo[playerid][acLastFivePosY], ac_maxdist);
  9679.                             #endif
  9680.                             ac_KickWithCode(playerid, "", 0, 53, 2);
  9681.                         }
  9682.                     }
  9683.                     ACInfo[playerid][acLastFivePosX] = ACInfo[playerid][acLastPosX] = ac_x;
  9684.                     ACInfo[playerid][acLastFivePosY] = ACInfo[playerid][acLastPosY] = ac_y;
  9685.                     ACInfo[playerid][acFiveSecTick] = ac_gtc;
  9686.                 }
  9687.                 else
  9688.                 {
  9689.                     if(ac_s == PLAYER_STATE_DRIVER)
  9690.                     {
  9691.                         ac_t = ACInfo[playerid][acVeh];
  9692.                         if(ACInfo[playerid][acACAllow][35] && GetPlayerCameraMode(playerid) == 55) ac_KickWithCode(playerid, "", 0, 35);
  9693.                         if(ACInfo[playerid][acACAllow][3] && ACInfo[playerid][acSet][8] == -1)
  9694.                         {
  9695.                             new Float:ac_time, Float:ac_maxdist = 140.0,
  9696.                             Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY], ACInfo[playerid][acPosZ]),
  9697.                             Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], ACInfo[playerid][acPosZ]);
  9698.                             if((ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1000.0) > 1.0) ac_maxdist *= ac_time;
  9699.                             if(ac_dist >= ac_maxdist && (ACInfo[playerid][acSet][7] == -1 || ac_dist_set >= ac_maxdist))
  9700.                             {
  9701.                                 #if defined DEBUG
  9702.                                     printf("[Nex-AC debug] Dist: %f, dist set: %f, acSet[7]: %d, speed: %d, veh: %d",
  9703.                                     ac_dist, ac_dist_set, ACInfo[playerid][acSet][7], ACVehInfo[ac_t][acSpeed], ac_t);
  9704.                                 #endif
  9705.                                 ac_KickWithCode(playerid, "", 0, 3, 3);
  9706.                             }
  9707.                         }
  9708.                         ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX];
  9709.                         ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY];
  9710.                         ac_s = ac_GetSpeed(ACVehInfo[ac_t][acVelX], ACVehInfo[ac_t][acVelY]);
  9711.                         if(ACInfo[playerid][acACAllow][10] && ac_gtc - ACInfo[playerid][acGtc][8] > ac_gpp)
  9712.                         {
  9713.                             new ac_model = GetVehicleModel(ac_t), ac_maxdiff = 80,
  9714.                             Float:ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1100.0;
  9715.                             if(ac_s - ACVehInfo[ac_t][acLastSpeed] >= (ac_time > 1.0 ? floatround(ac_maxdiff * ac_time) : ac_maxdiff) &&
  9716.                             (!ac_IsValidVehicleModel(ac_model) || !ac_IsATrainLoco(ac_model) && !ac_IsAnAirplane(ac_model)))
  9717.                             {
  9718.                                 ACInfo[playerid][acCheatCount][18] += (1 * AC_SPEEDHACK_VEH_RESET_DELAY);
  9719.                                 if(ACInfo[playerid][acCheatCount][18] > AC_MAX_SPEEDHACK_VEH_WARNINGS)
  9720.                                 {
  9721.                                     #undef AC_MAX_SPEEDHACK_VEH_WARNINGS
  9722.                                     #if defined DEBUG
  9723.                                         printf("[Nex-AC debug] Speed: %d, last speed: %d, veh model: %d, veh: %d",
  9724.                                         ac_s, ACVehInfo[ac_t][acLastSpeed], ac_model, ac_t);
  9725.                                     #endif
  9726.                                     ac_KickWithCode(playerid, "", 0, 10, 4);
  9727.                                     #if defined OnCheatDetected
  9728.                                         ACInfo[playerid][acCheatCount][18] = 0;
  9729.                                     #endif
  9730.                                 }
  9731.                                 #if defined OnCheatWarning
  9732.                                     else OnCheatWarning(playerid, "", 0, 10, 4, floatround(ACInfo[playerid][acCheatCount][18] / AC_SPEEDHACK_VEH_RESET_DELAY));
  9733.                                 #endif
  9734.                                 #undef AC_SPEEDHACK_VEH_RESET_DELAY
  9735.                             }
  9736.                         }
  9737.                         ACVehInfo[ac_t][acLastSpeed] = ac_s;
  9738.                     }
  9739.                     else if(ac_s == PLAYER_STATE_ONFOOT)
  9740.                     {
  9741.                         if(ACInfo[playerid][acACAllow][2] && ACInfo[playerid][acSet][8] == -1 &&
  9742.                         !IsVehicleStreamedIn(GetPlayerSurfingVehicleID(playerid), playerid) &&
  9743.                         GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
  9744.                         {
  9745.                             new Float:ac_time, Float:ac_maxdist = 80.0,
  9746.                             Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY], ACInfo[playerid][acPosZ]),
  9747.                             Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], ACInfo[playerid][acPosZ]);
  9748.                             if((ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1000.0) > 1.0) ac_maxdist *= ac_time;
  9749.                             if(ac_dist >= ac_maxdist && (ACInfo[playerid][acSet][7] == -1 || ac_dist_set >= ac_maxdist))
  9750.                             {
  9751.                                 #if defined DEBUG
  9752.                                     printf("[Nex-AC debug] Dist: %f, dist set: %f, acSet[7]: %d, speed: %d, old pos x, y: %f, %f",
  9753.                                     ac_dist, ac_dist_set, ACInfo[playerid][acSet][7], ACInfo[playerid][acSpeed], ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY]);
  9754.                                 #endif
  9755.                                 ac_KickWithCode(playerid, "", 0, 2, 6);
  9756.                             }
  9757.                         }
  9758.                         ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX];
  9759.                         ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY];
  9760.                     }
  9761.                 }
  9762.             }
  9763.             if(ACInfo[playerid][acACAllow][51])
  9764.             {
  9765.                 ac_s = ACInfo[playerid][acPackets] - ACInfo[playerid][acLastPackets];
  9766.                 ac_t = ACInfo[playerid][acLastPackets] > 0 ? (ac_gtc - ACInfo[playerid][acTimerTick]) / ACInfo[playerid][acLastPackets] : -1;
  9767.                 if(ACInfo[playerid][acPackets] >= 30 && ac_t != -1 && (ac_t + ac_s) <= 30 && ac_s >= 18)
  9768.                 {
  9769.                     ACInfo[playerid][acCheatCount][25] += (1 * AC_PACKETS_RESET_DELAY);
  9770.                     if(ACInfo[playerid][acCheatCount][25] > AC_MAX_PACKETS_WARNINGS)
  9771.                     {
  9772.                         #undef AC_MAX_PACKETS_WARNINGS
  9773.                         #if defined DEBUG
  9774.                             printf("[Nex-AC debug] Packets: %d, last packets: %d, diff: %d, optimal count: %d",
  9775.                             ACInfo[playerid][acPackets], ACInfo[playerid][acLastPackets], ac_s, ac_t);
  9776.                         #endif
  9777.                         ac_KickWithCode(playerid, "", 0, 51, 2);
  9778.                         #if defined OnCheatDetected
  9779.                             ACInfo[playerid][acCheatCount][25] = 0;
  9780.                         #endif
  9781.                     }
  9782.                     #if defined OnCheatWarning
  9783.                         else OnCheatWarning(playerid, "", 0, 51, 2, floatround(ACInfo[playerid][acCheatCount][25] / AC_PACKETS_RESET_DELAY));
  9784.                     #endif
  9785.                     #undef AC_PACKETS_RESET_DELAY
  9786.                 }
  9787.                 ACInfo[playerid][acLastPackets] = ACInfo[playerid][acPackets];
  9788.                 ACInfo[playerid][acPackets] = 0;
  9789.             }
  9790.             ac_t = orig_GetPlayerMoney(playerid);
  9791.             #if AC_USE_AMMUNATIONS
  9792.                 if(ACInfo[playerid][acSet][10] != -1)
  9793.                 {
  9794.                     if(ac_t < ACInfo[playerid][acMoney] &&
  9795.                     ACInfo[playerid][acMoney] - ac_t >= ACInfo[playerid][acSet][10]) ACInfo[playerid][acSet][10] = -1;
  9796.                     else if(ac_gtc - ACInfo[playerid][acGtc][17] > ac_gpp)
  9797.                     {
  9798.                         if(ACInfo[playerid][acACAllow][15])
  9799.                         {
  9800.                             if(++ACInfo[playerid][acCheatCount][20] > AC_MAX_NOP_TIMER_WARNINGS)
  9801.                             {
  9802.                                 #if defined DEBUG
  9803.                                     printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
  9804.                                     ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
  9805.                                 #endif
  9806.                                 ac_KickWithCode(playerid, "", 0, 15, 4);
  9807.                                 #if defined OnCheatDetected
  9808.                                     ACInfo[playerid][acSet][10] = -1;
  9809.                                 #endif
  9810.                             }
  9811.                             #if defined OnCheatWarning
  9812.                                 else OnCheatWarning(playerid, "", 0, 15, 4, ACInfo[playerid][acCheatCount][20]);
  9813.                             #endif
  9814.                         }
  9815.                         else if(++ACInfo[playerid][acCheatCount][20] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSet][10] = -1;
  9816.                     }
  9817.                 }
  9818.             #endif
  9819.             #if AC_USE_TUNING_GARAGES
  9820.                 if(ACInfo[playerid][acSet][11] != -1)
  9821.                 {
  9822.                     if(ac_t < ACInfo[playerid][acMoney] &&
  9823.                     ACInfo[playerid][acMoney] - ac_t >= ACInfo[playerid][acSet][11]) ACInfo[playerid][acSet][11] = -1;
  9824.                     else if(ac_gtc - ACInfo[playerid][acGtc][18] > ac_gpp)
  9825.                     {
  9826.                         if(ACInfo[playerid][acACAllow][23])
  9827.                         {
  9828.                             if(++ACInfo[playerid][acCheatCount][21] > AC_MAX_NOP_TIMER_WARNINGS)
  9829.                             {
  9830.                                 #if defined DEBUG
  9831.                                     printf("[Nex-AC debug] Money: %d, old money: %d, components price: %d",
  9832.                                     ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][11]);
  9833.                                 #endif
  9834.                                 ac_KickWithCode(playerid, "", 0, 23, 6);
  9835.                                 #if defined OnCheatDetected
  9836.                                     ACInfo[playerid][acSet][11] = -1;
  9837.                                 #endif
  9838.                             }
  9839.                             #if defined OnCheatWarning
  9840.                                 else OnCheatWarning(playerid, "", 0, 23, 6, ACInfo[playerid][acCheatCount][21]);
  9841.                             #endif
  9842.                         }
  9843.                         else if(++ACInfo[playerid][acCheatCount][21] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSet][11] = -1;
  9844.                     }
  9845.                 }
  9846.             #endif
  9847.             #undef AC_USE_TUNING_GARAGES
  9848.             #undef AC_MAX_NOP_TIMER_WARNINGS
  9849.             if(ACInfo[playerid][acNOPCount][11] > 0) ACInfo[playerid][acNOPCount][11]--;
  9850.             else
  9851.             {
  9852.                 if(ACInfo[playerid][acACAllow][14] && ac_t > ACInfo[playerid][acMoney] &&
  9853.                 (!ACInfo[playerid][acStuntBonus] || ACInfo[playerid][acVeh] == 0 && ac_gtc - ACInfo[playerid][acGtc][15] > ac_gpp))
  9854.                 {
  9855.                     #if AC_USE_CASINOS
  9856.                         if(!ac_InCasino(playerid, ACInfo[playerid][acInt]))
  9857.                         {
  9858.                     #endif
  9859.                         #if defined DEBUG
  9860.                             printf("[Nex-AC debug] AC money: %d, money: %d, stunt bonus: %d, veh: %d, playerid: %d",
  9861.                             ACInfo[playerid][acMoney], ac_t, ACInfo[playerid][acStuntBonus], ACInfo[playerid][acVeh], playerid);
  9862.                         #endif
  9863.                         #if defined OnCheatDetected
  9864.                             ac_KickWithCode(playerid, "", 0, 14);
  9865.                         #endif
  9866.                         ac_t = ACInfo[playerid][acMoney];
  9867.                         ResetPlayerMoney(playerid);
  9868.                         GivePlayerMoney(playerid, ac_t);
  9869.                     #if AC_USE_CASINOS
  9870.                         }
  9871.                     #endif
  9872.                 }
  9873.                 ACInfo[playerid][acMoney] = ac_t;
  9874.             }
  9875.         }
  9876.         else
  9877.         {
  9878.             if(ACInfo[playerid][acSet][9] != -1) ACInfo[playerid][acGtc][7] += (ac_gtc - ACInfo[playerid][acTimerTick]);
  9879.             if(ac_gtc - ACInfo[playerid][acGtc][9] <= ac_gpp) ACInfo[playerid][acGtc][9] += (ac_gtc - ACInfo[playerid][acTimerTick]);
  9880.             if(ac_gtc - ACInfo[playerid][acGtc][8] <= ac_gpp) ACInfo[playerid][acGtc][8] += (ac_gtc - ACInfo[playerid][acTimerTick]);
  9881.             if(ac_gtc - ACInfo[playerid][acGtc][6] <= ac_gpp) ACInfo[playerid][acGtc][6] += (ac_gtc - ACInfo[playerid][acTimerTick]);
  9882.         }
  9883.         if(ACInfo[playerid][acCheatCount][14] > 0) ACInfo[playerid][acCheatCount][14]--;
  9884.         if(ACInfo[playerid][acCheatCount][18] > 0) ACInfo[playerid][acCheatCount][18]--;
  9885.         if(ACInfo[playerid][acCheatCount][25] > 0) ACInfo[playerid][acCheatCount][25]--;
  9886.         if(ACInfo[playerid][acCheatCount][26] > 0) ACInfo[playerid][acCheatCount][26]--;
  9887.         ACInfo[playerid][acCheatCount][1] = ACInfo[playerid][acCheatCount][2] =
  9888.         ACInfo[playerid][acCheatCount][3] = ACInfo[playerid][acCheatCount][4] =
  9889.         ACInfo[playerid][acCheatCount][19] = 0;
  9890.     }
  9891.     if(ACInfo[playerid][acKicked] < 1)
  9892.     {
  9893.         ACInfo[playerid][acTimerTick] = ac_gtc;
  9894.         ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
  9895.     }
  9896.     return 1;
  9897. }
  9898.  
  9899. #if !defined OnCheatDetected
  9900.     //Don't make changes in this public
  9901.     //To customize punishments, declare 'OnCheatDetected' in your script
  9902.     ac_fpublic ac_OnCheatDetected(playerid, ip_address[], type, code)
  9903.     {
  9904.         if(type)
  9905.         {
  9906.             #if defined BlockIpAddress
  9907.                 BlockIpAddress(ip_address, 0);
  9908.             #else
  9909.                 static ac_strtmp[32];
  9910.                 format(ac_strtmp, sizeof ac_strtmp, "banip %s", ip_address);
  9911.                 SendRconCommand(ac_strtmp);
  9912.             #endif
  9913.         }
  9914.         else
  9915.         {
  9916.             switch(code)
  9917.             {
  9918.                 case 40: SendClientMessage(playerid, AC_DEFAULT_COLOR, MAX_CONNECTS_MSG);
  9919.                 case 41: SendClientMessage(playerid, AC_DEFAULT_COLOR, UNKNOWN_CLIENT_MSG);
  9920.                 default:
  9921.                 {
  9922.                     static ac_strtmp[sizeof KICK_MSG];
  9923.                     format(ac_strtmp, sizeof ac_strtmp, KICK_MSG, code);
  9924.                     SendClientMessage(playerid, AC_DEFAULT_COLOR, ac_strtmp);
  9925.                     #undef AC_DEFAULT_COLOR
  9926.                 }
  9927.             }
  9928.             AntiCheatKickWithDesync(playerid, code);
  9929.         }
  9930.         return 1;
  9931.     }
  9932. #endif
  9933.  
  9934. ac_fpublic ac_KickTimer(playerid) return Kick(playerid);
  9935.  
  9936. #undef ac_fpublic
  9937.  
  9938. stock AntiCheatGetHealth(playerid, &Float:health)
  9939. {
  9940.     if(!IsPlayerConnected(playerid)) return 0;
  9941.     health = ACInfo[playerid][acHealth];
  9942.     return 1;
  9943. }
  9944.  
  9945. stock AntiCheatGetArmour(playerid, &Float:armour)
  9946. {
  9947.     if(!IsPlayerConnected(playerid)) return 0;
  9948.     armour = ACInfo[playerid][acArmour];
  9949.     return 1;
  9950. }
  9951.  
  9952. stock AntiCheatGetWeaponData(playerid, slot, &weapons, &ammo)
  9953. {
  9954.     if(!IsPlayerConnected(playerid)) return 0;
  9955.     if(!(0 <= slot <= 12)) return -1;
  9956.     weapons = ACInfo[playerid][acWeapon][slot];
  9957.     ammo = ACInfo[playerid][acAmmo][slot];
  9958.     return 1;
  9959. }
  9960.  
  9961. stock AntiCheatGetPos(playerid, &Float:x, &Float:y, &Float:z)
  9962. {
  9963.     if(!IsPlayerConnected(playerid)) return 0;
  9964.     x = ACInfo[playerid][acPosX];
  9965.     y = ACInfo[playerid][acPosY];
  9966.     z = ACInfo[playerid][acPosZ];
  9967.     return 1;
  9968. }
  9969.  
  9970. stock AntiCheatGetSpawnPos(playerid, &Float:x, &Float:y, &Float:z)
  9971. {
  9972.     if(!IsPlayerConnected(playerid)) return 0;
  9973.     x = ACInfo[playerid][acSpawnPosX];
  9974.     y = ACInfo[playerid][acSpawnPosY];
  9975.     z = ACInfo[playerid][acSpawnPosZ];
  9976.     return 1;
  9977. }
  9978.  
  9979. stock AntiCheatGetSpawnWeapon(playerid, &weapon1, &weapon1_ammo, &weapon2, &weapon2_ammo, &weapon3, &weapon3_ammo)
  9980. {
  9981.     if(!IsPlayerConnected(playerid)) return 0;
  9982.     weapon1 = ACInfo[playerid][acSpawnWeapon1];
  9983.     weapon1_ammo = ACInfo[playerid][acSpawnAmmo1];
  9984.     weapon2 = ACInfo[playerid][acSpawnWeapon2];
  9985.     weapon2_ammo = ACInfo[playerid][acSpawnAmmo2];
  9986.     weapon3 = ACInfo[playerid][acSpawnWeapon3];
  9987.     weapon3_ammo = ACInfo[playerid][acSpawnAmmo3];
  9988.     return 1;
  9989. }
  9990.  
  9991. stock AntiCheatGetVehicleHealth(vehicleid, &Float:health)
  9992. {
  9993.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  9994.     health = ACVehInfo[vehicleid][acHealth];
  9995.     return 1;
  9996. }
  9997.  
  9998. stock AntiCheatGetVehiclePos(vehicleid, &Float:x, &Float:y, &Float:z)
  9999. {
  10000.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  10001.     x = ACVehInfo[vehicleid][acPosX];
  10002.     y = ACVehInfo[vehicleid][acPosY];
  10003.     z = ACVehInfo[vehicleid][acPosZ];
  10004.     return 1;
  10005. }
  10006.  
  10007. stock AntiCheatGetVehicleVelocity(vehicleid, &Float:x, &Float:y, &Float:z)
  10008. {
  10009.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  10010.     x = ACVehInfo[vehicleid][acVelX];
  10011.     y = ACVehInfo[vehicleid][acVelY];
  10012.     z = ACVehInfo[vehicleid][acVelZ];
  10013.     return 1;
  10014. }
  10015.  
  10016. stock AntiCheatGetVehicleZAngle(vehicleid, &Float:z_angle)
  10017. {
  10018.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  10019.     z_angle = ACVehInfo[vehicleid][acZAngle];
  10020.     return 1;
  10021. }
  10022.  
  10023. stock AntiCheatGetVehicleSpawnPos(vehicleid, &Float:x, &Float:y, &Float:z)
  10024. {
  10025.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  10026.     x = ACVehInfo[vehicleid][acSpawnPosX];
  10027.     y = ACVehInfo[vehicleid][acSpawnPosY];
  10028.     z = ACVehInfo[vehicleid][acSpawnPosZ];
  10029.     return 1;
  10030. }
  10031.  
  10032. stock AntiCheatGetVehicleSpawnZAngle(vehicleid, &Float:z_angle)
  10033. {
  10034.     if(GetVehicleModel(vehicleid) <= 0) return 0;
  10035.     z_angle = ACVehInfo[vehicleid][acSpawnZAngle];
  10036.     return 1;
  10037. }
  10038.  
  10039. stock AntiCheatGetPickupPos(pickupid, &Float:x, &Float:y, &Float:z)
  10040. {
  10041.     if(!(0 <= pickupid < MAX_PICKUPS) || ACPickInfo[pickupid][acType] <= 0) return 0;
  10042.     x = ACPickInfo[pickupid][acPosX];
  10043.     y = ACPickInfo[pickupid][acPosY];
  10044.     z = ACPickInfo[pickupid][acPosZ];
  10045.     return 1;
  10046. }
  10047.  
  10048. static ac_IsValidVehicleModel(modelid) return (400 <= modelid <= 611);
  10049.  
  10050. static ac_IsAnAirplane(modelid) return (ac_vType[modelid - 400] == 1);
  10051.  
  10052. static ac_IsAnAircraftEx(modelid) return (ac_IsValidVehicleModel(modelid) && 1 <= ac_vType[modelid - 400] <= 2);
  10053.  
  10054. static ac_IsABoatEx(modelid) return (ac_IsValidVehicleModel(modelid) && ac_vType[modelid - 400] == 3);
  10055.  
  10056. static ac_IsABmx(modelid) return (ac_vType[modelid - 400] == 4);
  10057.  
  10058. static ac_IsABmxEx(modelid) return (ac_IsValidVehicleModel(modelid) && ac_vType[modelid - 400] == 4);
  10059.  
  10060. static ac_IsABikeEx(modelid) return (ac_IsValidVehicleModel(modelid) && 4 <= ac_vType[modelid - 400] <= 5);
  10061.  
  10062. static ac_IsABusEx(modelid) return (ac_IsValidVehicleModel(modelid) && ac_vType[modelid - 400] == 6);
  10063.  
  10064. static ac_IsATrainLoco(modelid) return (modelid == 449 || ac_vType[modelid - 400] == 8);
  10065.  
  10066. static ac_IsATrainCarriageEx(modelid) return (ac_IsValidVehicleModel(modelid) && ac_vType[modelid - 400] == 9);
  10067.  
  10068. static ac_IsATrainPartEx(modelid) return (ac_IsValidVehicleModel(modelid) && 7 <= ac_vType[modelid - 400] <= 9);
  10069.  
  10070. static ac_IsValidDamageReason(weaponid) return (0 <= weaponid <= 18 || 22 <= weaponid <= 46 || 49 <= weaponid <= 54);
  10071.  
  10072. static ac_IsValidWeapon(weaponid) return (0 <= weaponid <= 18 || 22 <= weaponid <= 46);
  10073.  
  10074. static ac_IsWeaponWithAmmo(weaponid) return (16 <= weaponid <= 18 || weaponid != 40 && 22 <= weaponid <= 43);
  10075.  
  10076. static ac_IsAmmoSharingInSlot(weaponslot) return (3 <= weaponslot <= 5);
  10077.  
  10078. static ac_IsBulletWeapon(weaponid) return (weaponid == 38 || 22 <= weaponid <= 34);
  10079.  
  10080. static ac_IsValidFloat(Float:value) return (value == value && value != Float:0x7F800000 && value != Float:0xFF800000);
  10081.  
  10082. static ac_IsValidSkin(skinid) return (0 <= skinid < AC_MAX_SKINS && skinid != 74);
  10083.  
  10084. #undef AC_MAX_SKINS
  10085.  
  10086. #if defined VectorSize
  10087.     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);
  10088. #else
  10089.     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);
  10090. #endif
  10091.  
  10092. static ac_IsVehicleSeatOccupied(vehicleid, seat)
  10093. {
  10094.     #if defined foreach
  10095.         foreach(new ac_i : Player)
  10096.         {
  10097.             if(ACInfo[ac_i][acVeh] == vehicleid && ACInfo[ac_i][acSeat] == seat) return 1;
  10098.         }
  10099.     #else
  10100.         #if defined GetPlayerPoolSize
  10101.             for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  10102.         #else
  10103.             for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i)
  10104.         #endif
  10105.         {
  10106.             if(IsPlayerInVehicle(ac_i, vehicleid) && ACInfo[ac_i][acSeat] == seat) return 1;
  10107.         }
  10108.     #endif
  10109.     return 0;
  10110. }
  10111.  
  10112. #if AC_USE_RESTAURANTS
  10113.     static ac_InRestaurant(playerid, interiorid)
  10114.     {
  10115.         switch(interiorid)
  10116.         {
  10117.             case 5:
  10118.             {
  10119.                 if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[0][0], ac_Restaurants[0][1], ac_Restaurants[0][2])) return 1;
  10120.             }
  10121.             case 9:
  10122.             {
  10123.                 if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[1][0], ac_Restaurants[1][1], ac_Restaurants[1][2])) return 1;
  10124.             }
  10125.             case 10:
  10126.             {
  10127.                 if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[2][0], ac_Restaurants[2][1], ac_Restaurants[2][2])) return 1;
  10128.             }
  10129.         }
  10130.         return 0;
  10131.     }
  10132. #endif
  10133. #undef AC_USE_RESTAURANTS
  10134.  
  10135. #if AC_USE_AMMUNATIONS
  10136.     static ac_InAmmuNation(playerid, interiorid)
  10137.     {
  10138.         switch(interiorid)
  10139.         {
  10140.             case 1:
  10141.             {
  10142.                 if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[0][0], ac_AmmuNations[0][1], ac_AmmuNations[0][2])) return 1;
  10143.             }
  10144.             case 4:
  10145.             {
  10146.                 if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[1][0], ac_AmmuNations[1][1], ac_AmmuNations[1][2])) return 1;
  10147.             }
  10148.             case 6:
  10149.             {
  10150.                 if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[2][0], ac_AmmuNations[2][1], ac_AmmuNations[2][2]) ||
  10151.                 IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[3][0], ac_AmmuNations[3][1], ac_AmmuNations[3][2])) return 1;
  10152.             }
  10153.             case 7:
  10154.             {
  10155.                 if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[4][0], ac_AmmuNations[4][1], ac_AmmuNations[4][2])) return 1;
  10156.             }
  10157.         }
  10158.         return 0;
  10159.     }
  10160. #endif
  10161. #undef AC_USE_AMMUNATIONS
  10162.  
  10163. #if AC_USE_PAYNSPRAY
  10164.     static ac_InPayNSpray(playerid, interiorid)
  10165.     {
  10166.         if(interiorid == 0)
  10167.         {
  10168.             for(new ac_i = sizeof(ac_PayNSpray) - 1; ac_i >= 0; --ac_i)
  10169.             {
  10170.                 if(IsPlayerInRangeOfPoint(playerid, 7.5, ac_PayNSpray[ac_i][0], ac_PayNSpray[ac_i][1], ac_PayNSpray[ac_i][2])) return 1;
  10171.             }
  10172.         }
  10173.         return 0;
  10174.     }
  10175. #endif
  10176. #undef AC_USE_PAYNSPRAY
  10177.  
  10178. #if AC_USE_VENDING_MACHINES
  10179.     static ac_NearVendingMachine(playerid, interiorid)
  10180.     {
  10181.         switch(interiorid)
  10182.         {
  10183.             case 0:
  10184.             {
  10185.                 for(new ac_i = 44; ac_i >= 0; --ac_i)
  10186.                 {
  10187.                     if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1;
  10188.                 }
  10189.             }
  10190.             case 1:
  10191.             {
  10192.                 for(new ac_i = 51; ac_i >= 45; --ac_i)
  10193.                 {
  10194.                     if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1;
  10195.                 }
  10196.             }
  10197.             case 2:
  10198.             {
  10199.                 if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[52][0], ac_vMachines[52][1], ac_vMachines[52][2])) return 1;
  10200.             }
  10201.             case 3:
  10202.             {
  10203.                 for(new ac_i = 58; ac_i >= 53; --ac_i)
  10204.                 {
  10205.                     if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1;
  10206.                 }
  10207.             }
  10208.             case 6:
  10209.             {
  10210.                 if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[59][0], ac_vMachines[59][1], ac_vMachines[59][2]) ||
  10211.                 IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[60][0], ac_vMachines[60][1], ac_vMachines[60][2])) return 1;
  10212.             }
  10213.             case 7:
  10214.             {
  10215.                 if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[61][0], ac_vMachines[61][1], ac_vMachines[61][2])) return 1;
  10216.             }
  10217.             case 15:
  10218.             {
  10219.                 if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[62][0], ac_vMachines[62][1], ac_vMachines[62][2])) return 1;
  10220.             }
  10221.             case 16:
  10222.             {
  10223.                 if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[63][0], ac_vMachines[63][1], ac_vMachines[63][2]) ||
  10224.                 IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[64][0], ac_vMachines[64][1], ac_vMachines[64][2]) ||
  10225.                 IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[65][0], ac_vMachines[65][1], ac_vMachines[65][2])) return 1;
  10226.             }
  10227.             case 17:
  10228.             {
  10229.                 for(new ac_i = 72; ac_i >= 66; --ac_i)
  10230.                 {
  10231.                     if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1;
  10232.                 }
  10233.             }
  10234.             case 18:
  10235.             {
  10236.                 if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[73][0], ac_vMachines[73][1], ac_vMachines[73][2]) ||
  10237.                 IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[74][0], ac_vMachines[74][1], ac_vMachines[74][2])) return 1;
  10238.             }
  10239.         }
  10240.         return 0;
  10241.     }
  10242. #endif
  10243. #undef AC_USE_VENDING_MACHINES
  10244.  
  10245. #if AC_USE_CASINOS
  10246.     static ac_InCasino(playerid, interiorid)
  10247.     {
  10248.         switch(interiorid)
  10249.         {
  10250.             case 1:
  10251.             {
  10252.                 for(new ac_i = 41; ac_i >= 0; --ac_i)
  10253.                 {
  10254.                     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;
  10255.                 }
  10256.             }
  10257.             case 10:
  10258.             {
  10259.                 for(new ac_i = 61; ac_i >= 42; --ac_i)
  10260.                 {
  10261.                     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;
  10262.                 }
  10263.             }
  10264.             case 12:
  10265.             {
  10266.                 for(new ac_i = 70; ac_i >= 62; --ac_i)
  10267.                 {
  10268.                     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;
  10269.                 }
  10270.             }
  10271.         }
  10272.         return 0;
  10273.     }
  10274. #endif
  10275. #undef AC_USE_CASINOS
  10276.  
  10277. static ac_IsCompatible(modelid, componentid)
  10278. {
  10279.     if(ac_IsValidVehicleModel(modelid))
  10280.     {
  10281.         switch(componentid)
  10282.         {
  10283.             case 1000..1191:
  10284.             {
  10285.                 componentid -= 1000;
  10286.                 if(ac_vMods[(modelid - 400) * 6 + (componentid >>> 5)] & 1 << (componentid & 0b00011111)) return 1;
  10287.             }
  10288.             case 1192, 1193:
  10289.             {
  10290.                 if(modelid == 576) return 1;
  10291.             }
  10292.         }
  10293.     }
  10294.     return 0;
  10295. }
  10296.  
  10297. static ac_GetMaxPassengers(modelid)
  10298. {
  10299.     if(ac_IsValidVehicleModel(modelid))
  10300.     {
  10301.         modelid -= 400;
  10302.         return ((ac_MaxPassengers[modelid >>> 3] >>> ((modelid & 7) << 2)) & 0xF);
  10303.     }
  10304.     return 0xF;
  10305. }
  10306.  
  10307. static ac_IpToInt(const ip[])
  10308. {
  10309.     #if defined sscanf
  10310.         new ac_b0, ac_b1, ac_b2, ac_b3;
  10311.         sscanf(ip, "p<.>iiii", ac_b3, ac_b2, ac_b1, ac_b0);
  10312.         return (ac_b0 | ac_b1 << 8 | ac_b2 << 16 | ac_b3 << 24);
  10313.     #else
  10314.         new ac_bytes[1], ac_pos;
  10315.         ac_bytes{0} = strval(ip[ac_pos]);
  10316.         while(ac_pos < 15 && ip[ac_pos++] != '.'){}
  10317.         ac_bytes{1} = strval(ip[ac_pos]);
  10318.         while(ac_pos < 15 && ip[ac_pos++] != '.'){}
  10319.         ac_bytes{2} = strval(ip[ac_pos]);
  10320.         while(ac_pos < 15 && ip[ac_pos++] != '.'){}
  10321.         ac_bytes{3} = strval(ip[ac_pos]);
  10322.         return ac_bytes[0];
  10323.     #endif
  10324. }
  10325.  
  10326. static ac_FloodDetect(playerid, publicid)
  10327. {
  10328.     if(ACInfo[playerid][acKicked] < 1)
  10329.     {
  10330.         if(++ACInfo[playerid][acFloodCount][publicid] > ac_Mtfc[publicid][1])
  10331.         {
  10332.             #if defined DEBUG
  10333.                 printf(DEBUG_CODE_1, playerid, ac_Mtfc[publicid][1], publicid);
  10334.                 #if !defined mysql_included
  10335.                     #undef DEBUG
  10336.                 #endif
  10337.             #endif
  10338.             #if defined OnCheatDetected
  10339.                 ac_KickWithCode(playerid, "", 0, 49, publicid);
  10340.                 ACInfo[playerid][acFloodCount][publicid] = ACInfo[playerid][acFloodCount][27] = 0;
  10341.             #else
  10342.                 return ac_KickWithCode(playerid, "", 0, 49, publicid);
  10343.             #endif
  10344.         }
  10345.         #if defined OnFloodWarning
  10346.             else OnFloodWarning(playerid, publicid, ACInfo[playerid][acFloodCount][publicid]);
  10347.         #endif
  10348.     }
  10349.     return 0;
  10350. }
  10351.  
  10352. static ac_KickWithCode(playerid, ip_address[], type, code, code2 = 0)
  10353. {
  10354.     if(type == 0 && (!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked] > 0)) return 0;
  10355.     #if AC_USE_STATISTICS
  10356.         ac_sInfo[5]++;
  10357.         switch(code)
  10358.         {
  10359.             case 0..35, 37, 39, 51: ac_sInfo[0]++;
  10360.             case 36, 38, 40, 41, 50: ac_sInfo[4]++;
  10361.             case 42: ac_sInfo[1]++;
  10362.             case 47..49: ac_sInfo[3]++;
  10363.             case 43..46: ac_sInfo[2]++;
  10364.         }
  10365.     #endif
  10366.     #undef AC_USE_STATISTICS
  10367.     #if defined NO_SUSPICION_LOGS
  10368.         #pragma unused code2
  10369.     #else
  10370.         new ac_strtmp[6];
  10371.         if(code2) format(ac_strtmp, sizeof ac_strtmp, " (%d)", code2);
  10372.         if(type) printf(SUSPICION_2, ip_address, code, ac_strtmp);
  10373.         else printf(SUSPICION_1, playerid, code, ac_strtmp);
  10374.     #endif
  10375.     #if defined OnCheatDetected
  10376.         OnCheatDetected(playerid, ip_address, type, code, code2);
  10377.     #else
  10378.         ac_OnCheatDetected(playerid, ip_address, type, code);
  10379.     #endif
  10380.     return 0;
  10381. }
  10382.  
  10383. #if AC_USE_CONFIG_FILES
  10384.     static ac_LoadCfg()
  10385.     {
  10386.         static ac_strtmp[10];
  10387.         new ac_i, ac_string[430], File:ac_cfgFile;
  10388.         if(fexist(AC_CONFIG_FILE))
  10389.         {
  10390.             if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_read)))
  10391.             {
  10392.                 #if defined sscanf
  10393.                     new ac_j;
  10394.                 #endif
  10395.                 while(fread(ac_cfgFile, ac_string) > 0)
  10396.                 {
  10397.                     #if defined sscanf
  10398.                         sscanf(ac_string, "i'//'i", ac_j, ac_i);
  10399.                         ac_ACAllow[ac_i] = (ac_j != 0);
  10400.                     #else
  10401.                         if((ac_i = strfind(ac_string, "//")) != -1)
  10402.                         {
  10403.                             strmid(ac_strtmp, ac_string, ac_i + 2, strlen(ac_string));
  10404.                             if(0 <= (ac_i = strval(ac_strtmp)) < sizeof ac_ACAllow) ac_ACAllow[ac_i] = (strval(ac_string) != 0);
  10405.                         }
  10406.                     #endif
  10407.                 }
  10408.                 fclose(ac_cfgFile);
  10409.             }
  10410.             else return 0;
  10411.         }
  10412.         else if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_write)))
  10413.         {
  10414.             #undef AC_CONFIG_FILE
  10415.             for(; ac_i < sizeof ac_ACAllow; ++ac_i)
  10416.             {
  10417.                 format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_ACAllow[ac_i], ac_i);
  10418.                 strcat(ac_string, ac_strtmp);
  10419.             }
  10420.             fwrite(ac_cfgFile, ac_string);
  10421.             fclose(ac_cfgFile);
  10422.         }
  10423.         else return 0;
  10424.         return 1;
  10425.     }
  10426.  
  10427.     static ac_LoadNOPCfg()
  10428.     {
  10429.         static ac_strtmp[10];
  10430.         new ac_i, ac_string[87], File:ac_cfgFile;
  10431.         if(fexist(AC_NOP_CONFIG_FILE))
  10432.         {
  10433.             if((ac_cfgFile = fopen(AC_NOP_CONFIG_FILE, io_read)))
  10434.             {
  10435.                 #if defined sscanf
  10436.                     new ac_j;
  10437.                 #endif
  10438.                 while(fread(ac_cfgFile, ac_string) > 0)
  10439.                 {
  10440.                     #if defined sscanf
  10441.                         sscanf(ac_string, "i'//'i", ac_j, ac_i);
  10442.                         ac_NOPAllow[ac_i] = (ac_j != 0);
  10443.                     #else
  10444.                         if((ac_i = strfind(ac_string, "//")) != -1)
  10445.                         {
  10446.                             strmid(ac_strtmp, ac_string, ac_i + 2, strlen(ac_string));
  10447.                             if(0 <= (ac_i = strval(ac_strtmp)) < sizeof ac_NOPAllow) ac_NOPAllow[ac_i] = (strval(ac_string) != 0);
  10448.                         }
  10449.                     #endif
  10450.                 }
  10451.                 fclose(ac_cfgFile);
  10452.             }
  10453.             else return 0;
  10454.         }
  10455.         else if((ac_cfgFile = fopen(AC_NOP_CONFIG_FILE, io_write)))
  10456.         {
  10457.             #undef AC_NOP_CONFIG_FILE
  10458.             for(; ac_i < sizeof ac_NOPAllow; ++ac_i)
  10459.             {
  10460.                 format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_NOPAllow[ac_i], ac_i);
  10461.                 strcat(ac_string, ac_strtmp);
  10462.             }
  10463.             fwrite(ac_cfgFile, ac_string);
  10464.             fclose(ac_cfgFile);
  10465.         }
  10466.         else return 0;
  10467.         return 1;
  10468.     }
  10469. #endif
  10470. #undef AC_USE_CONFIG_FILES
  10471.  
  10472. #endif
  10473.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement