Advertisement
Guest User

Nex-AC

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