Advertisement
Guest User

Untitled

a guest
Jan 13th, 2022
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 240.11 KB | None | 0 0
  1. //Nex-AC by Nexius v1.9.29 (0.3.7-R2)
  2.  
  3. #if defined _nex_ac_included
  4. #endinput
  5. #endif
  6. #define _nex_ac_included
  7.  
  8. #include <a_samp>
  9.  
  10. #if !defined GetConsoleVarAsInt
  11. #error Please download SA-MP 0.3.7 R2 server package!
  12. #endif
  13.  
  14. #if !defined FILTERSCRIPT
  15.  
  16. #define DEBUG
  17.  
  18. #include <nex-ac_bih.lang> //Localization
  19.  
  20. #define NEX_AC_VERSION "1.9.29"
  21. #define AC_SERVER_VERSION "0.3.7-R2"
  22.  
  23. #define AC_CONFIG_FILE "nex-ac_settings.cfg"
  24. #define AC_MAX_CLASSES 320
  25. #define AC_DEFAULT_COLOR -1
  26.  
  27. #if !defined AC_USE_VENDING_MACHINES
  28. #define AC_USE_VENDING_MACHINES true
  29. #endif
  30.  
  31. #if !defined AC_USE_TUNING_GARAGES
  32. #define AC_USE_TUNING_GARAGES true
  33. #endif
  34.  
  35. #if !defined AC_USE_AMMUNATIONS
  36. #define AC_USE_AMMUNATIONS true
  37. #endif
  38.  
  39. #if !defined AC_USE_RESTAURANTS
  40. #define AC_USE_RESTAURANTS true
  41. #endif
  42.  
  43. #if !defined AC_USE_PAYNSPRAY
  44. #define AC_USE_PAYNSPRAY true
  45. #endif
  46.  
  47. #if !defined AC_USE_CASINOS
  48. #define AC_USE_CASINOS true
  49. #endif
  50.  
  51. #if !defined AC_USE_QUERY
  52. #define AC_USE_QUERY true
  53. #endif
  54.  
  55. #if !defined AC_MAX_CONNECTS_FROM_IP
  56. #define AC_MAX_CONNECTS_FROM_IP 1
  57. #endif
  58.  
  59. #if !defined AC_MAX_RCON_LOGIN_ATTEMPT
  60. #define AC_MAX_RCON_LOGIN_ATTEMPT 1
  61. #endif
  62.  
  63. #if !defined AC_MAX_MSGS_REC_DIFF
  64. #define AC_MAX_MSGS_REC_DIFF 800
  65. #endif
  66.  
  67. #if !defined AC_MAX_PING
  68. #define AC_MAX_PING 500
  69. #endif
  70.  
  71. #if !defined AC_MIN_TIME_RECONNECT
  72. #define AC_MIN_TIME_RECONNECT 12 //In seconds
  73. #endif
  74.  
  75. #if !defined AC_MAX_NOP_WARNINGS
  76. #define AC_MAX_NOP_WARNINGS 3
  77. #endif
  78.  
  79. #if !defined AC_MAX_PING_WARNINGS
  80. #define AC_MAX_PING_WARNINGS 3
  81. #endif
  82.  
  83. #if !defined AC_MAX_AIR_WARNINGS
  84. #define AC_MAX_AIR_WARNINGS 3
  85. #endif
  86.  
  87. #if !defined AC_MAX_AIR_VEH_WARNINGS
  88. #define AC_MAX_AIR_VEH_WARNINGS 3
  89. #endif
  90.  
  91. #if !defined AC_MAX_FLYHACK_VEH_WARNINGS
  92. #define AC_MAX_FLYHACK_VEH_WARNINGS 3
  93. #endif
  94.  
  95. #if !defined AC_MAX_FLYHACK_B_WARNINGS
  96. #define AC_MAX_FLYHACK_B_WARNINGS 5
  97. #endif
  98.  
  99. #if !defined AC_MAX_CARSHOT_WARNINGS
  100. #define AC_MAX_CARSHOT_WARNINGS 3
  101. #endif
  102.  
  103. #if !defined AC_MAX_PRO_AIM_WARNINGS
  104. #define AC_MAX_PRO_AIM_WARNINGS 2
  105. #endif
  106.  
  107. #if !defined AC_MAX_AFK_GHOST_WARNINGS
  108. #define AC_MAX_AFK_GHOST_WARNINGS 2
  109. #endif
  110.  
  111. #if !defined AC_MAX_RAPID_FIRE_WARNINGS
  112. #define AC_MAX_RAPID_FIRE_WARNINGS 3
  113. #endif
  114.  
  115. #if !defined AC_MAX_GODMODE_WARNINGS
  116. #define AC_MAX_GODMODE_WARNINGS 2
  117. #endif
  118.  
  119. #if !defined AC_MAX_GODMODE_VEH_WARNINGS
  120. #define AC_MAX_GODMODE_VEH_WARNINGS 2
  121. #endif
  122.  
  123. #if !defined AC_MAX_SILENT_AIM_WARNINGS
  124. #define AC_MAX_SILENT_AIM_WARNINGS 2
  125. #endif
  126.  
  127. #if !defined AC_MAX_FLYHACK_WARNINGS
  128. #define AC_MAX_FLYHACK_WARNINGS 2
  129. #endif
  130.  
  131. #if !defined AC_MAX_SPEEDHACK_WARNINGS
  132. #define AC_MAX_SPEEDHACK_WARNINGS 1
  133. #endif
  134.  
  135. #if !defined AC_MAX_MONEY_WARNINGS
  136. #define AC_MAX_MONEY_WARNINGS 2
  137. #endif
  138.  
  139. #define ac_fpublic%0(%1) forward %0(%1); public %0(%1)
  140. #define ac_abs(%1) (((%1) < 0) ? (-(%1)) : ((%1)))
  141.  
  142. //These are the default settings that will be set if no configuration file will be found
  143. //Don't change these values if you already have 'scriptfiles\nex-ac_settings.cfg'
  144. static bool:ac_ACAllow[] =
  145. {
  146. true, //0 Anti-AirBreak (onfoot)
  147. true, //1 Anti-AirBreak (in vehicle)
  148. true, //2 Anti-teleport hack (onfoot)
  149. true, //3 Anti-teleport hack (in vehicle)
  150. true, //4 Anti-teleport hack (into/between vehicles)
  151. true, //5 Anti-teleport hack (vehicle to player)
  152. true, //6 Anti-teleport hack (pickups)
  153. true, //7 Anti-FlyHack (onfoot)
  154. true, //8 Anti-FlyHack (in vehicle)
  155. true, //9 Anti-SpeedHack (onfoot)
  156. true, //10 Anti-SpeedHack (in vehicle)
  157. true, //11 Anti-Health hack (in vehicle)
  158. true, //12 Anti-Health hack (onfoot)
  159. true, //13 Anti-Armour hack
  160. true, //14 Anti-Money hack
  161. true, //15 Anti-Weapon hack
  162. true, //16 Anti-Ammo hack (add)
  163. true, //17 Anti-Ammo hack (infinite)
  164. true, //18 Anti-Special actions hack
  165. true, //19 Anti-GodMode from bullets (onfoot)
  166. true, //20 Anti-GodMode from bullets (in vehicle)
  167. true, //21 Anti-Invisible hack
  168. true, //22 Anti-lagcomp-spoof
  169. true, //23 Anti-Tuning hack
  170. false, //24 Anti-Parkour mod
  171. true, //25 Anti-Quick turn
  172. true, //26 Anti-Rapid fire
  173. true, //27 Anti-FakeSpawn
  174. true, //28 Anti-FakeKill
  175. true, //29 Anti-Pro Aim
  176. true, //30 Anti-CJ run
  177. true, //31 Anti-CarShot
  178. true, //32 Anti-CarJack
  179. false, //33 Anti-UnFreeze
  180. true, //34 Anti-AFK Ghost
  181. true, //35 Anti-Full Aiming
  182.  
  183. false, //36 Anti-Fake NPC
  184. true, //37 Anti-Reconnect
  185. true, //38 Anti-High ping
  186. true, //39 Anti-Dialog hack
  187. true, //40 Protection from the sandbox
  188. true, //41 Protection against an invalid version
  189. true, //42 Anti-Rcon hack
  190.  
  191. true, //43 Anti-Tuning crasher
  192. true, //44 Anti-Invalid seat crasher
  193. true, //45 Anti-Dialog crasher
  194. true, //46 Anti-Attached object crasher
  195. true, //47 Anti-Weapon Crasher
  196.  
  197. true, //48 Flood protection connects to one slot
  198. true, //49 Anti-flood callback functions
  199. true, //50 Anti-flood change seat
  200.  
  201. true, //51 Anti-Ddos
  202.  
  203. true //52 Anti-NOP's
  204. };
  205.  
  206. static const ac_Mtfc[][] =
  207. {
  208. {200, 5}, //0 OnDialogResponse
  209. {800, 2}, //1 OnEnterExitModShop
  210. {250, 3}, //2 OnPlayerClickMap
  211. {450, 3}, //3 OnPlayerClickPlayer
  212. {150, 8}, //4 OnPlayerClickTextDraw
  213. {400, 3}, //5 OnPlayerCommandText
  214. {150, 3}, //6 OnPlayerEnterVehicle
  215. {150, 3}, //7 OnPlayerExitVehicle
  216. {500, 8}, //8 OnPlayerPickUpPickup
  217. {150, 8}, //9 OnPlayerRequestClass
  218. {250, 5}, //10 OnPlayerSelectedMenuRow
  219. {600, 3}, //11 OnPlayerStateChange
  220. {500, 2}, //12 OnVehicleMod
  221. {500, 2}, //13 OnVehiclePaintjob
  222. {500, 2}, //14 OnVehicleRespray
  223. {300, 1}, //15 OnVehicleDeath
  224. {450, 2}, //16 OnPlayerText
  225. {500, 5}, //17 OnPlayerEnterCheckpoint
  226. {500, 5}, //18 OnPlayerLeaveCheckpoint
  227. {150, 3}, //19 OnPlayerRequestSpawn
  228. {250, 5}, //20 OnPlayerExitedMenu
  229. {500, 5}, //21 OnPlayerEnterRaceCheckpoint
  230. {500, 5}, //22 OnPlayerLeaveRaceCheckpoint
  231. {150, 8}, //23 OnPlayerClickPlayerTextDraw
  232. {51, 9}, //24 OnVehicleDamageStatusUpdate
  233. {150, 5}, //25 OnVehicleSirenStateChange
  234. {150, 5}, //26 OnPlayerSelectObject
  235. {150, 5} //27 Cross-public
  236. },
  237.  
  238. ac_wSlot[] =
  239. {
  240. 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10,
  241. 10, 8, 8, 8, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5,
  242. 4, 6, 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11, 11, 11
  243. },
  244.  
  245. ac_wModel[] =
  246. {
  247. 0, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325,
  248. 326, 342, 343, 344, 0, 0, 345, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356,
  249. 372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 371
  250. },
  251.  
  252. ac_vType[] =
  253. {
  254. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
  255. 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  256. 0, 0, 0, 0, 0, 0, 3, 2, 5, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0,
  257. 1, 5, 5, 5, 0, 0, 0, 0, 5, 2, 0, 5, 3, 3, 0, 0, 2, 0, 0, 0,
  258. 0, 4, 0, 0, 3, 0, 0, 2, 2, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0,
  259. 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 2, 2, 2, 0, 0, 0, 0, 0, 2,
  260. 2, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  261. 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
  262. 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0,
  263. 0, 5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 2, 2, 0, 3, 0, 0, 0, 0,
  264. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  265. },
  266.  
  267. #if AC_USE_TUNING_GARAGES
  268. ac_cPrice[] =
  269. {
  270. 400, 550, 200, 250, 100, 150, 80, 500, 500, 200, 1000, 220, 250, 100, 400,
  271. 500, 200, 500, 350, 300, 250, 200, 150, 350, 50, 1000, 480, 0, 770, 680, 0,
  272. 370, 170, 120, 790, 150, 500, 690, 190, 390, 0, 0, 1000, 500, 500, 510, 710,
  273. 670, 530, 810, 620, 0, 0, 130, 210, 230, 520, 430, 620, 720, 530, 180, 0, 0,
  274. 830, 850, 750, 250, 200, 550, 450, 0, 0, 1100, 1030, 980, 1560, 1620, 1200,
  275. 1030, 900, 1230, 820, 1560, 1350, 770, 100, 1500, 150, 650, 450, 100, 750,
  276. 350, 0, 0, 1000, 620, 1140, 0, 940, 0, 0, 3250, 1610, 1540, 780, 0, 780,
  277. 1610, 1540, 0, 0, 3340, 3250, 2130, 2050, 2040, 780, 940, 0, 0, 780, 860,
  278. 0, 1120, 3340, 3250, 3340, 1650, 3380, 3290, 1590, 830, 800, 1500, 1000, 0,
  279. 580, 470, 870, 980, 0, 150, 0, 100, 490, 600, 890, 1000, 1090, 840, 910,
  280. 1200, 1030, 1030, 920, 930, 550, 1050, 1050, 950, 650, 450, 550, 850, 950,
  281. 850, 950, 970, 880, 990, 900, 950, 1000, 900, 1000, 900, 2050, 2150, 2130,
  282. 2050, 2130, 2040, 2150, 2040, 2095, 2175, 2080, 2200, 1200, 1040, 940, 1100
  283. },
  284. #endif
  285.  
  286. ac_MaxPassengers[] =
  287. {
  288. 0x10331113, 0x11311131, 0x11331313, 0x80133301, 0x1381F110,
  289. 0x10311103, 0x10001F10, 0x11113311, 0x13113311, 0x31101100,
  290. 0x30002301, 0x11031311, 0x11111331, 0x10013111, 0x01131100,
  291. 0x11111110, 0x11100031, 0x11130221, 0x33113311, 0x11111101,
  292. 0x33101133, 0x101005F0, 0x03133111, 0xFF11113F, 0x13330111,
  293. 0xFF131111, 0x0000FF3F
  294. },
  295.  
  296. ac_vMods[] =
  297. {
  298. 0x033C2700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x021A27FA, 0x00000000, 0x00FFFE00,
  299. 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  300. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023B2785, 0x00000000, 0x00FFFE00,
  301. 0x00000007, 0x00000000, 0x00000000, 0x02BC4703, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  302. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  303. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  304. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03BA278A, 0x00000000, 0x00FFFE00,
  305. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  306. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  307. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  308. 0x028E078A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  309. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  310. 0x02310744, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  311. 0x00000007, 0x00000000, 0x00000000, 0x0228073A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  312. 0x02BD4701, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023A2780, 0x00000000, 0x00FFFE00,
  313. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  314. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  315. 0x00000007, 0x00000000, 0x00000000, 0x0228077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  316. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  317. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  318. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  319. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  320. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  321. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  322. 0x027A27CA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  323. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  324. 0x0282278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  325. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  326. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  327. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  328. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  329. 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  330. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  331. 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  332. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  333. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  334. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  335. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  336. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  337. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  338. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  339. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  340. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  341. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  342. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  343. 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  344. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  345. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  346. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  347. 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  348. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  349. 0x00000007, 0x00000000, 0x00000000, 0x023E07C0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  350. 0x03703730, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  351. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  352. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  353. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  354. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  355. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  356. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  357. 0x00000007, 0x00000000, 0x00000000, 0x031D2775, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  358. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02BE4788, 0x00000000, 0x00FFFE00,
  359. 0x00000007, 0x0003C000, 0x00000000, 0x02010771, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  360. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  361. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  362. 0x029A0FCE, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  363. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  364. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03382700, 0x00000000, 0x00FFFE00,
  365. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  366. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  367. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  368. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  369. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  370. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  371. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  372. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  373. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  374. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  375. 0x00000007, 0x00000000, 0x00000000, 0x023F8795, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  376. 0x029F078C, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x029627EA, 0x00000000, 0x00FFFE00,
  377. 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  378. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  379. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  380. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  381. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  382. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x0236C782, 0x00000000, 0x00FFFE00,
  383. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  384. 0x029E1FCA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  385. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  386. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  387. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0xFC000437, 0x00000000, 0x021C0000,
  388. 0x02000700, 0x00000000, 0x00FFFE00, 0x03FE6007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  389. 0x00001B87, 0x00000001, 0x01E00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  390. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  391. 0x00000007, 0x00000000, 0x00000000, 0x039E07D2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  392. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023CC700, 0x00000000, 0x00FFFE00,
  393. 0x00000007, 0x00030000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  394. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  395. 0x00000007, 0x00000000, 0x00000000, 0x038E07D6, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  396. 0x023D0709, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  397. 0x00000007, 0x00000000, 0x00000000, 0x029E1F8A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  398. 0x029C077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02BD076C, 0x00000000, 0x00FFFE00,
  399. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  400. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  401. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  402. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  403. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0xFFFFFE00, 0x00000007, 0x00000000, 0x000001F8,
  404. 0x02000700, 0x00000000, 0x00FFFFFE, 0x00000007, 0xC0000000, 0x00002007, 0xFE000700, 0x00000003, 0x00FFFE00,
  405. 0x00000007, 0x00003C00, 0x00000600, 0xCE000700, 0xFF800000, 0x00FFFE01, 0x00000007, 0x3C000000, 0x00000000,
  406. 0x02000700, 0x000003FC, 0x00FFFE00, 0x00000007, 0x003C0000, 0x00001800, 0x02000700, 0x00000000, 0x00FFFE00,
  407. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  408. 0x02000700, 0x007FE000, 0x00FFFE00, 0x00000007, 0x03C00000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  409. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000047, 0x0000003E, 0x3C000000,
  410. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  411. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  412. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  413. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  414. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00001C00, 0x00FFFE00,
  415. 0x0000000F, 0x00000000, 0x0003C000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x000003C0, 0xC0000000,
  416. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  417. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  418. 0x029607C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  419. 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  420. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  421. 0x00000007, 0x00000000, 0x00000000, 0x03FFE7CF, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  422. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  423. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  424. 0x031727F1, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  425. 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  426. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  427. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  428. 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  429. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  430. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  431. 0x00000007, 0x00000000, 0x00000000, 0x025627F0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  432. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  433. 0x00000007, 0x00000000, 0x00000000, 0x039E07C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000,
  434. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  435. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  436. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  437. 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000,
  438. 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00,
  439. 0x00000007, 0x00000000, 0x00000000
  440. },
  441.  
  442. #if AC_USE_AMMUNATIONS
  443. ac_AmmuNationInfo[][] =
  444. {
  445. {300, 5}, {0, 0}, {0, 0},
  446. {0, 0}, {0, 0}, {0, 0},
  447. {200, 30}, {600, 30}, {1200, 15},
  448. {600, 15}, {800, 12}, {1000, 10},
  449. {500, 60}, {2000, 90}, {3500, 120},
  450. {4500, 150}, {300, 60}, {1000, 20},
  451. {5000, 10}, {10000, 5}, {12000, 5},
  452. {6000, 80}, {10000, 500}, {2000, 1}
  453. },
  454.  
  455. Float:ac_AmmuNations[][] =
  456. {
  457. {296.5541, -38.5138, 1001.5156},
  458. {295.7008, -80.8109, 1001.5156},
  459. {290.1963, -109.7721, 1001.5156},
  460. {312.2592, -166.1385, 999.601}
  461. },
  462. #endif
  463.  
  464. #if AC_USE_RESTAURANTS
  465. Float:ac_Restaurants[][] =
  466. {
  467. {374.0, -119.641, 1001.4922},
  468. {368.789, -6.857, 1001.8516},
  469. {375.566, -68.222, 1001.5151}
  470. },
  471. #endif
  472.  
  473. #if AC_USE_PAYNSPRAY
  474. Float:ac_PayNSpray[][] =
  475. {
  476. {2064.2842, -1831.4736, 13.5469},
  477. {-2425.7822, 1022.1392, 50.3977},
  478. {-1420.5195, 2584.2305, 55.8433},
  479. {487.6401, -1739.9479, 11.1385},
  480. {1024.8651, -1024.087, 32.1016},
  481. {-1904.7019, 284.5968, 41.0469},
  482. {1975.2384, 2162.5088, 11.0703},
  483. {2393.4456, 1491.5537, 10.5616},
  484. {720.0854, -457.8807, 16.3359},
  485. {-99.9417, 1117.9048, 19.7417}
  486. },
  487. #endif
  488.  
  489. #if AC_USE_VENDING_MACHINES
  490. Float:ac_vMachines[][] =
  491. {
  492. {-862.82, 1536.6, 21.98},
  493. {2271.72, -76.46, 25.96},
  494. {1277.83, 372.51, 18.95},
  495. {662.42, -552.16, 15.71},
  496. {201.01, -107.61, 0.89},
  497. {-253.74, 2597.95, 62.24},
  498. {-253.74, 2599.75, 62.24},
  499. {-76.03, 1227.99, 19.12},
  500. {-14.7, 1175.35, 18.95},
  501. {-1455.11, 2591.66, 55.23},
  502. {2352.17, -1357.15, 23.77},
  503. {2325.97, -1645.13, 14.21},
  504. {2139.51, -1161.48, 23.35},
  505. {2153.23, -1016.14, 62.23},
  506. {1928.73, -1772.44, 12.94},
  507. {1154.72, -1460.89, 15.15},
  508. {2480.85, -1959.27, 12.96},
  509. {2060.11, -1897.64, 12.92},
  510. {1729.78, -1943.04, 12.94},
  511. {1634.1, -2237.53, 12.89},
  512. {1789.21, -1369.26, 15.16},
  513. {-2229.18, 286.41, 34.7},
  514. {2319.99, 2532.85, 10.21},
  515. {2845.72, 1295.04, 10.78},
  516. {2503.14, 1243.69, 10.21},
  517. {2647.69, 1129.66, 10.21},
  518. {-2420.21, 984.57, 44.29},
  519. {-2420.17, 985.94, 44.29},
  520. {2085.77, 2071.35, 10.45},
  521. {1398.84, 2222.6, 10.42},
  522. {1659.46, 1722.85, 10.21},
  523. {1520.14, 1055.26, 10.0},
  524. {-1980.78, 142.66, 27.07},
  525. {-2118.96, -423.64, 34.72},
  526. {-2118.61, -422.41, 34.72},
  527. {-2097.27, -398.33, 34.72},
  528. {-2092.08, -490.05, 34.72},
  529. {-2063.27, -490.05, 34.72},
  530. {-2005.64, -490.05, 34.72},
  531. {-2034.46, -490.05, 34.72},
  532. {-2068.56, -398.33, 34.72},
  533. {-2039.85, -398.33, 34.72},
  534. {-2011.14, -398.33, 34.72},
  535. {-1350.11, 492.28, 10.58},
  536. {-1350.11, 493.85, 10.58},
  537. {2222.36, 1602.64, 1000.06},
  538. {2222.2, 1606.77, 1000.05},
  539. {2155.9, 1606.77, 1000.05},
  540. {2155.84, 1607.87, 1000.06},
  541. {2209.9, 1607.19, 1000.05},
  542. {2202.45, 1617.0, 1000.06},
  543. {2209.24, 1621.21, 1000.06},
  544. {2576.7, -1284.43, 1061.09},
  545. {330.67, 178.5, 1020.07},
  546. {331.92, 178.5, 1020.07},
  547. {350.9, 206.08, 1008.47},
  548. {361.56, 158.61, 1008.47},
  549. {371.59, 178.45, 1020.07},
  550. {374.89, 188.97, 1008.47},
  551. {-19.03, -57.83, 1003.63},
  552. {-36.14, -57.87, 1003.63},
  553. {316.87, -140.35, 998.58},
  554. {2225.2, -1153.42, 1025.9},
  555. {-15.1, -140.22, 1003.63},
  556. {-16.53, -140.29, 1003.63},
  557. {-35.72, -140.22, 1003.63},
  558. {373.82, -178.14, 1000.73},
  559. {379.03, -178.88, 1000.73},
  560. {495.96, -24.32, 1000.73},
  561. {500.56, -1.36, 1000.73},
  562. {501.82, -1.42, 1000.73},
  563. {-33.87, -186.76, 1003.63},
  564. {-32.44, -186.69, 1003.63},
  565. {-16.11, -91.64, 1003.63},
  566. {-17.54, -91.71, 1003.63}
  567. },
  568. #endif
  569.  
  570. #if AC_USE_CASINOS
  571. Float:ac_Casinos[][] =
  572. {
  573. {2241.2878, 1617.1624, 1006.1797, 2.0},
  574. {2240.9736, 1604.6592, 1006.1797, 6.0},
  575. {2242.5427, 1592.8726, 1006.1836, 6.0},
  576. {2230.2124, 1592.1426, 1006.1832, 6.0},
  577. {2230.4717, 1604.484, 1006.186, 6.0},
  578. {2230.3298, 1616.9272, 1006.1799, 3.0},
  579. {2251.9407, 1586.1736, 1006.186, 1.0},
  580. {2218.6785, 1587.3448, 1006.1749, 1.0},
  581. {2219.2773, 1591.7467, 1006.1867, 1.0},
  582. {2218.5408, 1589.3229, 1006.184, 1.0},
  583. {2218.6477, 1593.6279, 1006.1797, 1.0},
  584. {2221.926, 1603.8285, 1006.1797, 1.0},
  585. {2218.5095, 1603.8385, 1006.1797, 1.0},
  586. {2219.9597, 1603.9216, 1006.1797, 1.0},
  587. {2216.3054, 1603.7996, 1006.1819, 1.0},
  588. {2218.731, 1619.8046, 1006.1794, 1.0},
  589. {2218.9407, 1617.8413, 1006.1821, 1.0},
  590. {2218.668, 1615.4681, 1006.1797, 1.0},
  591. {2218.6418, 1613.2629, 1006.1797, 1.0},
  592. {2252.4272, 1589.8412, 1006.1797, 5.0},
  593. {2252.4229, 1596.6169, 1006.1797, 5.0},
  594. {2255.1565, 1608.8784, 1006.186, 1.0},
  595. {2254.8496, 1610.8605, 1006.1797, 1.0},
  596. {2255.2917, 1612.9167, 1006.1797, 1.0},
  597. {2255.033, 1614.8892, 1006.1797, 1.0},
  598. {2255.1213, 1616.8284, 1006.1797, 1.0},
  599. {2255.2161, 1618.8005, 1006.1797, 1.0},
  600. {2268.5281, 1606.4894, 1006.1797, 1.0},
  601. {2270.4922, 1606.8539, 1006.1797, 1.0},
  602. {2272.5693, 1606.4473, 1006.1797, 1.0},
  603. {2274.5391, 1607.0122, 1006.1797, 1.0},
  604. {2271.8447, 1586.1633, 1006.1797, 1.0},
  605. {2261.4844, 1586.1724, 1006.1797, 1.0},
  606. {2257.4507, 1589.6555, 1006.1797, 5.0},
  607. {2267.8994, 1589.8672, 1006.1797, 5.0},
  608. {2262.8486, 1590.026, 1006.1797, 5.0},
  609. {2272.6458, 1589.7704, 1006.1797, 5.0},
  610. {2272.6533, 1596.5682, 1006.1797, 5.0},
  611. {2270.4895, 1596.4606, 1006.1797, 5.0},
  612. {2265.4441, 1596.4299, 1006.1797, 5.0},
  613. {2260.0308, 1596.7987, 1006.1797, 5.0},
  614. {2254.9907, 1596.241, 1006.1797, 5.0},
  615. {1956.9524, 988.2533, 992.4688, 2.0},
  616. {1961.6155, 993.0375, 992.4688, 2.0},
  617. {1963.7998, 998.4406, 992.4745, 2.0},
  618. {1936.2885, 987.1995, 992.4745, 2.0},
  619. {1944.9768, 986.3937, 992.4688, 2.0},
  620. {1940.7397, 990.9521, 992.4609, 2.0},
  621. {1940.0966, 1005.8996, 992.4688, 6.0},
  622. {1938.8785, 1014.1768, 992.4688, 6.0},
  623. {1938.8811, 1021.4434, 992.4688, 6.0},
  624. {1966.5975, 1006.6469, 992.4745, 6.0},
  625. {1966.5979, 1014.1024, 992.4688, 6.0},
  626. {1939.8351, 1029.912, 992.4688, 6.0},
  627. {1956.854, 1047.3718, 992.4688, 6.0},
  628. {1961.356, 1042.8112, 992.4688, 6.0},
  629. {1963.811, 1037.1263, 992.4745, 6.0},
  630. {1961.733, 1025.8929, 992.4688, 10.0},
  631. {1961.708, 1010.3194, 992.4688, 10.0},
  632. {1966.5989, 1029.7954, 992.4745, 6.0},
  633. {1961.4139, 1017.8281, 992.4688, 10.0},
  634. {1966.5985, 1021.7686, 992.4688, 6.0},
  635. {1128.7106, -1.9779, 1000.6797, 1.0},
  636. {1125.2388, 1.61, 1000.6797, 1.0},
  637. {1125.1249, -5.0489, 1000.6797, 1.0},
  638. {1127.4139, 3.0199, 1000.6797, 1.0},
  639. {1135.0634, -3.8695, 1000.6797, 1.0},
  640. {1135.0861, 0.6107, 1000.6797, 1.0},
  641. {1132.8943, -1.7139, 1000.6797, 1.0},
  642. {1125.3727, 3.0315, 1000.6797, 1.0},
  643. {1119.0272, -1.4916, 1000.6924, 1.0}
  644. },
  645. #endif
  646.  
  647. ac_pAmmo[] =
  648. {
  649. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  650. 1, 1, 1, 8, 8, 8, 0, 0, 4, 30, 10, 10, 15,
  651. 10, 10, 60, 60, 80, 80, 60, 20, 10, 4, 3,
  652. 100, 500, 5, 1, 500, 500, 36, 1, 1, 1
  653. },
  654.  
  655. Float:ac_wRange[] =
  656. {
  657. 30.0, 30.0, 30.0, 40.0, 30.0, 40.0,
  658. 30.0, 40.0, 50.0, 50.0, 30.0, 60.0,
  659. 60.0, 50.0, 50.0, 4.0, 65.0
  660. };
  661.  
  662. enum acInfo
  663. {
  664. Float:acPosX,
  665. Float:acPosY,
  666. Float:acPosZ,
  667. Float:acDropJpX,
  668. Float:acDropJpY,
  669. Float:acDropJpZ,
  670. Float:acSetPosX,
  671. Float:acSetPosY,
  672. Float:acSetPosZ,
  673. Float:acSetVehHealth,
  674. Float:acSpeed,
  675. acHealth,
  676. acArmour,
  677. acMoney,
  678. acLastShot,
  679. acLastWeapon,
  680. acEnterVehTime,
  681. acEnterVeh,
  682. acLastVeh,
  683. acVeh,
  684. acSeat,
  685. acDialog,
  686. acNextDialog,
  687. acInt,
  688. acAnim,
  689. acReload,
  690. acDmgRes,
  691. acSpecAct,
  692. acNextSpecAct,
  693. acLastSpecAct,
  694. acLastPickup,
  695. acShotTime,
  696. acSpawnTime,
  697. acLastUpdate,
  698. acSpawnWeapon1,
  699. acSpawnWeapon2,
  700. acSpawnWeapon3,
  701. acSpawnAmmo1,
  702. acSpawnAmmo2,
  703. acSpawnAmmo3,
  704. acSpawnRes,
  705. acTimerID,
  706. acKickTimerID,
  707. acLogged,
  708. acKicked,
  709. acIp[16],
  710. acSet[13],
  711. acGtc[18],
  712. acWeapon[13],
  713. acAmmo[13],
  714. acSetWeapon[13],
  715. acGiveAmmo[13],
  716. acGtcSetWeapon[13],
  717. acGtcGiveAmmo[13],
  718. acNOPCount[12],
  719. acCheatCount[17],
  720. acCall[sizeof ac_Mtfc],
  721. acFloodCount[sizeof ac_Mtfc],
  722. bool:acACAllow[sizeof ac_ACAllow],
  723. bool:acStuntBonus,
  724. bool:acModShop,
  725. bool:acFreeze,
  726. bool:acOnline,
  727. bool:acDeathRes,
  728. bool:acVehDmgRes,
  729. bool:acDead,
  730. bool:acTpToZ,
  731. bool:acParachute,
  732. bool:acIntEnterExits,
  733. bool:acSpec
  734. }
  735.  
  736. enum acVehInfo
  737. {
  738. Float:acVelX,
  739. Float:acVelY,
  740. Float:acVelZ,
  741. Float:acSpeedDiff,
  742. Float:acPosDiff,
  743. Float:acZAngle,
  744. Float:acHealth,
  745. acDriver,
  746. acInt,
  747. acPaintJob,
  748. bool:acSpawned
  749. }
  750.  
  751. enum acPickInfo
  752. {
  753. Float:acPosX,
  754. Float:acPosY,
  755. Float:acPosZ,
  756. acType,
  757. acWeapon,
  758. bool:acIsStatic
  759. }
  760.  
  761. static
  762. ac_sInfo[6],
  763. ac_Class[AC_MAX_CLASSES][3][2],
  764. ACInfo[MAX_PLAYERS][acInfo],
  765. ACVehInfo[MAX_VEHICLES][acVehInfo],
  766. ACPickInfo[MAX_PICKUPS][acPickInfo],
  767. bool:ac_IntEnterExits = true,
  768. bool:ac_StuntBonus = true,
  769. bool:ac_VehFriendlyFire,
  770. bool:ac_LagCompMode,
  771. #if !AC_USE_QUERY
  772. bool:ac_QueryEnable,
  773. #endif
  774. bool:ac_RconEnable,
  775. bool:ac_PedAnims;
  776.  
  777. ac_fpublic ac_AddStaticVehicle(vehicleid)
  778. {
  779. ACVehInfo[vehicleid][acInt] = 0;
  780. ACVehInfo[vehicleid][acPaintJob] = 3;
  781. ACVehInfo[vehicleid][acSpawned] = true;
  782. ACVehInfo[vehicleid][acHealth] = 1000.0;
  783. ACVehInfo[vehicleid][acSpeedDiff] =
  784. ACVehInfo[vehicleid][acPosDiff] =
  785. ACVehInfo[vehicleid][acVelX] =
  786. ACVehInfo[vehicleid][acVelY] =
  787. ACVehInfo[vehicleid][acVelZ] = 0.0;
  788. ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  789. return 1;
  790. }
  791.  
  792. ac_fpublic ac_CreateVehicle(vehicleid, ac_vehicletype)
  793. {
  794. ACVehInfo[vehicleid][acInt] = 0;
  795. ACVehInfo[vehicleid][acPaintJob] = 3;
  796. ACVehInfo[vehicleid][acHealth] = 1000.0;
  797. ACVehInfo[vehicleid][acSpeedDiff] =
  798. ACVehInfo[vehicleid][acPosDiff] =
  799. ACVehInfo[vehicleid][acVelX] =
  800. ACVehInfo[vehicleid][acVelY] =
  801. ACVehInfo[vehicleid][acVelZ] = 0.0;
  802. if(!(569 <= ac_vehicletype <= 570)) ACVehInfo[vehicleid][acSpawned] = true;
  803. ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  804. return 1;
  805. }
  806.  
  807. ac_fpublic ac_AddPlayerClass(ac_classid, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
  808. {
  809. if(ac_classid < AC_MAX_CLASSES)
  810. {
  811. #undef AC_MAX_CLASSES
  812. ac_Class[ac_classid][0][0] = ac_weapon1;
  813. ac_Class[ac_classid][0][1] = ac_weapon1_ammo;
  814. ac_Class[ac_classid][1][0] = ac_weapon2;
  815. ac_Class[ac_classid][1][1] = ac_weapon2_ammo;
  816. ac_Class[ac_classid][2][0] = ac_weapon3;
  817. ac_Class[ac_classid][2][1] = ac_weapon3_ammo;
  818. }
  819. return 1;
  820. }
  821.  
  822. ac_fpublic ac_SetSpawnInfo(playerid, ac_team, ac_skin, Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)
  823. {
  824. if(!SetSpawnInfo(playerid, ac_team, ac_skin, ac_x, ac_y, ac_z, ac_rotation, ac_weapon1, ac_weapon1_ammo, ac_weapon2, ac_weapon2_ammo, ac_weapon3, ac_weapon3_ammo)) return 0;
  825. ACInfo[playerid][acSpawnWeapon1] = ac_weapon1;
  826. ACInfo[playerid][acSpawnAmmo1] = ac_weapon1_ammo;
  827. ACInfo[playerid][acSpawnWeapon2] = ac_weapon2;
  828. ACInfo[playerid][acSpawnAmmo2] = ac_weapon2_ammo;
  829. ACInfo[playerid][acSpawnWeapon3] = ac_weapon3;
  830. ACInfo[playerid][acSpawnAmmo3] = ac_weapon3_ammo;
  831. return 1;
  832. }
  833.  
  834. ac_fpublic ac_AddStaticPickup(pickupid, ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z)
  835. {
  836. ACPickInfo[pickupid][acWeapon] = 0;
  837. switch(ac_type)
  838. {
  839. case 2, 3, 15, 22:
  840. {
  841. switch(ac_model)
  842. {
  843. case 370: ACPickInfo[pickupid][acType] = 2;
  844. case 1240: ACPickInfo[pickupid][acType] = 3;
  845. case 1242: ACPickInfo[pickupid][acType] = 4;
  846. case 321..369, 371, 372:
  847. {
  848. for(new ac_i = 46; ac_i >= 0; --ac_i)
  849. {
  850. if(ac_wModel[ac_i] == ac_model)
  851. {
  852. ACPickInfo[pickupid][acType] = 1;
  853. ACPickInfo[pickupid][acWeapon] = ac_i;
  854. break;
  855. }
  856. }
  857. }
  858. }
  859. }
  860. }
  861. ACPickInfo[pickupid][acIsStatic] = true;
  862. ACPickInfo[pickupid][acPosX] = ac_X;
  863. ACPickInfo[pickupid][acPosY] = ac_Y;
  864. ACPickInfo[pickupid][acPosZ] = ac_Z;
  865. return 1;
  866. }
  867.  
  868. ac_fpublic ac_CreatePickup(pickupid, ac_model, ac_type, Float:ac_X, Float:ac_Y, Float:ac_Z)
  869. {
  870. ACPickInfo[pickupid][acWeapon] = 0;
  871. switch(ac_type)
  872. {
  873. case 2, 3, 15, 22:
  874. {
  875. switch(ac_model)
  876. {
  877. case 370: ACPickInfo[pickupid][acType] = 2;
  878. case 1240: ACPickInfo[pickupid][acType] = 3;
  879. case 1242: ACPickInfo[pickupid][acType] = 4;
  880. case 321..369, 371, 372:
  881. {
  882. for(new ac_i = 46; ac_i >= 0; --ac_i)
  883. {
  884. if(ac_wModel[ac_i] == ac_model)
  885. {
  886. ACPickInfo[pickupid][acType] = 1;
  887. ACPickInfo[pickupid][acWeapon] = ac_i;
  888. break;
  889. }
  890. }
  891. }
  892. }
  893. }
  894. }
  895. ACPickInfo[pickupid][acIsStatic] = false;
  896. ACPickInfo[pickupid][acPosX] = ac_X;
  897. ACPickInfo[pickupid][acPosY] = ac_Y;
  898. ACPickInfo[pickupid][acPosZ] = ac_Z;
  899. return 1;
  900. }
  901.  
  902. #if defined Streamer_SetIntData
  903. #if defined STREAMER_ENABLE_TAGS
  904. ac_fpublic ac_CreateDynamicPickup(STREAMER_TAG_PICKUP pickupid, ac_modelid, ac_type)
  905. #else
  906. ac_fpublic ac_CreateDynamicPickup(pickupid, ac_modelid, ac_type)
  907. #endif
  908. {
  909. Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 0);
  910. switch(ac_type)
  911. {
  912. case 2, 3, 15, 22:
  913. {
  914. switch(ac_modelid)
  915. {
  916. case 370: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 2);
  917. case 1240: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 3);
  918. case 1242: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 4);
  919. case 321..369, 371, 372:
  920. {
  921. for(new ac_i = 46; ac_i >= 0; --ac_i)
  922. {
  923. if(ac_wModel[ac_i] == ac_modelid)
  924. {
  925. Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, ac_i + 100);
  926. break;
  927. }
  928. }
  929. }
  930. }
  931. }
  932. }
  933. return 1;
  934. }
  935. #endif
  936.  
  937. #if defined Streamer_UpdateEx
  938. stock ac_Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, type = -1, compensatedtime = -1, freezeplayer = 1)
  939. {
  940. if(!Streamer_UpdateEx(playerid, x, y, z, worldid, interiorid, type, compensatedtime, freezeplayer)) return 0;
  941. if(compensatedtime >= 0)
  942. {
  943. ACInfo[playerid][acSet][8] = 4;
  944. ACInfo[playerid][acNOPCount][10] = 0;
  945. ACInfo[playerid][acSetPosX] = x;
  946. ACInfo[playerid][acSetPosY] = y;
  947. ACInfo[playerid][acSetPosZ] = z;
  948. ACInfo[playerid][acGtc][11] = GetTickCount() + 500;
  949. }
  950. return 1;
  951. }
  952.  
  953. #if defined _ALS_Streamer_UpdateEx
  954. #undef Streamer_UpdateEx
  955. #else
  956. #define _ALS_Streamer_UpdateEx
  957. #endif
  958. #define Streamer_UpdateEx ac_Streamer_UpdateEx
  959. #endif
  960.  
  961. ac_fpublic ac_DestroyVehicle(vehicleid)
  962. {
  963. if(!DestroyVehicle(vehicleid)) return 0;
  964. ACVehInfo[vehicleid][acSpawned] = false;
  965. return 1;
  966. }
  967.  
  968. ac_fpublic ac_DestroyPickup(pickupid)
  969. {
  970. if(!DestroyPickup(pickupid)) return 0;
  971. ACPickInfo[pickupid][acType] = 0;
  972. return 1;
  973. }
  974.  
  975. ac_fpublic ac_DisableInteriorEnterExits()
  976. {
  977. ac_IntEnterExits = false;
  978. return DisableInteriorEnterExits();
  979. }
  980.  
  981. ac_fpublic ac_UsePlayerPedAnims()
  982. {
  983. ac_PedAnims = true;
  984. return UsePlayerPedAnims();
  985. }
  986.  
  987. ac_fpublic ac_EnableVehicleFriendlyFire()
  988. {
  989. ac_VehFriendlyFire = true;
  990. return EnableVehicleFriendlyFire();
  991. }
  992.  
  993. ac_fpublic ac_EnableStuntBonusForAll(enable)
  994. {
  995. ac_StuntBonus = !!enable;
  996. #if defined foreach
  997. foreach(new ac_i : Player) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
  998. #else
  999. for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1000. {
  1001. if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus;
  1002. }
  1003. #endif
  1004. return EnableStuntBonusForAll(enable);
  1005. }
  1006.  
  1007. ac_fpublic ac_EnableStuntBonusForPlayer(playerid, enable)
  1008. {
  1009. if(!EnableStuntBonusForPlayer(playerid, enable)) return 0;
  1010. ACInfo[playerid][acStuntBonus] = !!enable;
  1011. return 1;
  1012. }
  1013.  
  1014. ac_fpublic ac_ShowPlayerDialog(playerid, ac_dialogid)
  1015. {
  1016. ACInfo[playerid][acDialog] = ac_dialogid;
  1017. return 1;
  1018. }
  1019.  
  1020. ac_fpublic ac_fs_ShowPlayerDialog(playerid, ac_dialogid)
  1021. {
  1022. ACInfo[playerid][acNextDialog] = ac_dialogid;
  1023. return 1;
  1024. }
  1025.  
  1026. ac_fpublic ac_TogglePlayerControllable(playerid, toggle)
  1027. {
  1028. if(!TogglePlayerControllable(playerid, toggle)) return 0;
  1029. ACInfo[playerid][acFreeze] = !!toggle;
  1030. return 1;
  1031. }
  1032.  
  1033. ac_fpublic ac_TogglePlayerSpectating(playerid, toggle)
  1034. {
  1035. if(!TogglePlayerSpectating(playerid, toggle)) return 0;
  1036. if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING || ACInfo[playerid][acSet][6] != -1)
  1037. {
  1038. if(!toggle)
  1039. {
  1040. if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][7] = 4;
  1041. else
  1042. {
  1043. ACInfo[playerid][acSet][3] =
  1044. ACInfo[playerid][acSet][4] =
  1045. ACInfo[playerid][acSet][5] =
  1046. ACInfo[playerid][acSet][6] =
  1047. ACInfo[playerid][acSet][8] =
  1048. ACInfo[playerid][acSet][9] =
  1049. ACInfo[playerid][acNextSpecAct] = -1;
  1050. for(new ac_i = 12; ac_i >= 0; --ac_i)
  1051. {
  1052. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1053. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1054. }
  1055. ACInfo[playerid][acFreeze] = true;
  1056. ACInfo[playerid][acTpToZ] = false;
  1057. ACInfo[playerid][acSet][7] = 1;
  1058. }
  1059. ACInfo[playerid][acSpawnRes]++;
  1060. ACInfo[playerid][acSpec] = false;
  1061. ACInfo[playerid][acSpawnTime] = ACInfo[playerid][acNOPCount][9] = 0;
  1062. ACInfo[playerid][acGtc][13] = GetTickCount() + 500;
  1063. }
  1064. }
  1065. else if(toggle)
  1066. {
  1067. ACInfo[playerid][acSet][6] = 1;
  1068. ACInfo[playerid][acNOPCount][8] = 0;
  1069. ACInfo[playerid][acGtc][12] = GetTickCount() + 500;
  1070. }
  1071. return 1;
  1072. }
  1073.  
  1074. ac_fpublic ac_SpawnPlayer(playerid)
  1075. {
  1076. if(!SpawnPlayer(playerid)) return 0;
  1077. if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][7] = 5;
  1078. else
  1079. {
  1080. ACInfo[playerid][acSet][3] =
  1081. ACInfo[playerid][acSet][4] =
  1082. ACInfo[playerid][acSet][5] =
  1083. ACInfo[playerid][acSet][8] =
  1084. ACInfo[playerid][acSet][9] =
  1085. ACInfo[playerid][acNextSpecAct] = -1;
  1086. for(new ac_i = 12; ac_i >= 0; --ac_i)
  1087. {
  1088. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1089. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1090. }
  1091. ACInfo[playerid][acTpToZ] = false;
  1092. ACInfo[playerid][acFreeze] = true;
  1093. ACInfo[playerid][acSet][7] = 2;
  1094. }
  1095. ACInfo[playerid][acSpawnRes]++;
  1096. ACInfo[playerid][acSpawnTime] = ACInfo[playerid][acNOPCount][9] = 0;
  1097. ACInfo[playerid][acGtc][13] = GetTickCount() + 500;
  1098. return 1;
  1099. }
  1100.  
  1101. ac_fpublic ac_SetPlayerHealth(playerid, Float:ac_health)
  1102. {
  1103. if(!SetPlayerHealth(playerid, ac_health)) return 0;
  1104. if(floatcmp(ac_health, 0.0) == -1) ac_health = 0.0;
  1105. ACInfo[playerid][acNOPCount][3] = 0;
  1106. ACInfo[playerid][acSet][1] = floatround(ac_health, floatround_tozero);
  1107. ACInfo[playerid][acGtc][3] = GetTickCount() + 500;
  1108. return 1;
  1109. }
  1110.  
  1111. ac_fpublic ac_SetPlayerArmour(playerid, Float:ac_armour)
  1112. {
  1113. if(!SetPlayerArmour(playerid, ac_armour)) return 0;
  1114. if(floatcmp(ac_armour, 0.0) == -1) ac_armour = 0.0;
  1115. ACInfo[playerid][acNOPCount][5] = 0;
  1116. ACInfo[playerid][acSet][2] = floatround(ac_armour, floatround_tozero);
  1117. ACInfo[playerid][acGtc][5] = GetTickCount() + 500;
  1118. return 1;
  1119. }
  1120.  
  1121. ac_fpublic ac_GivePlayerWeapon(playerid, ac_weaponid, ac_ammo)
  1122. {
  1123. if(0 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 46)
  1124. {
  1125. new ac_s = ac_wSlot[ac_weaponid];
  1126. ACInfo[playerid][acNOPCount][0] = ACInfo[playerid][acNOPCount][1] = 0;
  1127. if(16 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 43)
  1128. {
  1129. if(ac_ammo != 0 || ACInfo[playerid][acAmmo][ac_s] != 0)
  1130. {
  1131. if(3 <= ac_s <= 5 || (ACInfo[playerid][acSetWeapon][ac_s] == -1
  1132. ? ACInfo[playerid][acWeapon][ac_s] : ACInfo[playerid][acSetWeapon][ac_s]) == ac_weaponid)
  1133. {
  1134. ACInfo[playerid][acGiveAmmo][ac_s] =
  1135. (ACInfo[playerid][acGiveAmmo][ac_s] == -65535 ? ACInfo[playerid][acAmmo][ac_s]
  1136. : ACInfo[playerid][acGiveAmmo][ac_s]) + ac_ammo;
  1137. }
  1138. else ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo;
  1139. if(ACInfo[playerid][acGiveAmmo][ac_s] < -32768) ac_ammo = ACInfo[playerid][acGiveAmmo][ac_s] = -32768;
  1140. else if(ACInfo[playerid][acGiveAmmo][ac_s] > 32767) ac_ammo = ACInfo[playerid][acGiveAmmo][ac_s] = 32767;
  1141. ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = ac_weaponid;
  1142. }
  1143. }
  1144. else
  1145. {
  1146. ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  1147. ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = ac_weaponid;
  1148. }
  1149. GivePlayerWeapon(playerid, ac_weaponid, ac_ammo);
  1150. ACInfo[playerid][acGtcGiveAmmo][ac_s] = ACInfo[playerid][acGtcSetWeapon][ac_s] =
  1151. ACInfo[playerid][acGtc][2] = GetTickCount() + 1650;
  1152. }
  1153. return 1;
  1154. }
  1155.  
  1156. ac_fpublic ac_SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo)
  1157. {
  1158. if(ac_ammo < -32768) ac_ammo = -32768;
  1159. else if(ac_ammo > 32767) ac_ammo = 32767;
  1160. SetPlayerAmmo(playerid, ac_weaponslot, ac_ammo);
  1161. if(16 <= ac_weaponslot <= 43)
  1162. {
  1163. new ac_s = ac_wSlot[ac_weaponslot];
  1164. if(ACInfo[playerid][acWeapon][ac_s] > 0 || ACInfo[playerid][acSetWeapon][ac_s] > 0)
  1165. {
  1166. ACInfo[playerid][acNOPCount][1] = 0;
  1167. ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo;
  1168. ACInfo[playerid][acGtcGiveAmmo][ac_s] = GetTickCount() + 500;
  1169. }
  1170. }
  1171. return 1;
  1172. }
  1173.  
  1174. ac_fpublic ac_SetPlayerArmedWeapon(playerid, ac_weaponid)
  1175. {
  1176. if(!SetPlayerArmedWeapon(playerid, ac_weaponid)) return 0;
  1177. if(0 <= ac_weaponid <= 18 || 22 <= ac_weaponid <= 46)
  1178. {
  1179. new ac_s = ac_wSlot[ac_weaponid];
  1180. if((ac_weaponid == ACInfo[playerid][acWeapon][ac_s] || ac_weaponid == ACInfo[playerid][acSetWeapon][ac_s]) &&
  1181. (ACInfo[playerid][acAmmo][ac_s] != 0 || ACInfo[playerid][acGiveAmmo][ac_s] != 0))
  1182. {
  1183. ACInfo[playerid][acNOPCount][0] = 0;
  1184. ACInfo[playerid][acSet][3] = ac_weaponid;
  1185. ACInfo[playerid][acGtc][2] = GetTickCount() + 1650;
  1186. }
  1187. }
  1188. return 1;
  1189. }
  1190.  
  1191. ac_fpublic ac_ResetPlayerWeapons(playerid)
  1192. {
  1193. if(!ResetPlayerWeapons(playerid)) return 0;
  1194. for(new ac_i = 12; ac_i >= 0; --ac_i)
  1195. {
  1196. ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acAmmo][ac_i] = 0;
  1197. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  1198. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  1199. }
  1200. ACInfo[playerid][acSet][3] = -1;
  1201. ACInfo[playerid][acGtc][7] = GetTickCount() + 300;
  1202. return 1;
  1203. }
  1204.  
  1205. ac_fpublic ac_GivePlayerMoney(playerid, ac_money)
  1206. {
  1207. if(!GivePlayerMoney(playerid, ac_money)) return 0;
  1208. ACInfo[playerid][acNOPCount][11] = AC_MAX_MONEY_WARNINGS;
  1209. ACInfo[playerid][acMoney] += ac_money;
  1210. #undef AC_MAX_MONEY_WARNINGS
  1211. return 1;
  1212. }
  1213.  
  1214. ac_fpublic ac_ResetPlayerMoney(playerid)
  1215. {
  1216. if(!ResetPlayerMoney(playerid)) return 0;
  1217. ACInfo[playerid][acNOPCount][11] = 0;
  1218. ACInfo[playerid][acMoney] = 0;
  1219. return 1;
  1220. }
  1221.  
  1222. static bad_GetPlayerMoney(playerid) return GetPlayerMoney(playerid);
  1223.  
  1224. ac_fpublic ac_SetPlayerSpecialAction(playerid, ac_actionid)
  1225. {
  1226. if(!SetPlayerSpecialAction(playerid, ac_actionid)) return 0;
  1227. if(ac_actionid == SPECIAL_ACTION_USEJETPACK || ac_actionid == SPECIAL_ACTION_USECELLPHONE || ac_actionid == 68 ||
  1228. SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4 || ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE &&
  1229. ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USECELLPHONE || (ac_actionid == SPECIAL_ACTION_HANDSUP ||
  1230. SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_CARRY) && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_ENTER_VEHICLE ||
  1231. ac_actionid == SPECIAL_ACTION_NONE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_DUCK &&
  1232. ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_ENTER_VEHICLE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_HANDSUP)
  1233. {
  1234. ACInfo[playerid][acNOPCount][6] = 0;
  1235. if((ac_actionid == 68 || SPECIAL_ACTION_HANDSUP <= ac_actionid <= SPECIAL_ACTION_USECELLPHONE ||
  1236. SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_CARRY) &&
  1237. SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4 ||
  1238. SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_CARRY &&
  1239. ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK) ACInfo[playerid][acNextSpecAct] = ac_actionid;
  1240. else
  1241. {
  1242. if(ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE) ac_actionid = SPECIAL_ACTION_NONE;
  1243. else if(ac_actionid == SPECIAL_ACTION_USEJETPACK || ac_actionid == SPECIAL_ACTION_HANDSUP ||
  1244. SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4) ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct];
  1245. else ACInfo[playerid][acNextSpecAct] = -1;
  1246. ACInfo[playerid][acSet][4] = ac_actionid;
  1247. ACInfo[playerid][acGtc][6] = GetTickCount() + 2650;
  1248. }
  1249. }
  1250. return 1;
  1251. }
  1252.  
  1253. ac_fpublic ac_SetPlayerInterior(playerid, ac_interiorid)
  1254. {
  1255. if(!SetPlayerInterior(playerid, ac_interiorid)) return 0;
  1256. if(ac_interiorid < 0) ac_interiorid %= 256;
  1257. ACInfo[playerid][acNOPCount][2] = 0;
  1258. ACInfo[playerid][acSet][0] = ac_interiorid;
  1259. ACInfo[playerid][acGtc][0] = GetTickCount() + 500;
  1260. return 1;
  1261. }
  1262.  
  1263. ac_fpublic ac_SetPlayerPos(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1264. {
  1265. if(!SetPlayerPos(playerid, ac_x, ac_y, ac_z)) return 0;
  1266. ACInfo[playerid][acSet][8] = 1;
  1267. ACInfo[playerid][acNOPCount][10] = 0;
  1268. ACInfo[playerid][acSetPosX] = ac_x;
  1269. ACInfo[playerid][acSetPosY] = ac_y;
  1270. ACInfo[playerid][acSetPosZ] = ac_z;
  1271. ACInfo[playerid][acGtc][11] = GetTickCount() + 500;
  1272. return 1;
  1273. }
  1274.  
  1275. ac_fpublic ac_SetPlayerPosFindZ(playerid, Float:ac_x, Float:ac_y, Float:ac_z)
  1276. {
  1277. if(!SetPlayerPosFindZ(playerid, ac_x, ac_y, ac_z)) return 0;
  1278. ACInfo[playerid][acSet][8] = 2;
  1279. ACInfo[playerid][acTpToZ] = true;
  1280. ACInfo[playerid][acNOPCount][10] = 0;
  1281. ACInfo[playerid][acSetPosX] = ac_x;
  1282. ACInfo[playerid][acSetPosY] = ac_y;
  1283. ACInfo[playerid][acGtc][11] = GetTickCount() + 500;
  1284. return 1;
  1285. }
  1286.  
  1287. ac_fpublic ac_SetPlayerVelocity(playerid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1288. {
  1289. if(!SetPlayerVelocity(playerid, ac_X, ac_Y, ac_Z)) return 0;
  1290. ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_X, ac_Y, ac_Z);
  1291. ACInfo[playerid][acGtc][10] = GetTickCount() + 300;
  1292. return 1;
  1293. }
  1294.  
  1295. ac_fpublic ac_PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid)
  1296. {
  1297. if(!PutPlayerInVehicle(playerid, ac_vehicleid, ac_seatid)) return 0;
  1298. if(!(SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4) &&
  1299. !(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DRINK_SPRUNK) &&
  1300. GetPlayerVirtualWorld(playerid) == GetVehicleVirtualWorld(ac_vehicleid))
  1301. {
  1302. new ac_model = GetVehicleModel(ac_vehicleid) - 400;
  1303. ACInfo[playerid][acNOPCount][7] = 0;
  1304. ACInfo[playerid][acSet][9] = ac_vehicleid;
  1305. if(ac_model == 31 || ac_model == 37 || ac_IsVehicleSeatOccupied(ac_vehicleid, ac_seatid) ||
  1306. ac_seatid > ac_MaxPassengers[ac_model >>> 3] >>> ((ac_model & 7) << 2) & 0xF) ACInfo[playerid][acSet][5] = -1;
  1307. else ACInfo[playerid][acSet][5] = ac_seatid;
  1308. ACInfo[playerid][acSet][11] = -1;
  1309. ACInfo[playerid][acGtc][1] = GetTickCount() + 500;
  1310. }
  1311. return 1;
  1312. }
  1313.  
  1314. ac_fpublic ac_RemovePlayerFromVehicle(playerid)
  1315. {
  1316. if(!RemovePlayerFromVehicle(playerid)) return 0;
  1317. ACInfo[playerid][acSet][11] = 1;
  1318. ACInfo[playerid][acGtc][8] = GetTickCount() + 3150;
  1319. return 1;
  1320. }
  1321.  
  1322. ac_fpublic ac_SetVehiclePos(vehicleid, Float:ac_x, Float:ac_y, Float:ac_z)
  1323. {
  1324. if(!SetVehiclePos(vehicleid, ac_x, ac_y, ac_z)) return 0;
  1325. ACVehInfo[vehicleid][acVelX] = ACVehInfo[vehicleid][acVelY] = ACVehInfo[vehicleid][acVelZ] = 0.0;
  1326. new ac_driver;
  1327. if((ac_driver = ACVehInfo[vehicleid][acDriver]) != INVALID_PLAYER_ID)
  1328. {
  1329. ACInfo[ac_driver][acSet][8] = 3;
  1330. ACInfo[ac_driver][acNOPCount][10] = 0;
  1331. ACInfo[ac_driver][acSetPosX] = ac_x;
  1332. ACInfo[ac_driver][acSetPosY] = ac_y;
  1333. ACInfo[ac_driver][acSetPosZ] = ac_z;
  1334. ACInfo[ac_driver][acGtc][11] =
  1335. ACInfo[ac_driver][acGtc][9] = GetTickCount() + 500;
  1336. }
  1337. return 1;
  1338. }
  1339.  
  1340. ac_fpublic ac_SetVehicleVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1341. {
  1342. if(!SetVehicleVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0;
  1343. new ac_driver;
  1344. if((ac_driver = ACVehInfo[vehicleid][acDriver]) != INVALID_PLAYER_ID)
  1345. {
  1346. ACVehInfo[vehicleid][acVelX] = ac_X;
  1347. ACVehInfo[vehicleid][acVelY] = ac_Y;
  1348. ACVehInfo[vehicleid][acVelZ] = ac_Z;
  1349. ACInfo[ac_driver][acGtc][9] = GetTickCount() + 300;
  1350. }
  1351. return 1;
  1352. }
  1353.  
  1354. ac_fpublic ac_SetVehicleAngularVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z)
  1355. {
  1356. if(!SetVehicleAngularVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0;
  1357. new ac_driver;
  1358. if((ac_driver = ACVehInfo[vehicleid][acDriver]) != INVALID_PLAYER_ID)
  1359. {
  1360. ACVehInfo[vehicleid][acVelX] = ac_X;
  1361. ACVehInfo[vehicleid][acVelY] = ac_Y;
  1362. ACVehInfo[vehicleid][acVelZ] = ac_Z;
  1363. ACInfo[ac_driver][acGtc][9] = GetTickCount() + 300;
  1364. }
  1365. return 1;
  1366. }
  1367.  
  1368. ac_fpublic ac_LinkVehicleToInterior(vehicleid, ac_interiorid)
  1369. {
  1370. if(!LinkVehicleToInterior(vehicleid, ac_interiorid)) return 0;
  1371. if(ac_interiorid < 0) ac_interiorid %= 256;
  1372. ACVehInfo[vehicleid][acInt] = ac_interiorid;
  1373. return 1;
  1374. }
  1375.  
  1376. ac_fpublic ac_ChangeVehiclePaintjob(vehicleid, ac_paintjobid)
  1377. {
  1378. if(!ChangeVehiclePaintjob(vehicleid, ac_paintjobid)) return 0;
  1379. ACVehInfo[vehicleid][acPaintJob] = ac_paintjobid;
  1380. return 1;
  1381. }
  1382.  
  1383. ac_fpublic ac_SetVehicleHealth(vehicleid, Float:ac_health)
  1384. {
  1385. if(!SetVehicleHealth(vehicleid, ac_health)) return 0;
  1386. new ac_driver;
  1387. if((ac_driver = ACVehInfo[vehicleid][acDriver]) != INVALID_PLAYER_ID)
  1388. {
  1389. ACInfo[ac_driver][acNOPCount][4] = 0;
  1390. ACInfo[ac_driver][acSetVehHealth] = ac_health;
  1391. ACInfo[ac_driver][acGtc][4] = GetTickCount() + 500;
  1392. }
  1393. else ACVehInfo[vehicleid][acHealth] = ac_health;
  1394. return 1;
  1395. }
  1396.  
  1397. ac_fpublic ac_RepairVehicle(vehicleid)
  1398. {
  1399. if(!RepairVehicle(vehicleid)) return 0;
  1400. new ac_driver;
  1401. if((ac_driver = ACVehInfo[vehicleid][acDriver]) != INVALID_PLAYER_ID)
  1402. {
  1403. ACInfo[ac_driver][acNOPCount][4] = 0;
  1404. ACInfo[ac_driver][acSetVehHealth] = 1000.0;
  1405. ACInfo[ac_driver][acGtc][4] = GetTickCount() + 500;
  1406. }
  1407. else ACVehInfo[vehicleid][acHealth] = 1000.0;
  1408. return 1;
  1409. }
  1410.  
  1411. ac_fpublic ac_SetVehicleToRespawn(vehicleid)
  1412. {
  1413. new ac_driver;
  1414. if((ac_driver = ACVehInfo[vehicleid][acDriver]) != INVALID_PLAYER_ID) ACInfo[ac_driver][acGtc][9] = GetTickCount() + 300;
  1415. return SetVehicleToRespawn(vehicleid);
  1416. }
  1417.  
  1418. ac_fpublic ac_EnableAntiCheat(acid, enable)
  1419. {
  1420. if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1421. if(acid == 42)
  1422. {
  1423. if(enable)
  1424. {
  1425. if(!ac_ACAllow[acid])
  1426. {
  1427. #if !AC_USE_QUERY
  1428. ac_QueryEnable = !!GetConsoleVarAsBool("query");
  1429. #endif
  1430. ac_RconEnable = !!GetConsoleVarAsBool("rcon");
  1431. }
  1432. #if !AC_USE_QUERY
  1433. SendRconCommand("query 0");
  1434. #endif
  1435. SendRconCommand("rcon 0");
  1436. }
  1437. else
  1438. {
  1439. static ac_strtmp[9];
  1440. #if !AC_USE_QUERY
  1441. format(ac_strtmp, sizeof ac_strtmp, "query %b", ac_QueryEnable);
  1442. SendRconCommand(ac_strtmp);
  1443. #endif
  1444. format(ac_strtmp, sizeof ac_strtmp, "rcon %b", ac_RconEnable);
  1445. SendRconCommand(ac_strtmp);
  1446. }
  1447. }
  1448. ac_ACAllow[acid] = !!enable;
  1449. if(enable)
  1450. {
  1451. #if defined foreach
  1452. foreach(new ac_i : Player)
  1453. #else
  1454. for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1455. {
  1456. if(IsPlayerConnected(ac_i))
  1457. #endif
  1458. {
  1459. ACInfo[ac_i][acACAllow][acid] = ac_ACAllow[acid];
  1460. switch(acid)
  1461. {
  1462. case 7: ACInfo[ac_i][acCheatCount][15] = 0;
  1463. case 8: ACInfo[ac_i][acCheatCount][3] = 0;
  1464. case 10: ACInfo[ac_i][acCheatCount][16] = 0;
  1465. case 15: ACInfo[ac_i][acCheatCount][10] = 0;
  1466. case 17: ACInfo[ac_i][acCheatCount][7] = 0;
  1467. case 19: ACInfo[ac_i][acCheatCount][9] = 0;
  1468. case 20: ACInfo[ac_i][acCheatCount][11] = 0;
  1469. case 23: ACInfo[ac_i][acCheatCount][12] = 0;
  1470. case 26: ACInfo[ac_i][acCheatCount][14] = ACInfo[ac_i][acCheatCount][8] = 0;
  1471. case 29: ACInfo[ac_i][acCheatCount][13] = ACInfo[ac_i][acCheatCount][6] = 0;
  1472. case 31: ACInfo[ac_i][acCheatCount][4] = 0;
  1473. case 34: ACInfo[ac_i][acCheatCount][5] = 0;
  1474. case 38: ACInfo[ac_i][acCheatCount][0] = 0;
  1475. }
  1476. }
  1477. #if !defined foreach
  1478. }
  1479. #endif
  1480. }
  1481. else
  1482. {
  1483. #if defined foreach
  1484. foreach(new ac_i : Player) ACInfo[ac_i][acACAllow][acid] = ac_ACAllow[acid];
  1485. #else
  1486. for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  1487. {
  1488. if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acACAllow][acid] = ac_ACAllow[acid];
  1489. }
  1490. #endif
  1491. }
  1492. return 1;
  1493. }
  1494.  
  1495. ac_fpublic ac_EnableAntiCheatForPlayer(playerid, acid, enable)
  1496. {
  1497. if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1498. ACInfo[playerid][acACAllow][acid] = !!enable;
  1499. if(enable)
  1500. {
  1501. switch(acid)
  1502. {
  1503. case 7: ACInfo[playerid][acCheatCount][15] = 0;
  1504. case 8: ACInfo[playerid][acCheatCount][3] = 0;
  1505. case 10: ACInfo[playerid][acCheatCount][16] = 0;
  1506. case 15: ACInfo[playerid][acCheatCount][10] = 0;
  1507. case 17: ACInfo[playerid][acCheatCount][7] = 0;
  1508. case 19: ACInfo[playerid][acCheatCount][9] = 0;
  1509. case 20: ACInfo[playerid][acCheatCount][11] = 0;
  1510. case 23: ACInfo[playerid][acCheatCount][12] = 0;
  1511. case 26: ACInfo[playerid][acCheatCount][14] = ACInfo[playerid][acCheatCount][8] = 0;
  1512. case 29: ACInfo[playerid][acCheatCount][13] = ACInfo[playerid][acCheatCount][6] = 0;
  1513. case 31: ACInfo[playerid][acCheatCount][4] = 0;
  1514. case 34: ACInfo[playerid][acCheatCount][5] = 0;
  1515. case 38: ACInfo[playerid][acCheatCount][0] = 0;
  1516. }
  1517. }
  1518. return 1;
  1519. }
  1520.  
  1521. ac_fpublic ac_IsAntiCheatEnabled(acid)
  1522. {
  1523. if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1524. return ac_ACAllow[acid];
  1525. }
  1526.  
  1527. ac_fpublic ac_IsAntiCheatEnabledForPlayer(playerid, acid)
  1528. {
  1529. if(!(0 <= acid < sizeof ac_ACAllow)) return 0;
  1530. return ACInfo[playerid][acACAllow][acid];
  1531. }
  1532.  
  1533. ac_fpublic ac_AntiCheatGetAnimationIndex(playerid) return ACInfo[playerid][acAnim];
  1534.  
  1535. ac_fpublic ac_AntiCheatGetDialog(playerid) return ACInfo[playerid][acDialog];
  1536.  
  1537. ac_fpublic ac_AntiCheatGetMoney(playerid) return ACInfo[playerid][acMoney];
  1538.  
  1539. ac_fpublic ac_AntiCheatGetEnterVehicle(playerid) return ACInfo[playerid][acEnterVeh];
  1540.  
  1541. ac_fpublic ac_AntiCheatGetVehicleID(playerid) return ACInfo[playerid][acVeh];
  1542.  
  1543. ac_fpublic ac_AntiCheatGetWeapon(playerid) return ACInfo[playerid][acLastWeapon];
  1544.  
  1545. ac_fpublic ac_AntiCheatGetVehicleSeat(playerid) return ACInfo[playerid][acSeat];
  1546.  
  1547. ac_fpublic ac_AntiCheatGetSpecialAction(playerid) return ACInfo[playerid][acSpecAct];
  1548.  
  1549. ac_fpublic ac_AntiCheatGetLastSpecialActio(playerid) return ACInfo[playerid][acLastSpecAct];
  1550.  
  1551. ac_fpublic ac_AntiCheatGetLastShotWeapon(playerid) return ACInfo[playerid][acLastShot];
  1552.  
  1553. ac_fpublic ac_AntiCheatGetLastPickup(playerid) return ACInfo[playerid][acLastPickup];
  1554.  
  1555. ac_fpublic ac_AntiCheatGetLastUpdateTime(playerid) return ACInfo[playerid][acLastUpdate];
  1556.  
  1557. ac_fpublic ac_AntiCheatGetLastReloadTime(playerid) return ACInfo[playerid][acReload];
  1558.  
  1559. ac_fpublic ac_AntiCheatGetLastEnteredVehTi(playerid) return ACInfo[playerid][acEnterVehTime];
  1560.  
  1561. ac_fpublic ac_AntiCheatGetLastShotTime(playerid) return ACInfo[playerid][acShotTime];
  1562.  
  1563. ac_fpublic ac_AntiCheatGetLastSpawnTime(playerid) return ACInfo[playerid][acSpawnTime];
  1564.  
  1565. ac_fpublic ac_AntiCheatIntEnterExitsIsEnab(playerid) return ACInfo[playerid][acIntEnterExits];
  1566.  
  1567. ac_fpublic ac_AntiCheatStuntBonusIsEnabled(playerid) return ACInfo[playerid][acStuntBonus];
  1568.  
  1569. ac_fpublic ac_AntiCheatIsInModShop(playerid) return ACInfo[playerid][acModShop];
  1570.  
  1571. ac_fpublic ac_AntiCheatIsFrozen(playerid) return ACInfo[playerid][acFreeze];
  1572.  
  1573. ac_fpublic ac_AntiCheatIsDead(playerid) return ACInfo[playerid][acDead];
  1574.  
  1575. ac_fpublic ac_AntiCheatIsConnected(playerid) return ACInfo[playerid][acOnline];
  1576.  
  1577. ac_fpublic ac_AntiCheatGetNextDialog(playerid) return ACInfo[playerid][acNextDialog];
  1578.  
  1579. #endif
  1580.  
  1581. stock acc_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
  1582. {
  1583. new ac_vehicleid = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2);
  1584. if(ac_vehicleid != INVALID_VEHICLE_ID)
  1585. {
  1586. #if defined FILTERSCRIPT
  1587. CallRemoteFunction("ac_AddStaticVehicle", "i", ac_vehicleid);
  1588. #else
  1589. ac_AddStaticVehicle(ac_vehicleid);
  1590. #endif
  1591. }
  1592. return ac_vehicleid;
  1593. }
  1594.  
  1595. #if defined _ALS_AddStaticVehicle
  1596. #undef AddStaticVehicle
  1597. #else
  1598. #define _ALS_AddStaticVehicle
  1599. #endif
  1600. #define AddStaticVehicle acc_AddStaticVehicle
  1601.  
  1602. stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren = 0)
  1603. {
  1604. new ac_vehicleid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren);
  1605. if(ac_vehicleid != INVALID_VEHICLE_ID)
  1606. {
  1607. #if defined FILTERSCRIPT
  1608. CallRemoteFunction("ac_AddStaticVehicle", "i", ac_vehicleid);
  1609. #else
  1610. ac_AddStaticVehicle(ac_vehicleid);
  1611. #endif
  1612. }
  1613. return ac_vehicleid;
  1614. }
  1615.  
  1616. #if defined _ALS_AddStaticVehicleEx
  1617. #undef AddStaticVehicleEx
  1618. #else
  1619. #define _ALS_AddStaticVehicleEx
  1620. #endif
  1621. #define AddStaticVehicleEx acc_AddStaticVehicleEx
  1622.  
  1623. stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren = 0)
  1624. {
  1625. new ac_vehicleid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay, addsiren);
  1626. if(ac_vehicleid != INVALID_VEHICLE_ID)
  1627. {
  1628. #if defined FILTERSCRIPT
  1629. CallRemoteFunction("ac_CreateVehicle", "ii", ac_vehicleid, vehicletype);
  1630. #else
  1631. ac_CreateVehicle(ac_vehicleid, vehicletype);
  1632. #endif
  1633. }
  1634. return ac_vehicleid;
  1635. }
  1636.  
  1637. #if defined _ALS_CreateVehicle
  1638. #undef CreateVehicle
  1639. #else
  1640. #define _ALS_CreateVehicle
  1641. #endif
  1642. #define CreateVehicle acc_CreateVehicle
  1643.  
  1644. 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)
  1645. {
  1646. new ac_classid = AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1647. #if defined FILTERSCRIPT
  1648. CallRemoteFunction("ac_AddPlayerClass", "iiiiiii", ac_classid, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1649. #else
  1650. ac_AddPlayerClass(ac_classid, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1651. #endif
  1652. return ac_classid;
  1653. }
  1654.  
  1655. #if defined _ALS_AddPlayerClass
  1656. #undef AddPlayerClass
  1657. #else
  1658. #define _ALS_AddPlayerClass
  1659. #endif
  1660. #define AddPlayerClass acc_AddPlayerClass
  1661.  
  1662. 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)
  1663. {
  1664. new ac_classid = AddPlayerClassEx(teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1665. #if defined FILTERSCRIPT
  1666. CallRemoteFunction("ac_AddPlayerClass", "iiiiiii", ac_classid, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1667. #else
  1668. ac_AddPlayerClass(ac_classid, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1669. #endif
  1670. return ac_classid;
  1671. }
  1672.  
  1673. #if defined _ALS_AddPlayerClassEx
  1674. #undef AddPlayerClassEx
  1675. #else
  1676. #define _ALS_AddPlayerClassEx
  1677. #endif
  1678. #define AddPlayerClassEx acc_AddPlayerClassEx
  1679.  
  1680. stock acc_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
  1681. {
  1682. #if defined FILTERSCRIPT
  1683. return CallRemoteFunction("ac_SetSpawnInfo", "iiiffffiiiiii", playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1684. #else
  1685. return ac_SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  1686. #endif
  1687. }
  1688.  
  1689. #if defined _ALS_SetSpawnInfo
  1690. #undef SetSpawnInfo
  1691. #else
  1692. #define _ALS_SetSpawnInfo
  1693. #endif
  1694. #define SetSpawnInfo acc_SetSpawnInfo
  1695.  
  1696. stock acc_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)
  1697. {
  1698. new ac_pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
  1699. if(ac_pickupid != -1)
  1700. {
  1701. #if defined FILTERSCRIPT
  1702. return CallRemoteFunction("ac_AddStaticPickup", "iiifff", ac_pickupid, model, type, X, Y, Z);
  1703. #else
  1704. return ac_AddStaticPickup(ac_pickupid, model, type, X, Y, Z);
  1705. #endif
  1706. }
  1707. return 0;
  1708. }
  1709.  
  1710. #if defined _ALS_AddStaticPickup
  1711. #undef AddStaticPickup
  1712. #else
  1713. #define _ALS_AddStaticPickup
  1714. #endif
  1715. #define AddStaticPickup acc_AddStaticPickup
  1716.  
  1717. stock acc_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0)
  1718. {
  1719. new ac_pickupid = CreatePickup(model, type, X, Y, Z, virtualworld);
  1720. if(ac_pickupid != -1)
  1721. {
  1722. #if defined FILTERSCRIPT
  1723. CallRemoteFunction("ac_CreatePickup", "iiifff", ac_pickupid, model, type, X, Y, Z);
  1724. #else
  1725. ac_CreatePickup(ac_pickupid, model, type, X, Y, Z);
  1726. #endif
  1727. }
  1728. return ac_pickupid;
  1729. }
  1730.  
  1731. #if defined _ALS_CreatePickup
  1732. #undef CreatePickup
  1733. #else
  1734. #define _ALS_CreatePickup
  1735. #endif
  1736. #define CreatePickup acc_CreatePickup
  1737.  
  1738. #if defined CreateDynamicPickup
  1739. #if defined STREAMER_ENABLE_TAGS
  1740. 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)
  1741. {
  1742. new STREAMER_TAG_PICKUP ac_pickupid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
  1743. #else
  1744. 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)
  1745. {
  1746. new ac_pickupid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority);
  1747. #endif
  1748. if(_:ac_pickupid > 0)
  1749. {
  1750. #if defined FILTERSCRIPT
  1751. CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickupid, modelid, type);
  1752. #else
  1753. ac_CreateDynamicPickup(ac_pickupid, modelid, type);
  1754. #endif
  1755. }
  1756. return ac_pickupid;
  1757. }
  1758.  
  1759. #if defined _ALS_CreateDynamicPickup
  1760. #undef CreateDynamicPickup
  1761. #else
  1762. #define _ALS_CreateDynamicPickup
  1763. #endif
  1764. #define CreateDynamicPickup acc_CreateDynamicPickup
  1765. #endif
  1766.  
  1767. #if defined CreateDynamicPickupEx
  1768. #if defined STREAMER_ENABLE_TAGS
  1769. stock STREAMER_TAG_PICKUP acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, STREAMER_TAG_AREA areas[] = { STREAMER_TAG_AREA -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
  1770. {
  1771. new STREAMER_TAG_PICKUP ac_pickupid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
  1772. #else
  1773. stock acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = 200.0, worlds[] = { -1 }, interiors[] = { -1 }, players[] = { -1 }, areas[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
  1774. {
  1775. new ac_pickupid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas);
  1776. #endif
  1777. if(_:ac_pickupid > 0)
  1778. {
  1779. #if defined FILTERSCRIPT
  1780. CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickupid, modelid, type);
  1781. #else
  1782. ac_CreateDynamicPickup(ac_pickupid, modelid, type);
  1783. #endif
  1784. }
  1785. return ac_pickupid;
  1786. }
  1787.  
  1788. #if defined _ALS_CreateDynamicPickupEx
  1789. #undef CreateDynamicPickupEx
  1790. #else
  1791. #define _ALS_CreateDynamicPickupEx
  1792. #endif
  1793. #define CreateDynamicPickupEx acc_CreateDynamicPickupEx
  1794. #endif
  1795.  
  1796. stock acc_DestroyVehicle(vehicleid)
  1797. {
  1798. #if defined FILTERSCRIPT
  1799. return CallRemoteFunction("ac_DestroyVehicle", "i", vehicleid);
  1800. #else
  1801. return ac_DestroyVehicle(vehicleid);
  1802. #endif
  1803. }
  1804.  
  1805. #if defined _ALS_DestroyVehicle
  1806. #undef DestroyVehicle
  1807. #else
  1808. #define _ALS_DestroyVehicle
  1809. #endif
  1810. #define DestroyVehicle acc_DestroyVehicle
  1811.  
  1812. stock acc_DestroyPickup(pickup)
  1813. {
  1814. #if defined FILTERSCRIPT
  1815. return CallRemoteFunction("ac_DestroyPickup", "i", pickup);
  1816. #else
  1817. return ac_DestroyPickup(pickup);
  1818. #endif
  1819. }
  1820.  
  1821. #if defined _ALS_DestroyPickup
  1822. #undef DestroyPickup
  1823. #else
  1824. #define _ALS_DestroyPickup
  1825. #endif
  1826. #define DestroyPickup acc_DestroyPickup
  1827.  
  1828. stock acc_DisableInteriorEnterExits()
  1829. {
  1830. #if defined FILTERSCRIPT
  1831. return CallRemoteFunction("ac_DisableInteriorEnterExits", "");
  1832. #else
  1833. return ac_DisableInteriorEnterExits();
  1834. #endif
  1835. }
  1836.  
  1837. #if defined _ALS_DisableInteriorEnterExits
  1838. #undef DisableInteriorEnterExits
  1839. #else
  1840. #define _ALS_DisableInteriorEnterExits
  1841. #endif
  1842. #define DisableInteriorEnterExits acc_DisableInteriorEnterExits
  1843.  
  1844. stock acc_UsePlayerPedAnims()
  1845. {
  1846. #if defined FILTERSCRIPT
  1847. return CallRemoteFunction("ac_UsePlayerPedAnims", "");
  1848. #else
  1849. return ac_UsePlayerPedAnims();
  1850. #endif
  1851. }
  1852.  
  1853. #if defined _ALS_UsePlayerPedAnims
  1854. #undef UsePlayerPedAnims
  1855. #else
  1856. #define _ALS_UsePlayerPedAnims
  1857. #endif
  1858. #define UsePlayerPedAnims acc_UsePlayerPedAnims
  1859.  
  1860. stock acc_EnableVehicleFriendlyFire()
  1861. {
  1862. #if defined FILTERSCRIPT
  1863. return CallRemoteFunction("ac_EnableVehicleFriendlyFire", "");
  1864. #else
  1865. return ac_EnableVehicleFriendlyFire();
  1866. #endif
  1867. }
  1868.  
  1869. #if defined _ALS_EnableVehicleFriendlyFire
  1870. #undef EnableVehicleFriendlyFire
  1871. #else
  1872. #define _ALS_EnableVehicleFriendlyFire
  1873. #endif
  1874. #define EnableVehicleFriendlyFire acc_EnableVehicleFriendlyFire
  1875.  
  1876. stock acc_EnableStuntBonusForAll(enable)
  1877. {
  1878. #if defined FILTERSCRIPT
  1879. return CallRemoteFunction("ac_EnableStuntBonusForAll", "i", enable);
  1880. #else
  1881. return ac_EnableStuntBonusForAll(enable);
  1882. #endif
  1883. }
  1884.  
  1885. #if defined _ALS_EnableStuntBonusForAll
  1886. #undef EnableStuntBonusForAll
  1887. #else
  1888. #define _ALS_EnableStuntBonusForAll
  1889. #endif
  1890. #define EnableStuntBonusForAll acc_EnableStuntBonusForAll
  1891.  
  1892. stock acc_EnableStuntBonusForPlayer(playerid, enable)
  1893. {
  1894. #if defined FILTERSCRIPT
  1895. return CallRemoteFunction("ac_EnableStuntBonusForPlayer", "ii", playerid, enable);
  1896. #else
  1897. return ac_EnableStuntBonusForPlayer(playerid, enable);
  1898. #endif
  1899. }
  1900.  
  1901. #if defined _ALS_EnableStuntBonusForPlayer
  1902. #undef EnableStuntBonusForPlayer
  1903. #else
  1904. #define _ALS_EnableStuntBonusForPlayer
  1905. #endif
  1906. #define EnableStuntBonusForPlayer acc_EnableStuntBonusForPlayer
  1907.  
  1908. #if defined _inc_y_dialog || defined _INC_y_dialog
  1909. stock ac_Dialog_Show(playerid, style, string:title[], string:caption[], string:button1[], string:button2[] = "", dialog = -1)
  1910. {
  1911. if(IsPlayerConnected(playerid))
  1912. {
  1913. #if defined FILTERSCRIPT
  1914. CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialog);
  1915. #else
  1916. ac_ShowPlayerDialog(playerid, dialog);
  1917. #endif
  1918. }
  1919. return Dialog_Show(playerid, style, title, caption, button1, button2, dialog);
  1920. }
  1921.  
  1922. #if defined _ALS_Dialog_Show
  1923. #undef Dialog_Show
  1924. #else
  1925. #define _ALS_Dialog_Show
  1926. #endif
  1927. #define Dialog_Show ac_Dialog_Show
  1928. #endif
  1929.  
  1930. stock acc_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
  1931. {
  1932. if(ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2))
  1933. {
  1934. #if defined FILTERSCRIPT
  1935. return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
  1936. #else
  1937. return ac_ShowPlayerDialog(playerid, dialogid);
  1938. #endif
  1939. }
  1940. return 0;
  1941. }
  1942.  
  1943. #if defined _ALS_ShowPlayerDialog
  1944. #undef ShowPlayerDialog
  1945. #else
  1946. #define _ALS_ShowPlayerDialog
  1947. #endif
  1948. #define ShowPlayerDialog acc_ShowPlayerDialog
  1949.  
  1950. stock acc_TogglePlayerControllable(playerid, toggle)
  1951. {
  1952. #if defined FILTERSCRIPT
  1953. return CallRemoteFunction("ac_TogglePlayerControllable", "ii", playerid, toggle);
  1954. #else
  1955. return ac_TogglePlayerControllable(playerid, toggle);
  1956. #endif
  1957. }
  1958.  
  1959. #if defined _ALS_TogglePlayerControllable
  1960. #undef TogglePlayerControllable
  1961. #else
  1962. #define _ALS_TogglePlayerControllable
  1963. #endif
  1964. #define TogglePlayerControllable acc_TogglePlayerControllable
  1965.  
  1966. stock acc_TogglePlayerSpectating(playerid, toggle)
  1967. {
  1968. #if defined FILTERSCRIPT
  1969. return CallRemoteFunction("ac_TogglePlayerSpectating", "ii", playerid, toggle);
  1970. #else
  1971. return ac_TogglePlayerSpectating(playerid, toggle);
  1972. #endif
  1973. }
  1974.  
  1975. #if defined _ALS_TogglePlayerSpectating
  1976. #undef TogglePlayerSpectating
  1977. #else
  1978. #define _ALS_TogglePlayerSpectating
  1979. #endif
  1980. #define TogglePlayerSpectating acc_TogglePlayerSpectating
  1981.  
  1982. stock acc_SpawnPlayer(playerid)
  1983. {
  1984. #if defined FILTERSCRIPT
  1985. return CallRemoteFunction("ac_SpawnPlayer", "i", playerid);
  1986. #else
  1987. return ac_SpawnPlayer(playerid);
  1988. #endif
  1989. }
  1990.  
  1991. #if defined _ALS_SpawnPlayer
  1992. #undef SpawnPlayer
  1993. #else
  1994. #define _ALS_SpawnPlayer
  1995. #endif
  1996. #define SpawnPlayer acc_SpawnPlayer
  1997.  
  1998. stock acc_SetPlayerHealth(playerid, Float:health)
  1999. {
  2000. if(floatcmp(health, 1048576.0) >= 0) health = 1048575.0;
  2001. #if defined FILTERSCRIPT
  2002. return CallRemoteFunction("ac_SetPlayerHealth", "if", playerid, health);
  2003. #else
  2004. return ac_SetPlayerHealth(playerid, health);
  2005. #endif
  2006. }
  2007.  
  2008. #if defined _ALS_SetPlayerHealth
  2009. #undef SetPlayerHealth
  2010. #else
  2011. #define _ALS_SetPlayerHealth
  2012. #endif
  2013. #define SetPlayerHealth acc_SetPlayerHealth
  2014.  
  2015. stock acc_SetPlayerArmour(playerid, Float:armour)
  2016. {
  2017. if(floatcmp(armour, 1048576.0) >= 0) armour = 1048575.0;
  2018. #if defined FILTERSCRIPT
  2019. return CallRemoteFunction("ac_SetPlayerArmour", "if", playerid, armour);
  2020. #else
  2021. return ac_SetPlayerArmour(playerid, armour);
  2022. #endif
  2023. }
  2024.  
  2025. #if defined _ALS_SetPlayerArmour
  2026. #undef SetPlayerArmour
  2027. #else
  2028. #define _ALS_SetPlayerArmour
  2029. #endif
  2030. #define SetPlayerArmour acc_SetPlayerArmour
  2031.  
  2032. stock acc_GivePlayerWeapon(playerid, weaponid, ammo)
  2033. {
  2034. if(!IsPlayerConnected(playerid)) return 0;
  2035. #if defined FILTERSCRIPT
  2036. return CallRemoteFunction("ac_GivePlayerWeapon", "iid", playerid, weaponid, ammo);
  2037. #else
  2038. return ac_GivePlayerWeapon(playerid, weaponid, ammo);
  2039. #endif
  2040. }
  2041.  
  2042. #if defined _ALS_GivePlayerWeapon
  2043. #undef GivePlayerWeapon
  2044. #else
  2045. #define _ALS_GivePlayerWeapon
  2046. #endif
  2047. #define GivePlayerWeapon acc_GivePlayerWeapon
  2048.  
  2049. stock acc_SetPlayerAmmo(playerid, weaponslot, ammo)
  2050. {
  2051. if(!IsPlayerConnected(playerid)) return 0;
  2052. #if defined FILTERSCRIPT
  2053. return CallRemoteFunction("ac_SetPlayerAmmo", "iid", playerid, weaponslot, ammo);
  2054. #else
  2055. return ac_SetPlayerAmmo(playerid, weaponslot, ammo);
  2056. #endif
  2057. }
  2058.  
  2059. #if defined _ALS_SetPlayerAmmo
  2060. #undef SetPlayerAmmo
  2061. #else
  2062. #define _ALS_SetPlayerAmmo
  2063. #endif
  2064. #define SetPlayerAmmo acc_SetPlayerAmmo
  2065.  
  2066. stock acc_SetPlayerArmedWeapon(playerid, weaponid)
  2067. {
  2068. #if defined FILTERSCRIPT
  2069. return CallRemoteFunction("ac_SetPlayerArmedWeapon", "ii", playerid, weaponid);
  2070. #else
  2071. return ac_SetPlayerArmedWeapon(playerid, weaponid);
  2072. #endif
  2073. }
  2074.  
  2075. #if defined _ALS_SetPlayerArmedWeapon
  2076. #undef SetPlayerArmedWeapon
  2077. #else
  2078. #define _ALS_SetPlayerArmedWeapon
  2079. #endif
  2080. #define SetPlayerArmedWeapon acc_SetPlayerArmedWeapon
  2081.  
  2082. stock acc_ResetPlayerWeapons(playerid)
  2083. {
  2084. #if defined FILTERSCRIPT
  2085. return CallRemoteFunction("ac_ResetPlayerWeapons", "i", playerid);
  2086. #else
  2087. return ac_ResetPlayerWeapons(playerid);
  2088. #endif
  2089. }
  2090.  
  2091. #if defined _ALS_ResetPlayerWeapons
  2092. #undef ResetPlayerWeapons
  2093. #else
  2094. #define _ALS_ResetPlayerWeapons
  2095. #endif
  2096. #define ResetPlayerWeapons acc_ResetPlayerWeapons
  2097.  
  2098. stock acc_GivePlayerMoney(playerid, money)
  2099. {
  2100. #if defined FILTERSCRIPT
  2101. return CallRemoteFunction("ac_GivePlayerMoney", "id", playerid, money);
  2102. #else
  2103. return ac_GivePlayerMoney(playerid, money);
  2104. #endif
  2105. }
  2106.  
  2107. #if defined _ALS_GivePlayerMoney
  2108. #undef GivePlayerMoney
  2109. #else
  2110. #define _ALS_GivePlayerMoney
  2111. #endif
  2112. #define GivePlayerMoney acc_GivePlayerMoney
  2113.  
  2114. stock acc_ResetPlayerMoney(playerid)
  2115. {
  2116. #if defined FILTERSCRIPT
  2117. return CallRemoteFunction("ac_ResetPlayerMoney", "i", playerid);
  2118. #else
  2119. return ac_ResetPlayerMoney(playerid);
  2120. #endif
  2121. }
  2122.  
  2123. #if defined _ALS_ResetPlayerMoney
  2124. #undef ResetPlayerMoney
  2125. #else
  2126. #define _ALS_ResetPlayerMoney
  2127. #endif
  2128. #define ResetPlayerMoney acc_ResetPlayerMoney
  2129.  
  2130. stock acc_GetPlayerMoney(playerid)
  2131. {
  2132. if(!IsPlayerConnected(playerid)) return 0;
  2133. #if defined FILTERSCRIPT
  2134. return CallRemoteFunction("ac_AntiCheatGetMoney", "i", playerid);
  2135. #else
  2136. return ac_AntiCheatGetMoney(playerid);
  2137. #endif
  2138. }
  2139.  
  2140. #if defined _ALS_GetPlayerMoney
  2141. #undef GetPlayerMoney
  2142. #else
  2143. #define _ALS_GetPlayerMoney
  2144. #endif
  2145. #define GetPlayerMoney acc_GetPlayerMoney
  2146.  
  2147. stock acc_SetPlayerSpecialAction(playerid, actionid)
  2148. {
  2149. #if defined FILTERSCRIPT
  2150. return CallRemoteFunction("ac_SetPlayerSpecialAction", "ii", playerid, actionid);
  2151. #else
  2152. return ac_SetPlayerSpecialAction(playerid, actionid);
  2153. #endif
  2154. }
  2155.  
  2156. #if defined _ALS_SetPlayerSpecialAction
  2157. #undef SetPlayerSpecialAction
  2158. #else
  2159. #define _ALS_SetPlayerSpecialAction
  2160. #endif
  2161. #define SetPlayerSpecialAction acc_SetPlayerSpecialAction
  2162.  
  2163. stock acc_SetPlayerInterior(playerid, interiorid)
  2164. {
  2165. #if defined FILTERSCRIPT
  2166. return CallRemoteFunction("ac_SetPlayerInterior", "ii", playerid, interiorid);
  2167. #else
  2168. return ac_SetPlayerInterior(playerid, interiorid);
  2169. #endif
  2170. }
  2171.  
  2172. #if defined _ALS_SetPlayerInterior
  2173. #undef SetPlayerInterior
  2174. #else
  2175. #define _ALS_SetPlayerInterior
  2176. #endif
  2177. #define SetPlayerInterior acc_SetPlayerInterior
  2178.  
  2179. stock acc_SetPlayerPos(playerid, Float:x, Float:y, Float:z)
  2180. {
  2181. #if defined FILTERSCRIPT
  2182. return CallRemoteFunction("ac_SetPlayerPos", "ifff", playerid, x, y, z);
  2183. #else
  2184. return ac_SetPlayerPos(playerid, x, y, z);
  2185. #endif
  2186. }
  2187.  
  2188. #if defined _ALS_SetPlayerPos
  2189. #undef SetPlayerPos
  2190. #else
  2191. #define _ALS_SetPlayerPos
  2192. #endif
  2193. #define SetPlayerPos acc_SetPlayerPos
  2194.  
  2195. stock acc_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z)
  2196. {
  2197. #if defined FILTERSCRIPT
  2198. return CallRemoteFunction("ac_SetPlayerPosFindZ", "ifff", playerid, x, y, z);
  2199. #else
  2200. return ac_SetPlayerPosFindZ(playerid, x, y, z);
  2201. #endif
  2202. }
  2203.  
  2204. #if defined _ALS_SetPlayerPosFindZ
  2205. #undef SetPlayerPosFindZ
  2206. #else
  2207. #define _ALS_SetPlayerPosFindZ
  2208. #endif
  2209. #define SetPlayerPosFindZ acc_SetPlayerPosFindZ
  2210.  
  2211. stock acc_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z)
  2212. {
  2213. #if defined FILTERSCRIPT
  2214. return CallRemoteFunction("ac_SetPlayerVelocity", "ifff", playerid, X, Y, Z);
  2215. #else
  2216. return ac_SetPlayerVelocity(playerid, X, Y, Z);
  2217. #endif
  2218. }
  2219.  
  2220. #if defined _ALS_SetPlayerVelocity
  2221. #undef SetPlayerVelocity
  2222. #else
  2223. #define _ALS_SetPlayerVelocity
  2224. #endif
  2225. #define SetPlayerVelocity acc_SetPlayerVelocity
  2226.  
  2227. stock acc_PutPlayerInVehicle(playerid, vehicleid, seatid)
  2228. {
  2229. #if defined FILTERSCRIPT
  2230. return CallRemoteFunction("ac_PutPlayerInVehicle", "iii", playerid, vehicleid, seatid);
  2231. #else
  2232. return ac_PutPlayerInVehicle(playerid, vehicleid, seatid);
  2233. #endif
  2234. }
  2235.  
  2236. #if defined _ALS_PutPlayerInVehicle
  2237. #undef PutPlayerInVehicle
  2238. #else
  2239. #define _ALS_PutPlayerInVehicle
  2240. #endif
  2241. #define PutPlayerInVehicle acc_PutPlayerInVehicle
  2242.  
  2243. stock acc_RemovePlayerFromVehicle(playerid)
  2244. {
  2245. #if defined FILTERSCRIPT
  2246. return CallRemoteFunction("ac_RemovePlayerFromVehicle", "i", playerid);
  2247. #else
  2248. return ac_RemovePlayerFromVehicle(playerid);
  2249. #endif
  2250. }
  2251.  
  2252. #if defined _ALS_RemovePlayerFromVehicle
  2253. #undef RemovePlayerFromVehicle
  2254. #else
  2255. #define _ALS_RemovePlayerFromVehicle
  2256. #endif
  2257. #define RemovePlayerFromVehicle acc_RemovePlayerFromVehicle
  2258.  
  2259. stock acc_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z)
  2260. {
  2261. #if defined FILTERSCRIPT
  2262. return CallRemoteFunction("ac_SetVehiclePos", "ifff", vehicleid, x, y, z);
  2263. #else
  2264. return ac_SetVehiclePos(vehicleid, x, y, z);
  2265. #endif
  2266. }
  2267.  
  2268. #if defined _ALS_SetVehiclePos
  2269. #undef SetVehiclePos
  2270. #else
  2271. #define _ALS_SetVehiclePos
  2272. #endif
  2273. #define SetVehiclePos acc_SetVehiclePos
  2274.  
  2275. stock acc_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  2276. {
  2277. #if defined FILTERSCRIPT
  2278. return CallRemoteFunction("ac_SetVehicleVelocity", "ifff", vehicleid, X, Y, Z);
  2279. #else
  2280. return ac_SetVehicleVelocity(vehicleid, X, Y, Z);
  2281. #endif
  2282. }
  2283.  
  2284. #if defined _ALS_SetVehicleVelocity
  2285. #undef SetVehicleVelocity
  2286. #else
  2287. #define _ALS_SetVehicleVelocity
  2288. #endif
  2289. #define SetVehicleVelocity acc_SetVehicleVelocity
  2290.  
  2291. stock acc_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z)
  2292. {
  2293. #if defined FILTERSCRIPT
  2294. return CallRemoteFunction("ac_SetVehicleAngularVelocity", "ifff", vehicleid, X, Y, Z);
  2295. #else
  2296. return ac_SetVehicleAngularVelocity(vehicleid, X, Y, Z);
  2297. #endif
  2298. }
  2299.  
  2300. #if defined _ALS_SetVehicleAngularVelocity
  2301. #undef SetVehicleAngularVelocity
  2302. #else
  2303. #define _ALS_SetVehicleAngularVelocity
  2304. #endif
  2305. #define SetVehicleAngularVelocity acc_SetVehicleAngularVelocity
  2306.  
  2307. stock acc_LinkVehicleToInterior(vehicleid, interiorid)
  2308. {
  2309. #if defined FILTERSCRIPT
  2310. return CallRemoteFunction("ac_LinkVehicleToInterior", "ii", vehicleid, interiorid);
  2311. #else
  2312. return ac_LinkVehicleToInterior(vehicleid, interiorid);
  2313. #endif
  2314. }
  2315.  
  2316. #if defined _ALS_LinkVehicleToInterior
  2317. #undef LinkVehicleToInterior
  2318. #else
  2319. #define _ALS_LinkVehicleToInterior
  2320. #endif
  2321. #define LinkVehicleToInterior acc_LinkVehicleToInterior
  2322.  
  2323. stock acc_ChangeVehiclePaintjob(vehicleid, paintjobid)
  2324. {
  2325. #if defined FILTERSCRIPT
  2326. return CallRemoteFunction("ac_ChangeVehiclePaintjob", "ii", vehicleid, paintjobid);
  2327. #else
  2328. return ac_ChangeVehiclePaintjob(vehicleid, paintjobid);
  2329. #endif
  2330. }
  2331.  
  2332. #if defined _ALS_ChangeVehiclePaintjob
  2333. #undef ChangeVehiclePaintjob
  2334. #else
  2335. #define _ALS_ChangeVehiclePaintjob
  2336. #endif
  2337. #define ChangeVehiclePaintjob acc_ChangeVehiclePaintjob
  2338.  
  2339. stock acc_SetVehicleHealth(vehicleid, Float:health)
  2340. {
  2341. if(floatcmp(health, 0.0) == -1) health = 0.0;
  2342. #if defined FILTERSCRIPT
  2343. return CallRemoteFunction("ac_SetVehicleHealth", "if", vehicleid, health);
  2344. #else
  2345. return ac_SetVehicleHealth(vehicleid, health);
  2346. #endif
  2347. }
  2348.  
  2349. #if defined _ALS_SetVehicleHealth
  2350. #undef SetVehicleHealth
  2351. #else
  2352. #define _ALS_SetVehicleHealth
  2353. #endif
  2354. #define SetVehicleHealth acc_SetVehicleHealth
  2355.  
  2356. stock acc_RepairVehicle(vehicleid)
  2357. {
  2358. #if defined FILTERSCRIPT
  2359. return CallRemoteFunction("ac_RepairVehicle", "i", vehicleid);
  2360. #else
  2361. return ac_RepairVehicle(vehicleid);
  2362. #endif
  2363. }
  2364.  
  2365. #if defined _ALS_RepairVehicle
  2366. #undef RepairVehicle
  2367. #else
  2368. #define _ALS_RepairVehicle
  2369. #endif
  2370. #define RepairVehicle acc_RepairVehicle
  2371.  
  2372. stock acc_SetVehicleToRespawn(vehicleid)
  2373. {
  2374. if(GetVehicleModel(vehicleid) > 0)
  2375. {
  2376. #if defined FILTERSCRIPT
  2377. return CallRemoteFunction("ac_SetVehicleToRespawn", "i", vehicleid);
  2378. #else
  2379. return ac_SetVehicleToRespawn(vehicleid);
  2380. #endif
  2381. }
  2382. return 0;
  2383. }
  2384.  
  2385. #if defined _ALS_SetVehicleToRespawn
  2386. #undef SetVehicleToRespawn
  2387. #else
  2388. #define _ALS_SetVehicleToRespawn
  2389. #endif
  2390. #define SetVehicleToRespawn acc_SetVehicleToRespawn
  2391.  
  2392. stock EnableAntiCheat(acid, enable)
  2393. {
  2394. #if defined FILTERSCRIPT
  2395. return CallRemoteFunction("ac_EnableAntiCheat", "ii", acid, enable);
  2396. #else
  2397. return ac_EnableAntiCheat(acid, enable);
  2398. #endif
  2399. }
  2400.  
  2401. stock EnableAntiCheatForPlayer(playerid, acid, enable)
  2402. {
  2403. if(!IsPlayerConnected(playerid)) return 0;
  2404. #if defined FILTERSCRIPT
  2405. return CallRemoteFunction("ac_EnableAntiCheatForPlayer", "iii", playerid, acid, enable);
  2406. #else
  2407. return ac_EnableAntiCheatForPlayer(playerid, acid, enable);
  2408. #endif
  2409. }
  2410.  
  2411. stock IsAntiCheatEnabled(acid)
  2412. {
  2413. #if defined FILTERSCRIPT
  2414. return CallRemoteFunction("ac_IsAntiCheatEnabled", "i", acid);
  2415. #else
  2416. return ac_IsAntiCheatEnabled(acid);
  2417. #endif
  2418. }
  2419.  
  2420. stock IsAntiCheatEnabledForPlayer(playerid, acid)
  2421. {
  2422. if(!IsPlayerConnected(playerid)) return 0;
  2423. #if defined FILTERSCRIPT
  2424. return CallRemoteFunction("ac_IsAntiCheatEnabledForPlayer", "ii", playerid, acid);
  2425. #else
  2426. return ac_IsAntiCheatEnabledForPlayer(playerid, acid);
  2427. #endif
  2428. }
  2429.  
  2430. stock AntiCheatGetAnimationIndex(playerid)
  2431. {
  2432. if(!IsPlayerConnected(playerid)) return 0;
  2433. #if defined FILTERSCRIPT
  2434. return CallRemoteFunction("ac_AntiCheatGetAnimationIndex", "i", playerid);
  2435. #else
  2436. return ac_AntiCheatGetAnimationIndex(playerid);
  2437. #endif
  2438. }
  2439.  
  2440. stock AntiCheatGetDialog(playerid)
  2441. {
  2442. if(!IsPlayerConnected(playerid)) return 0;
  2443. #if defined FILTERSCRIPT
  2444. return CallRemoteFunction("ac_AntiCheatGetDialog", "i", playerid);
  2445. #else
  2446. return ac_AntiCheatGetDialog(playerid);
  2447. #endif
  2448. }
  2449.  
  2450. stock AntiCheatGetMoney(playerid)
  2451. {
  2452. if(!IsPlayerConnected(playerid)) return 0;
  2453. #if defined FILTERSCRIPT
  2454. return CallRemoteFunction("ac_AntiCheatGetMoney", "i", playerid);
  2455. #else
  2456. return ac_AntiCheatGetMoney(playerid);
  2457. #endif
  2458. }
  2459.  
  2460. stock AntiCheatGetClass(playerid)
  2461. {
  2462. if(!IsPlayerConnected(playerid)) return 0;
  2463. #if defined FILTERSCRIPT
  2464. return CallRemoteFunction("ac_AntiCheatGetClass", "i", playerid);
  2465. #else
  2466. return ac_AntiCheatGetClass(playerid);
  2467. #endif
  2468. }
  2469.  
  2470. stock AntiCheatGetEnterVehicle(playerid)
  2471. {
  2472. if(!IsPlayerConnected(playerid)) return 0;
  2473. #if defined FILTERSCRIPT
  2474. return CallRemoteFunction("ac_AntiCheatGetEnterVehicle", "i", playerid);
  2475. #else
  2476. return ac_AntiCheatGetEnterVehicle(playerid);
  2477. #endif
  2478. }
  2479.  
  2480. stock AntiCheatGetVehicleID(playerid)
  2481. {
  2482. if(!IsPlayerConnected(playerid)) return 0;
  2483. #if defined FILTERSCRIPT
  2484. return CallRemoteFunction("ac_AntiCheatGetVehicleID", "i", playerid);
  2485. #else
  2486. return ac_AntiCheatGetVehicleID(playerid);
  2487. #endif
  2488. }
  2489.  
  2490. stock AntiCheatGetWeapon(playerid)
  2491. {
  2492. if(!IsPlayerConnected(playerid)) return 0;
  2493. #if defined FILTERSCRIPT
  2494. return CallRemoteFunction("ac_AntiCheatGetWeapon", "i", playerid);
  2495. #else
  2496. return ac_AntiCheatGetWeapon(playerid);
  2497. #endif
  2498. }
  2499.  
  2500. stock AntiCheatGetVehicleSeat(playerid)
  2501. {
  2502. if(!IsPlayerConnected(playerid)) return 0;
  2503. #if defined FILTERSCRIPT
  2504. return CallRemoteFunction("ac_AntiCheatGetVehicleSeat", "i", playerid);
  2505. #else
  2506. return ac_AntiCheatGetVehicleSeat(playerid);
  2507. #endif
  2508. }
  2509.  
  2510. stock AntiCheatGetSpecialAction(playerid)
  2511. {
  2512. if(!IsPlayerConnected(playerid)) return 0;
  2513. #if defined FILTERSCRIPT
  2514. return CallRemoteFunction("ac_AntiCheatGetSpecialAction", "i", playerid);
  2515. #else
  2516. return ac_AntiCheatGetSpecialAction(playerid);
  2517. #endif
  2518. }
  2519.  
  2520. stock AntiCheatGetLastSpecialAction(playerid)
  2521. {
  2522. if(!IsPlayerConnected(playerid)) return 0;
  2523. #if defined FILTERSCRIPT
  2524. return CallRemoteFunction("ac_AntiCheatGetLastSpecialActio", "i", playerid);
  2525. #else
  2526. return ac_AntiCheatGetLastSpecialActio(playerid);
  2527. #endif
  2528. }
  2529.  
  2530. stock AntiCheatGetLastShotWeapon(playerid)
  2531. {
  2532. if(!IsPlayerConnected(playerid)) return 0;
  2533. #if defined FILTERSCRIPT
  2534. return CallRemoteFunction("ac_AntiCheatGetLastShotWeapon", "i", playerid);
  2535. #else
  2536. return ac_AntiCheatGetLastShotWeapon(playerid);
  2537. #endif
  2538. }
  2539.  
  2540. stock AntiCheatGetLastPickup(playerid)
  2541. {
  2542. if(!IsPlayerConnected(playerid)) return 0;
  2543. #if defined FILTERSCRIPT
  2544. return CallRemoteFunction("ac_AntiCheatGetLastPickup", "i", playerid);
  2545. #else
  2546. return ac_AntiCheatGetLastPickup(playerid);
  2547. #endif
  2548. }
  2549.  
  2550. stock AntiCheatGetLastUpdateTime(playerid)
  2551. {
  2552. if(!IsPlayerConnected(playerid)) return 0;
  2553. #if defined FILTERSCRIPT
  2554. return CallRemoteFunction("ac_AntiCheatGetLastUpdateTime", "i", playerid);
  2555. #else
  2556. return ac_AntiCheatGetLastUpdateTime(playerid);
  2557. #endif
  2558. }
  2559.  
  2560. stock AntiCheatGetLastReloadTime(playerid)
  2561. {
  2562. if(!IsPlayerConnected(playerid)) return 0;
  2563. #if defined FILTERSCRIPT
  2564. return CallRemoteFunction("ac_AntiCheatGetLastReloadTime", "i", playerid);
  2565. #else
  2566. return ac_AntiCheatGetLastReloadTime(playerid);
  2567. #endif
  2568. }
  2569.  
  2570. stock AntiCheatGetLastEnteredVehTime(playerid)
  2571. {
  2572. if(!IsPlayerConnected(playerid)) return 0;
  2573. #if defined FILTERSCRIPT
  2574. return CallRemoteFunction("ac_AntiCheatGetLastEnteredVehTi", "i", playerid);
  2575. #else
  2576. return ac_AntiCheatGetLastEnteredVehTi(playerid);
  2577. #endif
  2578. }
  2579.  
  2580. stock AntiCheatGetLastShotTime(playerid)
  2581. {
  2582. if(!IsPlayerConnected(playerid)) return 0;
  2583. #if defined FILTERSCRIPT
  2584. return CallRemoteFunction("ac_AntiCheatGetLastShotTime", "i", playerid);
  2585. #else
  2586. return ac_AntiCheatGetLastShotTime(playerid);
  2587. #endif
  2588. }
  2589.  
  2590. stock AntiCheatGetLastSpawnTime(playerid)
  2591. {
  2592. if(!IsPlayerConnected(playerid)) return 0;
  2593. #if defined FILTERSCRIPT
  2594. return CallRemoteFunction("ac_AntiCheatGetLastSpawnTime", "i", playerid);
  2595. #else
  2596. return ac_AntiCheatGetLastSpawnTime(playerid);
  2597. #endif
  2598. }
  2599.  
  2600. stock AntiCheatIntEnterExitsIsEnabled(playerid)
  2601. {
  2602. if(!IsPlayerConnected(playerid)) return 0;
  2603. #if defined FILTERSCRIPT
  2604. return CallRemoteFunction("ac_AntiCheatIntEnterExitsIsEnab", "i", playerid);
  2605. #else
  2606. return ac_AntiCheatIntEnterExitsIsEnab(playerid);
  2607. #endif
  2608. }
  2609.  
  2610. stock AntiCheatStuntBonusIsEnabled(playerid)
  2611. {
  2612. if(!IsPlayerConnected(playerid)) return 0;
  2613. #if defined FILTERSCRIPT
  2614. return CallRemoteFunction("ac_AntiCheatStuntBonusIsEnabled", "i", playerid);
  2615. #else
  2616. return ac_AntiCheatStuntBonusIsEnabled(playerid);
  2617. #endif
  2618. }
  2619.  
  2620. stock AntiCheatIsInModShop(playerid)
  2621. {
  2622. if(!IsPlayerConnected(playerid)) return 0;
  2623. #if defined FILTERSCRIPT
  2624. return CallRemoteFunction("ac_AntiCheatIsInModShop", "i", playerid);
  2625. #else
  2626. return ac_AntiCheatIsInModShop(playerid);
  2627. #endif
  2628. }
  2629.  
  2630. stock AntiCheatIsFrozen(playerid)
  2631. {
  2632. if(!IsPlayerConnected(playerid)) return 0;
  2633. #if defined FILTERSCRIPT
  2634. return CallRemoteFunction("ac_AntiCheatIsFrozen", "i", playerid);
  2635. #else
  2636. return ac_AntiCheatIsFrozen(playerid);
  2637. #endif
  2638. }
  2639.  
  2640. stock AntiCheatIsDead(playerid)
  2641. {
  2642. if(!IsPlayerConnected(playerid)) return 0;
  2643. #if defined FILTERSCRIPT
  2644. return CallRemoteFunction("ac_AntiCheatIsDead", "i", playerid);
  2645. #else
  2646. return ac_AntiCheatIsDead(playerid);
  2647. #endif
  2648. }
  2649.  
  2650. stock AntiCheatIsConnected(playerid)
  2651. {
  2652. if(!IsPlayerConnected(playerid)) return 0;
  2653. #if defined FILTERSCRIPT
  2654. return CallRemoteFunction("ac_AntiCheatIsConnected", "i", playerid);
  2655. #else
  2656. return ac_AntiCheatIsConnected(playerid);
  2657. #endif
  2658. }
  2659.  
  2660. #if defined _inc_y_hooks || defined _INC_y_hooks
  2661. DEFINE_HOOK_REPLACEMENT(SirenState, Siren);
  2662. DEFINE_HOOK_REPLACEMENT(Vehicle, Veh);
  2663. #endif
  2664.  
  2665. #if defined FILTERSCRIPT
  2666.  
  2667. static fs_AntiCheatGetNextDialog(playerid)
  2668. {
  2669. if(!IsPlayerConnected(playerid)) return 0;
  2670. return CallRemoteFunction("ac_AntiCheatGetNextDialog", "i", playerid);
  2671. }
  2672.  
  2673. static fs_AntiCheatSetDialog(playerid, dialogid)
  2674. {
  2675. if(!IsPlayerConnected(playerid)) return 0;
  2676. return CallRemoteFunction("ac_ShowPlayerDialog", "id", playerid, dialogid);
  2677. }
  2678.  
  2679. static fs_AntiCheatSetNextDialog(playerid, dialogid)
  2680. {
  2681. if(!IsPlayerConnected(playerid)) return 0;
  2682. return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
  2683. }
  2684.  
  2685. #else
  2686.  
  2687. #if defined _inc_y_hooks || defined _INC_y_hooks
  2688. hook OnGameModeInit()
  2689. #else
  2690. public OnGameModeInit()
  2691. #endif
  2692. {
  2693. if(!ac_LoadCfg()) printf(CFG_OPENING_ERROR, AC_CONFIG_FILE);
  2694. if(ac_ACAllow[42])
  2695. {
  2696. #if !AC_USE_QUERY
  2697. ac_QueryEnable = !!GetConsoleVarAsBool("query");
  2698. SendRconCommand("query 0");
  2699. #endif
  2700. #undef AC_USE_QUERY
  2701. ac_RconEnable = !!GetConsoleVarAsBool("rcon");
  2702. SendRconCommand("rcon 0");
  2703. }
  2704. #if AC_MAX_CONNECTS_FROM_IP > 1
  2705. ac_ACAllow[37] = false;
  2706. #endif
  2707. ac_LagCompMode = !!GetConsoleVarAsInt("lagcompmode");
  2708. print(" ");
  2709. print("--------------------------------------");
  2710. print(LOADED_MSG_1);
  2711. printf(LOADED_MSG_2, NEX_AC_VERSION);
  2712. print(LOADED_MSG_3);
  2713. print("--------------------------------------\n");
  2714. new ac_a = 1;
  2715. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2716. && defined ac_OnGameModeInit
  2717. ac_a = ac_OnGameModeInit();
  2718. #endif
  2719. static ac_strtmp[10];
  2720. GetConsoleVarAsString("version", ac_strtmp, sizeof ac_strtmp);
  2721. if(strcmp(ac_strtmp, AC_SERVER_VERSION)) print(VERSION_WARNING);
  2722. #undef AC_SERVER_VERSION
  2723. return ac_a;
  2724. }
  2725.  
  2726. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2727. #if defined _ALS_OnGameModeInit
  2728. #undef OnGameModeInit
  2729. #else
  2730. #define _ALS_OnGameModeInit
  2731. #endif
  2732. #define OnGameModeInit ac_OnGameModeInit
  2733. #if defined ac_OnGameModeInit
  2734. forward ac_OnGameModeInit();
  2735. #endif
  2736. #endif
  2737.  
  2738. #if defined _inc_y_hooks || defined _INC_y_hooks
  2739. hook OnGameModeExit()
  2740. #else
  2741. public OnGameModeExit()
  2742. #endif
  2743. {
  2744. new ac_a = 1;
  2745. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2746. && defined ac_OnGameModeExit
  2747. ac_a = ac_OnGameModeExit();
  2748. #endif
  2749. print(" ");
  2750. print("--------------------------------------");
  2751. print(STATS_STRING_1);
  2752. print(STATS_STRING_2);
  2753. printf(STATS_STRING_3, ac_sInfo[0]);
  2754. printf(STATS_STRING_4, ac_sInfo[1]);
  2755. printf(STATS_STRING_5, ac_sInfo[2]);
  2756. printf(STATS_STRING_6, ac_sInfo[3]);
  2757. printf(STATS_STRING_7, ac_sInfo[4]);
  2758. printf(STATS_STRING_8, ac_sInfo[5]);
  2759. print("--------------------------------------\n");
  2760. return ac_a;
  2761. }
  2762.  
  2763. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2764. #if defined _ALS_OnGameModeExit
  2765. #undef OnGameModeExit
  2766. #else
  2767. #define _ALS_OnGameModeExit
  2768. #endif
  2769. #define OnGameModeExit ac_OnGameModeExit
  2770. #if defined ac_OnGameModeExit
  2771. forward ac_OnGameModeExit();
  2772. #endif
  2773. #endif
  2774.  
  2775. #if defined _inc_y_hooks || defined _INC_y_hooks
  2776. hook OnPlayerConnect(playerid)
  2777. #else
  2778. public OnPlayerConnect(playerid)
  2779. #endif
  2780. {
  2781. GetPlayerIp(playerid, ACInfo[playerid][acIp], 16);
  2782. if(IsPlayerNPC(playerid))
  2783. {
  2784. if(ac_ACAllow[36] && strcmp(ACInfo[playerid][acIp], "127.0.0.1")) ac_KickWithCode(playerid, "", 0, 36);
  2785. }
  2786. else
  2787. {
  2788. if(ac_ACAllow[48] && ACInfo[playerid][acOnline]) ac_KickWithCode(playerid, "", 0, 48, 1);
  2789. if(ac_ACAllow[41])
  2790. {
  2791. new ac_version[8];
  2792. GetPlayerVersion(playerid, ac_version, sizeof ac_version);
  2793. if(!strcmp(ac_version, "unknown", true))
  2794. {
  2795. #if defined DEBUG
  2796. printf(DEBUG_CODE_2, playerid, ac_version);
  2797. #endif
  2798. ac_KickWithCode(playerid, "", 0, 41);
  2799. }
  2800. }
  2801. new ac_i = AC_MAX_CONNECTS_FROM_IP;
  2802. if(ac_ACAllow[40])
  2803. {
  2804. #if defined foreach
  2805. foreach(new ac_f : Player)
  2806. {
  2807. if(!IsPlayerNPC(ac_f) && ac_f != playerid && !strcmp(ACInfo[playerid][acIp], ACInfo[ac_f][acIp], false))
  2808. #else
  2809. for(new ac_f = GetPlayerPoolSize(); ac_f >= 0; --ac_f)
  2810. {
  2811. if(IsPlayerConnected(ac_f) && !IsPlayerNPC(ac_f) && ac_f != playerid &&
  2812. !strcmp(ACInfo[playerid][acIp], ACInfo[ac_f][acIp], false))
  2813. #endif
  2814. {
  2815. ac_i--;
  2816. if(ac_i == 0)
  2817. {
  2818. #if defined DEBUG
  2819. printf(DEBUG_CODE_3, playerid, AC_MAX_CONNECTS_FROM_IP);
  2820. #endif
  2821. #undef AC_MAX_CONNECTS_FROM_IP
  2822. ac_KickWithCode(playerid, "", 0, 40);
  2823. break;
  2824. }
  2825. }
  2826. }
  2827. }
  2828. ACInfo[playerid][acSpec] =
  2829. ACInfo[playerid][acDeathRes] = false;
  2830. ACInfo[playerid][acDead] = true;
  2831. ACInfo[playerid][acIntEnterExits] = ac_IntEnterExits;
  2832. ACInfo[playerid][acStuntBonus] = ac_StuntBonus;
  2833. ACInfo[playerid][acCheatCount][0] =
  2834. ACInfo[playerid][acLastWeapon] =
  2835. ACInfo[playerid][acSpawnRes] =
  2836. ACInfo[playerid][acLogged] =
  2837. ACInfo[playerid][acKicked] =
  2838. ACInfo[playerid][acMoney] =
  2839. ACInfo[playerid][acInt] = 0;
  2840. ACInfo[playerid][acSet][12] =
  2841. ACInfo[playerid][acSet][10] =
  2842. ACInfo[playerid][acSet][0] =
  2843. ACInfo[playerid][acNextDialog] =
  2844. ACInfo[playerid][acDialog] = -1;
  2845. ACInfo[playerid][acAnim] = -2;
  2846. for(ac_i = 12; ac_i >= 0; --ac_i)
  2847. {
  2848. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  2849. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  2850. }
  2851. for(ac_i = 27; ac_i >= 0; --ac_i) ACInfo[playerid][acFloodCount][ac_i] = 0;
  2852. ACInfo[playerid][acDropJpX] = ACInfo[playerid][acDropJpY] = ACInfo[playerid][acDropJpZ] = 20000.0;
  2853. memcpy(ACInfo[playerid][acACAllow], ac_ACAllow, 0, sizeof(ac_ACAllow) * 4, sizeof ac_ACAllow);
  2854. #if defined SetPlayerTimerEx_
  2855. ACInfo[playerid][acTimerID] = SetPlayerTimerEx_(playerid, "ac_Timer", 0, 1000, 1, "i", playerid);
  2856. #else
  2857. ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
  2858. #endif
  2859. }
  2860. ACInfo[playerid][acOnline] = true;
  2861. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2862. && defined ac_OnPlayerConnect
  2863. return ac_OnPlayerConnect(playerid);
  2864. #else
  2865. return 1;
  2866. #endif
  2867. }
  2868.  
  2869. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2870. #if defined _ALS_OnPlayerConnect
  2871. #undef OnPlayerConnect
  2872. #else
  2873. #define _ALS_OnPlayerConnect
  2874. #endif
  2875. #define OnPlayerConnect ac_OnPlayerConnect
  2876. #if defined ac_OnPlayerConnect
  2877. forward ac_OnPlayerConnect(playerid);
  2878. #endif
  2879. #endif
  2880.  
  2881. #if defined _inc_y_hooks || defined _INC_y_hooks
  2882. hook OnPlayerDisconnect(playerid, reason)
  2883. #else
  2884. public OnPlayerDisconnect(playerid, reason)
  2885. #endif
  2886. {
  2887. ACInfo[playerid][acOnline] = false;
  2888. if(!IsPlayerNPC(playerid))
  2889. {
  2890. #if defined KillPlayerTimer
  2891. KillPlayerTimer(ACInfo[playerid][acTimerID]);
  2892. #else
  2893. KillTimer(ACInfo[playerid][acTimerID]);
  2894. #endif
  2895. if(ACInfo[playerid][acACAllow][37]) BlockIpAddress(ACInfo[playerid][acIp],
  2896. (AC_MIN_TIME_RECONNECT * 1000) - (reason > 0 ? 0 : GetConsoleVarAsInt("playertimeout")));
  2897. #undef AC_MIN_TIME_RECONNECT
  2898. }
  2899. #if defined KillPlayerTimer
  2900. KillPlayerTimer(ACInfo[playerid][acKickTimerID]);
  2901. #else
  2902. KillTimer(ACInfo[playerid][acKickTimerID]);
  2903. #endif
  2904. new ac_veh = ACInfo[playerid][acLastVeh];
  2905. if(ac_veh > 0 && ACVehInfo[ac_veh][acDriver] == playerid)
  2906. {
  2907. ACVehInfo[ac_veh][acDriver] = INVALID_PLAYER_ID;
  2908. if(ACInfo[playerid][acKicked] == 2)
  2909. {
  2910. LinkVehicleToInterior(ac_veh, ACVehInfo[ac_veh][acInt]);
  2911. SetVehicleZAngle(ac_veh, ACVehInfo[ac_veh][acZAngle]);
  2912. SetVehicleHealth(ac_veh, ACVehInfo[ac_veh][acHealth]);
  2913. ChangeVehiclePaintjob(ac_veh, ACVehInfo[ac_veh][acPaintJob]);
  2914. }
  2915. }
  2916. ac_veh = ACInfo[playerid][acVeh];
  2917. if(ac_veh > 0 && ACVehInfo[ac_veh][acDriver] == playerid)
  2918. {
  2919. ACVehInfo[ac_veh][acDriver] = INVALID_PLAYER_ID;
  2920. if(ACInfo[playerid][acKicked] == 2)
  2921. {
  2922. LinkVehicleToInterior(ac_veh, ACVehInfo[ac_veh][acInt]);
  2923. SetVehicleZAngle(ac_veh, ACVehInfo[ac_veh][acZAngle]);
  2924. SetVehiclePos(ac_veh, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  2925. SetVehicleHealth(ac_veh, ACVehInfo[ac_veh][acHealth]);
  2926. ChangeVehiclePaintjob(ac_veh, ACVehInfo[ac_veh][acPaintJob]);
  2927. }
  2928. }
  2929. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  2930. && defined ac_OnPlayerDisconnect
  2931. return ac_OnPlayerDisconnect(playerid, reason);
  2932. #else
  2933. return 1;
  2934. #endif
  2935. }
  2936.  
  2937. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  2938. #if defined _ALS_OnPlayerDisconnect
  2939. #undef OnPlayerDisconnect
  2940. #else
  2941. #define _ALS_OnPlayerDisconnect
  2942. #endif
  2943. #define OnPlayerDisconnect ac_OnPlayerDisconnect
  2944. #if defined ac_OnPlayerDisconnect
  2945. forward ac_OnPlayerDisconnect(playerid, reason);
  2946. #endif
  2947. #endif
  2948.  
  2949. #if defined _inc_y_hooks || defined _INC_y_hooks
  2950. hook OnPlayerSpawn(playerid)
  2951. #else
  2952. public OnPlayerSpawn(playerid)
  2953. #endif
  2954. {
  2955. if(ACInfo[playerid][acKicked]) return 0;
  2956. if(!IsPlayerNPC(playerid))
  2957. {
  2958. new ac_i;
  2959. if(ACInfo[playerid][acSpec] && ACInfo[playerid][acSet][7] < 2)
  2960. {
  2961. ACInfo[playerid][acSet][3] =
  2962. ACInfo[playerid][acSet][4] =
  2963. ACInfo[playerid][acSet][5] =
  2964. ACInfo[playerid][acSet][8] =
  2965. ACInfo[playerid][acSet][9] = -1;
  2966. ACInfo[playerid][acSpec] = false;
  2967. }
  2968. else
  2969. {
  2970. if(ACInfo[playerid][acACAllow][27] &&
  2971. (ACInfo[playerid][acSpawnRes] < 1 || (ac_i = GetTickCount()) < ACInfo[playerid][acSpawnTime] + 1000))
  2972. {
  2973. #if defined DEBUG
  2974. printf("[Nex-AC debug] Spawn res: %d, Respawn time: %d",
  2975. ACInfo[playerid][acSpawnRes], ac_i - ACInfo[playerid][acSpawnTime]);
  2976. #endif
  2977. ac_KickWithCode(playerid, "", 0, 27);
  2978. #if defined OnCheatDetected
  2979. ACInfo[playerid][acSpawnRes] = 1;
  2980. #endif
  2981. }
  2982. ACInfo[playerid][acSpawnRes]--;
  2983. if(!(1 <= ACInfo[playerid][acSet][7] <= 2))
  2984. {
  2985. for(ac_i = 11; ac_i >= 0; --ac_i) ACInfo[playerid][acSet][ac_i] = -1;
  2986. SetPlayerHealth(playerid, 100.0);
  2987. SetPlayerArmour(playerid, 0.0);
  2988. SetPlayerInterior(playerid, 0);
  2989. ACInfo[playerid][acHealth] = 100;
  2990. ACInfo[playerid][acArmour] =
  2991. ACInfo[playerid][acInt] = 0;
  2992. }
  2993. }
  2994. if(!(1 <= ACInfo[playerid][acSet][7] <= 2))
  2995. {
  2996. for(ac_i = 12; ac_i >= 0; --ac_i)
  2997. {
  2998. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  2999. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  3000. }
  3001. ACInfo[playerid][acNextSpecAct] = -1;
  3002. ACInfo[playerid][acTpToZ] = false;
  3003. ACInfo[playerid][acFreeze] = true;
  3004. }
  3005. for(ac_i = 12; ac_i >= 0; --ac_i) ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acAmmo][ac_i] = 0;
  3006. ACInfo[playerid][acParachute] =
  3007. ACInfo[playerid][acModShop] =
  3008. ACInfo[playerid][acDead] = false;
  3009. ACInfo[playerid][acLastPickup] =
  3010. ACInfo[playerid][acSet][7] =
  3011. ACInfo[playerid][acSeat] = -1;
  3012. ACInfo[playerid][acCheatCount][14] =
  3013. ACInfo[playerid][acCheatCount][9] =
  3014. ACInfo[playerid][acLastSpecAct] =
  3015. ACInfo[playerid][acLastShot] =
  3016. ACInfo[playerid][acLastVeh] =
  3017. ACInfo[playerid][acSpecAct] =
  3018. ACInfo[playerid][acDmgRes] =
  3019. ACInfo[playerid][acVeh] = 0;
  3020. ACInfo[playerid][acLogged] = 2;
  3021. ACInfo[playerid][acSpeed] = 0.0;
  3022. if(ACInfo[playerid][acSpawnWeapon1] != -1)
  3023. {
  3024. ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon1]];
  3025. ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon1];
  3026. ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo1];
  3027. }
  3028. if(ACInfo[playerid][acSpawnWeapon2] != -1)
  3029. {
  3030. ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon2]];
  3031. ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon2];
  3032. ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo2];
  3033. }
  3034. if(ACInfo[playerid][acSpawnWeapon3] != -1)
  3035. {
  3036. ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon3]];
  3037. ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon3];
  3038. ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo3];
  3039. }
  3040. }
  3041. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3042. && defined ac_OnPlayerSpawn
  3043. return ac_OnPlayerSpawn(playerid);
  3044. #else
  3045. return 1;
  3046. #endif
  3047. }
  3048.  
  3049. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3050. #if defined _ALS_OnPlayerSpawn
  3051. #undef OnPlayerSpawn
  3052. #else
  3053. #define _ALS_OnPlayerSpawn
  3054. #endif
  3055. #define OnPlayerSpawn ac_OnPlayerSpawn
  3056. #if defined ac_OnPlayerSpawn
  3057. forward ac_OnPlayerSpawn(playerid);
  3058. #endif
  3059. #endif
  3060.  
  3061. #if defined _inc_y_hooks || defined _INC_y_hooks
  3062. hook OnPlayerDeath(playerid, killerid, reason)
  3063. #else
  3064. public OnPlayerDeath(playerid, killerid, reason)
  3065. #endif
  3066. {
  3067. if(ACInfo[playerid][acKicked]) return 0;
  3068. if(ACInfo[playerid][acACAllow][28] &&
  3069. (ACInfo[playerid][acDead] || !ACInfo[playerid][acDeathRes] &&
  3070. reason != 255 && (reason != WEAPON_COLLISION || killerid != INVALID_PLAYER_ID)))
  3071. {
  3072. #if defined DEBUG
  3073. printf("[Nex-AC debug] Is dead: %d, Death res: %d, killerid: %d, reason: %d",
  3074. ACInfo[playerid][acDead], ACInfo[playerid][acDeathRes], killerid, reason);
  3075. #endif
  3076. ac_KickWithCode(playerid, "", 0, 28);
  3077. }
  3078. ACInfo[playerid][acDead] = true;
  3079. ACInfo[playerid][acSpawnRes] = 1;
  3080. ACInfo[playerid][acDeathRes] = false;
  3081. ACInfo[playerid][acSpawnTime] = GetTickCount();
  3082. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3083. && defined ac_OnPlayerDeath
  3084. return ac_OnPlayerDeath(playerid, killerid, reason);
  3085. #else
  3086. return 1;
  3087. #endif
  3088. }
  3089.  
  3090. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3091. #if defined _ALS_OnPlayerDeath
  3092. #undef OnPlayerDeath
  3093. #else
  3094. #define _ALS_OnPlayerDeath
  3095. #endif
  3096. #define OnPlayerDeath ac_OnPlayerDeath
  3097. #if defined ac_OnPlayerDeath
  3098. forward ac_OnPlayerDeath(playerid, killerid, reason);
  3099. #endif
  3100. #endif
  3101.  
  3102. #if defined _inc_y_hooks || defined _INC_y_hooks
  3103. hook OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  3104. #else
  3105. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  3106. #endif
  3107. {
  3108. if(ACInfo[playerid][acKicked]) return 1;
  3109. ACInfo[playerid][acDeathRes] = true;
  3110. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3111. && defined ac_OnPlayerTakeDamage
  3112. return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid, bodypart);
  3113. #else
  3114. return 0;
  3115. #endif
  3116. }
  3117.  
  3118. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3119. #if defined _ALS_OnPlayerTakeDamage
  3120. #undef OnPlayerTakeDamage
  3121. #else
  3122. #define _ALS_OnPlayerTakeDamage
  3123. #endif
  3124. #define OnPlayerTakeDamage ac_OnPlayerTakeDamage
  3125. #if defined ac_OnPlayerTakeDamage
  3126. forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  3127. #endif
  3128. #endif
  3129.  
  3130. #if defined _inc_y_hooks || defined _INC_y_hooks
  3131. hook OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  3132. #else
  3133. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  3134. #endif
  3135. {
  3136. if(ACInfo[playerid][acKicked]) return 1;
  3137. if(ACInfo[playerid][acACAllow][47] && !(3 <= bodypart <= 9))
  3138. {
  3139. #if defined DEBUG
  3140. printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d, bodypart: %d", damagedid, amount, weaponid, bodypart);
  3141. #endif
  3142. ac_KickWithCode(playerid, "", 0, 47, 3);
  3143. return 1;
  3144. }
  3145. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3146. && defined ac_OnPlayerGiveDamage
  3147. return ac_OnPlayerGiveDamage(playerid, damagedid, amount, weaponid, bodypart);
  3148. #else
  3149. return 0;
  3150. #endif
  3151. }
  3152.  
  3153. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3154. #if defined _ALS_OnPlayerGiveDamage
  3155. #undef OnPlayerGiveDamage
  3156. #else
  3157. #define _ALS_OnPlayerGiveDamage
  3158. #endif
  3159. #define OnPlayerGiveDamage ac_OnPlayerGiveDamage
  3160. #if defined ac_OnPlayerGiveDamage
  3161. forward ac_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart);
  3162. #endif
  3163. #endif
  3164.  
  3165. #endif
  3166.  
  3167. #if defined FILTERSCRIPT
  3168.  
  3169. #if defined _inc_y_hooks || defined _INC_y_hooks
  3170. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3171. #else
  3172. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3173. #endif
  3174. {
  3175. if(dialogid != AntiCheatGetDialog(playerid))
  3176. {
  3177. new ac_nd = fs_AntiCheatGetNextDialog(playerid);
  3178. if(dialogid == ac_nd) fs_AntiCheatSetDialog(playerid, ac_nd);
  3179. }
  3180. fs_AntiCheatSetNextDialog(playerid, -1);
  3181. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3182. && defined ac_fs_OnDialogResponse
  3183. return ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  3184. #else
  3185. return 0;
  3186. #endif
  3187. }
  3188.  
  3189. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3190. #if defined _ALS_OnDialogResponse
  3191. #undef OnDialogResponse
  3192. #else
  3193. #define _ALS_OnDialogResponse
  3194. #endif
  3195. #define OnDialogResponse ac_fs_OnDialogResponse
  3196. #if defined ac_fs_OnDialogResponse
  3197. forward ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  3198. #endif
  3199. #endif
  3200.  
  3201. #else
  3202.  
  3203. #if defined _inc_y_hooks || defined _INC_y_hooks
  3204. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3205. #else
  3206. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3207. #endif
  3208. {
  3209. if(ACInfo[playerid][acKicked]) return 1;
  3210. new ac_i = GetTickCount();
  3211. if(ACInfo[playerid][acACAllow][49])
  3212. {
  3213. if(ac_i < ACInfo[playerid][acCall][0] + ac_Mtfc[0][0]) ac_FloodDetect(playerid, 0);
  3214. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  3215. else ACInfo[playerid][acFloodCount][0] = ACInfo[playerid][acFloodCount][27] = 0;
  3216. }
  3217. if(ACInfo[playerid][acACAllow][39] && dialogid != ACInfo[playerid][acDialog])
  3218. {
  3219. #if defined DEBUG
  3220. printf("[Nex-AC debug] AC dialog: %d, dialogid: %d", ACInfo[playerid][acDialog], dialogid);
  3221. #endif
  3222. #if defined OnCheatDetected
  3223. ac_KickWithCode(playerid, "", 0, 39);
  3224. #else
  3225. ac_KickWithCode(playerid, "", 0, 39);
  3226. return 1;
  3227. #endif
  3228. }
  3229. ACInfo[playerid][acDialog] = -1;
  3230. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][0] = ac_i;
  3231. if(ACInfo[playerid][acACAllow][45])
  3232. {
  3233. for(ac_i = strlen(inputtext) - 1; ac_i >= 0; --ac_i)
  3234. {
  3235. if(inputtext[ac_i] == '%') strdel(inputtext, ac_i, ac_i + 1);
  3236. }
  3237. }
  3238. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3239. && defined ac_OnDialogResponse
  3240. return ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  3241. #else
  3242. return 0;
  3243. #endif
  3244. }
  3245.  
  3246. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3247. #if defined _ALS_OnDialogResponse
  3248. #undef OnDialogResponse
  3249. #else
  3250. #define _ALS_OnDialogResponse
  3251. #endif
  3252. #define OnDialogResponse ac_OnDialogResponse
  3253. #if defined ac_OnDialogResponse
  3254. forward ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  3255. #endif
  3256. #endif
  3257.  
  3258. #if defined _inc_y_hooks || defined _INC_y_hooks
  3259. hook OnEnterExitModShop(playerid, enterexit, interiorid)
  3260. #else
  3261. public OnEnterExitModShop(playerid, enterexit, interiorid)
  3262. #endif
  3263. {
  3264. if(ACInfo[playerid][acKicked]) return 0;
  3265. #if !AC_USE_TUNING_GARAGES && !defined OnCheatDetected
  3266. if(ACInfo[playerid][acACAllow][23]) return ac_KickWithCode(playerid, "", 0, 23, 1);
  3267. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3268. && defined ac_OnEnterExitModShop
  3269. return ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  3270. #else
  3271. return 1;
  3272. #endif
  3273. #else
  3274. #if !AC_USE_TUNING_GARAGES
  3275. if(ACInfo[playerid][acACAllow][23]) ac_KickWithCode(playerid, "", 0, 23, 1);
  3276. #endif
  3277. new ac_gtc = GetTickCount();
  3278. if(ACInfo[playerid][acACAllow][49])
  3279. {
  3280. if(ac_gtc < ACInfo[playerid][acCall][1] + ac_Mtfc[1][0]) ac_FloodDetect(playerid, 1);
  3281. else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  3282. else ACInfo[playerid][acFloodCount][1] = ACInfo[playerid][acFloodCount][27] = 0;
  3283. }
  3284. ACInfo[playerid][acModShop] = !!enterexit;
  3285. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][1] = ac_gtc;
  3286. ACInfo[playerid][acGtc][11] = ac_gtc + 1650;
  3287. #if defined foreach
  3288. foreach(new ac_i : Player)
  3289. #else
  3290. for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  3291. {
  3292. if(IsPlayerConnected(ac_i))
  3293. #endif
  3294. {
  3295. if(ACInfo[playerid][acVeh] == ACInfo[ac_i][acVeh]) ACInfo[ac_i][acInt] = interiorid;
  3296. }
  3297. #if !defined foreach
  3298. }
  3299. #endif
  3300. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3301. && defined ac_OnEnterExitModShop
  3302. return ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  3303. #else
  3304. return 1;
  3305. #endif
  3306. #endif
  3307. }
  3308.  
  3309. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3310. #if defined _ALS_OnEnterExitModShop
  3311. #undef OnEnterExitModShop
  3312. #else
  3313. #define _ALS_OnEnterExitModShop
  3314. #endif
  3315. #define OnEnterExitModShop ac_OnEnterExitModShop
  3316. #if defined ac_OnEnterExitModShop
  3317. forward ac_OnEnterExitModShop(playerid, enterexit, interiorid);
  3318. #endif
  3319. #endif
  3320.  
  3321. #if defined _inc_y_hooks || defined _INC_y_hooks
  3322. hook OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  3323. #else
  3324. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  3325. #endif
  3326. {
  3327. if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) return 0;
  3328. new ac_vehid = GetPlayerVehicleID(playerid);
  3329. if(newinteriorid != ACInfo[playerid][acSet][0])
  3330. {
  3331. if(ACInfo[playerid][acSet][0] == -1)
  3332. {
  3333. if(ac_vehid > 0)
  3334. {
  3335. if(ACInfo[playerid][acACAllow][3] && newinteriorid != ACInfo[playerid][acInt])
  3336. {
  3337. #if defined DEBUG
  3338. printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d, vehicleid: %d",
  3339. ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid, ac_vehid);
  3340. #endif
  3341. ac_KickWithCode(playerid, "", 0, 3, 1);
  3342. }
  3343. }
  3344. else if(ACInfo[playerid][acIntEnterExits])
  3345. {
  3346. GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  3347. ACInfo[playerid][acGtc][11] = GetTickCount() + 1650;
  3348. }
  3349. else if(ACInfo[playerid][acACAllow][2] && newinteriorid != ACInfo[playerid][acInt])
  3350. {
  3351. #if defined DEBUG
  3352. printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d",
  3353. ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid);
  3354. #endif
  3355. ac_KickWithCode(playerid, "", 0, 2, 1);
  3356. }
  3357. }
  3358. }
  3359. else ACInfo[playerid][acSet][0] = -1;
  3360. ACInfo[playerid][acInt] = newinteriorid;
  3361. if(!ACInfo[playerid][acKicked] && ac_vehid > 0) ACVehInfo[ac_vehid][acInt] = newinteriorid;
  3362. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3363. && defined ac_OnPlayerInteriorChange
  3364. return ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  3365. #else
  3366. return 1;
  3367. #endif
  3368. }
  3369.  
  3370. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3371. #if defined _ALS_OnPlayerInteriorChange
  3372. #undef OnPlayerInteriorChange
  3373. #else
  3374. #define _ALS_OnPlayerInteriorChange
  3375. #endif
  3376. #define OnPlayerInteriorChange ac_OnPlayerInteriorChange
  3377. #if defined ac_OnPlayerInteriorChange
  3378. forward ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  3379. #endif
  3380. #endif
  3381.  
  3382. #if defined _inc_y_hooks || defined _INC_y_hooks
  3383. hook OnRconLoginAttempt(ip[], password[], success)
  3384. #else
  3385. public OnRconLoginAttempt(ip[], password[], success)
  3386. #endif
  3387. {
  3388. if(ac_ACAllow[42])
  3389. {
  3390. static ac_ipTables[MAX_PLAYERS][2], ac_ip_index;
  3391. new ac_i, ac_current_ip = ac_IpToInt(ip);
  3392. for(; ac_i < ac_ip_index && ac_i < sizeof ac_ipTables; ++ac_i)
  3393. {
  3394. if(ac_ipTables[ac_i][0] == ac_current_ip)
  3395. {
  3396. if(success) ac_ipTables[ac_i][1] = 0;
  3397. else if(++ac_ipTables[ac_i][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
  3398. {
  3399. #if defined DEBUG
  3400. printf(DEBUG_CODE_4, ip, password);
  3401. #endif
  3402. ac_ipTables[ac_i][1] = 0;
  3403. ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 1);
  3404. }
  3405. ac_i = -1;
  3406. break;
  3407. }
  3408. }
  3409. if(ac_i != -1 && !success)
  3410. {
  3411. ac_ipTables[ac_ip_index][0] = ac_current_ip;
  3412. if(++ac_ipTables[ac_ip_index][1] > AC_MAX_RCON_LOGIN_ATTEMPT)
  3413. {
  3414. #undef AC_MAX_RCON_LOGIN_ATTEMPT
  3415. #if defined DEBUG
  3416. printf(DEBUG_CODE_4, ip, password, ac_ipTables[ac_ip_index][1]);
  3417. #endif
  3418. ac_ipTables[ac_ip_index][1] = 0;
  3419. ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 2);
  3420. }
  3421. if(++ac_ip_index >= sizeof ac_ipTables) ac_ip_index = 0;
  3422. ac_ipTables[ac_ip_index][1] = 0;
  3423. }
  3424. }
  3425. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  3426. && defined ac_OnRconLoginAttempt
  3427. return ac_OnRconLoginAttempt(ip, password, success);
  3428. #else
  3429. return 1;
  3430. #endif
  3431. }
  3432.  
  3433. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  3434. #if defined _ALS_OnRconLoginAttempt
  3435. #undef OnRconLoginAttempt
  3436. #else
  3437. #define _ALS_OnRconLoginAttempt
  3438. #endif
  3439. #define OnRconLoginAttempt ac_OnRconLoginAttempt
  3440. #if defined ac_OnRconLoginAttempt
  3441. forward ac_OnRconLoginAttempt(ip[], password[], success);
  3442. #endif
  3443. #endif
  3444.  
  3445. #if defined _inc_y_hooks || defined _INC_y_hooks
  3446. hook OnPlayerUpdate(playerid)
  3447. #else
  3448. public OnPlayerUpdate(playerid)
  3449. #endif
  3450. {
  3451. if(ACInfo[playerid][acKicked]) return 0;
  3452. new ac_gtc = GetTickCount(), ac_gpp;
  3453. if(!IsPlayerNPC(playerid))
  3454. {
  3455. new ac_sa;
  3456. if((ac_sa = GetPlayerState(playerid)) != PLAYER_STATE_SPECTATING)
  3457. {
  3458. ac_gpp = GetPlayerPing(playerid);
  3459. new ac_w = GetPlayerWeapon(playerid), ac_a = GetPlayerAmmo(playerid), ac_s = ac_wSlot[ac_w];
  3460. if(ACInfo[playerid][acSet][3] != -1)
  3461. {
  3462. if(ACInfo[playerid][acSet][3] == ac_w)
  3463. {
  3464. ACInfo[playerid][acSet][3] =
  3465. ACInfo[playerid][acSetWeapon][ac_s] = -1;
  3466. ACInfo[playerid][acWeapon][ac_s] = ac_w;
  3467. }
  3468. else if(ACInfo[playerid][acGiveAmmo][ac_wSlot[ACInfo[playerid][acSet][3]]] == 0) ACInfo[playerid][acSet][3] = -1;
  3469. else if(ACInfo[playerid][acACAllow][52] && !(PLAYER_STATE_DRIVER <= ac_sa <= PLAYER_STATE_PASSENGER) &&
  3470. (ac_wSlot[ACInfo[playerid][acSet][3]] == ac_s || ACInfo[playerid][acSetWeapon][ac_wSlot[ACInfo[playerid][acSet][3]]] == -1) &&
  3471. ac_gtc > ACInfo[playerid][acGtc][2] + ac_gpp && ++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
  3472. {
  3473. #if defined DEBUG
  3474. printf(DEBUG_CODE_5, playerid, "SetPlayerArmedWeapon");
  3475. printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSet][3], ac_w);
  3476. #endif
  3477. #if defined OnCheatDetected
  3478. ac_KickWithCode(playerid, "", 0, 52, 1);
  3479. ACInfo[playerid][acSetWeapon][ac_s] = ACInfo[playerid][acSet][3] = -1;
  3480. #else
  3481. return ac_KickWithCode(playerid, "", 0, 52, 1);
  3482. #endif
  3483. }
  3484. }
  3485. if(ACInfo[playerid][acGiveAmmo][ac_s] != -65535)
  3486. {
  3487. if(ACInfo[playerid][acGiveAmmo][ac_s] == ac_a ||
  3488. ACInfo[playerid][acGiveAmmo][ac_s] > ac_a && ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_s] + ac_gpp)
  3489. {
  3490. ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  3491. ACInfo[playerid][acAmmo][ac_s] = ac_a;
  3492. }
  3493. else if(ACInfo[playerid][acACAllow][52] &&
  3494. ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_s] + ac_gpp &&
  3495. ++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS)
  3496. {
  3497. #if defined DEBUG
  3498. printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  3499. printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  3500. ACInfo[playerid][acGiveAmmo][ac_s], ac_a, ac_w);
  3501. #endif
  3502. #if defined OnCheatDetected
  3503. ac_KickWithCode(playerid, "", 0, 52, 2);
  3504. ACInfo[playerid][acGiveAmmo][ac_s] = -65535;
  3505. #else
  3506. return ac_KickWithCode(playerid, "", 0, 52, 2);
  3507. #endif
  3508. }
  3509. }
  3510. #if AC_USE_AMMUNATIONS || AC_USE_TUNING_GARAGES
  3511. new ac_money = bad_GetPlayerMoney(playerid);
  3512. #endif
  3513. #if AC_USE_AMMUNATIONS
  3514. if(ACInfo[playerid][acSet][10] != -1)
  3515. {
  3516. if(ac_money < ACInfo[playerid][acMoney] &&
  3517. ACInfo[playerid][acSet][10] <= ACInfo[playerid][acMoney] - ac_money) ACInfo[playerid][acSet][10] = -1;
  3518. else if(ACInfo[playerid][acACAllow][15] && ac_gtc > ACInfo[playerid][acGtc][15] + ac_gpp &&
  3519. ++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_WARNINGS)
  3520. {
  3521. #if defined DEBUG
  3522. printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
  3523. ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
  3524. #endif
  3525. #if defined OnCheatDetected
  3526. ac_KickWithCode(playerid, "", 0, 15, 3);
  3527. ACInfo[playerid][acSet][10] = -1;
  3528. #else
  3529. return ac_KickWithCode(playerid, "", 0, 15, 3);
  3530. #endif
  3531. }
  3532. }
  3533. #endif
  3534. new ac_i = GetPlayerInterior(playerid), Float:ac_X, Float:ac_Y, Float:ac_Z, Float:ac_tmp;
  3535. GetPlayerPos(playerid, ac_X, ac_Y, ac_Z);
  3536. if(ACInfo[playerid][acLastWeapon] != ac_w)
  3537. {
  3538. if(ACInfo[playerid][acWeapon][ac_s] != ac_w)
  3539. {
  3540. #if defined Streamer_GetDistanceToItem\
  3541. && defined Streamer_GetIntData
  3542. if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS) Streamer_GetDistanceToItem(ac_X, ac_Y, ac_Z, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_tmp);
  3543. if((ac_w == 40 || ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute]) ||
  3544. 0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  3545. ac_a <= (3 <= ac_s <= 5 ? ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  3546. IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  3547. ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) ||
  3548. ACInfo[playerid][acLastPickup] > MAX_PICKUPS &&
  3549. Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) == ac_w + 100 &&
  3550. ac_a <= (3 <= ac_s <= 5 ? ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) && floatcmp(ac_tmp, 8.0) <= 0)
  3551. {
  3552. ACInfo[playerid][acWeapon][ac_s] = ac_w;
  3553. ACInfo[playerid][acAmmo][ac_s] = ac_a;
  3554. }
  3555. #else
  3556. if((ac_w == 40 || ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute]) ||
  3557. 0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  3558. ac_a <= (3 <= ac_s <= 5 ? ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  3559. IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  3560. ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
  3561. {
  3562. ACInfo[playerid][acWeapon][ac_s] = ac_w;
  3563. ACInfo[playerid][acAmmo][ac_s] = ac_a;
  3564. }
  3565. #endif
  3566. #if AC_USE_AMMUNATIONS
  3567. else if(16 <= ac_w <= 39 && ac_InAmmuNation(playerid, ac_i))
  3568. {
  3569. ACInfo[playerid][acCheatCount][10] = 0;
  3570. if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 16][0];
  3571. else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 16][0];
  3572. if(3 <= ac_s <= 5) ACInfo[playerid][acAmmo][ac_s] += ac_AmmuNationInfo[ac_w - 16][1];
  3573. else ACInfo[playerid][acAmmo][ac_s] = ac_AmmuNationInfo[ac_w - 16][1];
  3574. ACInfo[playerid][acWeapon][ac_s] = ac_w;
  3575. ACInfo[playerid][acGtc][15] = ac_gtc + 1650;
  3576. }
  3577. #endif
  3578. else if(ACInfo[playerid][acACAllow][15] &&
  3579. ACInfo[playerid][acSetWeapon][ac_s] == -1 && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  3580. {
  3581. #if defined DEBUG
  3582. printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
  3583. ACInfo[playerid][acWeapon][ac_s], ACInfo[playerid][acAmmo][ac_s], ac_w, ac_a);
  3584. #endif
  3585. #if defined OnCheatDetected
  3586. ac_KickWithCode(playerid, "", 0, 15, 1);
  3587. ACInfo[playerid][acWeapon][ac_s] = ac_w;
  3588. ACInfo[playerid][acAmmo][ac_s] = ac_a;
  3589. #else
  3590. return ac_KickWithCode(playerid, "", 0, 15, 1);
  3591. #endif
  3592. }
  3593. }
  3594. }
  3595. else if(ACInfo[playerid][acAmmo][ac_s] != ac_a)
  3596. {
  3597. switch(ac_w)
  3598. {
  3599. case 16..18, 35, 36, 39, 43:
  3600. {
  3601. if(ac_sa != PLAYER_STATE_DRIVER)
  3602. {
  3603. if(ACInfo[playerid][acACAllow][16] &&
  3604. ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp &&
  3605. (ACInfo[playerid][acAmmo][ac_s] == 0 || ac_a > ACInfo[playerid][acAmmo][ac_s] ||
  3606. ac_a < 0 < ACInfo[playerid][acAmmo][ac_s]))
  3607. {
  3608. #if defined DEBUG
  3609. printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  3610. ACInfo[playerid][acAmmo][ac_s], ac_a, ac_w);
  3611. #endif
  3612. #if defined OnCheatDetected
  3613. ac_KickWithCode(playerid, "", 0, 16, 1);
  3614. #else
  3615. return ac_KickWithCode(playerid, "", 0, 16, 1);
  3616. #endif
  3617. }
  3618. ACInfo[playerid][acAmmo][ac_s] = ac_a;
  3619. }
  3620. }
  3621. }
  3622. }
  3623. GetPlayerHealth(playerid, ac_tmp);
  3624. new ac_health = floatround(ac_tmp, floatround_tozero);
  3625. if(ACInfo[playerid][acSet][1] != -1)
  3626. {
  3627. if(ACInfo[playerid][acSet][1] > 255)
  3628. {
  3629. while(ac_health < ACInfo[playerid][acSet][1]) ac_health += 256;
  3630. }
  3631. if(ACInfo[playerid][acSet][1] == ac_health || ACInfo[playerid][acDmgRes] ||
  3632. ACInfo[playerid][acSet][1] > ac_health && ac_gtc > ACInfo[playerid][acGtc][3] + ac_gpp)
  3633. {
  3634. ACInfo[playerid][acSet][1] = -1;
  3635. ACInfo[playerid][acDmgRes] = 0;
  3636. }
  3637. else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][3] + ac_gpp &&
  3638. ++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS)
  3639. {
  3640. #if defined DEBUG
  3641. printf(DEBUG_CODE_5, playerid, "SetPlayerHealth");
  3642. printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acSet][1], ac_health);
  3643. #endif
  3644. #if defined OnCheatDetected
  3645. ac_KickWithCode(playerid, "", 0, 52, 3);
  3646. ACInfo[playerid][acSet][1] = -1;
  3647. #else
  3648. return ac_KickWithCode(playerid, "", 0, 52, 3);
  3649. #endif
  3650. }
  3651. }
  3652. else if(ACInfo[playerid][acACAllow][12])
  3653. {
  3654. while(ACInfo[playerid][acHealth] > ac_health + 255) ac_health += 256;
  3655. if(ac_health > ACInfo[playerid][acHealth])
  3656. {
  3657. #if AC_USE_RESTAURANTS
  3658. if(ac_health > ACInfo[playerid][acHealth] + 70 || !ac_InRestaurant(playerid, ac_i))
  3659. {
  3660. #endif
  3661. #if AC_USE_VENDING_MACHINES
  3662. if(ac_health > ACInfo[playerid][acHealth] + 35 || !ac_NearVendingMachine(playerid, ac_i))
  3663. {
  3664. #endif
  3665. #if defined DEBUG
  3666. printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acHealth], ac_health);
  3667. #endif
  3668. #if defined OnCheatDetected
  3669. ac_KickWithCode(playerid, "", 0, 12);
  3670. #else
  3671. return ac_KickWithCode(playerid, "", 0, 12);
  3672. #endif
  3673. #if AC_USE_VENDING_MACHINES
  3674. }
  3675. #endif
  3676. #if AC_USE_RESTAURANTS
  3677. }
  3678. #endif
  3679. }
  3680. }
  3681. GetPlayerArmour(playerid, ac_tmp);
  3682. new ac_armour = floatround(ac_tmp, floatround_tozero);
  3683. if(ACInfo[playerid][acSet][2] != -1)
  3684. {
  3685. if(ACInfo[playerid][acSet][2] > 255)
  3686. {
  3687. while(ac_armour < ACInfo[playerid][acSet][2]) ac_armour += 256;
  3688. }
  3689. if(ACInfo[playerid][acSet][2] == ac_armour || ACInfo[playerid][acDmgRes] ||
  3690. ACInfo[playerid][acSet][2] > ac_armour && ac_gtc > ACInfo[playerid][acGtc][5] + ac_gpp)
  3691. {
  3692. ACInfo[playerid][acSet][2] = -1;
  3693. ACInfo[playerid][acDmgRes] = 0;
  3694. }
  3695. else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][5] + ac_gpp &&
  3696. ++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS)
  3697. {
  3698. #if defined DEBUG
  3699. printf(DEBUG_CODE_5, playerid, "SetPlayerArmour");
  3700. printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acSet][2], ac_armour);
  3701. #endif
  3702. #if defined OnCheatDetected
  3703. ac_KickWithCode(playerid, "", 0, 52, 4);
  3704. ACInfo[playerid][acSet][2] = -1;
  3705. #else
  3706. return ac_KickWithCode(playerid, "", 0, 52, 4);
  3707. #endif
  3708. }
  3709. }
  3710. else if(ACInfo[playerid][acACAllow][13])
  3711. {
  3712. while(ACInfo[playerid][acArmour] > ac_armour + 255) ac_armour += 256;
  3713. if(ac_armour > ACInfo[playerid][acArmour])
  3714. {
  3715. #if AC_USE_AMMUNATIONS
  3716. if(ac_InAmmuNation(playerid, ac_i))
  3717. {
  3718. ACInfo[playerid][acCheatCount][10] = 0;
  3719. if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += 200;
  3720. else ACInfo[playerid][acSet][10] = 200;
  3721. ACInfo[playerid][acGtc][15] = ac_gtc + 1650;
  3722. }
  3723. else
  3724. {
  3725. #endif
  3726. #if defined DEBUG
  3727. printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acArmour], ac_armour);
  3728. #endif
  3729. #if defined OnCheatDetected
  3730. ac_KickWithCode(playerid, "", 0, 13);
  3731. #else
  3732. return ac_KickWithCode(playerid, "", 0, 13);
  3733. #endif
  3734. #if AC_USE_AMMUNATIONS
  3735. }
  3736. #endif
  3737. }
  3738. }
  3739. if(ACInfo[playerid][acACAllow][19])
  3740. {
  3741. if(ac_health < ACInfo[playerid][acHealth] || ac_armour < ACInfo[playerid][acArmour])
  3742. {
  3743. ACInfo[playerid][acVehDmgRes] = false;
  3744. ACInfo[playerid][acCheatCount][9] = ACInfo[playerid][acDmgRes] = 0;
  3745. }
  3746. else if(ACInfo[playerid][acDmgRes] && ac_gtc > ACInfo[playerid][acGtc][14] + ac_gpp)
  3747. {
  3748. ACInfo[playerid][acDmgRes] = 0;
  3749. ACInfo[playerid][acVehDmgRes] = false;
  3750. if(++ACInfo[playerid][acCheatCount][9] > AC_MAX_GODMODE_WARNINGS)
  3751. {
  3752. #undef AC_MAX_GODMODE_WARNINGS
  3753. #if defined DEBUG
  3754. printf("[Nex-AC debug] AC health: %d, health: %d, AC armour: %d, armour: %d",
  3755. ACInfo[playerid][acHealth], ac_health, ACInfo[playerid][acArmour], ac_armour);
  3756. #endif
  3757. #if defined OnCheatDetected
  3758. ac_KickWithCode(playerid, "", 0, 19);
  3759. ACInfo[playerid][acCheatCount][9] = 0;
  3760. #else
  3761. return ac_KickWithCode(playerid, "", 0, 19);
  3762. #endif
  3763. }
  3764. }
  3765. }
  3766. #if AC_USE_TUNING_GARAGES
  3767. if(ACInfo[playerid][acSet][12] != -1)
  3768. {
  3769. if(ac_money < ACInfo[playerid][acMoney] &&
  3770. ACInfo[playerid][acSet][12] <= ACInfo[playerid][acMoney] - ac_money) ACInfo[playerid][acSet][12] = -1;
  3771. else if(ACInfo[playerid][acACAllow][23] && ac_gtc > ACInfo[playerid][acGtc][17] + ac_gpp &&
  3772. ++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_WARNINGS)
  3773. {
  3774. #if defined DEBUG
  3775. printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
  3776. ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][12]);
  3777. #endif
  3778. #if defined OnCheatDetected
  3779. ac_KickWithCode(playerid, "", 0, 23, 3);
  3780. ACInfo[playerid][acSet][12] = -1;
  3781. #else
  3782. return ac_KickWithCode(playerid, "", 0, 23, 3);
  3783. #endif
  3784. }
  3785. }
  3786. #endif
  3787. new ac_vehid = GetPlayerVehicleID(playerid);
  3788. if(ACInfo[playerid][acACAllow][52])
  3789. {
  3790. if(ACInfo[playerid][acSet][0] != -1 && ac_gtc > ACInfo[playerid][acGtc][0] + ac_gpp)
  3791. {
  3792. if(ACInfo[playerid][acSet][0] == ac_i) ACInfo[playerid][acSet][0] = -1;
  3793. else if(++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS)
  3794. {
  3795. #if defined DEBUG
  3796. printf(DEBUG_CODE_5, playerid, "SetPlayerInterior");
  3797. printf("[Nex-AC debug] AC interior: %d, interiorid: %d", ACInfo[playerid][acSet][0], ac_i);
  3798. #endif
  3799. #if defined OnCheatDetected
  3800. ac_KickWithCode(playerid, "", 0, 52, 5);
  3801. ACInfo[playerid][acSet][0] = -1;
  3802. #else
  3803. return ac_KickWithCode(playerid, "", 0, 52, 5);
  3804. #endif
  3805. }
  3806. }
  3807. if(ACInfo[playerid][acSet][6] != -1 && ac_gtc > ACInfo[playerid][acGtc][12] + ac_gpp &&
  3808. ++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS)
  3809. {
  3810. #if defined DEBUG
  3811. printf(DEBUG_CODE_5, playerid, "TogglePlayerSpectating");
  3812. #endif
  3813. #if defined OnCheatDetected
  3814. ac_KickWithCode(playerid, "", 0, 52, 6);
  3815. ACInfo[playerid][acSet][6] = -1;
  3816. #else
  3817. return ac_KickWithCode(playerid, "", 0, 52, 6);
  3818. #endif
  3819. }
  3820. if(ACInfo[playerid][acSet][7] != -1 && ac_gtc > ACInfo[playerid][acGtc][13] + ac_gpp &&
  3821. ++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS)
  3822. {
  3823. #if defined DEBUG
  3824. printf(DEBUG_CODE_5, playerid, "SpawnPlayer");
  3825. printf("[Nex-AC debug] acSet[7]: %d", ACInfo[playerid][acSet][7]);
  3826. #endif
  3827. #if defined OnCheatDetected
  3828. ac_KickWithCode(playerid, "", 0, 52, 7);
  3829. ACInfo[playerid][acSet][7] = -1;
  3830. #else
  3831. return ac_KickWithCode(playerid, "", 0, 52, 7);
  3832. #endif
  3833. }
  3834. if(ACInfo[playerid][acSet][11] != -1 && ac_vehid > 0 && ac_gtc > ACInfo[playerid][acGtc][8] + ac_gpp)
  3835. {
  3836. #if defined DEBUG
  3837. printf(DEBUG_CODE_5, playerid, "RemovePlayerFromVehicle");
  3838. printf("[Nex-AC debug] Veh model: %d", GetVehicleModel(ac_vehid));
  3839. #endif
  3840. #if defined OnCheatDetected
  3841. ac_KickWithCode(playerid, "", 0, 52, 8);
  3842. ACInfo[playerid][acSet][11] = -1;
  3843. #else
  3844. return ac_KickWithCode(playerid, "", 0, 52, 8);
  3845. #endif
  3846. }
  3847. }
  3848. ac_s = GetPlayerVehicleSeat(playerid);
  3849. if(ACInfo[playerid][acSet][9] != -1)
  3850. {
  3851. if(ACInfo[playerid][acSet][9] == ac_vehid &&
  3852. (ACInfo[playerid][acSet][5] == ac_s || ACInfo[playerid][acSet][5] == -1))
  3853. {
  3854. if(ACInfo[playerid][acVeh] > 0 &&
  3855. ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = INVALID_PLAYER_ID;
  3856. if(ac_s == 0)
  3857. {
  3858. ACVehInfo[ac_vehid][acDriver] = playerid;
  3859. GetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]);
  3860. ACInfo[playerid][acSetVehHealth] = -1.0;
  3861. }
  3862. ACInfo[playerid][acCheatCount][11] = 0;
  3863. ACInfo[playerid][acVehDmgRes] = false;
  3864. ACInfo[playerid][acSet][11] =
  3865. ACInfo[playerid][acSet][9] =
  3866. ACInfo[playerid][acSet][8] =
  3867. ACInfo[playerid][acSet][5] = -1;
  3868. ACInfo[playerid][acSeat] = ac_s;
  3869. }
  3870. else if(!GetVehicleModel(ACInfo[playerid][acSet][9]) ||
  3871. !ACVehInfo[ACInfo[playerid][acSet][9]][acSpawned])
  3872. {
  3873. ACInfo[playerid][acSet][9] =
  3874. ACInfo[playerid][acSet][5] = -1;
  3875. }
  3876. else if(ac_gtc > ACInfo[playerid][acGtc][1] + ac_gpp)
  3877. {
  3878. if(ACInfo[playerid][acSet][5] == -1) ACInfo[playerid][acSet][9] = -1;
  3879. else if(ACInfo[playerid][acACAllow][52] && ++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS)
  3880. {
  3881. #if defined DEBUG
  3882. printf(DEBUG_CODE_5, playerid, "PutPlayerInVehicle");
  3883. printf("[Nex-AC debug] AC vehicle: %d, vehicleid: %d, AC seat: %d, seatid: %d",
  3884. ACInfo[playerid][acSet][9], ac_vehid, ACInfo[playerid][acSet][5], ac_s);
  3885. #endif
  3886. #if defined OnCheatDetected
  3887. ac_KickWithCode(playerid, "", 0, 52, 9);
  3888. ACInfo[playerid][acSet][9] = -1;
  3889. #else
  3890. return ac_KickWithCode(playerid, "", 0, 52, 9);
  3891. #endif
  3892. }
  3893. }
  3894. }
  3895. else
  3896. {
  3897. if(ACInfo[playerid][acSet][8] != -1)
  3898. {
  3899. if(IsPlayerInRangeOfPoint(playerid, 8.0, ACInfo[playerid][acSetPosX],
  3900. ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_Z : ACInfo[playerid][acSetPosZ])))
  3901. {
  3902. ACInfo[playerid][acSet][8] = -1;
  3903. ACInfo[playerid][acTpToZ] = false;
  3904. ACInfo[playerid][acPosX] = ac_X;
  3905. ACInfo[playerid][acPosY] = ac_Y;
  3906. ACInfo[playerid][acPosZ] = ac_Z;
  3907. }
  3908. else if(ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  3909. {
  3910. if(ACInfo[playerid][acACAllow][52] && ++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS)
  3911. {
  3912. #if defined DEBUG
  3913. printf(DEBUG_CODE_5, playerid, "SetPlayerPos");
  3914. printf("[Nex-AC debug] Distance: %f, acSet[8]: %d", GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX],
  3915. ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_Z : ACInfo[playerid][acSetPosZ])), ACInfo[playerid][acSet][8]);
  3916. #endif
  3917. #if defined OnCheatDetected
  3918. ac_KickWithCode(playerid, "", 0, 52, 10);
  3919. ACInfo[playerid][acSet][8] = -1;
  3920. #else
  3921. return ac_KickWithCode(playerid, "", 0, 52, 10);
  3922. #endif
  3923. }
  3924. ACInfo[playerid][acTpToZ] = false;
  3925. }
  3926. }
  3927. new Float:ac_vX, Float:ac_vY, Float:ac_vZ, ac_specact = GetPlayerSpecialAction(playerid),
  3928. Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]),
  3929. Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_Z : ACInfo[playerid][acSetPosZ]));
  3930. if(ac_vehid > 0)
  3931. {
  3932. if(!ACInfo[playerid][acVeh])
  3933. {
  3934. if(ACInfo[playerid][acACAllow][4] &&
  3935. (ACInfo[playerid][acEnterVeh] != ac_vehid || ac_gtc < ACInfo[playerid][acEnterVehTime] + 600))
  3936. {
  3937. #if defined DEBUG
  3938. printf("[Nex-AC debug] Entered vehicle: %d, vehicleid: %d, Enter time: %d",
  3939. ACInfo[playerid][acEnterVeh], ac_vehid, ac_gtc - ACInfo[playerid][acEnterVehTime]);
  3940. #endif
  3941. #if defined OnCheatDetected
  3942. ac_KickWithCode(playerid, "", 0, 4, 1);
  3943. #else
  3944. return ac_KickWithCode(playerid, "", 0, 4, 1);
  3945. #endif
  3946. }
  3947. }
  3948. else if(ACInfo[playerid][acVeh] != ac_vehid)
  3949. {
  3950. if(ACInfo[playerid][acACAllow][4])
  3951. {
  3952. #if defined DEBUG
  3953. printf("[Nex-AC debug] AC vehicle: %d, vehicleid: %d", ACInfo[playerid][acVeh], ac_vehid);
  3954. #endif
  3955. #if defined OnCheatDetected
  3956. ac_KickWithCode(playerid, "", 0, 4, 2);
  3957. #else
  3958. return ac_KickWithCode(playerid, "", 0, 4, 2);
  3959. #endif
  3960. }
  3961. }
  3962. else if(ACInfo[playerid][acACAllow][50] && ACInfo[playerid][acSeat] != ac_s)
  3963. {
  3964. #if defined DEBUG
  3965. printf("[Nex-AC debug] AC seat: %d, seatid: %d, vehicleid: %d", ACInfo[playerid][acSeat], ac_s, ac_vehid);
  3966. #endif
  3967. #if defined OnCheatDetected
  3968. ac_KickWithCode(playerid, "", 0, 50);
  3969. #else
  3970. return ac_KickWithCode(playerid, "", 0, 50);
  3971. #endif
  3972. }
  3973. if(ac_sa == PLAYER_STATE_DRIVER)
  3974. {
  3975. if(ACInfo[playerid][acACAllow][32] &&
  3976. ACVehInfo[ac_vehid][acDriver] != INVALID_PLAYER_ID && ACVehInfo[ac_vehid][acDriver] != playerid)
  3977. {
  3978. #if defined DEBUG
  3979. printf("[Nex-AC debug] AC driver: %d, driver: %d, vehicleid: %d",
  3980. ACVehInfo[ac_vehid][acDriver], playerid, ac_vehid);
  3981. #endif
  3982. #if defined OnCheatDetected
  3983. ac_KickWithCode(playerid, "", 0, 32);
  3984. #else
  3985. return ClearAnimations(playerid, 1);
  3986. #endif
  3987. }
  3988. if(ACInfo[playerid][acACAllow][35] && GetPlayerCameraMode(playerid) == 55)
  3989. {
  3990. #if defined OnCheatDetected
  3991. ac_KickWithCode(playerid, "", 0, 35);
  3992. #else
  3993. return ac_KickWithCode(playerid, "", 0, 35);
  3994. #endif
  3995. }
  3996. new Float:ac_vHealth;
  3997. GetVehicleHealth(ac_vehid, ac_vHealth);
  3998. if(floatcmp(ACInfo[playerid][acSetVehHealth], -1.0) != 0)
  3999. {
  4000. if(floatcmp(ACInfo[playerid][acSetVehHealth], ac_vHealth) == 0 ||
  4001. floatcmp(ACInfo[playerid][acSetVehHealth], ac_vHealth) == 1 &&
  4002. ac_gtc > ACInfo[playerid][acGtc][4] + ac_gpp)
  4003. {
  4004. ACInfo[playerid][acSetVehHealth] = -1.0;
  4005. ACInfo[playerid][acVehDmgRes] = false;
  4006. }
  4007. else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][4] + ac_gpp &&
  4008. ++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS)
  4009. {
  4010. #if defined DEBUG
  4011. printf(DEBUG_CODE_5, playerid, "SetVehicleHealth");
  4012. printf("[Nex-AC debug] AC veh health: %f, veh health: %f, vehicleid: %d",
  4013. ACInfo[playerid][acSetVehHealth], ac_vHealth, ac_vehid);
  4014. #endif
  4015. #if defined OnCheatDetected
  4016. ac_KickWithCode(playerid, "", 0, 52, 11);
  4017. ACInfo[playerid][acSetVehHealth] = -1.0;
  4018. #else
  4019. return ac_KickWithCode(playerid, "", 0, 52, 11);
  4020. #endif
  4021. }
  4022. }
  4023. else if(ACInfo[playerid][acACAllow][11] &&
  4024. floatcmp(ac_vHealth, ACVehInfo[ac_vehid][acHealth]) == 1 && !ACInfo[playerid][acModShop])
  4025. {
  4026. #if AC_USE_PAYNSPRAY
  4027. if(!ac_InPayNSpray(playerid, ac_i))
  4028. {
  4029. #endif
  4030. #if defined DEBUG
  4031. printf("[Nex-AC debug] AC veh health: %f, veh health: %f, vehicleid: %d, playerid: %d",
  4032. ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid, playerid);
  4033. #endif
  4034. #if defined OnCheatDetected
  4035. ac_KickWithCode(playerid, "", 0, 11);
  4036. #endif
  4037. SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]);
  4038. #if AC_USE_PAYNSPRAY
  4039. }
  4040. #endif
  4041. }
  4042. if(ACInfo[playerid][acACAllow][20] && ACInfo[playerid][acVehDmgRes])
  4043. {
  4044. if(floatcmp(ac_vHealth, ACVehInfo[ac_vehid][acHealth]) == -1)
  4045. {
  4046. ACInfo[playerid][acVehDmgRes] = false;
  4047. ACInfo[playerid][acCheatCount][11] = ACInfo[playerid][acDmgRes] = 0;
  4048. }
  4049. else if(ac_gtc > ACInfo[playerid][acGtc][16] + ac_gpp)
  4050. {
  4051. ACInfo[playerid][acDmgRes] = 0;
  4052. ACInfo[playerid][acVehDmgRes] = false;
  4053. if(++ACInfo[playerid][acCheatCount][11] > AC_MAX_GODMODE_VEH_WARNINGS)
  4054. {
  4055. #undef AC_MAX_GODMODE_VEH_WARNINGS
  4056. #if defined DEBUG
  4057. printf("[Nex-AC debug] AC veh health: %f, veh health: %f, vehicleid: %d",
  4058. ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid);
  4059. #endif
  4060. #if defined OnCheatDetected
  4061. ac_KickWithCode(playerid, "", 0, 20);
  4062. ACInfo[playerid][acCheatCount][11] = 0;
  4063. #else
  4064. return ac_KickWithCode(playerid, "", 0, 20);
  4065. #endif
  4066. }
  4067. }
  4068. }
  4069. new Float:ac_zAngle;
  4070. GetVehicleZAngle(ac_vehid, ac_zAngle);
  4071. ac_zAngle = floatround(ac_zAngle, floatround_floor) % 360 + floatfract(ac_zAngle);
  4072. GetVehicleVelocity(ac_vehid, ac_vX, ac_vY, ac_vZ);
  4073. if(ac_gtc > ACInfo[playerid][acGtc][9] + ac_gpp)
  4074. {
  4075. ac_i = GetVehicleModel(ac_vehid) - 400;
  4076. new Float:ac_vsp = ac_GetSpeed(ac_vX, ac_vY, ac_vZ),
  4077. Float:ac_spDiff = ac_vsp - ac_GetSpeed(ACVehInfo[ac_vehid][acVelX], ACVehInfo[ac_vehid][acVelY], ACVehInfo[ac_vehid][acVelZ]);
  4078. if(ACInfo[playerid][acACAllow][10] && floatcmp(ac_spDiff, 20.0) >= 0 &&
  4079. floatcmp(ACVehInfo[ac_vehid][acSpeedDiff], ac_spDiff) <= 0 && floatcmp(ACVehInfo[ac_vehid][acHealth], ac_vHealth) == 0 &&
  4080. !((ac_i == 49 || 137 <= ac_i <= 138) && floatcmp(ac_spDiff, 65.0) == -1 ||
  4081. (ac_i == 81 || 109 <= ac_i <= 110) && floatcmp(floatabs(ac_vX), 0.3) <= 0 && floatcmp(floatabs(ac_vY), 0.3) <= 0 && floatcmp(floatabs(ac_vZ), 0.3) <= 0 ||
  4082. !(ac_i == 49 || ac_i == 81 || 109 <= ac_i <= 110 || 137 <= ac_i <= 138) && floatcmp(ACVehInfo[ac_vehid][acHealth], 220.0) <= 0))
  4083. {
  4084. ACInfo[playerid][acCheatCount][16] += 3;
  4085. if(ACInfo[playerid][acCheatCount][16] > AC_MAX_SPEEDHACK_WARNINGS * 3)
  4086. {
  4087. #undef AC_MAX_SPEEDHACK_WARNINGS
  4088. #if defined DEBUG
  4089. printf("[Nex-AC debug] Speed: %.1f, old speed: %.1f, veh model: %d",
  4090. ac_vsp, ac_vsp - ac_spDiff, ac_i + 400);
  4091. #endif
  4092. #if defined OnCheatDetected
  4093. ac_KickWithCode(playerid, "", 0, 10, 1);
  4094. #else
  4095. return ac_KickWithCode(playerid, "", 0, 10, 1);
  4096. #endif
  4097. }
  4098. }
  4099. if(ACInfo[playerid][acACAllow][25] &&
  4100. floatcmp(ac_vsp, 15.0) == 1 && floatcmp(floatabs(ac_spDiff), 25.0) == -1 &&
  4101. floatround(floatabs(ac_zAngle - ACVehInfo[ac_vehid][acZAngle])) == 180 &&
  4102. (floatcmp(ac_vX, 0.0) == -1) != (floatcmp(ACVehInfo[ac_vehid][acVelX], 0.0) == -1) &&
  4103. (floatcmp(ac_vY, 0.0) == -1) != (floatcmp(ACVehInfo[ac_vehid][acVelY], 0.0) == -1) &&
  4104. (floatcmp(ac_vZ, 0.0) == -1) != (floatcmp(ACVehInfo[ac_vehid][acVelZ], 0.0) == -1))
  4105. {
  4106. #if defined DEBUG
  4107. printf("[Nex-AC debug] Speed: %.1f, speed diff: %.1f, z angle: %f, old z angle: %f, vehicleid: %d",
  4108. ac_vsp, ac_spDiff, ac_zAngle, ACVehInfo[ac_vehid][acZAngle], ac_vehid);
  4109. #endif
  4110. #if defined OnCheatDetected
  4111. ac_KickWithCode(playerid, "", 0, 25);
  4112. #else
  4113. return ac_KickWithCode(playerid, "", 0, 25);
  4114. #endif
  4115. }
  4116. new Float:ac_zDiff = ac_Z - ACInfo[playerid][acPosZ];
  4117. if(17 <= ac_i <= 193 && 1 <= ac_vType[ac_i] <= 2)
  4118. {
  4119. if(ACInfo[playerid][acACAllow][10] && ac_GetSpeed(ac_vX, ac_vY, ac_vZ, false) > 270)
  4120. {
  4121. #if defined DEBUG
  4122. printf("[Nex-AC debug] Speed (x, y): %d, veh model: %d",
  4123. ac_GetSpeed(ac_vX, ac_vY, ac_vZ, false), ac_i + 400);
  4124. #endif
  4125. #if defined OnCheatDetected
  4126. ac_KickWithCode(playerid, "", 0, 10, 2);
  4127. #else
  4128. return ac_KickWithCode(playerid, "", 0, 10, 2);
  4129. #endif
  4130. }
  4131. }
  4132. else if(ACInfo[playerid][acACAllow][8])
  4133. {
  4134. if(floatcmp(ac_vZ, 0.1) >= 0 && floatcmp(ac_vZ, ACVehInfo[ac_vehid][acVelZ]) == 1 &&
  4135. floatcmp(floatabs(ACInfo[playerid][acPosX] - ac_X), ac_zDiff / 2) == -1 &&
  4136. floatcmp(floatabs(ACInfo[playerid][acPosY] - ac_Y), ac_zDiff / 2) == -1)
  4137. {
  4138. if(++ACInfo[playerid][acCheatCount][3] > (81 <= ac_i <= 110 &&
  4139. ac_vType[ac_i] == 4 ? AC_MAX_FLYHACK_B_WARNINGS : AC_MAX_FLYHACK_VEH_WARNINGS))
  4140. {
  4141. #undef AC_MAX_FLYHACK_B_WARNINGS
  4142. #if defined DEBUG
  4143. printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, vehicleid: %d",
  4144. ac_vZ, ACVehInfo[ac_vehid][acVelZ], ACInfo[playerid][acPosX] - ac_X, ACInfo[playerid][acPosY] - ac_Y, ac_zDiff, ac_vehid);
  4145. #endif
  4146. #if defined OnCheatDetected
  4147. ac_KickWithCode(playerid, "", 0, 8, 1);
  4148. ACInfo[playerid][acCheatCount][3] = 0;
  4149. #else
  4150. return ac_KickWithCode(playerid, "", 0, 8, 1);
  4151. #endif
  4152. }
  4153. }
  4154. else ACInfo[playerid][acCheatCount][3] = 0;
  4155. }
  4156. if(floatcmp(ac_dist, 0.8) == 1 &&
  4157. (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_dist_set, 0.8) == 1) &&
  4158. ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  4159. {
  4160. if(floatcmp(ac_dist, 25.0) == 1 &&
  4161. floatcmp(ac_dist, ACVehInfo[ac_vehid][acPosDiff] + ((ac_dist / 2.6) * 1.8)) == 1 &&
  4162. (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_dist_set, 25.0) == 1 &&
  4163. floatcmp(ac_dist_set, ACVehInfo[ac_vehid][acPosDiff] + ((ac_dist_set / 2.6) * 1.8)) == 1))
  4164. {
  4165. if(ACInfo[playerid][acACAllow][3] && floatcmp(ACInfo[playerid][acPosZ], -95.0) == 1)
  4166. {
  4167. #if defined DEBUG
  4168. printf("[Nex-AC debug] Distance: %f, distance set: %f, old pos diff: %f, speed: %.1f, vehicleid: %d",
  4169. ac_dist, ac_dist_set, ACVehInfo[ac_vehid][acPosDiff], ac_vsp, ac_vehid);
  4170. #endif
  4171. #if defined OnCheatDetected
  4172. ac_KickWithCode(playerid, "", 0, 3, 2);
  4173. #else
  4174. return ac_KickWithCode(playerid, "", 0, 3, 2);
  4175. #endif
  4176. }
  4177. }
  4178. else if(ACInfo[playerid][acACAllow][1] && floatcmp(ac_vsp, 16.0) == -1 &&
  4179. ++ACInfo[playerid][acCheatCount][2] > AC_MAX_AIR_VEH_WARNINGS)
  4180. {
  4181. #undef AC_MAX_AIR_VEH_WARNINGS
  4182. #if defined DEBUG
  4183. printf("[Nex-AC debug] Speed: %.1f, distance: %f, distance set: %f, vehicleid: %d",
  4184. ac_vsp, ac_dist, ac_dist_set, ac_vehid);
  4185. #endif
  4186. #if defined OnCheatDetected
  4187. ac_KickWithCode(playerid, "", 0, 1);
  4188. ACInfo[playerid][acCheatCount][2] = 0;
  4189. #else
  4190. return ac_KickWithCode(playerid, "", 0, 1);
  4191. #endif
  4192. }
  4193. }
  4194. ACVehInfo[ac_vehid][acSpeedDiff] = ac_spDiff;
  4195. }
  4196. ACVehInfo[ac_vehid][acVelX] = ac_vX;
  4197. ACVehInfo[ac_vehid][acVelY] = ac_vY;
  4198. ACVehInfo[ac_vehid][acVelZ] = ac_vZ;
  4199. ACVehInfo[ac_vehid][acPosDiff] = ac_dist;
  4200. ACVehInfo[ac_vehid][acHealth] = ac_vHealth;
  4201. ACVehInfo[ac_vehid][acZAngle] = ac_zAngle;
  4202. }
  4203. ACInfo[playerid][acSeat] = ac_s;
  4204. }
  4205. else
  4206. {
  4207. ac_sa = GetPlayerAnimationIndex(playerid);
  4208. GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  4209. ac_vX = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  4210. if(ACInfo[playerid][acAnim] != ac_sa)
  4211. {
  4212. switch(ac_sa)
  4213. {
  4214. case -1:
  4215. {
  4216. if(ACInfo[playerid][acACAllow][24])
  4217. {
  4218. #if defined OnCheatDetected
  4219. ac_KickWithCode(playerid, "", 0, 24);
  4220. #else
  4221. return ac_KickWithCode(playerid, "", 0, 24);
  4222. #endif
  4223. }
  4224. }
  4225. case 958..979:
  4226. {
  4227. if(ACInfo[playerid][acACAllow][7])
  4228. {
  4229. if(ac_w != 46)
  4230. {
  4231. if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
  4232. {
  4233. #if defined DEBUG
  4234. printf("[Nex-AC debug] Anim: %d, old anim: %d, weaponid: %d",
  4235. ac_sa, ACInfo[playerid][acAnim], ac_w);
  4236. #endif
  4237. #if defined OnCheatDetected
  4238. ac_KickWithCode(playerid, "", 0, 7, 1);
  4239. ACInfo[playerid][acCheatCount][15] = 0;
  4240. #else
  4241. return ac_KickWithCode(playerid, "", 0, 7, 1);
  4242. #endif
  4243. }
  4244. }
  4245. else ACInfo[playerid][acCheatCount][15] = 0;
  4246. }
  4247. }
  4248. case 1058:
  4249. {
  4250. if(ACInfo[playerid][acACAllow][7])
  4251. {
  4252. #if defined OnCheatDetected
  4253. ac_KickWithCode(playerid, "", 0, 7, 2);
  4254. #else
  4255. return ac_KickWithCode(playerid, "", 0, 7, 2);
  4256. #endif
  4257. }
  4258. }
  4259. case 1231:
  4260. {
  4261. if(ACInfo[playerid][acACAllow][30])
  4262. {
  4263. ac_i = GetPlayerSkin(playerid);
  4264. if(!ac_PedAnims && ac_i > 0 && ac_i != 74 && ac_w != 46)
  4265. {
  4266. #if defined DEBUG
  4267. printf("[Nex-AC debug] Skin: %d, old anim: %d, weaponid: %d",
  4268. ac_i, ACInfo[playerid][acAnim], ac_w);
  4269. #endif
  4270. #if defined OnCheatDetected
  4271. ac_KickWithCode(playerid, "", 0, 30);
  4272. #else
  4273. return ac_KickWithCode(playerid, "", 0, 30);
  4274. #endif
  4275. }
  4276. }
  4277. }
  4278. }
  4279. }
  4280. else if(ACInfo[playerid][acACAllow][7])
  4281. {
  4282. if(floatcmp(ac_vX, 31.0) == 1 && floatcmp(ACInfo[playerid][acSpeed], ac_vX) == -1 && 1538 <= ac_sa <= 1544)
  4283. {
  4284. if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_FLYHACK_WARNINGS)
  4285. {
  4286. #undef AC_MAX_FLYHACK_WARNINGS
  4287. #if defined DEBUG
  4288. printf("[Nex-AC debug] Speed: %.1f, old speed: %.1f, anim: %d",
  4289. ac_vX, ACInfo[playerid][acSpeed], ac_sa);
  4290. #endif
  4291. #if defined OnCheatDetected
  4292. ac_KickWithCode(playerid, "", 0, 7, 3);
  4293. ACInfo[playerid][acCheatCount][15] = 0;
  4294. #else
  4295. return ac_KickWithCode(playerid, "", 0, 7, 3);
  4296. #endif
  4297. }
  4298. }
  4299. else ACInfo[playerid][acCheatCount][15] = 0;
  4300. }
  4301. if(ACInfo[playerid][acSet][4] != -1)
  4302. {
  4303. if(ac_specact == ACInfo[playerid][acSet][4]) ACInfo[playerid][acSet][4] = -1;
  4304. else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtc][6] + ac_gpp &&
  4305. ++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS)
  4306. {
  4307. #if defined DEBUG
  4308. printf(DEBUG_CODE_5, playerid, "SetPlayerSpecialAction");
  4309. printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSet][4], ac_specact);
  4310. #endif
  4311. #if defined OnCheatDetected
  4312. ac_KickWithCode(playerid, "", 0, 52, 12);
  4313. ACInfo[playerid][acSet][4] = -1;
  4314. #else
  4315. return ac_KickWithCode(playerid, "", 0, 52, 12);
  4316. #endif
  4317. }
  4318. }
  4319. else if(ac_specact != ACInfo[playerid][acSpecAct])
  4320. {
  4321. if(ac_specact == ACInfo[playerid][acNextSpecAct]) ACInfo[playerid][acNextSpecAct] = -1;
  4322. else if(ACInfo[playerid][acACAllow][18])
  4323. {
  4324. switch(ac_specact)
  4325. {
  4326. case SPECIAL_ACTION_NONE:
  4327. {
  4328. switch(ACInfo[playerid][acSpecAct])
  4329. {
  4330. case SPECIAL_ACTION_USECELLPHONE, SPECIAL_ACTION_CUFFED, SPECIAL_ACTION_CARRY:
  4331. {
  4332. #if defined OnCheatDetected
  4333. ac_KickWithCode(playerid, "", 0, 18, 1);
  4334. #else
  4335. return ac_KickWithCode(playerid, "", 0, 18, 1);
  4336. #endif
  4337. }
  4338. }
  4339. }
  4340. case SPECIAL_ACTION_DUCK:
  4341. {
  4342. if(ACInfo[playerid][acSpecAct] > SPECIAL_ACTION_NONE &&
  4343. !(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_CUFFED))
  4344. {
  4345. #if defined OnCheatDetected
  4346. ac_KickWithCode(playerid, "", 0, 18, 2);
  4347. #else
  4348. return ac_KickWithCode(playerid, "", 0, 18, 2);
  4349. #endif
  4350. }
  4351. }
  4352. case SPECIAL_ACTION_USEJETPACK:
  4353. {
  4354. if(!IsPlayerInRangeOfPoint(playerid, 8.0, ACInfo[playerid][acDropJpX],
  4355. ACInfo[playerid][acDropJpY], ACInfo[playerid][acDropJpZ]))
  4356. {
  4357. #if defined DEBUG
  4358. printf("[Nex-AC debug] AC spec act: %d, spec act: %d, distance: %f",
  4359. ACInfo[playerid][acSpecAct], ac_specact, GetPlayerDistanceFromPoint(playerid,
  4360. ACInfo[playerid][acDropJpX], ACInfo[playerid][acDropJpY], ACInfo[playerid][acDropJpZ]));
  4361. #endif
  4362. #if defined OnCheatDetected
  4363. ac_KickWithCode(playerid, "", 0, 18, 3);
  4364. #else
  4365. return ac_KickWithCode(playerid, "", 0, 18, 3);
  4366. #endif
  4367. }
  4368. ACInfo[playerid][acDropJpX] = ACInfo[playerid][acDropJpY] =
  4369. ACInfo[playerid][acDropJpZ] = 20000.0;
  4370. }
  4371. case SPECIAL_ACTION_ENTER_VEHICLE:
  4372. {
  4373. switch(ACInfo[playerid][acSpecAct])
  4374. {
  4375. case SPECIAL_ACTION_DANCE1, SPECIAL_ACTION_DANCE2, SPECIAL_ACTION_DANCE3, SPECIAL_ACTION_DANCE4, SPECIAL_ACTION_USECELLPHONE, 68:
  4376. {
  4377. #if defined OnCheatDetected
  4378. ac_KickWithCode(playerid, "", 0, 18, 4);
  4379. #else
  4380. return ac_KickWithCode(playerid, "", 0, 18, 4);
  4381. #endif
  4382. }
  4383. }
  4384. }
  4385. default:
  4386. {
  4387. if(!((SPECIAL_ACTION_DRINK_BEER <= ac_specact <= SPECIAL_ACTION_CUFFED &&
  4388. ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK ||
  4389. ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) &&
  4390. ac_specact == ACInfo[playerid][acLastSpecAct]) &&
  4391. (!ACInfo[playerid][acVeh] || ac_specact != SPECIAL_ACTION_EXIT_VEHICLE &&
  4392. ac_specact != SPECIAL_ACTION_USECELLPHONE &&
  4393. !(SPECIAL_ACTION_CUFFED <= ac_specact <= SPECIAL_ACTION_CARRY)))
  4394. {
  4395. #if defined DEBUG
  4396. printf("[Nex-AC debug] AC spec act: %d, spec act: %d, Last spec act: %d, last vehicleid: %d",
  4397. ACInfo[playerid][acSpecAct], ac_specact, ACInfo[playerid][acLastSpecAct], ACInfo[playerid][acVeh]);
  4398. #endif
  4399. #if defined OnCheatDetected
  4400. ac_KickWithCode(playerid, "", 0, 18, 5);
  4401. #else
  4402. return ac_KickWithCode(playerid, "", 0, 18, 5);
  4403. #endif
  4404. }
  4405. }
  4406. }
  4407. }
  4408. ACInfo[playerid][acLastSpecAct] = ACInfo[playerid][acSpecAct];
  4409. }
  4410. if(GetPlayerSurfingVehicleID(playerid) == INVALID_VEHICLE_ID &&
  4411. GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID)
  4412. {
  4413. if(floatcmp(ac_dist, 0.7) == 1 &&
  4414. (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_dist_set, 0.7) == 1) &&
  4415. ac_gtc > ACInfo[playerid][acGtc][11] + ac_gpp)
  4416. {
  4417. if(floatcmp(ac_dist, 30.0) == 1 &&
  4418. (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_dist_set, 30.0) == 1))
  4419. {
  4420. if(ACInfo[playerid][acACAllow][2] &&
  4421. !ACInfo[playerid][acIntEnterExits] && floatcmp(ACInfo[playerid][acPosZ], -95.0) == 1)
  4422. {
  4423. #if defined DEBUG
  4424. printf("[Nex-AC debug] Distance: %f, distance set: %f, speed: %.1f, pos x, y, z: %f, %f, %f",
  4425. ac_dist, ac_dist_set, ac_vX, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  4426. #endif
  4427. #if defined OnCheatDetected
  4428. ac_KickWithCode(playerid, "", 0, 2, 2);
  4429. #else
  4430. return ac_KickWithCode(playerid, "", 0, 2, 2);
  4431. #endif
  4432. }
  4433. }
  4434. else if(floatcmp(ac_vX, ac_dist * (floatcmp(ac_dist, 1.0) == -1 ? 20.0 : 5.0)) <= 0 &&
  4435. (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_vX, ac_dist_set * (floatcmp(ac_dist_set, 1.0) == -1 ? 20.0 : 5.0)) <= 0))
  4436. {
  4437. if(floatcmp(ac_vX, 3.0) == -1 && floatcmp(ac_dist, 5.0) == 1 &&
  4438. (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_dist_set, 5.0) == 1))
  4439. {
  4440. if(ACInfo[playerid][acACAllow][2])
  4441. {
  4442. #if defined DEBUG
  4443. printf("[Nex-AC debug] Speed: %.1f, distance: %f, distance set: %f",
  4444. ac_vX, ac_dist, ac_dist_set);
  4445. #endif
  4446. #if defined OnCheatDetected
  4447. ac_KickWithCode(playerid, "", 0, 2, 3);
  4448. #else
  4449. return ac_KickWithCode(playerid, "", 0, 2, 3);
  4450. #endif
  4451. }
  4452. }
  4453. else if(ACInfo[playerid][acACAllow][0] && ac_vX &&
  4454. ++ACInfo[playerid][acCheatCount][1] > AC_MAX_AIR_WARNINGS)
  4455. {
  4456. #undef AC_MAX_AIR_WARNINGS
  4457. #if defined DEBUG
  4458. printf("[Nex-AC debug] Speed: %.1f, distance: %f, distance set: %f", ac_vX, ac_dist, ac_dist_set);
  4459. #endif
  4460. #if defined OnCheatDetected
  4461. ac_KickWithCode(playerid, "", 0, 0);
  4462. ACInfo[playerid][acCheatCount][1] = 0;
  4463. #else
  4464. return ac_KickWithCode(playerid, "", 0, 0);
  4465. #endif
  4466. }
  4467. }
  4468. }
  4469. if(ac_gtc > ACInfo[playerid][acGtc][10] + ac_gpp)
  4470. {
  4471. if(ACInfo[playerid][acACAllow][9] &&
  4472. floatcmp(ac_vX, 257.0) == 1 && floatcmp(ACInfo[playerid][acSpeed], ac_vX) == -1)
  4473. {
  4474. #if defined DEBUG
  4475. printf("[Nex-AC debug] Speed: %.1f, old speed: %.1f", ac_vX, ACInfo[playerid][acSpeed]);
  4476. #endif
  4477. #if defined OnCheatDetected
  4478. ac_KickWithCode(playerid, "", 0, 9);
  4479. #else
  4480. return ac_KickWithCode(playerid, "", 0, 9);
  4481. #endif
  4482. }
  4483. ACInfo[playerid][acSpeed] = ac_vX;
  4484. }
  4485. }
  4486. else ACInfo[playerid][acSpeed] = ac_vX;
  4487. ACInfo[playerid][acAnim] = ac_sa;
  4488. }
  4489. ACInfo[playerid][acSpecAct] = ac_specact;
  4490. ACInfo[playerid][acHealth] = ac_health;
  4491. ACInfo[playerid][acArmour] = ac_armour;
  4492. }
  4493. ACInfo[playerid][acPosX] = ac_X;
  4494. ACInfo[playerid][acPosY] = ac_Y;
  4495. ACInfo[playerid][acPosZ] = ac_Z;
  4496. ACInfo[playerid][acLastWeapon] = ac_w;
  4497. ACInfo[playerid][acVeh] = ac_vehid;
  4498. }
  4499. }
  4500. ac_gpp = 1;
  4501. ACInfo[playerid][acLastUpdate] = ac_gtc;
  4502. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4503. && defined ac_OnPlayerUpdate
  4504. ac_gpp = ac_OnPlayerUpdate(playerid);
  4505. #endif
  4506. if(ACInfo[playerid][acACAllow][33] && ac_gpp) return ACInfo[playerid][acFreeze];
  4507. return ac_gpp;
  4508. }
  4509.  
  4510. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4511. #if defined _ALS_OnPlayerUpdate
  4512. #undef OnPlayerUpdate
  4513. #else
  4514. #define _ALS_OnPlayerUpdate
  4515. #endif
  4516. #define OnPlayerUpdate ac_OnPlayerUpdate
  4517. #if defined ac_OnPlayerUpdate
  4518. forward ac_OnPlayerUpdate(playerid);
  4519. #endif
  4520. #endif
  4521.  
  4522. #if defined _inc_y_hooks || defined _INC_y_hooks
  4523. hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  4524. #else
  4525. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  4526. #endif
  4527. {
  4528. if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) return 0;
  4529. if((newkeys & KEY_SECONDARY_ATTACK) && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USEJETPACK &&
  4530. GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_USEJETPACK)
  4531. {
  4532. ACInfo[playerid][acDropJpX] = ACInfo[playerid][acPosX];
  4533. ACInfo[playerid][acDropJpY] = ACInfo[playerid][acPosY];
  4534. ACInfo[playerid][acDropJpZ] = ACInfo[playerid][acPosZ];
  4535. }
  4536. if((newkeys & KEY_CROUCH) && 24 <= GetPlayerWeapon(playerid) <= 25) ACInfo[playerid][acCheatCount][14] = 0;
  4537. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4538. && defined ac_OnPlayerKeyStateChange
  4539. return ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  4540. #else
  4541. return 1;
  4542. #endif
  4543. }
  4544.  
  4545. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4546. #if defined _ALS_OnPlayerKeyStateChange
  4547. #undef OnPlayerKeyStateChange
  4548. #else
  4549. #define _ALS_OnPlayerKeyStateChange
  4550. #endif
  4551. #define OnPlayerKeyStateChange ac_OnPlayerKeyStateChange
  4552. #if defined ac_OnPlayerKeyStateChange
  4553. forward ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  4554. #endif
  4555. #endif
  4556.  
  4557. #if defined _inc_y_hooks || defined _INC_y_hooks
  4558. hook OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  4559. #else
  4560. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  4561. #endif
  4562. {
  4563. if(ACInfo[playerid][acKicked]) return 1;
  4564. new ac_gtc = GetTickCount();
  4565. if(ACInfo[playerid][acACAllow][49])
  4566. {
  4567. if(ac_gtc < ACInfo[playerid][acCall][2] + ac_Mtfc[2][0])
  4568. {
  4569. ac_FloodDetect(playerid, 2);
  4570. return 1;
  4571. }
  4572. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4573. else ACInfo[playerid][acFloodCount][2] = ACInfo[playerid][acFloodCount][27] = 0;
  4574. }
  4575. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][2] = ac_gtc;
  4576. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4577. && defined ac_OnPlayerClickMap
  4578. return ac_OnPlayerClickMap(playerid, fX, fY, fZ);
  4579. #else
  4580. return 0;
  4581. #endif
  4582. }
  4583.  
  4584. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4585. #if defined _ALS_OnPlayerClickMap
  4586. #undef OnPlayerClickMap
  4587. #else
  4588. #define _ALS_OnPlayerClickMap
  4589. #endif
  4590. #define OnPlayerClickMap ac_OnPlayerClickMap
  4591. #if defined ac_OnPlayerClickMap
  4592. forward ac_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
  4593. #endif
  4594. #endif
  4595.  
  4596. #if defined _inc_y_hooks || defined _INC_y_hooks
  4597. hook OnPlayerClickPlayer(playerid, clickedplayerid, source)
  4598. #else
  4599. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  4600. #endif
  4601. {
  4602. if(ACInfo[playerid][acKicked]) return 1;
  4603. new ac_gtc = GetTickCount();
  4604. if(ACInfo[playerid][acACAllow][49])
  4605. {
  4606. if(ac_gtc < ACInfo[playerid][acCall][3] + ac_Mtfc[3][0])
  4607. {
  4608. ac_FloodDetect(playerid, 3);
  4609. return 1;
  4610. }
  4611. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4612. else ACInfo[playerid][acFloodCount][3] = ACInfo[playerid][acFloodCount][27] = 0;
  4613. }
  4614. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][3] = ac_gtc;
  4615. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4616. && defined ac_OnPlayerClickPlayer
  4617. return ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  4618. #else
  4619. return 0;
  4620. #endif
  4621. }
  4622.  
  4623. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4624. #if defined _ALS_OnPlayerClickPlayer
  4625. #undef OnPlayerClickPlayer
  4626. #else
  4627. #define _ALS_OnPlayerClickPlayer
  4628. #endif
  4629. #define OnPlayerClickPlayer ac_OnPlayerClickPlayer
  4630. #if defined ac_OnPlayerClickPlayer
  4631. forward ac_OnPlayerClickPlayer(playerid, clickedplayerid, source);
  4632. #endif
  4633. #endif
  4634.  
  4635. #if defined _inc_y_hooks || defined _INC_y_hooks
  4636. hook OnPlayerClickTextDraw(playerid, Text:clickedid)
  4637. #else
  4638. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  4639. #endif
  4640. {
  4641. if(ACInfo[playerid][acKicked]) return 1;
  4642. new ac_gtc = GetTickCount();
  4643. if(ACInfo[playerid][acACAllow][49])
  4644. {
  4645. if(ac_gtc < ACInfo[playerid][acCall][4] + ac_Mtfc[4][0])
  4646. {
  4647. ac_FloodDetect(playerid, 4);
  4648. return 1;
  4649. }
  4650. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4651. else ACInfo[playerid][acFloodCount][4] = ACInfo[playerid][acFloodCount][27] = 0;
  4652. }
  4653. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][4] = ac_gtc;
  4654. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4655. && defined ac_OnPlayerClickTextDraw
  4656. return ac_OnPlayerClickTextDraw(playerid, clickedid);
  4657. #else
  4658. return 0;
  4659. #endif
  4660. }
  4661.  
  4662. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4663. #if defined _ALS_OnPlayerClickTextDraw
  4664. #undef OnPlayerClickTextDraw
  4665. #else
  4666. #define _ALS_OnPlayerClickTextDraw
  4667. #endif
  4668. #define OnPlayerClickTextDraw ac_OnPlayerClickTextDraw
  4669. #if defined ac_OnPlayerClickTextDraw
  4670. forward ac_OnPlayerClickTextDraw(playerid, Text:clickedid);
  4671. #endif
  4672. #endif
  4673.  
  4674. #if defined _inc_y_hooks || defined _INC_y_hooks
  4675. hook OnPlayerCommandText(playerid, cmdtext[])
  4676. #else
  4677. public OnPlayerCommandText(playerid, cmdtext[])
  4678. #endif
  4679. {
  4680. if(ACInfo[playerid][acKicked]) return 1;
  4681. new ac_gtc = GetTickCount();
  4682. if(ACInfo[playerid][acACAllow][49])
  4683. {
  4684. if(ac_gtc < ACInfo[playerid][acCall][5] + ac_Mtfc[5][0])
  4685. {
  4686. ac_FloodDetect(playerid, 5);
  4687. return 1;
  4688. }
  4689. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4690. else ACInfo[playerid][acFloodCount][5] = ACInfo[playerid][acFloodCount][27] = 0;
  4691. }
  4692. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][5] = ac_gtc;
  4693. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4694. && defined ac_OnPlayerCommandText
  4695. return ac_OnPlayerCommandText(playerid, cmdtext);
  4696. #else
  4697. return 0;
  4698. #endif
  4699. }
  4700.  
  4701. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4702. #if defined _ALS_OnPlayerCommandText
  4703. #undef OnPlayerCommandText
  4704. #else
  4705. #define _ALS_OnPlayerCommandText
  4706. #endif
  4707. #define OnPlayerCommandText ac_OnPlayerCommandText
  4708. #if defined ac_OnPlayerCommandText
  4709. forward ac_OnPlayerCommandText(playerid, cmdtext[]);
  4710. #endif
  4711. #endif
  4712.  
  4713. #if defined _inc_y_hooks || defined _INC_y_hooks
  4714. hook OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  4715. #else
  4716. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  4717. #endif
  4718. {
  4719. if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) return 0;
  4720. if(!IsPlayerNPC(playerid))
  4721. {
  4722. new ac_gtc = GetTickCount();
  4723. if(ACInfo[playerid][acACAllow][49])
  4724. {
  4725. if(ac_gtc < ACInfo[playerid][acCall][6] + ac_Mtfc[6][0]) return ac_FloodDetect(playerid, 6);
  4726. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4727. else ACInfo[playerid][acFloodCount][6] = ACInfo[playerid][acFloodCount][27] = 0;
  4728. }
  4729. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][6] = ac_gtc;
  4730. new ac_model = GetVehicleModel(vehicleid) - 400;
  4731. if(ACInfo[playerid][acACAllow][44] && ac_model < 0) return ac_KickWithCode(playerid, "", 0, 44, 1);
  4732. if(ACInfo[playerid][acEnterVeh] != vehicleid)
  4733. {
  4734. new ac_tmpPrm1, ac_tmpPrm2;
  4735. GetVehicleParamsEx(vehicleid, ac_tmpPrm2, ac_tmpPrm2, ac_tmpPrm2, ac_tmpPrm1, ac_tmpPrm2, ac_tmpPrm2, ac_tmpPrm2);
  4736. if(ispassenger || ac_tmpPrm1 != VEHICLE_PARAMS_ON)
  4737. {
  4738. ACInfo[playerid][acEnterVeh] = vehicleid;
  4739. if(ac_model == 170 || 30 <= ac_model <= 195 && ac_vType[ac_model] == 3) ACInfo[playerid][acEnterVehTime] = 0;
  4740. else ACInfo[playerid][acEnterVehTime] = ac_gtc;
  4741. }
  4742. }
  4743. }
  4744. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4745. && defined ac_OnPlayerEnterVehicle
  4746. return ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  4747. #else
  4748. return 1;
  4749. #endif
  4750. }
  4751.  
  4752. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4753. #if defined _ALS_OnPlayerEnterVehicle
  4754. #undef OnPlayerEnterVehicle
  4755. #else
  4756. #define _ALS_OnPlayerEnterVehicle
  4757. #endif
  4758. #define OnPlayerEnterVehicle ac_OnPlayerEnterVehicle
  4759. #if defined ac_OnPlayerEnterVehicle
  4760. forward ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  4761. #endif
  4762. #endif
  4763.  
  4764. #if defined _inc_y_hooks || defined _INC_y_hooks
  4765. hook OnPlayerExitVehicle(playerid, vehicleid)
  4766. #else
  4767. public OnPlayerExitVehicle(playerid, vehicleid)
  4768. #endif
  4769. {
  4770. if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) return 0;
  4771. if(!IsPlayerNPC(playerid))
  4772. {
  4773. new ac_i = GetTickCount();
  4774. if(ACInfo[playerid][acACAllow][49])
  4775. {
  4776. if(ac_i < ACInfo[playerid][acCall][7] + ac_Mtfc[7][0]) return ac_FloodDetect(playerid, 7);
  4777. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4778. else ACInfo[playerid][acFloodCount][7] = ACInfo[playerid][acFloodCount][27] = 0;
  4779. }
  4780. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][7] = ac_i;
  4781. ac_i = GetVehicleModel(ACInfo[playerid][acVeh]) - 400;
  4782. if(17 <= ac_i <= 193 && ac_vType[ac_i] == 2) ACInfo[playerid][acParachute] = true;
  4783. else ACInfo[playerid][acParachute] = false;
  4784. }
  4785. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4786. && defined ac_OnPlayerExitVehicle
  4787. return ac_OnPlayerExitVehicle(playerid, vehicleid);
  4788. #else
  4789. return 1;
  4790. #endif
  4791. }
  4792.  
  4793. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4794. #if defined _ALS_OnPlayerExitVehicle
  4795. #undef OnPlayerExitVehicle
  4796. #else
  4797. #define _ALS_OnPlayerExitVehicle
  4798. #endif
  4799. #define OnPlayerExitVehicle ac_OnPlayerExitVehicle
  4800. #if defined ac_OnPlayerExitVehicle
  4801. forward ac_OnPlayerExitVehicle(playerid, vehicleid);
  4802. #endif
  4803. #endif
  4804.  
  4805. #if defined OnPlayerPickUpDynamicPickup\
  4806. && defined Streamer_GetDistanceToItem\
  4807. && defined Streamer_GetIntData
  4808. #if defined _inc_y_hooks || defined _INC_y_hooks
  4809. #if defined STREAMER_ENABLE_TAGS
  4810. hook OnPlayerPickUpDynPickup(playerid, STREAMER_TAG_PICKUP pickupid)
  4811. #else
  4812. hook OnPlayerPickUpDynPickup(playerid, pickupid)
  4813. #endif
  4814. #else
  4815. #if defined STREAMER_ENABLE_TAGS
  4816. public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid)
  4817. #else
  4818. public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  4819. #endif
  4820. #endif
  4821. {
  4822. if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) return 0;
  4823. new ac_i = GetTickCount();
  4824. if(ACInfo[playerid][acACAllow][49])
  4825. {
  4826. if(ac_i < ACInfo[playerid][acCall][8] + ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
  4827. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4828. else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
  4829. }
  4830. if(ACInfo[playerid][acACAllow][6])
  4831. {
  4832. new Float:ac_X, Float:ac_Y, Float:ac_Z, Float:ac_tmp, Float:ac_tmp2;
  4833. GetPlayerPos(playerid, ac_X, ac_Y, ac_Z);
  4834. Streamer_GetDistanceToItem(ac_X, ac_Y, ac_Z, STREAMER_TYPE_PICKUP, pickupid, ac_tmp);
  4835. Streamer_GetDistanceToItem(ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_Z : ACInfo[playerid][acSetPosZ]), STREAMER_TYPE_PICKUP, pickupid, ac_tmp2);
  4836. if(floatcmp(ac_tmp, 8.0) == 1 && (ACInfo[playerid][acSet][8] == -1 || floatcmp(ac_tmp2, 8.0) == 1))
  4837. {
  4838. #if defined DEBUG
  4839. printf("[Nex-AC debug] Pickupid: %d, distance: %f, distance 2: %f, acSet[8]: %d",
  4840. _:pickupid, ac_tmp, ac_tmp2, ACInfo[playerid][acSet][8]);
  4841. #endif
  4842. #if defined OnCheatDetected
  4843. ac_KickWithCode(playerid, "", 0, 6, 2);
  4844. #else
  4845. return ac_KickWithCode(playerid, "", 0, 6, 2);
  4846. #endif
  4847. }
  4848. }
  4849. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
  4850. switch((ac_i = Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID)))
  4851. {
  4852. case 2: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK;
  4853. case 3: ACInfo[playerid][acHealth] = 100;
  4854. case 4: ACInfo[playerid][acArmour] = 100;
  4855. default:
  4856. {
  4857. if(ac_i > 100)
  4858. {
  4859. ac_i -= 100;
  4860. new ac_s = ac_wSlot[ac_i];
  4861. if(ACInfo[playerid][acWeapon][ac_s] == ac_i ||
  4862. 3 <= ac_s <= 5 && ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i];
  4863. }
  4864. }
  4865. }
  4866. ACInfo[playerid][acLastPickup] = _:pickupid + MAX_PICKUPS;
  4867. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4868. && defined ac_OnPlayerPickUpDynamicPickup
  4869. return ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  4870. #else
  4871. return 1;
  4872. #endif
  4873. }
  4874.  
  4875. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4876. #if defined _ALS_OnPlayerPickUpDynamicPicku\
  4877. || defined _ALS_OnPlayerPickUpDynPickup\
  4878. || defined _ALS_OnPlayerPickUpDynamicPick || defined _ALS_OnPlayerPickUpDynamicPUp
  4879. #undef OnPlayerPickUpDynamicPickup
  4880. #else
  4881. #define _ALS_OnPlayerPickUpDynPickup
  4882. #endif
  4883. #define OnPlayerPickUpDynamicPickup ac_OnPlayerPickUpDynamicPickup
  4884. #if defined ac_OnPlayerPickUpDynamicPickup
  4885. #if defined STREAMER_ENABLE_TAGS
  4886. forward ac_OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP pickupid);
  4887. #else
  4888. forward ac_OnPlayerPickUpDynamicPickup(playerid, pickupid);
  4889. #endif
  4890. #endif
  4891. #endif
  4892. #endif
  4893.  
  4894. #if defined _inc_y_hooks || defined _INC_y_hooks
  4895. hook OnPlayerPickUpPickup(playerid, pickupid)
  4896. #else
  4897. public OnPlayerPickUpPickup(playerid, pickupid)
  4898. #endif
  4899. {
  4900. if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked] || !(0 <= pickupid < MAX_PICKUPS)) return 0;
  4901. #if defined Streamer_GetItemStreamerID\
  4902. && defined IsValidDynamicPickup
  4903. #if defined STREAMER_ENABLE_TAGS
  4904. new STREAMER_TAG_PICKUP streamerid = STREAMER_TAG_PICKUP Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
  4905. #else
  4906. new streamerid = Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid);
  4907. #endif
  4908. if(!IsValidDynamicPickup(streamerid))
  4909. {
  4910. #endif
  4911. new ac_i = GetTickCount();
  4912. if(ACInfo[playerid][acACAllow][49])
  4913. {
  4914. if(ac_i < ACInfo[playerid][acCall][8] + ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8);
  4915. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4916. else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0;
  4917. }
  4918. if(ACInfo[playerid][acACAllow][6] &&
  4919. !IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]) &&
  4920. (ACInfo[playerid][acSet][8] == -1 || floatcmp(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]), 8.0) == 1))
  4921. {
  4922. #if defined DEBUG
  4923. printf("[Nex-AC debug] Pickupid: %d, distance: %f",
  4924. pickupid, GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX],
  4925. ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]));
  4926. #endif
  4927. #if defined OnCheatDetected
  4928. ac_KickWithCode(playerid, "", 0, 6, 1);
  4929. #else
  4930. return ac_KickWithCode(playerid, "", 0, 6, 1);
  4931. #endif
  4932. }
  4933. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i;
  4934. switch(ACPickInfo[pickupid][acType])
  4935. {
  4936. case 1:
  4937. {
  4938. ac_i = ACPickInfo[pickupid][acWeapon];
  4939. new ac_s = ac_wSlot[ac_i];
  4940. if(ACInfo[playerid][acWeapon][ac_s] == ac_i ||
  4941. 3 <= ac_s <= 5 && ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i];
  4942. }
  4943. case 2: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK;
  4944. case 3: ACInfo[playerid][acHealth] = 100;
  4945. case 4: ACInfo[playerid][acArmour] = 100;
  4946. }
  4947. ACInfo[playerid][acLastPickup] = pickupid;
  4948. #if defined Streamer_GetItemStreamerID\
  4949. && defined IsValidDynamicPickup
  4950. }
  4951. #endif
  4952. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  4953. && defined ac_OnPlayerPickUpPickup
  4954. #if defined IsValidDynamicPickup
  4955. if(IsValidDynamicPickup(streamerid) ||
  4956. !ACPickInfo[pickupid][acIsStatic]) return ac_OnPlayerPickUpPickup(playerid, pickupid);
  4957. #else
  4958. if(!ACPickInfo[pickupid][acIsStatic]) return ac_OnPlayerPickUpPickup(playerid, pickupid);
  4959. #endif
  4960. return 1;
  4961. #else
  4962. return 1;
  4963. #endif
  4964. }
  4965.  
  4966. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  4967. #if defined _ALS_OnPlayerPickUpPickup
  4968. #undef OnPlayerPickUpPickup
  4969. #else
  4970. #define _ALS_OnPlayerPickUpPickup
  4971. #endif
  4972. #define OnPlayerPickUpPickup ac_OnPlayerPickUpPickup
  4973. #if defined ac_OnPlayerPickUpPickup
  4974. forward ac_OnPlayerPickUpPickup(playerid, pickupid);
  4975. #endif
  4976. #endif
  4977.  
  4978. #if defined _inc_y_hooks || defined _INC_y_hooks
  4979. hook OnPlayerRequestClass(playerid, classid)
  4980. #else
  4981. public OnPlayerRequestClass(playerid, classid)
  4982. #endif
  4983. {
  4984. if(ACInfo[playerid][acKicked]) return 0;
  4985. new ac_gtc = GetTickCount();
  4986. if(ACInfo[playerid][acACAllow][49])
  4987. {
  4988. if(ac_gtc < ACInfo[playerid][acCall][9] + ac_Mtfc[9][0]) return ac_FloodDetect(playerid, 9);
  4989. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  4990. else ACInfo[playerid][acFloodCount][9] = ACInfo[playerid][acFloodCount][27] = 0;
  4991. }
  4992. ACInfo[playerid][acLogged] = 1;
  4993. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][9] = ac_gtc;
  4994. ACInfo[playerid][acSpawnWeapon1] = ac_Class[classid][0][0];
  4995. ACInfo[playerid][acSpawnAmmo1] = ac_Class[classid][0][1];
  4996. ACInfo[playerid][acSpawnWeapon2] = ac_Class[classid][1][0];
  4997. ACInfo[playerid][acSpawnAmmo2] = ac_Class[classid][1][1];
  4998. ACInfo[playerid][acSpawnWeapon3] = ac_Class[classid][2][0];
  4999. ACInfo[playerid][acSpawnAmmo3] = ac_Class[classid][2][1];
  5000. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5001. && defined ac_OnPlayerRequestClass
  5002. return ac_OnPlayerRequestClass(playerid, classid);
  5003. #else
  5004. return 1;
  5005. #endif
  5006. }
  5007.  
  5008. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5009. #if defined _ALS_OnPlayerRequestClass
  5010. #undef OnPlayerRequestClass
  5011. #else
  5012. #define _ALS_OnPlayerRequestClass
  5013. #endif
  5014. #define OnPlayerRequestClass ac_OnPlayerRequestClass
  5015. #if defined ac_OnPlayerRequestClass
  5016. forward ac_OnPlayerRequestClass(playerid, classid);
  5017. #endif
  5018. #endif
  5019.  
  5020. #if defined _inc_y_hooks || defined _INC_y_hooks
  5021. hook OnPlayerSelectedMenuRow(playerid, row)
  5022. #else
  5023. public OnPlayerSelectedMenuRow(playerid, row)
  5024. #endif
  5025. {
  5026. if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) return 0;
  5027. new ac_gtc = GetTickCount();
  5028. if(ACInfo[playerid][acACAllow][49])
  5029. {
  5030. if(ac_gtc < ACInfo[playerid][acCall][10] + ac_Mtfc[10][0]) ac_FloodDetect(playerid, 10);
  5031. else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5032. else ACInfo[playerid][acFloodCount][10] = ACInfo[playerid][acFloodCount][27] = 0;
  5033. }
  5034. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][10] = ac_gtc;
  5035. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5036. && defined ac_OnPlayerSelectedMenuRow
  5037. return ac_OnPlayerSelectedMenuRow(playerid, row);
  5038. #else
  5039. return 1;
  5040. #endif
  5041. }
  5042.  
  5043. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5044. #if defined _ALS_OnPlayerSelectedMenuRow
  5045. #undef OnPlayerSelectedMenuRow
  5046. #else
  5047. #define _ALS_OnPlayerSelectedMenuRow
  5048. #endif
  5049. #define OnPlayerSelectedMenuRow ac_OnPlayerSelectedMenuRow
  5050. #if defined ac_OnPlayerSelectedMenuRow
  5051. forward ac_OnPlayerSelectedMenuRow(playerid, row);
  5052. #endif
  5053. #endif
  5054.  
  5055. #if defined _inc_y_hooks || defined _INC_y_hooks
  5056. hook OnPlayerStateChange(playerid, newstate, oldstate)
  5057. #else
  5058. public OnPlayerStateChange(playerid, newstate, oldstate)
  5059. #endif
  5060. {
  5061. if(ACInfo[playerid][acKicked]) return 0;
  5062. if(!IsPlayerNPC(playerid))
  5063. {
  5064. new ac_i = GetTickCount();
  5065. if(ACInfo[playerid][acACAllow][49])
  5066. {
  5067. if(ac_i < ACInfo[playerid][acCall][11] + ac_Mtfc[11][0])
  5068. {
  5069. if(newstate != PLAYER_STATE_ONFOOT || oldstate != PLAYER_STATE_SPAWNED)
  5070. {
  5071. new ac_model;
  5072. if(oldstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(ACInfo[playerid][acVeh]) - 400;
  5073. else if(newstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(GetPlayerVehicleID(playerid)) - 400;
  5074. if(!(30 <= ac_model <= 195 && ac_vType[ac_model] == 3)) ac_FloodDetect(playerid, 11);
  5075. }
  5076. }
  5077. else if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5078. else ACInfo[playerid][acFloodCount][11] = ACInfo[playerid][acFloodCount][27] = 0;
  5079. }
  5080. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][11] = ac_i;
  5081. switch(oldstate)
  5082. {
  5083. case PLAYER_STATE_NONE:
  5084. {
  5085. if(ACInfo[playerid][acACAllow][48] &&
  5086. !(PLAYER_STATE_SPAWNED <= newstate <= PLAYER_STATE_SPECTATING) && !ACInfo[playerid][acLogged])
  5087. {
  5088. #if defined DEBUG
  5089. printf("[Nex-AC debug] Newstate: %d", newstate);
  5090. #endif
  5091. ac_KickWithCode(playerid, "", 0, 48, 2);
  5092. }
  5093. }
  5094. case PLAYER_STATE_DRIVER:
  5095. {
  5096. new ac_t;
  5097. if(ACVehInfo[ACInfo[playerid][acVeh]][acDriver] == playerid) ACVehInfo[ACInfo[playerid][acVeh]][acDriver] = INVALID_PLAYER_ID;
  5098. GetPlayerWeaponData(playerid, 4, ac_t, ac_t);
  5099. if(ac_t < ACInfo[playerid][acAmmo][4] &&
  5100. !(ac_t < 0 <= ACInfo[playerid][acAmmo][4])) ACInfo[playerid][acAmmo][4] = ac_t;
  5101. if(1 <= ACInfo[playerid][acHealth] < 5)
  5102. {
  5103. ac_t = GetVehicleModel(ACInfo[playerid][acVeh]) - 400;
  5104. if(48 <= ac_t <= 186 && 4 <= ac_vType[ac_t] <= 5) ACInfo[playerid][acHealth] = 5;
  5105. }
  5106. new Float:ac_vX, Float:ac_vY, Float:ac_vZ;
  5107. if(ACInfo[playerid][acACAllow][2] && newstate == PLAYER_STATE_ONFOOT && ACInfo[playerid][acSet][8] == -1)
  5108. {
  5109. if(floatcmp(ACInfo[playerid][acPosZ], -95.0) == 1 &&
  5110. floatcmp((ac_vX = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ])), 30.0) == 1)
  5111. {
  5112. #if defined DEBUG
  5113. printf("[Nex-AC debug] Distance: %f", ac_vX);
  5114. #endif
  5115. ac_KickWithCode(playerid, "", 0, 2, 4);
  5116. }
  5117. }
  5118. GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  5119. ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  5120. ACInfo[playerid][acGtc][10] = ac_i + 300;
  5121. }
  5122. case PLAYER_STATE_PASSENGER:
  5123. {
  5124. new ac_driver = ACVehInfo[ACInfo[playerid][acVeh]][acDriver], Float:ac_vX, Float:ac_vY, Float:ac_vZ;
  5125. if(ACInfo[playerid][acACAllow][2] && newstate == PLAYER_STATE_ONFOOT && ACInfo[playerid][acSet][8] == -1 &&
  5126. (ac_driver == INVALID_PLAYER_ID || ac_i < ACInfo[ac_driver][acLastUpdate] + 2000))
  5127. {
  5128. if(floatcmp((ac_vX = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ])), 30.0) == 1)
  5129. {
  5130. #if defined DEBUG
  5131. if(ac_driver == INVALID_PLAYER_ID) printf("[Nex-AC debug] Distance: %f", ac_vX);
  5132. else printf("[Nex-AC debug] Driver AFK time: %d, distance: %f", ac_i - ACInfo[ac_driver][acLastUpdate], ac_vX);
  5133. #endif
  5134. ac_KickWithCode(playerid, "", 0, 2, 5);
  5135. }
  5136. }
  5137. GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ);
  5138. ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_vX, ac_vY, ac_vZ);
  5139. ACInfo[playerid][acGtc][10] = ac_i + 300;
  5140. }
  5141. }
  5142. switch(newstate)
  5143. {
  5144. case PLAYER_STATE_ONFOOT:
  5145. {
  5146. ACInfo[playerid][acSet][11] = -1;
  5147. ACInfo[playerid][acEnterVeh] = 0;
  5148. GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5149. }
  5150. case PLAYER_STATE_DRIVER:
  5151. {
  5152. ACInfo[playerid][acSet][11] = -1;
  5153. ac_i = GetPlayerVehicleID(playerid);
  5154. if(ACInfo[playerid][acACAllow][44])
  5155. {
  5156. new ac_seatid;
  5157. if((ac_seatid = GetPlayerVehicleSeat(playerid)) != 128)
  5158. {
  5159. new ac_model = GetVehicleModel(ac_i) - 400;
  5160. if(ac_seatid || ac_model < 0 || ac_MaxPassengers[ac_model >>> 3] >>> ((ac_model & 7) << 2) & 0xF == 15 &&
  5161. ACInfo[playerid][acSet][9] == -1)
  5162. {
  5163. #if defined DEBUG
  5164. printf("[Nex-AC debug] Veh model: %d, seatid: %d", ac_model + 400, ac_seatid);
  5165. #endif
  5166. ac_KickWithCode(playerid, "", 0, 44, 2);
  5167. }
  5168. }
  5169. }
  5170. if(ACInfo[playerid][acSet][9] == -1)
  5171. {
  5172. ACVehInfo[ac_i][acDriver] = playerid;
  5173. if(ACInfo[playerid][acACAllow][4])
  5174. {
  5175. ac_i = GetVehicleModel(ac_i);
  5176. new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5177. if(ac_i != 577 && ac_i != 592 && floatcmp(ac_dist, 15.0) == 1 || floatcmp(ac_dist, 25.0) == 1)
  5178. {
  5179. #if defined DEBUG
  5180. printf("[Nex-AC debug] Veh model: %d, distance: %f", ac_i, ac_dist);
  5181. #endif
  5182. ac_KickWithCode(playerid, "", 0, 4, 3);
  5183. }
  5184. }
  5185. GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5186. ACInfo[playerid][acCheatCount][11] = 0;
  5187. ACInfo[playerid][acVehDmgRes] = false;
  5188. ACInfo[playerid][acSetVehHealth] = -1.0;
  5189. }
  5190. }
  5191. case PLAYER_STATE_PASSENGER:
  5192. {
  5193. ACInfo[playerid][acSet][11] = -1;
  5194. ACInfo[playerid][acCheatCount][4] = 0;
  5195. if(ACInfo[playerid][acACAllow][44] && (ac_i = GetPlayerVehicleSeat(playerid)) != 128)
  5196. {
  5197. new ac_model;
  5198. if((ac_model = GetVehicleModel(GetPlayerVehicleID(playerid)) - 400) < 0)
  5199. {
  5200. #if defined DEBUG
  5201. printf("[Nex-AC debug] Veh model: %d, seatid: %d", ac_model + 400, ac_i);
  5202. #endif
  5203. ac_KickWithCode(playerid, "", 0, 44, 3);
  5204. }
  5205. else
  5206. {
  5207. new ac_maxseats = (ac_MaxPassengers[ac_model >>> 3] >>> ((ac_model & 7) << 2)) & 0xF;
  5208. if(ac_i < 1 || (ac_maxseats == 15 || ac_i > ac_maxseats) && ACInfo[playerid][acSet][9] == -1)
  5209. {
  5210. #if defined DEBUG
  5211. printf("[Nex-AC debug] Veh model: %d, max seats: %d, seatid: %d", ac_model + 400, ac_maxseats, ac_i);
  5212. #endif
  5213. ac_KickWithCode(playerid, "", 0, 44, 4);
  5214. }
  5215. }
  5216. }
  5217. }
  5218. case PLAYER_STATE_SPAWNED: GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]);
  5219. case PLAYER_STATE_SPECTATING:
  5220. {
  5221. if(ACInfo[playerid][acACAllow][21] && !ACInfo[playerid][acSpec] &&
  5222. ACInfo[playerid][acSet][6] == -1) ac_KickWithCode(playerid, "", 0, 21);
  5223. ACInfo[playerid][acHealth] = 100;
  5224. ACInfo[playerid][acSet][6] = -1;
  5225. ACInfo[playerid][acSpec] = true;
  5226. }
  5227. }
  5228. }
  5229. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5230. && defined ac_OnPlayerStateChange
  5231. return ac_OnPlayerStateChange(playerid, newstate, oldstate);
  5232. #else
  5233. return 1;
  5234. #endif
  5235. }
  5236.  
  5237. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5238. #if defined _ALS_OnPlayerStateChange
  5239. #undef OnPlayerStateChange
  5240. #else
  5241. #define _ALS_OnPlayerStateChange
  5242. #endif
  5243. #define OnPlayerStateChange ac_OnPlayerStateChange
  5244. #if defined ac_OnPlayerStateChange
  5245. forward ac_OnPlayerStateChange(playerid, newstate, oldstate);
  5246. #endif
  5247. #endif
  5248.  
  5249. #if defined _inc_y_hooks || defined _INC_y_hooks
  5250. hook OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  5251. #else
  5252. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  5253. #endif
  5254. {
  5255. if(ACInfo[playerid][acKicked]) return 0;
  5256. new ac_i, ac_gtc = GetTickCount(), bool:ac_ur, bool:ac_ur2;
  5257. if(!IsPlayerNPC(playerid))
  5258. {
  5259. if(ACInfo[playerid][acACAllow][22] && !ac_LagCompMode) return ac_KickWithCode(playerid, "", 0, 22);
  5260. if(ACInfo[playerid][acACAllow][47] &&
  5261. (!(BULLET_HIT_TYPE_NONE <= hittype <= BULLET_HIT_TYPE_PLAYER_OBJECT) ||
  5262. weaponid != 38 && !(22 <= weaponid <= 34)))
  5263. {
  5264. #if defined DEBUG
  5265. printf("[Nex-AC debug] Hittype: %d, hitid: %d, weaponid: %d", hittype, hitid, weaponid);
  5266. #endif
  5267. return ac_KickWithCode(playerid, "", 0, 47, 1);
  5268. }
  5269. new Float:ac_oX, Float:ac_oY, Float:ac_oZ, Float:ac_X, Float:ac_Y, Float:ac_Z;
  5270. GetPlayerLastShotVectors(playerid, ac_oX, ac_oY, ac_oZ, ac_X, ac_Y, ac_Z);
  5271. if(ACInfo[playerid][acACAllow][34])
  5272. {
  5273. if(!IsPlayerInRangeOfPoint(playerid, 8.0, ac_oX, ac_oY, ac_oZ))
  5274. {
  5275. if(++ACInfo[playerid][acCheatCount][5] > AC_MAX_AFK_GHOST_WARNINGS)
  5276. {
  5277. #undef AC_MAX_AFK_GHOST_WARNINGS
  5278. #if defined DEBUG
  5279. printf("[Nex-AC debug] Distance: %f", GetPlayerDistanceFromPoint(playerid, ac_oX, ac_oY, ac_oZ));
  5280. #endif
  5281. #if defined OnCheatDetected
  5282. ac_KickWithCode(playerid, "", 0, 34);
  5283. ACInfo[playerid][acCheatCount][5] = 0;
  5284. #else
  5285. return ac_KickWithCode(playerid, "", 0, 34);
  5286. #endif
  5287. }
  5288. }
  5289. else ACInfo[playerid][acCheatCount][5] = 0;
  5290. }
  5291. if(ACInfo[playerid][acACAllow][29])
  5292. {
  5293. if(hittype > BULLET_HIT_TYPE_NONE && !fX && !fY && !fZ)
  5294. {
  5295. if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_SILENT_AIM_WARNINGS)
  5296. {
  5297. #undef AC_MAX_SILENT_AIM_WARNINGS
  5298. #if defined DEBUG
  5299. printf("[Nex-AC debug] Hittype: %d, weaponid: %d", hittype, weaponid);
  5300. #endif
  5301. #if defined OnCheatDetected
  5302. ac_KickWithCode(playerid, "", 0, 29, 1);
  5303. ACInfo[playerid][acCheatCount][13] = 0;
  5304. #else
  5305. return ac_KickWithCode(playerid, "", 0, 29, 1);
  5306. #endif
  5307. }
  5308. }
  5309. else
  5310. {
  5311. ACInfo[playerid][acCheatCount][13] = 0;
  5312. if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID &&
  5313. !ACInfo[hitid][acDead] && ac_gtc < ACInfo[hitid][acLastUpdate] + 1500 && !IsPlayerInAnyVehicle(hitid) &&
  5314. GetPlayerSurfingVehicleID(hitid) == INVALID_VEHICLE_ID && GetPlayerSurfingObjectID(hitid) == INVALID_OBJECT_ID)
  5315. {
  5316. if(!IsPlayerInRangeOfPoint(hitid, 8.0, ac_X, ac_Y, ac_Z))
  5317. {
  5318. if(++ACInfo[playerid][acCheatCount][6] > AC_MAX_PRO_AIM_WARNINGS)
  5319. {
  5320. #undef AC_MAX_PRO_AIM_WARNINGS
  5321. #if defined DEBUG
  5322. printf("[Nex-AC debug] Distance: %f", GetPlayerDistanceFromPoint(hitid, ac_X, ac_Y, ac_Z));
  5323. #endif
  5324. #if defined OnCheatDetected
  5325. ac_KickWithCode(playerid, "", 0, 29, 2);
  5326. ACInfo[playerid][acCheatCount][6] = 0;
  5327. #else
  5328. return ac_KickWithCode(playerid, "", 0, 29, 2);
  5329. #endif
  5330. }
  5331. }
  5332. else ACInfo[playerid][acCheatCount][6] = 0;
  5333. }
  5334. }
  5335. }
  5336. new ac_t;
  5337. switch(hittype)
  5338. {
  5339. case BULLET_HIT_TYPE_PLAYER:
  5340. {
  5341. if(hitid != INVALID_PLAYER_ID && ACInfo[hitid][acACAllow][19] &&
  5342. ACInfo[hitid][acFreeze] && !ACInfo[hitid][acDead] &&
  5343. IsPlayerInRangeOfPoint(hitid, ac_wRange[weaponid - 22], ac_oX, ac_oY, ac_oZ) &&
  5344. !(SPECIAL_ACTION_ENTER_VEHICLE <= GetPlayerSpecialAction(hitid) <= SPECIAL_ACTION_EXIT_VEHICLE))
  5345. {
  5346. ac_t = GetPlayerTeam(playerid);
  5347. if(ac_t == 0 || ac_t == NO_TEAM || ac_t != GetPlayerTeam(hitid))
  5348. {
  5349. ac_i = GetPlayerInterior(hitid);
  5350. #if AC_USE_RESTAURANTS
  5351. if(!ac_InRestaurant(hitid, ac_i))
  5352. {
  5353. #endif
  5354. #if AC_USE_AMMUNATIONS
  5355. if(!ac_InAmmuNation(hitid, ac_i))
  5356. {
  5357. #endif
  5358. #if AC_USE_CASINOS
  5359. if(!ac_InCasino(hitid, ac_i))
  5360. {
  5361. #endif
  5362. ac_ur = true;
  5363. #if AC_USE_CASINOS
  5364. }
  5365. #endif
  5366. #if AC_USE_AMMUNATIONS
  5367. }
  5368. #endif
  5369. #if AC_USE_RESTAURANTS
  5370. }
  5371. #endif
  5372. }
  5373. }
  5374. }
  5375. case BULLET_HIT_TYPE_VEHICLE:
  5376. {
  5377. if(hitid != INVALID_VEHICLE_ID)
  5378. {
  5379. ac_i = ACVehInfo[hitid][acDriver];
  5380. if(ac_i != INVALID_PLAYER_ID && ACInfo[ac_i][acACAllow][20] &&
  5381. ACInfo[ac_i][acFreeze] && floatcmp(ACVehInfo[hitid][acHealth], 220.0) == 1)
  5382. {
  5383. ac_t = GetPlayerTeam(playerid);
  5384. if(!ac_VehFriendlyFire || ac_t == 0 || ac_t == NO_TEAM || ac_t != GetPlayerTeam(ac_i))
  5385. {
  5386. ac_t = GetVehicleModel(hitid);
  5387. new Float:ac_Offset[9], Float:ac_Offset2[6];
  5388. GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSFRONT, ac_Offset[0], ac_Offset[1], ac_Offset[2]);
  5389. ac_Offset2[0] = (floatsin((ACVehInfo[hitid][acZAngle] = 360.0 - ACVehInfo[hitid][acZAngle]), degrees) * ac_Offset[1]) + (floatcos(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[0]);
  5390. ac_Offset2[1] = (floatcos(ACVehInfo[hitid][acZAngle], degrees) * ac_Offset[1]) - (floatsin(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[0]);
  5391. GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSREAR, ac_Offset[3], ac_Offset[4], ac_Offset[5]);
  5392. ac_Offset2[2] = (floatsin((ACVehInfo[hitid][acZAngle] = 360.0 - ACVehInfo[hitid][acZAngle]), degrees) * ac_Offset[4]) + (floatcos(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[3]);
  5393. ac_Offset2[3] = (floatcos(ACVehInfo[hitid][acZAngle], degrees) * ac_Offset[4]) - (floatsin(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[3]);
  5394. GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSMID, ac_Offset[6], ac_Offset[7], ac_Offset[8]);
  5395. ac_Offset2[4] = (floatsin((ACVehInfo[hitid][acZAngle] = 360.0 - ACVehInfo[hitid][acZAngle]), degrees) * ac_Offset[7]) + (floatcos(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[6]);
  5396. ac_Offset2[5] = (floatcos(ACVehInfo[hitid][acZAngle], degrees) * ac_Offset[7]) - (floatsin(ACVehInfo[hitid][acZAngle], degrees) * -ac_Offset[6]);
  5397. if(floatcmp(VectorSize(ac_Offset[0] - fX, ac_Offset[1] - fY, ac_Offset[2] - fZ), 2.5) == 1 &&
  5398. floatcmp(floatabs(VectorSize(ac_Offset2[0] - fX, ac_Offset2[1] - fY, ac_Offset[2] - fZ)), 2.5) == 1 &&
  5399. floatcmp(VectorSize(ac_Offset[3] - fX, ac_Offset[4] - fY, ac_Offset[5] - fZ), 2.5) == 1 &&
  5400. floatcmp(floatabs(VectorSize(ac_Offset2[2] - fX, ac_Offset2[3] - fY, ac_Offset[5] - fZ)), 2.5) == 1 &&
  5401. (!ac_Offset[6] && !ac_Offset[7] && !ac_Offset[8] || floatcmp(VectorSize(ac_Offset[6] - fX, ac_Offset[7] - fY, ac_Offset[8] - fZ), 2.5) == 1 &&
  5402. floatcmp(floatabs(VectorSize(ac_Offset2[4] - fX, ac_Offset2[5] - fY, ac_Offset[8] - fZ)), 2.5) == 1)) ac_ur2 = true;
  5403. }
  5404. }
  5405. }
  5406. }
  5407. }
  5408. if((ac_t = GetPlayerState(playerid)) != PLAYER_STATE_DRIVER)
  5409. {
  5410. new ac_s = GetPlayerWeapon(playerid);
  5411. if(ACInfo[playerid][acACAllow][47] && ac_t != PLAYER_STATE_PASSENGER && ac_s != weaponid)
  5412. {
  5413. #if defined DEBUG
  5414. printf("[Nex-AC debug] Armed weapon: %d, weaponid: %d, state: %d", ac_s, weaponid, ac_t);
  5415. #endif
  5416. return ac_KickWithCode(playerid, "", 0, 47, 2);
  5417. }
  5418. ac_s = ac_wSlot[weaponid];
  5419. if(ACInfo[playerid][acACAllow][26])
  5420. {
  5421. ac_i = ac_gtc - ACInfo[playerid][acShotTime];
  5422. if(ACInfo[playerid][acLastShot] == weaponid)
  5423. {
  5424. if(weaponid != 38 && ac_t != PLAYER_STATE_PASSENGER)
  5425. {
  5426. if(ac_gtc < ACInfo[playerid][acReload] + 500)
  5427. {
  5428. #if defined DEBUG
  5429. printf("[Nex-AC debug] Weaponid: %d, Reload time: %d, state: %d",
  5430. weaponid, ac_gtc - ACInfo[playerid][acReload], ac_t);
  5431. #endif
  5432. #if defined OnCheatDetected
  5433. ac_KickWithCode(playerid, "", 0, 26, 4);
  5434. ACInfo[playerid][acReload] = 0;
  5435. #else
  5436. return ac_KickWithCode(playerid, "", 0, 26, 4);
  5437. #endif
  5438. }
  5439. else if(ac_i < 30 || ac_i < 50 && weaponid != 32 &&
  5440. !(28 <= weaponid <= 29) || ac_i <= 385 && 33 <= weaponid <= 34)
  5441. {
  5442. if(++ACInfo[playerid][acCheatCount][8] > AC_MAX_RAPID_FIRE_WARNINGS)
  5443. {
  5444. #if defined DEBUG
  5445. printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
  5446. #endif
  5447. #if defined OnCheatDetected
  5448. ac_KickWithCode(playerid, "", 0, 26, 1);
  5449. ACInfo[playerid][acCheatCount][8] = 0;
  5450. #else
  5451. return ac_KickWithCode(playerid, "", 0, 26, 1);
  5452. #endif
  5453. }
  5454. }
  5455. else ACInfo[playerid][acCheatCount][8] = 0;
  5456. if((weaponid == 24 && ac_i < 600 || weaponid == 25 && ac_i < 800) &&
  5457. ++ACInfo[playerid][acCheatCount][14] > AC_MAX_RAPID_FIRE_WARNINGS)
  5458. {
  5459. #undef AC_MAX_RAPID_FIRE_WARNINGS
  5460. #if defined DEBUG
  5461. printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
  5462. #endif
  5463. #if defined OnCheatDetected
  5464. ac_KickWithCode(playerid, "", 0, 26, 2);
  5465. ACInfo[playerid][acCheatCount][14] = 0;
  5466. #else
  5467. return ac_KickWithCode(playerid, "", 0, 26, 2);
  5468. #endif
  5469. }
  5470. }
  5471. }
  5472. else if(ac_i < 30)
  5473. {
  5474. #if defined DEBUG
  5475. printf("[Nex-AC debug] Fire rate: %d, weaponid: %d, last weapon: %d",
  5476. ac_i, weaponid, ACInfo[playerid][acLastShot]);
  5477. #endif
  5478. #if defined OnCheatDetected
  5479. ac_KickWithCode(playerid, "", 0, 26, 3);
  5480. #else
  5481. return ac_KickWithCode(playerid, "", 0, 26, 3);
  5482. #endif
  5483. }
  5484. if(GetPlayerWeaponState(playerid) == WEAPONSTATE_LAST_BULLET) ACInfo[playerid][acReload] = ac_gtc;
  5485. }
  5486. if(ACInfo[playerid][acACAllow][17] && ac_t != PLAYER_STATE_PASSENGER)
  5487. {
  5488. ac_t = GetPlayerAmmo(playerid);
  5489. if(ACInfo[playerid][acAmmo][ac_s] == 0)
  5490. {
  5491. if(ac_gtc > ACInfo[playerid][acGtc][7] + GetPlayerPing(playerid))
  5492. {
  5493. #if defined DEBUG
  5494. printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  5495. weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  5496. #endif
  5497. #if defined OnCheatDetected
  5498. ac_KickWithCode(playerid, "", 0, 17, 1);
  5499. ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5500. #else
  5501. return ac_KickWithCode(playerid, "", 0, 17, 1);
  5502. #endif
  5503. }
  5504. else return 0;
  5505. }
  5506. if((ac_i = ac_abs(ACInfo[playerid][acAmmo][ac_s] - ac_t)) && ACInfo[playerid][acGiveAmmo][ac_s] == -65535)
  5507. {
  5508. switch(weaponid)
  5509. {
  5510. case 23, 24, 25, 27:
  5511. {
  5512. if(ac_i > 2)
  5513. {
  5514. #if defined DEBUG
  5515. printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  5516. weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  5517. #endif
  5518. #if defined OnCheatDetected
  5519. ac_KickWithCode(playerid, "", 0, 17, 2);
  5520. ACInfo[playerid][acCheatCount][7] = 0;
  5521. ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5522. #else
  5523. return ac_KickWithCode(playerid, "", 0, 17, 2);
  5524. #endif
  5525. }
  5526. }
  5527. case 38:
  5528. {
  5529. if(ACInfo[playerid][acAmmo][ac_s] < ac_t && ++ACInfo[playerid][acCheatCount][7] > 8)
  5530. {
  5531. #if defined DEBUG
  5532. printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d, acCheatCount[7]: %d",
  5533. weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t, ACInfo[playerid][acCheatCount][7]);
  5534. #endif
  5535. #if defined OnCheatDetected
  5536. ac_KickWithCode(playerid, "", 0, 17, 3);
  5537. ACInfo[playerid][acCheatCount][7] = 0;
  5538. ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5539. #else
  5540. return ac_KickWithCode(playerid, "", 0, 17, 3);
  5541. #endif
  5542. }
  5543. }
  5544. default:
  5545. {
  5546. if(ac_i > 3 && ACInfo[playerid][acAmmo][ac_s] < ac_t)
  5547. {
  5548. #if defined DEBUG
  5549. printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
  5550. weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
  5551. #endif
  5552. #if defined OnCheatDetected
  5553. ac_KickWithCode(playerid, "", 0, 17, 4);
  5554. ACInfo[playerid][acCheatCount][7] = 0;
  5555. ACInfo[playerid][acAmmo][ac_s] = ac_t;
  5556. #else
  5557. return ac_KickWithCode(playerid, "", 0, 17, 4);
  5558. #endif
  5559. }
  5560. }
  5561. }
  5562. }
  5563. else ACInfo[playerid][acCheatCount][7] = 0;
  5564. }
  5565. ACInfo[playerid][acAmmo][ac_s]--;
  5566. if(ACInfo[playerid][acAmmo][ac_s] < -32768) ACInfo[playerid][acAmmo][ac_s] += 65536;
  5567. else if(ACInfo[playerid][acAmmo][ac_s] == 0 &&
  5568. ACInfo[playerid][acSet][3] == weaponid) ACInfo[playerid][acSet][3] = ACInfo[playerid][acSetWeapon][ac_s] = -1;
  5569. }
  5570. ACInfo[playerid][acLastShot] = weaponid;
  5571. ACInfo[playerid][acShotTime] = ac_gtc;
  5572. }
  5573. ac_i = 1;
  5574. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5575. && defined ac_OnPlayerWeaponShot
  5576. ac_i = ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
  5577. #endif
  5578. if(ac_i)
  5579. {
  5580. if(ac_ur)
  5581. {
  5582. if(ACInfo[hitid][acArmour] > 0) ACInfo[hitid][acDmgRes] = 2;
  5583. else ACInfo[hitid][acDmgRes] = 1;
  5584. ACInfo[hitid][acGtc][14] = ac_gtc + 150;
  5585. }
  5586. if(ac_ur2)
  5587. {
  5588. ACInfo[ACVehInfo[hitid][acDriver]][acVehDmgRes] = true;
  5589. ACInfo[ACVehInfo[hitid][acDriver]][acGtc][16] = ac_gtc + 150;
  5590. }
  5591. }
  5592. return ac_i;
  5593. }
  5594.  
  5595. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5596. #if defined _ALS_OnPlayerWeaponShot
  5597. #undef OnPlayerWeaponShot
  5598. #else
  5599. #define _ALS_OnPlayerWeaponShot
  5600. #endif
  5601. #define OnPlayerWeaponShot ac_OnPlayerWeaponShot
  5602. #if defined ac_OnPlayerWeaponShot
  5603. forward ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  5604. #endif
  5605. #endif
  5606.  
  5607. #if defined _inc_y_hooks || defined _INC_y_hooks
  5608. hook OnVehicleMod(playerid, vehicleid, componentid)
  5609. #else
  5610. public OnVehicleMod(playerid, vehicleid, componentid)
  5611. #endif
  5612. {
  5613. if(ACInfo[playerid][acKicked]) return 0;
  5614. new ac_i = GetTickCount();
  5615. if(ACInfo[playerid][acACAllow][49])
  5616. {
  5617. if(ac_i < ACInfo[playerid][acCall][12] + ac_Mtfc[12][0]) return ac_FloodDetect(playerid, 12);
  5618. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5619. else ACInfo[playerid][acFloodCount][12] = ACInfo[playerid][acFloodCount][27] = 0;
  5620. }
  5621. if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop])
  5622. {
  5623. #if defined OnCheatDetected
  5624. ac_KickWithCode(playerid, "", 0, 23, 2);
  5625. #else
  5626. return ac_KickWithCode(playerid, "", 0, 23, 2);
  5627. #endif
  5628. }
  5629. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][12] = ac_i;
  5630. ACInfo[playerid][acGtc][17] = ac_i + 1650;
  5631. if(ACInfo[playerid][acACAllow][43] && !ac_IsCompatible((ac_i = GetVehicleModel(vehicleid)), componentid))
  5632. {
  5633. #if defined DEBUG
  5634. printf("[Nex-AC debug] Veh model: %d, componentid: %d", ac_i, componentid);
  5635. #endif
  5636. return ac_KickWithCode(playerid, "", 0, 43, 1);
  5637. }
  5638. #if AC_USE_TUNING_GARAGES
  5639. ac_i = componentid - 1000;
  5640. if(ACInfo[playerid][acSet][12] != -1) ACInfo[playerid][acSet][12] += ac_cPrice[ac_i];
  5641. else ACInfo[playerid][acSet][12] = ac_cPrice[ac_i];
  5642. ACInfo[playerid][acCheatCount][12] = 0;
  5643. #endif
  5644. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5645. && defined ac_OnVehicleMod
  5646. return ac_OnVehicleMod(playerid, vehicleid, componentid);
  5647. #else
  5648. return 1;
  5649. #endif
  5650. }
  5651.  
  5652. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5653. #if defined _ALS_OnVehicleMod
  5654. #undef OnVehicleMod
  5655. #else
  5656. #define _ALS_OnVehicleMod
  5657. #endif
  5658. #define OnVehicleMod ac_OnVehicleMod
  5659. #if defined ac_OnVehicleMod
  5660. forward ac_OnVehicleMod(playerid, vehicleid, componentid);
  5661. #endif
  5662. #endif
  5663.  
  5664. #if defined _inc_y_hooks || defined _INC_y_hooks
  5665. hook OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  5666. #else
  5667. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  5668. #endif
  5669. {
  5670. if(ACInfo[playerid][acKicked]) return 0;
  5671. new ac_gtc = GetTickCount();
  5672. if(ACInfo[playerid][acACAllow][49])
  5673. {
  5674. if(ac_gtc < ACInfo[playerid][acCall][13] + ac_Mtfc[13][0]) ac_FloodDetect(playerid, 13);
  5675. else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5676. else ACInfo[playerid][acFloodCount][13] = ACInfo[playerid][acFloodCount][27] = 0;
  5677. }
  5678. if(ACInfo[playerid][acACAllow][43] && !(0 <= paintjobid <= 2))
  5679. {
  5680. #if defined DEBUG
  5681. printf("[Nex-AC debug] Veh model: %d, paintjobid: %d", GetVehicleModel(vehicleid), paintjobid);
  5682. #endif
  5683. ac_KickWithCode(playerid, "", 0, 43, 2);
  5684. }
  5685. else if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop]) ac_KickWithCode(playerid, "", 0, 23, 4);
  5686. else ACVehInfo[vehicleid][acPaintJob] = paintjobid;
  5687. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][13] = ac_gtc;
  5688. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5689. && defined ac_OnVehiclePaintjob
  5690. return ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  5691. #else
  5692. return 1;
  5693. #endif
  5694. }
  5695.  
  5696. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5697. #if defined _ALS_OnVehiclePaintjob
  5698. #undef OnVehiclePaintjob
  5699. #else
  5700. #define _ALS_OnVehiclePaintjob
  5701. #endif
  5702. #define OnVehiclePaintjob ac_OnVehiclePaintjob
  5703. #if defined ac_OnVehiclePaintjob
  5704. forward ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  5705. #endif
  5706. #endif
  5707.  
  5708. #if defined _inc_y_hooks || defined _INC_y_hooks
  5709. hook OnVehicleRespray(playerid, vehicleid, color1, color2)
  5710. #else
  5711. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  5712. #endif
  5713. {
  5714. if(ACInfo[playerid][acKicked]) return 0;
  5715. new ac_gtc = GetTickCount();
  5716. if(ACInfo[playerid][acACAllow][49])
  5717. {
  5718. if(ac_gtc < ACInfo[playerid][acCall][14] + ac_Mtfc[14][0]) return ac_FloodDetect(playerid, 14);
  5719. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5720. else ACInfo[playerid][acFloodCount][14] = ACInfo[playerid][acFloodCount][27] = 0;
  5721. }
  5722. #if !AC_USE_TUNING_GARAGES && !AC_USE_PAYNSPRAY
  5723. if(ACInfo[playerid][acACAllow][23])
  5724. {
  5725. #if defined OnCheatDetected
  5726. ac_KickWithCode(playerid, "", 0, 23, 5);
  5727. #else
  5728. return ac_KickWithCode(playerid, "", 0, 23, 5);
  5729. #endif
  5730. }
  5731. #endif
  5732. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][14] = ac_gtc;
  5733. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5734. && defined ac_OnVehicleRespray
  5735. return ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  5736. #else
  5737. return 1;
  5738. #endif
  5739. }
  5740.  
  5741. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5742. #if defined _ALS_OnVehicleRespray
  5743. #undef OnVehicleRespray
  5744. #else
  5745. #define _ALS_OnVehicleRespray
  5746. #endif
  5747. #define OnVehicleRespray ac_OnVehicleRespray
  5748. #if defined ac_OnVehicleRespray
  5749. forward ac_OnVehicleRespray(playerid, vehicleid, color1, color2);
  5750. #endif
  5751. #endif
  5752.  
  5753. #if defined _inc_y_hooks || defined _INC_y_hooks
  5754. hook OnVehicleSpawn(vehicleid)
  5755. #else
  5756. public OnVehicleSpawn(vehicleid)
  5757. #endif
  5758. {
  5759. ACVehInfo[vehicleid][acPaintJob] = 3;
  5760. ACVehInfo[vehicleid][acSpawned] = true;
  5761. ACVehInfo[vehicleid][acHealth] = 1000.0;
  5762. ACVehInfo[vehicleid][acSpeedDiff] =
  5763. ACVehInfo[vehicleid][acPosDiff] =
  5764. ACVehInfo[vehicleid][acVelX] =
  5765. ACVehInfo[vehicleid][acVelY] =
  5766. ACVehInfo[vehicleid][acVelZ] = 0.0;
  5767. ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID;
  5768. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5769. && defined ac_OnVehicleSpawn
  5770. return ac_OnVehicleSpawn(vehicleid);
  5771. #else
  5772. return 1;
  5773. #endif
  5774. }
  5775.  
  5776. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5777. #if defined _ALS_OnVehicleSpawn
  5778. #undef OnVehicleSpawn
  5779. #else
  5780. #define _ALS_OnVehicleSpawn
  5781. #endif
  5782. #define OnVehicleSpawn ac_OnVehicleSpawn
  5783. #if defined ac_OnVehicleSpawn
  5784. forward ac_OnVehicleSpawn(vehicleid);
  5785. #endif
  5786. #endif
  5787.  
  5788. #if defined _inc_y_hooks || defined _INC_y_hooks
  5789. hook OnVehicleDeath(vehicleid, killerid)
  5790. #else
  5791. public OnVehicleDeath(vehicleid, killerid)
  5792. #endif
  5793. {
  5794. if(killerid != INVALID_PLAYER_ID)
  5795. {
  5796. new ac_gtc = GetTickCount();
  5797. if(ACInfo[killerid][acACAllow][49])
  5798. {
  5799. if(ac_gtc < ACInfo[killerid][acCall][15] + ac_Mtfc[15][0]) ac_FloodDetect(killerid, 15);
  5800. else if(ac_gtc < ACInfo[killerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(killerid, 27);
  5801. else ACInfo[killerid][acFloodCount][15] = ACInfo[killerid][acFloodCount][27] = 0;
  5802. }
  5803. ACInfo[killerid][acCall][27] = ACInfo[killerid][acCall][15] = ac_gtc;
  5804. }
  5805. new Float:ac_vHealth;
  5806. GetVehicleHealth(vehicleid, ac_vHealth);
  5807. if(floatcmp(ac_vHealth, 250.0) == -1) ACVehInfo[vehicleid][acSpawned] = false;
  5808. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5809. && defined ac_OnVehicleDeath
  5810. return ac_OnVehicleDeath(vehicleid, killerid);
  5811. #else
  5812. return 1;
  5813. #endif
  5814. }
  5815.  
  5816. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5817. #if defined _ALS_OnVehicleDeath
  5818. #undef OnVehicleDeath
  5819. #else
  5820. #define _ALS_OnVehicleDeath
  5821. #endif
  5822. #define OnVehicleDeath ac_OnVehicleDeath
  5823. #if defined ac_OnVehicleDeath
  5824. forward ac_OnVehicleDeath(vehicleid, killerid);
  5825. #endif
  5826. #endif
  5827.  
  5828. #if defined _inc_y_hooks || defined _INC_y_hooks
  5829. hook OnPlayerText(playerid, text[])
  5830. #else
  5831. public OnPlayerText(playerid, text[])
  5832. #endif
  5833. {
  5834. if(ACInfo[playerid][acKicked]) return 0;
  5835. new ac_gtc = GetTickCount();
  5836. if(ACInfo[playerid][acACAllow][49])
  5837. {
  5838. if(ac_gtc < ACInfo[playerid][acCall][16] + ac_Mtfc[16][0]) return ac_FloodDetect(playerid, 16);
  5839. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5840. else ACInfo[playerid][acFloodCount][16] = ACInfo[playerid][acFloodCount][27] = 0;
  5841. }
  5842. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][16] = ac_gtc;
  5843. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5844. && defined ac_OnPlayerText
  5845. return ac_OnPlayerText(playerid, text);
  5846. #else
  5847. return 1;
  5848. #endif
  5849. }
  5850.  
  5851. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5852. #if defined _ALS_OnPlayerText
  5853. #undef OnPlayerText
  5854. #else
  5855. #define _ALS_OnPlayerText
  5856. #endif
  5857. #define OnPlayerText ac_OnPlayerText
  5858. #if defined ac_OnPlayerText
  5859. forward ac_OnPlayerText(playerid, text[]);
  5860. #endif
  5861. #endif
  5862.  
  5863. #if defined _inc_y_hooks || defined _INC_y_hooks
  5864. hook OnPlayerEnterCheckpoint(playerid)
  5865. #else
  5866. public OnPlayerEnterCheckpoint(playerid)
  5867. #endif
  5868. {
  5869. if(ACInfo[playerid][acKicked]) return 0;
  5870. new ac_gtc = GetTickCount();
  5871. if(ACInfo[playerid][acACAllow][49])
  5872. {
  5873. if(ac_gtc < ACInfo[playerid][acCall][17] + ac_Mtfc[17][0]) ac_FloodDetect(playerid, 17);
  5874. else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5875. else ACInfo[playerid][acFloodCount][17] = ACInfo[playerid][acFloodCount][27] = 0;
  5876. }
  5877. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][17] = ac_gtc;
  5878. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5879. && defined ac_OnPlayerEnterCheckpoint
  5880. return ac_OnPlayerEnterCheckpoint(playerid);
  5881. #else
  5882. return 1;
  5883. #endif
  5884. }
  5885.  
  5886. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5887. #if defined _ALS_OnPlayerEnterCheckpoint
  5888. #undef OnPlayerEnterCheckpoint
  5889. #else
  5890. #define _ALS_OnPlayerEnterCheckpoint
  5891. #endif
  5892. #define OnPlayerEnterCheckpoint ac_OnPlayerEnterCheckpoint
  5893. #if defined ac_OnPlayerEnterCheckpoint
  5894. forward ac_OnPlayerEnterCheckpoint(playerid);
  5895. #endif
  5896. #endif
  5897.  
  5898. #if defined _inc_y_hooks || defined _INC_y_hooks
  5899. hook OnPlayerLeaveCheckpoint(playerid)
  5900. #else
  5901. public OnPlayerLeaveCheckpoint(playerid)
  5902. #endif
  5903. {
  5904. if(ACInfo[playerid][acKicked]) return 0;
  5905. new ac_gtc = GetTickCount();
  5906. if(ACInfo[playerid][acACAllow][49])
  5907. {
  5908. if(ac_gtc < ACInfo[playerid][acCall][18] + ac_Mtfc[18][0]) ac_FloodDetect(playerid, 18);
  5909. else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5910. else ACInfo[playerid][acFloodCount][18] = ACInfo[playerid][acFloodCount][27] = 0;
  5911. }
  5912. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][18] = ac_gtc;
  5913. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5914. && defined ac_OnPlayerLeaveCheckpoint
  5915. return ac_OnPlayerLeaveCheckpoint(playerid);
  5916. #else
  5917. return 1;
  5918. #endif
  5919. }
  5920.  
  5921. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5922. #if defined _ALS_OnPlayerLeaveCheckpoint
  5923. #undef OnPlayerLeaveCheckpoint
  5924. #else
  5925. #define _ALS_OnPlayerLeaveCheckpoint
  5926. #endif
  5927. #define OnPlayerLeaveCheckpoint ac_OnPlayerLeaveCheckpoint
  5928. #if defined ac_OnPlayerLeaveCheckpoint
  5929. forward ac_OnPlayerLeaveCheckpoint(playerid);
  5930. #endif
  5931. #endif
  5932.  
  5933. #if defined _inc_y_hooks || defined _INC_y_hooks
  5934. hook OnPlayerRequestSpawn(playerid)
  5935. #else
  5936. public OnPlayerRequestSpawn(playerid)
  5937. #endif
  5938. {
  5939. if(ACInfo[playerid][acKicked]) return 0;
  5940. new ac_i = GetTickCount();
  5941. if(ACInfo[playerid][acACAllow][49])
  5942. {
  5943. if(ac_i < ACInfo[playerid][acCall][19] + ac_Mtfc[19][0]) return ac_FloodDetect(playerid, 19);
  5944. if(ac_i < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5945. else ACInfo[playerid][acFloodCount][19] = ACInfo[playerid][acFloodCount][27] = 0;
  5946. }
  5947. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][19] = ac_i;
  5948. ac_i = 1;
  5949. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5950. && defined ac_OnPlayerRequestSpawn
  5951. ac_i = ac_OnPlayerRequestSpawn(playerid);
  5952. #endif
  5953. if(ac_i && ACInfo[playerid][acLogged] != 2)
  5954. {
  5955. ACInfo[playerid][acSet][7] = 3;
  5956. ACInfo[playerid][acSpawnTime] =
  5957. ACInfo[playerid][acNOPCount][9] = 0;
  5958. ACInfo[playerid][acSpawnRes] = 1;
  5959. }
  5960. return ac_i;
  5961. }
  5962.  
  5963. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5964. #if defined _ALS_OnPlayerRequestSpawn
  5965. #undef OnPlayerRequestSpawn
  5966. #else
  5967. #define _ALS_OnPlayerRequestSpawn
  5968. #endif
  5969. #define OnPlayerRequestSpawn ac_OnPlayerRequestSpawn
  5970. #if defined ac_OnPlayerRequestSpawn
  5971. forward ac_OnPlayerRequestSpawn(playerid);
  5972. #endif
  5973. #endif
  5974.  
  5975. #if defined _inc_y_hooks || defined _INC_y_hooks
  5976. hook OnPlayerExitedMenu(playerid)
  5977. #else
  5978. public OnPlayerExitedMenu(playerid)
  5979. #endif
  5980. {
  5981. if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) return 0;
  5982. new ac_gtc = GetTickCount();
  5983. if(ACInfo[playerid][acACAllow][49])
  5984. {
  5985. if(ac_gtc < ACInfo[playerid][acCall][20] + ac_Mtfc[20][0]) ac_FloodDetect(playerid, 20);
  5986. else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  5987. else ACInfo[playerid][acFloodCount][20] = ACInfo[playerid][acFloodCount][27] = 0;
  5988. }
  5989. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][20] = ac_gtc;
  5990. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  5991. && defined ac_OnPlayerExitedMenu
  5992. return ac_OnPlayerExitedMenu(playerid);
  5993. #else
  5994. return 1;
  5995. #endif
  5996. }
  5997.  
  5998. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  5999. #if defined _ALS_OnPlayerExitedMenu
  6000. #undef OnPlayerExitedMenu
  6001. #else
  6002. #define _ALS_OnPlayerExitedMenu
  6003. #endif
  6004. #define OnPlayerExitedMenu ac_OnPlayerExitedMenu
  6005. #if defined ac_OnPlayerExitedMenu
  6006. forward ac_OnPlayerExitedMenu(playerid);
  6007. #endif
  6008. #endif
  6009.  
  6010. #if defined _inc_y_hooks || defined _INC_y_hooks
  6011. hook OnPlayerEnterRaceCP(playerid)
  6012. #else
  6013. public OnPlayerEnterRaceCheckpoint(playerid)
  6014. #endif
  6015. {
  6016. if(ACInfo[playerid][acKicked]) return 0;
  6017. new ac_gtc = GetTickCount();
  6018. if(ACInfo[playerid][acACAllow][49])
  6019. {
  6020. if(ac_gtc < ACInfo[playerid][acCall][21] + ac_Mtfc[21][0]) ac_FloodDetect(playerid, 21);
  6021. else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6022. else ACInfo[playerid][acFloodCount][21] = ACInfo[playerid][acFloodCount][27] = 0;
  6023. }
  6024. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][21] = ac_gtc;
  6025. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6026. && defined ac_OnPlayerEnterRaceCheckpoint
  6027. return ac_OnPlayerEnterRaceCheckpoint(playerid);
  6028. #else
  6029. return 1;
  6030. #endif
  6031. }
  6032.  
  6033. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6034. #if defined _ALS_OnPlayerEnterRaceCheckpoin\
  6035. || defined _ALS_OnPlayerEnterRaceCP
  6036. #undef OnPlayerEnterRaceCheckpoint
  6037. #else
  6038. #define _ALS_OnPlayerEnterRaceCP
  6039. #endif
  6040. #define OnPlayerEnterRaceCheckpoint ac_OnPlayerEnterRaceCheckpoint
  6041. #if defined ac_OnPlayerEnterRaceCheckpoint
  6042. forward ac_OnPlayerEnterRaceCheckpoint(playerid);
  6043. #endif
  6044. #endif
  6045.  
  6046. #if defined _inc_y_hooks || defined _INC_y_hooks
  6047. hook OnPlayerLeaveRaceCP(playerid)
  6048. #else
  6049. public OnPlayerLeaveRaceCheckpoint(playerid)
  6050. #endif
  6051. {
  6052. if(ACInfo[playerid][acKicked]) return 0;
  6053. new ac_gtc = GetTickCount();
  6054. if(ACInfo[playerid][acACAllow][49])
  6055. {
  6056. if(ac_gtc < ACInfo[playerid][acCall][22] + ac_Mtfc[22][0]) ac_FloodDetect(playerid, 22);
  6057. else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6058. else ACInfo[playerid][acFloodCount][22] = ACInfo[playerid][acFloodCount][27] = 0;
  6059. }
  6060. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][22] = ac_gtc;
  6061. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6062. && defined ac_OnPlayerLeaveRaceCheckpoint
  6063. return ac_OnPlayerLeaveRaceCheckpoint(playerid);
  6064. #else
  6065. return 1;
  6066. #endif
  6067. }
  6068.  
  6069. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6070. #if defined _ALS_OnPlayerLeaveRaceCheckpoin\
  6071. || defined _ALS_OnPlayerLeaveRaceCP
  6072. #undef OnPlayerLeaveRaceCheckpoint
  6073. #else
  6074. #define _ALS_OnPlayerLeaveRaceCP
  6075. #endif
  6076. #define OnPlayerLeaveRaceCheckpoint ac_OnPlayerLeaveRaceCheckpoint
  6077. #if defined ac_OnPlayerLeaveRaceCheckpoint
  6078. forward ac_OnPlayerLeaveRaceCheckpoint(playerid);
  6079. #endif
  6080. #endif
  6081.  
  6082. #if defined _inc_y_hooks || defined _INC_y_hooks
  6083. hook OnPlayerClickPlayerTD(playerid, PlayerText:playertextid)
  6084. #else
  6085. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  6086. #endif
  6087. {
  6088. if(ACInfo[playerid][acKicked]) return 1;
  6089. new ac_gtc = GetTickCount();
  6090. if(ACInfo[playerid][acACAllow][49])
  6091. {
  6092. if(ac_gtc < ACInfo[playerid][acCall][23] + ac_Mtfc[23][0])
  6093. {
  6094. ac_FloodDetect(playerid, 23);
  6095. return 1;
  6096. }
  6097. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6098. else ACInfo[playerid][acFloodCount][23] = ACInfo[playerid][acFloodCount][27] = 0;
  6099. }
  6100. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][23] = ac_gtc;
  6101. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6102. && defined ac_OnPlayerClickPlayerTextDraw
  6103. return ac_OnPlayerClickPlayerTextDraw(playerid, playertextid);
  6104. #else
  6105. return 0;
  6106. #endif
  6107. }
  6108.  
  6109. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6110. #if defined _ALS_OnPlayerClickPlayerTextDra\
  6111. || defined _ALS_OnPlayerClickPlayerTD
  6112. #undef OnPlayerClickPlayerTextDraw
  6113. #else
  6114. #define _ALS_OnPlayerClickPlayerTD
  6115. #endif
  6116. #define OnPlayerClickPlayerTextDraw ac_OnPlayerClickPlayerTextDraw
  6117. #if defined ac_OnPlayerClickPlayerTextDraw
  6118. forward ac_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
  6119. #endif
  6120. #endif
  6121.  
  6122. #if defined _inc_y_hooks || defined _INC_y_hooks
  6123. hook OnVehDamageStatusUpd(vehicleid, playerid)
  6124. #else
  6125. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  6126. #endif
  6127. {
  6128. if(ACInfo[playerid][acKicked]) return 1;
  6129. new ac_gtc = GetTickCount();
  6130. if(ACInfo[playerid][acACAllow][49])
  6131. {
  6132. if(ac_gtc < ACInfo[playerid][acCall][24] + ac_Mtfc[24][0])
  6133. {
  6134. ac_FloodDetect(playerid, 24);
  6135. return 1;
  6136. }
  6137. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6138. else ACInfo[playerid][acFloodCount][24] = ACInfo[playerid][acFloodCount][27] = 0;
  6139. }
  6140. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][24] = ac_gtc;
  6141. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6142. && defined ac_OnVehicleDamageStatusUpdate
  6143. return ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  6144. #else
  6145. return 0;
  6146. #endif
  6147. }
  6148.  
  6149. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6150. #if defined _ALS_OnVehicleDamageStatusUpdat\
  6151. || defined _ALS_OnVehicleDamageStatusUpd
  6152. #undef OnVehicleDamageStatusUpdate
  6153. #else
  6154. #define _ALS_OnVehicleDamageStatusUpd
  6155. #endif
  6156. #define OnVehicleDamageStatusUpdate ac_OnVehicleDamageStatusUpdate
  6157. #if defined ac_OnVehicleDamageStatusUpdate
  6158. forward ac_OnVehicleDamageStatusUpdate(vehicleid, playerid);
  6159. #endif
  6160. #endif
  6161.  
  6162. #if defined _inc_y_hooks || defined _INC_y_hooks
  6163. hook OnVehicleSirenChange(playerid, vehicleid, newstate)
  6164. #else
  6165. public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
  6166. #endif
  6167. {
  6168. if(ACInfo[playerid][acKicked]) return 1;
  6169. new ac_gtc = GetTickCount();
  6170. if(ACInfo[playerid][acACAllow][49])
  6171. {
  6172. if(ac_gtc < ACInfo[playerid][acCall][25] + ac_Mtfc[25][0])
  6173. {
  6174. ac_FloodDetect(playerid, 25);
  6175. return 1;
  6176. }
  6177. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6178. else ACInfo[playerid][acFloodCount][25] = ACInfo[playerid][acFloodCount][27] = 0;
  6179. }
  6180. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][25] = ac_gtc;
  6181. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6182. && defined ac_OnVehicleSirenStateChange
  6183. return ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  6184. #else
  6185. return 0;
  6186. #endif
  6187. }
  6188.  
  6189. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6190. #if defined _ALS_OnVehicleSirenStateChange
  6191. #undef OnVehicleSirenStateChange
  6192. #else
  6193. #define _ALS_OnVehicleSirenStateChange
  6194. #endif
  6195. #define OnVehicleSirenStateChange ac_OnVehicleSirenStateChange
  6196. #if defined ac_OnVehicleSirenStateChange
  6197. forward ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  6198. #endif
  6199. #endif
  6200.  
  6201. #if defined OnPlayerSelectDynamicObject
  6202. #if defined _inc_y_hooks || defined _INC_y_hooks
  6203. #if defined STREAMER_ENABLE_TAGS
  6204. hook OnPlayerSelectDynObject(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z)
  6205. #else
  6206. hook OnPlayerSelectDynObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  6207. #endif
  6208. #else
  6209. #if defined STREAMER_ENABLE_TAGS
  6210. public OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z)
  6211. #else
  6212. public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
  6213. #endif
  6214. #endif
  6215. {
  6216. if(ACInfo[playerid][acKicked]) return 0;
  6217. new ac_gtc = GetTickCount();
  6218. if(ACInfo[playerid][acACAllow][49])
  6219. {
  6220. if(ac_gtc < ACInfo[playerid][acCall][26] + ac_Mtfc[26][0]) ac_FloodDetect(playerid, 26);
  6221. else if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6222. else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
  6223. }
  6224. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_gtc;
  6225. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6226. && defined ac_OnPlayerSelectDynamicObject
  6227. return ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, x, y, z);
  6228. #else
  6229. return 1;
  6230. #endif
  6231. }
  6232.  
  6233. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6234. #if defined _ALS_OnPlayerSelectDynamicObjec\
  6235. || defined _ALS_OnPlayerSelectDynObject || defined _ALS_OnPlayerSelectDynamicObj
  6236. #undef OnPlayerSelectDynamicObject
  6237. #else
  6238. #define _ALS_OnPlayerSelectDynObject
  6239. #endif
  6240. #define OnPlayerSelectDynamicObject ac_OnPlayerSelectDynamicObject
  6241. #if defined ac_OnPlayerSelectDynamicObject
  6242. #if defined STREAMER_ENABLE_TAGS
  6243. forward ac_OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT objectid, modelid, Float:x, Float:y, Float:z);
  6244. #else
  6245. forward ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z);
  6246. #endif
  6247. #endif
  6248. #endif
  6249. #endif
  6250.  
  6251. #if defined _inc_y_hooks || defined _INC_y_hooks
  6252. hook OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  6253. #else
  6254. public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  6255. #endif
  6256. {
  6257. if(ACInfo[playerid][acKicked]) return 1;
  6258. new ac_gtc = GetTickCount();
  6259. if(ACInfo[playerid][acACAllow][49])
  6260. {
  6261. if(ac_gtc < ACInfo[playerid][acCall][26] + ac_Mtfc[26][0])
  6262. {
  6263. ac_FloodDetect(playerid, 26);
  6264. return 1;
  6265. }
  6266. if(ac_gtc < ACInfo[playerid][acCall][27] + ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27);
  6267. else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0;
  6268. }
  6269. ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_gtc;
  6270. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6271. && defined ac_OnPlayerSelectObject
  6272. return ac_OnPlayerSelectObject(playerid, type, objectid, modelid, fX, fY, fZ);
  6273. #else
  6274. return 0;
  6275. #endif
  6276. }
  6277.  
  6278. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6279. #if defined _ALS_OnPlayerSelectObject
  6280. #undef OnPlayerSelectObject
  6281. #else
  6282. #define _ALS_OnPlayerSelectObject
  6283. #endif
  6284. #define OnPlayerSelectObject ac_OnPlayerSelectObject
  6285. #if defined ac_OnPlayerSelectObject
  6286. forward ac_OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
  6287. #endif
  6288. #endif
  6289.  
  6290. #if defined _inc_y_hooks || defined _INC_y_hooks
  6291. hook OnUnoccupiedVehicleUpd(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  6292. #else
  6293. public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z)
  6294. #endif
  6295. {
  6296. if(ACInfo[playerid][acKicked]) return 0;
  6297. new Float:ac_X, Float:ac_Y, Float:ac_Z, Float:ac_D = GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z);
  6298. GetVehiclePos(vehicleid, ac_X, ac_Y, ac_Z);
  6299. if(passenger_seat > 0)
  6300. {
  6301. new Float:ac_zDiff = new_z - ac_Z;
  6302. if(ACInfo[playerid][acACAllow][31] && floatcmp(ac_zDiff, -5.0) == 1 &&
  6303. (floatcmp(floatabs(vel_x), floatabs(ACVehInfo[vehicleid][acVelX])) >= 0 && floatcmp(floatabs(ACVehInfo[vehicleid][acVelX]), 0.3) == 1 ||
  6304. floatcmp(floatabs(vel_y), floatabs(ACVehInfo[vehicleid][acVelY])) >= 0 && floatcmp(floatabs(ACVehInfo[vehicleid][acVelY]), 0.3) == 1 ||
  6305. floatcmp(floatabs(vel_x - ACVehInfo[vehicleid][acVelX]), 25.0) == 1 ||
  6306. floatcmp(floatabs(vel_y - ACVehInfo[vehicleid][acVelY]), 25.0) == 1))
  6307. {
  6308. if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS)
  6309. {
  6310. #undef AC_MAX_CARSHOT_WARNINGS
  6311. #if defined DEBUG
  6312. printf("[Nex-AC debug] Vel x, y: %f, %f, old vel x, y: %f, %f, pos diff z: %f, vehicleid: %d",
  6313. vel_x, vel_y, ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], ac_zDiff, vehicleid);
  6314. #endif
  6315. #if defined OnCheatDetected
  6316. ac_KickWithCode(playerid, "", 0, 31);
  6317. ACInfo[playerid][acCheatCount][4] = 0;
  6318. #else
  6319. return ac_KickWithCode(playerid, "", 0, 31);
  6320. #endif
  6321. }
  6322. }
  6323. else if(ACInfo[playerid][acACAllow][8] &&
  6324. floatcmp(vel_z, 0.1) >= 0 && floatcmp(vel_z, ACVehInfo[vehicleid][acVelZ]) == 1 &&
  6325. floatcmp(floatabs(ac_X - new_x), ac_zDiff / 2) == -1 && floatcmp(floatabs(ac_Y - new_y), ac_zDiff / 2) == -1)
  6326. {
  6327. if(++ACInfo[playerid][acCheatCount][3] > AC_MAX_FLYHACK_VEH_WARNINGS)
  6328. {
  6329. #undef AC_MAX_FLYHACK_VEH_WARNINGS
  6330. #if defined DEBUG
  6331. printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, vehicleid: %d",
  6332. vel_z, ACVehInfo[vehicleid][acVelZ], ac_X - new_x, ac_Y - new_y, ac_zDiff, vehicleid);
  6333. #endif
  6334. #if defined OnCheatDetected
  6335. ac_KickWithCode(playerid, "", 0, 8, 2);
  6336. ACInfo[playerid][acCheatCount][3] = 0;
  6337. #else
  6338. return ac_KickWithCode(playerid, "", 0, 8, 2);
  6339. #endif
  6340. }
  6341. }
  6342. else ACInfo[playerid][acCheatCount][4] =
  6343. ACInfo[playerid][acCheatCount][3] = 0;
  6344. }
  6345. if(ACInfo[playerid][acACAllow][5] &&
  6346. floatcmp(ac_D, 15.0) == 1 && floatcmp(ac_Z, -70.0) == 1 &&
  6347. floatcmp(ac_D, ACVehInfo[vehicleid][acPosDiff] + ((ac_D / 3.0) * 1.6)) == 1)
  6348. {
  6349. #if defined DEBUG
  6350. printf("[Nex-AC debug] Distance: %f, old pos diff: %f, pos z: %f, vehicleid: %d, playerid: %d",
  6351. ac_D, ACVehInfo[vehicleid][acPosDiff], ac_Z, vehicleid, playerid);
  6352. #endif
  6353. #if defined OnCheatDetected
  6354. ac_KickWithCode(playerid, "", 0, 5);
  6355. #endif
  6356. GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  6357. SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]);
  6358. SetVehiclePos(vehicleid, ac_X, ac_Y, ac_Z);
  6359. return 0;
  6360. }
  6361. new ac_a = 1;
  6362. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6363. && defined ac_OnUnoccupiedVehicleUpdate
  6364. ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z, vel_x, vel_y, vel_z);
  6365. #endif
  6366. if(ac_a)
  6367. {
  6368. ACVehInfo[vehicleid][acSpeedDiff] = ac_GetSpeed(vel_x, vel_y, vel_z) - ac_GetSpeed(ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], ACVehInfo[vehicleid][acVelZ]);
  6369. ACVehInfo[vehicleid][acPosDiff] = ac_D;
  6370. ACVehInfo[vehicleid][acVelX] = vel_x;
  6371. ACVehInfo[vehicleid][acVelY] = vel_y;
  6372. ACVehInfo[vehicleid][acVelZ] = vel_z;
  6373. }
  6374. return ac_a;
  6375. }
  6376.  
  6377. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6378. #if defined _ALS_OnUnoccupiedVehicleUpdate
  6379. #undef OnUnoccupiedVehicleUpdate
  6380. #else
  6381. #define _ALS_OnUnoccupiedVehicleUpdate
  6382. #endif
  6383. #define OnUnoccupiedVehicleUpdate ac_OnUnoccupiedVehicleUpdate
  6384. #if defined ac_OnUnoccupiedVehicleUpdate
  6385. 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);
  6386. #endif
  6387. #endif
  6388.  
  6389. #if defined _inc_y_hooks || defined _INC_y_hooks
  6390. hook OnPlayerEditAttachedObj(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
  6391. #else
  6392. 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)
  6393. #endif
  6394. {
  6395. if(ACInfo[playerid][acKicked]) return 1;
  6396. if(ACInfo[playerid][acACAllow][46] && 384 <= modelid <= 393)
  6397. {
  6398. #if defined DEBUG
  6399. printf("[Nex-AC debug] Object modelid: %d", modelid);
  6400. #endif
  6401. ac_KickWithCode(playerid, "", 0, 46);
  6402. return 1;
  6403. }
  6404. #if !defined _inc_y_hooks && !defined _INC_y_hooks\
  6405. && defined ac_OnPlayerEditAttachedObject
  6406. return ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ);
  6407. #else
  6408. return 0;
  6409. #endif
  6410. }
  6411.  
  6412. #if !defined _inc_y_hooks && !defined _INC_y_hooks
  6413. #if defined _ALS_OnPlayerEditAttachedObject
  6414. #undef OnPlayerEditAttachedObject
  6415. #else
  6416. #define _ALS_OnPlayerEditAttachedObject
  6417. #endif
  6418. #define OnPlayerEditAttachedObject ac_OnPlayerEditAttachedObject
  6419. #if defined ac_OnPlayerEditAttachedObject
  6420. 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);
  6421. #endif
  6422. #endif
  6423.  
  6424. ac_fpublic ac_Timer(playerid)
  6425. {
  6426. if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) return 0;
  6427. if(ACInfo[playerid][acACAllow][51] && NetStats_MessagesRecvPerSecond(playerid) > AC_MAX_MSGS_REC_DIFF)
  6428. {
  6429. #if defined DEBUG
  6430. printf("[Nex-AC debug] Max msgs per sec: %d, msgs per sec: %d",
  6431. AC_MAX_MSGS_REC_DIFF, NetStats_MessagesRecvPerSecond(playerid));
  6432. #endif
  6433. #undef AC_MAX_MSGS_REC_DIFF
  6434. ac_KickWithCode(playerid, "", 0, 51);
  6435. }
  6436. new ac_gpp = GetPlayerPing(playerid);
  6437. if(ACInfo[playerid][acACAllow][38])
  6438. {
  6439. if(ac_gpp > AC_MAX_PING && ac_gpp != 65535)
  6440. {
  6441. if(++ACInfo[playerid][acCheatCount][0] > AC_MAX_PING_WARNINGS)
  6442. {
  6443. #undef AC_MAX_PING_WARNINGS
  6444. #if defined DEBUG
  6445. printf("[Nex-AC debug] Max ping: %d, ping: %d", AC_MAX_PING, ac_gpp);
  6446. #endif
  6447. ac_KickWithCode(playerid, "", 0, 38);
  6448. #if defined OnCheatDetected
  6449. ACInfo[playerid][acCheatCount][0] = 0;
  6450. #endif
  6451. }
  6452. }
  6453. else ACInfo[playerid][acCheatCount][0] = 0;
  6454. }
  6455. new ac_gtc = GetTickCount();
  6456. if(ac_gtc < ACInfo[playerid][acLastUpdate] + 1500)
  6457. {
  6458. new ac_t;
  6459. #if AC_USE_AMMUNATIONS || AC_USE_CASINOS
  6460. new ac_int = GetPlayerInterior(playerid);
  6461. #endif
  6462. #if defined Streamer_GetDistanceToItem\
  6463. && defined Streamer_GetIntData
  6464. new Float:ac_tmp;
  6465. if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS)
  6466. {
  6467. new Float:ac_X, Float:ac_Y, Float:ac_Z;
  6468. GetPlayerPos(playerid, ac_X, ac_Y, ac_Z);
  6469. Streamer_GetDistanceToItem(ac_X, ac_Y, ac_Z, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_tmp);
  6470. ac_t = Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) - 100;
  6471. }
  6472. #endif
  6473. if(!ACInfo[playerid][acDead] && ac_gtc > ACInfo[playerid][acGtc][7] + ac_gpp)
  6474. {
  6475. for(new ac_i, ac_w, ac_a, bool:ac_cw, ac_s = ac_wSlot[GetPlayerWeapon(playerid)]; ac_i <= 12; ++ac_i)
  6476. {
  6477. GetPlayerWeaponData(playerid, ac_i, ac_w, ac_a);
  6478. if(ac_w == 39) ac_cw = true;
  6479. if(ac_s != ac_i)
  6480. {
  6481. if(ACInfo[playerid][acSetWeapon][ac_i] != -1)
  6482. {
  6483. if(ACInfo[playerid][acSetWeapon][ac_i] == ac_w)
  6484. {
  6485. if(ACInfo[playerid][acSet][3] == ac_w) ACInfo[playerid][acSet][3] = -1;
  6486. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  6487. ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6488. }
  6489. else if(ACInfo[playerid][acACAllow][52] && ac_gtc > ACInfo[playerid][acGtcSetWeapon][ac_i] + ac_gpp &&
  6490. ++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS)
  6491. {
  6492. #if defined DEBUG
  6493. printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon");
  6494. printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSetWeapon][ac_i], ac_w);
  6495. #endif
  6496. ac_KickWithCode(playerid, "", 0, 52, 13);
  6497. #if defined OnCheatDetected
  6498. ACInfo[playerid][acSetWeapon][ac_i] = -1;
  6499. #endif
  6500. }
  6501. }
  6502. else
  6503. {
  6504. if(ACInfo[playerid][acWeapon][ac_i] != ac_w)
  6505. {
  6506. #if defined Streamer_GetDistanceToItem\
  6507. && defined Streamer_GetIntData
  6508. if((ac_w == 0 || ac_w == 40 && ac_cw || ac_w == 46 &&
  6509. ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute]) ||
  6510. 0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
  6511. ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  6512. ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  6513. IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  6514. ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) ||
  6515. ACInfo[playerid][acLastPickup] > MAX_PICKUPS && ac_t == ac_w &&
  6516. ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) && floatcmp(ac_tmp, 8.0) <= 0)
  6517. {
  6518. ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6519. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6520. }
  6521. #else
  6522. if((ac_w == 0 || ac_w == 40 && ac_cw || ac_w == 46 &&
  6523. ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute]) ||
  6524. 0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS &&
  6525. ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w &&
  6526. ac_a <= (3 <= ac_i <= 5 ? ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w] : ac_pAmmo[ac_w]) &&
  6527. IsPlayerInRangeOfPoint(playerid, 8.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX],
  6528. ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]))
  6529. {
  6530. ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6531. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6532. }
  6533. #endif
  6534. else if(ACInfo[playerid][acACAllow][15] && !(16 <= ac_w <= 43 && ac_a == 0))
  6535. {
  6536. #if defined DEBUG
  6537. printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
  6538. ACInfo[playerid][acWeapon][ac_i], ACInfo[playerid][acAmmo][ac_i], ac_w, ac_a);
  6539. #endif
  6540. ac_KickWithCode(playerid, "", 0, 15, 2);
  6541. #if defined OnCheatDetected
  6542. ACInfo[playerid][acWeapon][ac_i] = ac_w;
  6543. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6544. #endif
  6545. }
  6546. }
  6547. if(ACInfo[playerid][acGiveAmmo][ac_i] != -65535)
  6548. {
  6549. if(ACInfo[playerid][acGiveAmmo][ac_i] == ac_a ||
  6550. ACInfo[playerid][acGiveAmmo][ac_i] > ac_a && ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_i] + ac_gpp)
  6551. {
  6552. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  6553. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6554. }
  6555. else if(ACInfo[playerid][acACAllow][52] &&
  6556. ac_gtc > ACInfo[playerid][acGtcGiveAmmo][ac_i] + ac_gpp &&
  6557. ++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS)
  6558. {
  6559. #if defined DEBUG
  6560. printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo");
  6561. printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  6562. ACInfo[playerid][acGiveAmmo][ac_i], ac_a, ac_w);
  6563. #endif
  6564. ac_KickWithCode(playerid, "", 0, 52, 14);
  6565. #if defined OnCheatDetected
  6566. ACInfo[playerid][acGiveAmmo][ac_i] = -65535;
  6567. #endif
  6568. }
  6569. }
  6570. else if(16 <= ac_w <= 43)
  6571. {
  6572. if(ac_a == 0) ACInfo[playerid][acAmmo][ac_i] = 0;
  6573. else if(ACInfo[playerid][acACAllow][16] &&
  6574. (ac_w != 40 && ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i]))
  6575. {
  6576. #if defined DEBUG
  6577. printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  6578. ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
  6579. #endif
  6580. ac_KickWithCode(playerid, "", 0, 16, 2);
  6581. #if defined OnCheatDetected
  6582. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6583. #endif
  6584. }
  6585. }
  6586. }
  6587. }
  6588. else if(22 <= ac_w <= 32 || 41 <= ac_w <= 42 || !ac_LagCompMode && (ac_w == 43 || 16 <= ac_w <= 39))
  6589. {
  6590. if((ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i]) &&
  6591. ACInfo[playerid][acGiveAmmo][ac_i] == -65535)
  6592. {
  6593. #if AC_USE_AMMUNATIONS
  6594. if(16 <= ac_w <= 39 && ac_InAmmuNation(playerid, ac_int) &&
  6595. ac_AmmuNationInfo[ac_w - 16][1] == ac_abs(ac_a - ACInfo[playerid][acAmmo][ac_i]))
  6596. {
  6597. if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 16][0];
  6598. else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 16][0];
  6599. ACInfo[playerid][acAmmo][ac_i] += ac_AmmuNationInfo[ac_w - 16][1];
  6600. ACInfo[playerid][acGtc][15] = ac_gtc + 1650;
  6601. ACInfo[playerid][acCheatCount][10] = 0;
  6602. }
  6603. else
  6604. {
  6605. #endif
  6606. if(ACInfo[playerid][acACAllow][16] && !ac_LagCompMode)
  6607. {
  6608. #if defined DEBUG
  6609. printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
  6610. ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w);
  6611. #endif
  6612. ac_KickWithCode(playerid, "", 0, 16, 3);
  6613. #if defined OnCheatDetected
  6614. ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6615. #endif
  6616. }
  6617. #if AC_USE_AMMUNATIONS
  6618. }
  6619. #endif
  6620. #undef ac_abs
  6621. }
  6622. else if(ACInfo[playerid][acAmmo][ac_i] != 0) ACInfo[playerid][acAmmo][ac_i] = ac_a;
  6623. }
  6624. }
  6625. }
  6626. ac_t = bad_GetPlayerMoney(playerid);
  6627. #if AC_USE_AMMUNATIONS
  6628. if(ACInfo[playerid][acSet][10] != -1)
  6629. {
  6630. if(ac_t < ACInfo[playerid][acMoney] &&
  6631. ACInfo[playerid][acSet][10] <= ACInfo[playerid][acMoney] - ac_t) ACInfo[playerid][acSet][10] = -1;
  6632. else if(ACInfo[playerid][acACAllow][15] && ac_gtc > ACInfo[playerid][acGtc][15] + ac_gpp &&
  6633. ++ACInfo[playerid][acCheatCount][10] > AC_MAX_NOP_WARNINGS)
  6634. {
  6635. #if defined DEBUG
  6636. printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
  6637. ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]);
  6638. #endif
  6639. ac_KickWithCode(playerid, "", 0, 15, 4);
  6640. #if defined OnCheatDetected
  6641. ACInfo[playerid][acSet][10] = -1;
  6642. #endif
  6643. }
  6644. }
  6645. #endif
  6646. #if AC_USE_TUNING_GARAGES
  6647. if(ACInfo[playerid][acSet][12] != -1)
  6648. {
  6649. if(ac_t < ACInfo[playerid][acMoney] &&
  6650. ACInfo[playerid][acSet][12] <= ACInfo[playerid][acMoney] - ac_t) ACInfo[playerid][acSet][12] = -1;
  6651. else if(ACInfo[playerid][acACAllow][23] && ac_gtc > ACInfo[playerid][acGtc][17] + ac_gpp &&
  6652. ++ACInfo[playerid][acCheatCount][12] > AC_MAX_NOP_WARNINGS)
  6653. {
  6654. #undef AC_MAX_NOP_WARNINGS
  6655. #if defined DEBUG
  6656. printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
  6657. ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][12]);
  6658. #endif
  6659. ac_KickWithCode(playerid, "", 0, 23, 6);
  6660. #if defined OnCheatDetected
  6661. ACInfo[playerid][acSet][12] = -1;
  6662. #endif
  6663. }
  6664. }
  6665. #endif
  6666. #undef AC_USE_TUNING_GARAGES
  6667. if(ACInfo[playerid][acNOPCount][11] > 0) ACInfo[playerid][acNOPCount][11]--;
  6668. else
  6669. {
  6670. if(ACInfo[playerid][acACAllow][14] &&
  6671. ac_t > ACInfo[playerid][acMoney] && (!ACInfo[playerid][acStuntBonus] || !ACInfo[playerid][acVeh]))
  6672. {
  6673. #if AC_USE_CASINOS
  6674. if(!ac_InCasino(playerid, ac_int))
  6675. {
  6676. #endif
  6677. #if defined DEBUG
  6678. printf("[Nex-AC debug] AC money: %d, money: %d, Stunt Bonus: %d, vehicleid: %d, playerid: %d",
  6679. ACInfo[playerid][acMoney], ac_t, ACInfo[playerid][acStuntBonus], ACInfo[playerid][acVeh], playerid);
  6680. #endif
  6681. #if defined OnCheatDetected
  6682. ac_KickWithCode(playerid, "", 0, 14);
  6683. ACInfo[playerid][acMoney] = ac_t;
  6684. #else
  6685. ac_t = ACInfo[playerid][acMoney];
  6686. ResetPlayerMoney(playerid);
  6687. GivePlayerMoney(playerid, ac_t);
  6688. #endif
  6689. #if AC_USE_CASINOS
  6690. }
  6691. #endif
  6692. }
  6693. ACInfo[playerid][acMoney] = ac_t;
  6694. }
  6695. }
  6696. ACInfo[playerid][acCheatCount][1] = ACInfo[playerid][acCheatCount][2] = 0;
  6697. if(ACInfo[playerid][acCheatCount][16] > 0) ACInfo[playerid][acCheatCount][16]--;
  6698. #if defined SetPlayerTimerEx_
  6699. ACInfo[playerid][acTimerID] = SetPlayerTimerEx_(playerid, "ac_Timer", 0, 1000, 1, "i", playerid);
  6700. #else
  6701. ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
  6702. #endif
  6703. return 1;
  6704. }
  6705.  
  6706. //Don't make changes in this public
  6707. //To customize the punishments, declare 'OnCheatDetected' in your script
  6708. ac_fpublic ac_OnCheatDetected(playerid, ip_address[], type, code)
  6709. {
  6710. if(type) BlockIpAddress(ip_address, 0);
  6711. else
  6712. {
  6713. switch(code)
  6714. {
  6715. case 40: SendClientMessage(playerid, AC_DEFAULT_COLOR, MAX_CONNECTS_MSG);
  6716. case 41: SendClientMessage(playerid, AC_DEFAULT_COLOR, UNKNOWN_CLIENT_MSG);
  6717. default:
  6718. {
  6719. static ac_strtmp[sizeof KICK_MSG];
  6720. format(ac_strtmp, sizeof ac_strtmp, KICK_MSG, code);
  6721. SendClientMessage(playerid, AC_DEFAULT_COLOR, ac_strtmp);
  6722. #undef AC_DEFAULT_COLOR
  6723. }
  6724. }
  6725. new ac_vehid = GetPlayerVehicleID(playerid), ac_gpp = GetPlayerPing(playerid) + 150;
  6726. #if defined SetPlayerTimerEx_
  6727. ACInfo[playerid][acKickTimerID] = SetPlayerTimerEx_(playerid, "ac_KickTimer", 0, (ac_gpp > AC_MAX_PING ? AC_MAX_PING : ac_gpp), 1, "i", playerid);
  6728. #else
  6729. ACInfo[playerid][acKickTimerID] = SetTimerEx("ac_KickTimer", (ac_gpp > AC_MAX_PING ? AC_MAX_PING : ac_gpp), false, "i", playerid);
  6730. #endif
  6731. #undef AC_MAX_PING
  6732. if(ac_vehid > 0)
  6733. {
  6734. if(code == 4) ACInfo[playerid][acLastVeh] = ac_vehid;
  6735. ACInfo[playerid][acKicked] = 2;
  6736. }
  6737. else ACInfo[playerid][acKicked] = 1;
  6738. }
  6739. return 1;
  6740. }
  6741.  
  6742. ac_fpublic ac_KickTimer(playerid) return Kick(playerid);
  6743.  
  6744. #undef ac_fpublic
  6745.  
  6746. stock AntiCheatGetHealth(playerid, &Float:health)
  6747. {
  6748. if(!IsPlayerConnected(playerid)) return 0;
  6749. health = ACInfo[playerid][acHealth];
  6750. return 1;
  6751. }
  6752.  
  6753. stock AntiCheatGetArmour(playerid, &Float:armour)
  6754. {
  6755. if(!IsPlayerConnected(playerid)) return 0;
  6756. armour = ACInfo[playerid][acArmour];
  6757. return 1;
  6758. }
  6759.  
  6760. stock AntiCheatGetVehicleHealth(vehicleid, &Float:health)
  6761. {
  6762. if(!GetVehicleModel(vehicleid)) return 0;
  6763. health = ACVehInfo[vehicleid][acHealth];
  6764. return 1;
  6765. }
  6766.  
  6767. stock AntiCheatGetWeaponData(playerid, slot, &weapons, &ammo)
  6768. {
  6769. if(!IsPlayerConnected(playerid)) return 0;
  6770. weapons = ACInfo[playerid][acWeapon][slot];
  6771. ammo = ACInfo[playerid][acAmmo][slot];
  6772. return 1;
  6773. }
  6774.  
  6775. stock AntiCheatGetSpawnWeapon(playerid, &weapon1, &weapon1_ammo, &weapon2, &weapon2_ammo, &weapon3, &weapon3_ammo)
  6776. {
  6777. if(!IsPlayerConnected(playerid)) return 0;
  6778. weapon1 = ACInfo[playerid][acSpawnWeapon1];
  6779. weapon1_ammo = ACInfo[playerid][acSpawnAmmo1];
  6780. weapon2 = ACInfo[playerid][acSpawnWeapon2];
  6781. weapon2_ammo = ACInfo[playerid][acSpawnAmmo2];
  6782. weapon3 = ACInfo[playerid][acSpawnWeapon3];
  6783. weapon3_ammo = ACInfo[playerid][acSpawnAmmo3];
  6784. return 1;
  6785. }
  6786.  
  6787. stock AntiCheatGetPos(playerid, &Float:x, &Float:y, &Float:z)
  6788. {
  6789. if(!IsPlayerConnected(playerid)) return 0;
  6790. x = ACInfo[playerid][acPosX];
  6791. y = ACInfo[playerid][acPosY];
  6792. z = ACInfo[playerid][acPosZ];
  6793. return 1;
  6794. }
  6795.  
  6796. stock AntiCheatGetSpeed(playerid, &Float:speed)
  6797. {
  6798. if(!IsPlayerConnected(playerid)) return 0;
  6799. speed = ACInfo[playerid][acSpeed];
  6800. return 1;
  6801. }
  6802.  
  6803. stock AntiCheatGetVehicleVelocity(vehicleid, &Float:x, &Float:y, &Float:z)
  6804. {
  6805. if(!GetVehicleModel(vehicleid)) return 0;
  6806. x = ACVehInfo[vehicleid][acVelX];
  6807. y = ACVehInfo[vehicleid][acVelY];
  6808. z = ACVehInfo[vehicleid][acVelZ];
  6809. return 1;
  6810. }
  6811.  
  6812. static ac_GetSpeed(Float:ac_x, Float:ac_y, Float:ac_z, bool:speed3d = true)
  6813. {
  6814. if(speed3d) return floatround(VectorSize(ac_x, ac_y, ac_z) * 179.28625);
  6815. return floatround(VectorSize(ac_x, ac_y, 0.0) * 179.28625);
  6816. }
  6817.  
  6818. static ac_IsVehicleSeatOccupied(vehicleid, seat)
  6819. {
  6820. #if defined foreach
  6821. foreach(new ac_i : Player)
  6822. #else
  6823. for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i)
  6824. {
  6825. if(IsPlayerConnected(ac_i))
  6826. #endif
  6827. {
  6828. if(ACInfo[ac_i][acVeh] == vehicleid && ACInfo[ac_i][acSeat] == seat) return 1;
  6829. }
  6830. #if !defined foreach
  6831. }
  6832. #endif
  6833. return 0;
  6834. }
  6835.  
  6836. static stock ac_InRestaurant(playerid, interiorid)
  6837. {
  6838. #if AC_USE_RESTAURANTS
  6839. new ac_i;
  6840. switch(interiorid)
  6841. {
  6842. case 5: ac_i = 0;
  6843. case 9: ac_i = 1;
  6844. case 10: ac_i = 2;
  6845. default: return 0;
  6846. }
  6847. return IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[ac_i][0], ac_Restaurants[ac_i][1], ac_Restaurants[ac_i][2]);
  6848. #else
  6849. #pragma unused playerid, interiorid
  6850. return 0;
  6851. #endif
  6852. #undef AC_USE_RESTAURANTS
  6853. }
  6854.  
  6855. static stock ac_InAmmuNation(playerid, interiorid)
  6856. {
  6857. #if AC_USE_AMMUNATIONS
  6858. new ac_i, ac_s;
  6859. switch(interiorid)
  6860. {
  6861. case 1: ac_i = 0, ac_s = -1;
  6862. case 4: ac_i = 1, ac_s = 0;
  6863. case 6: ac_i = 3, ac_s = 1;
  6864. default: return 0;
  6865. }
  6866. for(; ac_i > ac_s; --ac_i)
  6867. {
  6868. if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[ac_i][0],
  6869. ac_AmmuNations[ac_i][1], ac_AmmuNations[ac_i][2])) return 1;
  6870. }
  6871. #else
  6872. #pragma unused playerid, interiorid
  6873. #endif
  6874. #undef AC_USE_AMMUNATIONS
  6875. return 0;
  6876. }
  6877.  
  6878. static stock ac_InPayNSpray(playerid, interiorid)
  6879. {
  6880. #if AC_USE_PAYNSPRAY
  6881. if(interiorid == 0)
  6882. {
  6883. for(new ac_i = sizeof(ac_PayNSpray) - 1; ac_i >= 0; --ac_i)
  6884. {
  6885. if(IsPlayerInRangeOfPoint(playerid, 7.5, ac_PayNSpray[ac_i][0], ac_PayNSpray[ac_i][1], ac_PayNSpray[ac_i][2])) return 1;
  6886. }
  6887. }
  6888. #else
  6889. #pragma unused playerid, interiorid
  6890. #endif
  6891. #undef AC_USE_PAYNSPRAY
  6892. return 0;
  6893. }
  6894.  
  6895. static stock ac_NearVendingMachine(playerid, interiorid)
  6896. {
  6897. #if AC_USE_VENDING_MACHINES
  6898. new ac_i, ac_s;
  6899. switch(interiorid)
  6900. {
  6901. case 0: ac_i = 44, ac_s = -1;
  6902. case 1: ac_i = 51, ac_s = 44;
  6903. case 2: ac_i = 52, ac_s = 51;
  6904. case 3: ac_i = 58, ac_s = 52;
  6905. case 6: ac_i = 60, ac_s = 58;
  6906. case 7: ac_i = 61, ac_s = 60;
  6907. case 15: ac_i = 62, ac_s = 61;
  6908. case 16: ac_i = 65, ac_s = 62;
  6909. case 17: ac_i = 72, ac_s = 65;
  6910. case 18: ac_i = 74, ac_s = 72;
  6911. default: return 0;
  6912. }
  6913. for(; ac_i > ac_s; --ac_i)
  6914. {
  6915. if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1;
  6916. }
  6917. #else
  6918. #pragma unused playerid, interiorid
  6919. #endif
  6920. #undef AC_USE_VENDING_MACHINES
  6921. return 0;
  6922. }
  6923.  
  6924. static stock ac_InCasino(playerid, interiorid)
  6925. {
  6926. #if AC_USE_CASINOS
  6927. new ac_i, ac_s;
  6928. switch(interiorid)
  6929. {
  6930. case 1: ac_i = 41, ac_s = -1;
  6931. case 10: ac_i = 61, ac_s = 41;
  6932. case 12: ac_i = 70, ac_s = 61;
  6933. default: return 0;
  6934. }
  6935. for(; ac_i > ac_s; --ac_i)
  6936. {
  6937. if(IsPlayerInRangeOfPoint(playerid, ac_Casinos[ac_i][3], ac_Casinos[ac_i][0],
  6938. ac_Casinos[ac_i][1], ac_Casinos[ac_i][2])) return 1;
  6939. }
  6940. #else
  6941. #pragma unused playerid, interiorid
  6942. #endif
  6943. #undef AC_USE_CASINOS
  6944. return 0;
  6945. }
  6946.  
  6947. static ac_IsCompatible(modelid, componentid)
  6948. {
  6949. if(modelid > 0)
  6950. {
  6951. switch(componentid)
  6952. {
  6953. case 1000..1191:
  6954. {
  6955. componentid -= 1000;
  6956. if(ac_vMods[(modelid - 400) * 6 + (componentid >>> 5)] & 1 << (componentid & 0b00011111)) return 1;
  6957. }
  6958. case 1192, 1193:
  6959. {
  6960. if(modelid == 576) return 1;
  6961. }
  6962. }
  6963. }
  6964. return 0;
  6965. }
  6966.  
  6967. static ac_IpToInt(const s_szIP[])
  6968. {
  6969. new ac_aiBytes[1], ac_iPos;
  6970. ac_aiBytes{0} = strval(s_szIP[ac_iPos]);
  6971. while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
  6972. ac_aiBytes{1} = strval(s_szIP[ac_iPos]);
  6973. while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
  6974. ac_aiBytes{2} = strval(s_szIP[ac_iPos]);
  6975. while(ac_iPos < 15 && s_szIP[ac_iPos++] != '.'){}
  6976. ac_aiBytes{3} = strval(s_szIP[ac_iPos]);
  6977. return ac_aiBytes[0];
  6978. }
  6979.  
  6980. static ac_FloodDetect(playerid, publicid)
  6981. {
  6982. if(!ACInfo[playerid][acKicked])
  6983. {
  6984. if(++ACInfo[playerid][acFloodCount][publicid] > ac_Mtfc[publicid][1])
  6985. {
  6986. #if defined DEBUG
  6987. printf(DEBUG_CODE_1, playerid, ac_Mtfc[publicid][1], publicid);
  6988. #undef DEBUG
  6989. #endif
  6990. #if defined OnCheatDetected
  6991. ac_KickWithCode(playerid, "", 0, 49, publicid);
  6992. ACInfo[playerid][acFloodCount][publicid] = ACInfo[playerid][acFloodCount][27] = 0;
  6993. #else
  6994. return ac_KickWithCode(playerid, "", 0, 49, publicid);
  6995. #endif
  6996. }
  6997. ACInfo[playerid][acCall][publicid] = ACInfo[playerid][acCall][27] = GetTickCount();
  6998. }
  6999. return 0;
  7000. }
  7001.  
  7002. static ac_KickWithCode(playerid, ip_address[], type, code, code2 = 0)
  7003. {
  7004. if(type == 0 && (!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked]) ||
  7005. !(0 <= code < sizeof ac_ACAllow)) return 0;
  7006. ac_sInfo[5]++;
  7007. switch(code)
  7008. {
  7009. case 0..35, 37, 39, 51: ac_sInfo[0]++;
  7010. case 36, 38, 40, 41, 50: ac_sInfo[4]++;
  7011. case 42: ac_sInfo[1]++;
  7012. case 47..49: ac_sInfo[3]++;
  7013. case 43..46: ac_sInfo[2]++;
  7014. }
  7015. new ac_strtmp[6];
  7016. if(code2) format(ac_strtmp, sizeof ac_strtmp, " (%d)", code2);
  7017. if(type) printf(SUSPICION_2, ip_address, code, ac_strtmp);
  7018. else printf(SUSPICION_1, playerid, code, ac_strtmp);
  7019. #if defined OnCheatDetected
  7020. OnCheatDetected(playerid, ip_address, type, code);
  7021. #else
  7022. ac_OnCheatDetected(playerid, ip_address, type, code);
  7023. #endif
  7024. return 0;
  7025. }
  7026.  
  7027. static ac_LoadCfg()
  7028. {
  7029. static ac_strtmp[10];
  7030. new ac_i, ac_string[415], File:ac_cfgFile;
  7031. if(fexist(AC_CONFIG_FILE))
  7032. {
  7033. if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_read)))
  7034. {
  7035. #if defined sscanf
  7036. new ac_j;
  7037. #endif
  7038. while(fread(ac_cfgFile, ac_string) > 0)
  7039. {
  7040. #if defined sscanf
  7041. sscanf(ac_string, "i'//'i", ac_j, ac_i);
  7042. ac_ACAllow[ac_i] = !!ac_j;
  7043. #else
  7044. if((ac_i = strfind(ac_string, "//")) != -1)
  7045. {
  7046. strmid(ac_strtmp, ac_string, ac_i + 2, strlen(ac_string));
  7047. if(0 <= (ac_i = strval(ac_strtmp)) < sizeof ac_ACAllow) ac_ACAllow[ac_i] = !!strval(ac_string);
  7048. }
  7049. #endif
  7050. }
  7051. fclose(ac_cfgFile);
  7052. }
  7053. else return 0;
  7054. }
  7055. else if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_write)))
  7056. {
  7057. #undef AC_CONFIG_FILE
  7058. for(; ac_i < sizeof ac_ACAllow; ++ac_i)
  7059. {
  7060. format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_ACAllow[ac_i], ac_i);
  7061. strcat(ac_string, ac_strtmp);
  7062. }
  7063. fwrite(ac_cfgFile, ac_string);
  7064. fclose(ac_cfgFile);
  7065. }
  7066. else return 0;
  7067. return 1;
  7068. }
  7069.  
  7070. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement