SHOW:
|
|
- or go back to the newest paste.
| 1 | - | //Nex-AC by Nexius v1.9.53 (0.3.7) |
| 1 | + | //Nex-AC by Nexius v1.9.54 (0.3.7) |
| 2 | ||
| 3 | #if defined _nex_ac_included | |
| 4 | #endinput | |
| 5 | #endif | |
| 6 | #define _nex_ac_included | |
| 7 | ||
| 8 | #tryinclude <a_samp> | |
| 9 | ||
| 10 | #if !defined FILTERSCRIPT | |
| 11 | ||
| 12 | #if !defined DEBUG | |
| 13 | #define DEBUG | |
| 14 | #endif | |
| 15 | ||
| 16 | #if !defined NO_SUSPICION_LOGS | |
| 17 | //#define NO_SUSPICION_LOGS | |
| 18 | #endif | |
| 19 | ||
| 20 | #if defined NO_SUSPICION_LOGS | |
| 21 | #pragma unused SUSPICION_1 | |
| 22 | #pragma unused SUSPICION_2 | |
| 23 | #endif | |
| 24 | ||
| 25 | #if !defined _nex_ac_lang_included | |
| 26 | #include <nex-ac_en.lang> //Localization | |
| 27 | #endif | |
| 28 | ||
| 29 | - | #define NEX_AC_VERSION "1.9.53" |
| 29 | + | #define NEX_AC_VERSION "1.9.54" |
| 30 | ||
| 31 | #define AC_SERVER_VERSION "0.3.7" | |
| 32 | #define AC_SERVER_DL_VERSION "0.3.DL" | |
| 33 | ||
| 34 | #if !defined AC_CLIENT_VERSION | |
| 35 | #define AC_CLIENT_VERSION "0.3" | |
| 36 | #endif | |
| 37 | ||
| 38 | #if !defined AC_USE_CONFIG_FILES | |
| 39 | #define AC_USE_CONFIG_FILES true | |
| 40 | #endif | |
| 41 | ||
| 42 | #if AC_USE_CONFIG_FILES | |
| 43 | #if !defined AC_CONFIG_FILE | |
| 44 | #define AC_CONFIG_FILE "nex-ac_settings.cfg" | |
| 45 | #endif | |
| 46 | ||
| 47 | #if !defined AC_NOP_CONFIG_FILE | |
| 48 | #define AC_NOP_CONFIG_FILE "nex-ac_nop_settings.cfg" | |
| 49 | #endif | |
| 50 | #else | |
| 51 | #pragma unused CFG_OPENING_ERROR | |
| 52 | #endif | |
| 53 | ||
| 54 | #if !defined AC_USE_VENDING_MACHINES | |
| 55 | #define AC_USE_VENDING_MACHINES true | |
| 56 | #endif | |
| 57 | ||
| 58 | #if !defined AC_USE_TUNING_GARAGES | |
| 59 | #define AC_USE_TUNING_GARAGES true | |
| 60 | #endif | |
| 61 | ||
| 62 | #if !defined AC_USE_PICKUP_WEAPONS | |
| 63 | #define AC_USE_PICKUP_WEAPONS true | |
| 64 | #endif | |
| 65 | ||
| 66 | #if !defined AC_USE_AMMUNATIONS | |
| 67 | #define AC_USE_AMMUNATIONS true | |
| 68 | #endif | |
| 69 | ||
| 70 | #if !defined AC_USE_RESTAURANTS | |
| 71 | #define AC_USE_RESTAURANTS true | |
| 72 | #endif | |
| 73 | ||
| 74 | #if !defined AC_USE_PAYNSPRAY | |
| 75 | #define AC_USE_PAYNSPRAY true | |
| 76 | #endif | |
| 77 | ||
| 78 | #if !defined AC_USE_CASINOS | |
| 79 | #define AC_USE_CASINOS true | |
| 80 | #endif | |
| 81 | ||
| 82 | #if !defined AC_USE_QUERY | |
| 83 | #define AC_USE_QUERY true | |
| 84 | #endif | |
| 85 | ||
| 86 | #if !defined AC_USE_NPC | |
| 87 | #define AC_USE_NPC true | |
| 88 | #endif | |
| 89 | ||
| 90 | #if !defined AC_USE_STATISTICS | |
| 91 | #define AC_USE_STATISTICS true | |
| 92 | #endif | |
| 93 | ||
| 94 | #if !AC_USE_STATISTICS | |
| 95 | #pragma unused STATS_STRING_1 | |
| 96 | #pragma unused STATS_STRING_2 | |
| 97 | #pragma unused STATS_STRING_3 | |
| 98 | #pragma unused STATS_STRING_4 | |
| 99 | #pragma unused STATS_STRING_5 | |
| 100 | #pragma unused STATS_STRING_6 | |
| 101 | #pragma unused STATS_STRING_7 | |
| 102 | #pragma unused STATS_STRING_8 | |
| 103 | #endif | |
| 104 | ||
| 105 | #if !defined AUTOSAVE_SETTINGS_IN_CONFIG | |
| 106 | #define AUTOSAVE_SETTINGS_IN_CONFIG false | |
| 107 | #endif | |
| 108 | ||
| 109 | #if !defined AC_DEFAULT_COLOR | |
| 110 | #define AC_DEFAULT_COLOR -1 | |
| 111 | #endif | |
| 112 | ||
| 113 | #if !defined AC_MAX_CLASSES | |
| 114 | #define AC_MAX_CLASSES 320 | |
| 115 | #endif | |
| 116 | ||
| 117 | #if !defined AC_MAX_SKINS | |
| 118 | #define AC_MAX_SKINS 312 | |
| 119 | #endif | |
| 120 | ||
| 121 | #if !defined AC_MAX_CONNECTS_FROM_IP | |
| 122 | #define AC_MAX_CONNECTS_FROM_IP 1 | |
| 123 | #endif | |
| 124 | ||
| 125 | #if !defined AC_MAX_RCON_LOGIN_ATTEMPT | |
| 126 | #define AC_MAX_RCON_LOGIN_ATTEMPT 1 | |
| 127 | #endif | |
| 128 | ||
| 129 | #if !defined AC_MAX_MSGS_REC_DIFF | |
| 130 | #define AC_MAX_MSGS_REC_DIFF 800 | |
| 131 | #endif | |
| 132 | ||
| 133 | #if !defined AC_MAX_PING | |
| 134 | #define AC_MAX_PING 500 | |
| 135 | #endif | |
| 136 | ||
| 137 | #if !defined AC_MIN_TIME_RECONNECT | |
| 138 | #define AC_MIN_TIME_RECONNECT 12 //In seconds | |
| 139 | #endif | |
| 140 | ||
| 141 | #if !defined AC_SPEEDHACK_VEH_RESET_DELAY | |
| 142 | #define AC_SPEEDHACK_VEH_RESET_DELAY 3 //In seconds | |
| 143 | #endif | |
| 144 | ||
| 145 | #if !defined AC_MAX_NOP_WARNINGS | |
| 146 | #define AC_MAX_NOP_WARNINGS 8 | |
| 147 | #endif | |
| 148 | ||
| 149 | #if !defined AC_MAX_NOP_TIMER_WARNINGS | |
| 150 | #define AC_MAX_NOP_TIMER_WARNINGS 3 | |
| 151 | #endif | |
| 152 | ||
| 153 | #if !defined AC_MAX_PING_WARNINGS | |
| 154 | #define AC_MAX_PING_WARNINGS 8 | |
| 155 | #endif | |
| 156 | ||
| 157 | #if !defined AC_MAX_MONEY_WARNINGS | |
| 158 | #define AC_MAX_MONEY_WARNINGS 2 | |
| 159 | #endif | |
| 160 | ||
| 161 | #if !defined AC_MAX_AIR_WARNINGS | |
| 162 | #define AC_MAX_AIR_WARNINGS 4 | |
| 163 | #endif | |
| 164 | ||
| 165 | #if !defined AC_MAX_AIR_VEH_WARNINGS | |
| 166 | #define AC_MAX_AIR_VEH_WARNINGS 4 | |
| 167 | #endif | |
| 168 | ||
| 169 | #if !defined AC_MAX_SPEEDHACK_WARNINGS | |
| 170 | #define AC_MAX_SPEEDHACK_WARNINGS 4 | |
| 171 | #endif | |
| 172 | ||
| 173 | #if !defined AC_MAX_SPEEDHACK_VEH_WARNINGS | |
| 174 | #define AC_MAX_SPEEDHACK_VEH_WARNINGS (1 * AC_SPEEDHACK_VEH_RESET_DELAY) | |
| 175 | #endif | |
| 176 | ||
| 177 | #if !defined AC_MAX_FLYHACK_WARNINGS | |
| 178 | #define AC_MAX_FLYHACK_WARNINGS 2 | |
| 179 | #endif | |
| 180 | ||
| 181 | #if !defined AC_MAX_FLYHACK_BIKE_WARNINGS | |
| 182 | #define AC_MAX_FLYHACK_BIKE_WARNINGS 6 | |
| 183 | #endif | |
| 184 | ||
| 185 | #if !defined AC_MAX_FLYHACK_VEH_WARNINGS | |
| 186 | #define AC_MAX_FLYHACK_VEH_WARNINGS 4 | |
| 187 | #endif | |
| 188 | ||
| 189 | #if !defined AC_MAX_CARSHOT_WARNINGS | |
| 190 | #define AC_MAX_CARSHOT_WARNINGS 4 | |
| 191 | #endif | |
| 192 | ||
| 193 | #if !defined AC_MAX_GODMODE_WARNINGS | |
| 194 | #define AC_MAX_GODMODE_WARNINGS 3 | |
| 195 | #endif | |
| 196 | ||
| 197 | #if !defined AC_MAX_GODMODE_VEH_WARNINGS | |
| 198 | #define AC_MAX_GODMODE_VEH_WARNINGS 3 | |
| 199 | #endif | |
| 200 | ||
| 201 | #if !defined AC_MAX_FAKE_WEAPON_WARNINGS | |
| 202 | #define AC_MAX_FAKE_WEAPON_WARNINGS 2 | |
| 203 | #endif | |
| 204 | ||
| 205 | #if !defined AC_MAX_SILENT_AIM_WARNINGS | |
| 206 | #define AC_MAX_SILENT_AIM_WARNINGS 2 | |
| 207 | #endif | |
| 208 | ||
| 209 | #if !defined AC_MAX_PRO_AIM_WARNINGS | |
| 210 | #define AC_MAX_PRO_AIM_WARNINGS 2 | |
| 211 | #endif | |
| 212 | ||
| 213 | #if !defined AC_MAX_AFK_GHOST_WARNINGS | |
| 214 | #define AC_MAX_AFK_GHOST_WARNINGS 2 | |
| 215 | #endif | |
| 216 | ||
| 217 | #if !defined AC_MAX_RAPID_FIRE_WARNINGS | |
| 218 | #define AC_MAX_RAPID_FIRE_WARNINGS 16 | |
| 219 | #endif | |
| 220 | ||
| 221 | #if !defined AC_MAX_AUTO_C_WARNINGS | |
| 222 | #define AC_MAX_AUTO_C_WARNINGS 8 | |
| 223 | #endif | |
| 224 | ||
| 225 | #if !defined AC_MAX_TELEPORT_GLITCH_WARNINGS | |
| 226 | #define AC_MAX_TELEPORT_GLITCH_WARNINGS 1 | |
| 227 | #endif | |
| 228 | ||
| 229 | #if !defined AC_MAX_CJ_RUN_WARNINGS | |
| 230 | #define AC_MAX_CJ_RUN_WARNINGS 3 | |
| 231 | #endif | |
| 232 | ||
| 233 | #define ac_fpublic%0(%1) forward%0(%1); public%0(%1) | |
| 234 | #define ac_AbsoluteAngle(%0) ((floatround(%0, floatround_floor) % 360) + floatfract(%0)) | |
| 235 | #define ac_abs(%0) (((%0) < 0) ? (-(%0)) : ((%0))) | |
| 236 | ||
| 237 | //'ac_ACAllow' contains the default settings that will be set if no config file is found | |
| 238 | //Don't change these values if you already have 'scriptfiles\nex-ac_settings.cfg' | |
| 239 | static bool:ac_ACAllow[] = | |
| 240 | {
| |
| 241 | true, //0 Anti-AirBreak (onfoot) | |
| 242 | true, //1 Anti-AirBreak (in vehicle) | |
| 243 | true, //2 Anti-teleport hack (onfoot) | |
| 244 | true, //3 Anti-teleport hack (in vehicle) | |
| 245 | true, //4 Anti-teleport hack (into/between vehicles) | |
| 246 | true, //5 Anti-teleport hack (vehicle to player) | |
| 247 | true, //6 Anti-teleport hack (pickups) | |
| 248 | true, //7 Anti-FlyHack (onfoot) | |
| 249 | true, //8 Anti-FlyHack (in vehicle) | |
| 250 | true, //9 Anti-SpeedHack (onfoot) | |
| 251 | true, //10 Anti-SpeedHack (in vehicle) | |
| 252 | true, //11 Anti-Health hack (in vehicle) | |
| 253 | true, //12 Anti-Health hack (onfoot) | |
| 254 | true, //13 Anti-Armour hack | |
| 255 | true, //14 Anti-Money hack | |
| 256 | true, //15 Anti-Weapon hack | |
| 257 | true, //16 Anti-Ammo hack (add) | |
| 258 | true, //17 Anti-Ammo hack (infinite) | |
| 259 | true, //18 Anti-Special actions hack | |
| 260 | true, //19 Anti-GodMode from bullets (onfoot) | |
| 261 | true, //20 Anti-GodMode from bullets (in vehicle) | |
| 262 | true, //21 Anti-Invisible hack | |
| 263 | true, //22 Anti-lagcomp-spoof | |
| 264 | true, //23 Anti-Tuning hack | |
| 265 | false, //24 Anti-Parkour mod | |
| 266 | true, //25 Anti-Quick turn | |
| 267 | true, //26 Anti-Rapid fire | |
| 268 | true, //27 Anti-FakeSpawn | |
| 269 | true, //28 Anti-FakeKill | |
| 270 | true, //29 Anti-Pro Aim | |
| 271 | true, //30 Anti-CJ run | |
| 272 | true, //31 Anti-CarShot | |
| 273 | true, //32 Anti-CarJack | |
| 274 | false, //33 Anti-UnFreeze | |
| 275 | true, //34 Anti-AFK Ghost | |
| 276 | true, //35 Anti-Full Aiming | |
| 277 | ||
| 278 | false, //36 Anti-Fake NPC | |
| 279 | true, //37 Anti-Reconnect | |
| 280 | true, //38 Anti-High ping | |
| 281 | true, //39 Anti-Dialog hack | |
| 282 | true, //40 Protection from sandbox | |
| 283 | true, //41 Protection from invalid version | |
| 284 | true, //42 Anti-Rcon hack | |
| 285 | ||
| 286 | true, //43 Anti-Tuning crasher | |
| 287 | true, //44 Anti-Invalid seat crasher | |
| 288 | true, //45 Anti-Dialog crasher | |
| 289 | true, //46 Anti-Attached object crasher | |
| 290 | true, //47 Anti-Weapon Crasher | |
| 291 | ||
| 292 | true, //48 Protection from connection flood in one slot | |
| 293 | true, //49 Anti-callback functions flood | |
| 294 | true, //50 Anti-flood by seat changing | |
| 295 | ||
| 296 | true, //51 Anti-DoS | |
| 297 | ||
| 298 | true //52 Anti-NOPs | |
| 299 | }, | |
| 300 | ||
| 301 | bool:ac_NOPAllow[] = | |
| 302 | {
| |
| 303 | true, //0 Anti-NOP GivePlayerWeapon | |
| 304 | true, //1 Anti-NOP SetPlayerAmmo | |
| 305 | true, //2 Anti-NOP SetPlayerInterior | |
| 306 | true, //3 Anti-NOP SetPlayerHealth | |
| 307 | true, //4 Anti-NOP SetVehicleHealth | |
| 308 | true, //5 Anti-NOP SetPlayerArmour | |
| 309 | true, //6 Anti-NOP SetPlayerSpecialAction | |
| 310 | true, //7 Anti-NOP PutPlayerInVehicle | |
| 311 | true, //8 Anti-NOP TogglePlayerSpectating | |
| 312 | true, //9 Anti-NOP SpawnPlayer | |
| 313 | true, //10 Anti-NOP SetPlayerPos | |
| 314 | true //11 Anti-NOP RemovePlayerFromVehicle | |
| 315 | }; | |
| 316 | ||
| 317 | static const ac_Mtfc[][] = | |
| 318 | {
| |
| 319 | {120, 8}, //0 OnDialogResponse
| |
| 320 | {800, 2}, //1 OnEnterExitModShop
| |
| 321 | {250, 5}, //2 OnPlayerClickMap
| |
| 322 | {400, 5}, //3 OnPlayerClickPlayer
| |
| 323 | {50, 11}, //4 OnPlayerClickTextDraw
| |
| 324 | {400, 5}, //5 OnPlayerCommandText
| |
| 325 | {50, 8}, //6 OnPlayerEnterVehicle
| |
| 326 | {50, 11}, //7 OnPlayerExitVehicle
| |
| 327 | {50, 8}, //8 OnPlayerPickUpPickup
| |
| 328 | {150, 8}, //9 OnPlayerRequestClass
| |
| 329 | {120, 8}, //10 OnPlayerSelectedMenuRow
| |
| 330 | {600, 5}, //11 OnPlayerStateChange
| |
| 331 | {450, 2}, //12 OnVehicleMod
| |
| 332 | {450, 2}, //13 OnVehiclePaintjob
| |
| 333 | {450, 2}, //14 OnVehicleRespray
| |
| 334 | {300, 1}, //15 OnVehicleDeath
| |
| 335 | {450, 3}, //16 OnPlayerText
| |
| 336 | {150, 8}, //17 OnPlayerEnterCheckpoint
| |
| 337 | {150, 8}, //18 OnPlayerLeaveCheckpoint
| |
| 338 | {150, 5}, //19 OnPlayerRequestSpawn
| |
| 339 | {120, 8}, //20 OnPlayerExitedMenu
| |
| 340 | {150, 8}, //21 OnPlayerEnterRaceCheckpoint
| |
| 341 | {150, 8}, //22 OnPlayerLeaveRaceCheckpoint
| |
| 342 | {50, 11}, //23 OnPlayerClickPlayerTextDraw
| |
| 343 | {60, 9}, //24 OnVehicleDamageStatusUpdate
| |
| 344 | {150, 8}, //25 OnVehicleSirenStateChange
| |
| 345 | {150, 5}, //26 OnPlayerSelectObject
| |
| 346 | {50, 11} //27 Cross-public
| |
| 347 | }, | |
| 348 | ||
| 349 | ac_wSlot[] = | |
| 350 | {
| |
| 351 | 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10, | |
| 352 | 10, 8, 8, 8, 8, 8, 8, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, | |
| 353 | 4, 6, 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11, 11, 11 | |
| 354 | }, | |
| 355 | ||
| 356 | ac_vType[] = | |
| 357 | {
| |
| 358 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, | |
| 359 | 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 6, 0, 0, 0, 0, 0, 6, 0, 0, | |
| 360 | 0, 0, 0, 0, 0, 0, 3, 2, 5, 7, 0, 0, 3, 3, 3, 0, 0, 0, 0, 0, | |
| 361 | 1, 5, 5, 5, 0, 0, 0, 0, 5, 2, 0, 5, 3, 3, 0, 0, 1, 0, 0, 0, | |
| 362 | 0, 4, 0, 0, 3, 0, 0, 2, 2, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, | |
| 363 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 1, 1, 1, 0, 0, 0, 0, 0, 1, | |
| 364 | 1, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 1, | |
| 365 | 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, | |
| 366 | 0, 0, 0, 2, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 1, 0, 0, | |
| 367 | 0, 5, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 1, 0, 3, 0, 0, 0, 0, | |
| 368 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | |
| 369 | }, | |
| 370 | ||
| 371 | #if AC_USE_PICKUP_WEAPONS | |
| 372 | ac_wModel[] = | |
| 373 | {
| |
| 374 | 0, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325, | |
| 375 | 326, 342, 343, 344, 345, 345, 345, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, | |
| 376 | 372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 371 | |
| 377 | }, | |
| 378 | ||
| 379 | ac_pAmmo[] = | |
| 380 | {
| |
| 381 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 382 | 1, 1, 1, 8, 8, 8, 8, 4, 4, 30, 10, 10, 15, | |
| 383 | 10, 10, 60, 60, 80, 80, 60, 20, 10, 4, 3, | |
| 384 | 100, 500, 5, 1, 500, 500, 36, 0, 0, 1 | |
| 385 | }, | |
| 386 | #endif | |
| 387 | ||
| 388 | #if AC_USE_TUNING_GARAGES | |
| 389 | ac_cPrice[] = | |
| 390 | {
| |
| 391 | 400, 550, 200, 250, 100, 150, 80, 500, 500, 200, 1000, 220, 250, 100, 400, | |
| 392 | 500, 200, 500, 350, 300, 250, 200, 150, 350, 50, 1000, 480, 480, 770, 680, 370, | |
| 393 | 370, 170, 120, 790, 150, 500, 690, 190, 390, 500, 390, 1000, 500, 500, 510, 710, | |
| 394 | 670, 530, 810, 620, 670, 530, 130, 210, 230, 520, 430, 620, 720, 530, 180, 550, 430, | |
| 395 | 830, 850, 750, 250, 200, 550, 450, 550, 450, 1100, 1030, 980, 1560, 1620, 1200, | |
| 396 | 1030, 900, 1230, 820, 1560, 1350, 770, 100, 1500, 150, 650, 450, 100, 750, | |
| 397 | 350, 450, 350, 1000, 620, 1140, 1000, 940, 780, 830, 3250, 1610, 1540, 780, 780, 780, | |
| 398 | 1610, 1540, 0, 0, 3340, 3250, 2130, 2050, 2040, 780, 940, 780, 940, 780, 860, | |
| 399 | 780, 1120, 3340, 3250, 3340, 1650, 3380, 3290, 1590, 830, 800, 1500, 1000, 800, | |
| 400 | 580, 470, 870, 980, 150, 150, 100, 100, 490, 600, 890, 1000, 1090, 840, 910, | |
| 401 | 1200, 1030, 1030, 920, 930, 550, 1050, 1050, 950, 650, 450, 550, 850, 950, | |
| 402 | 850, 950, 970, 880, 990, 900, 950, 1000, 900, 1000, 900, 2050, 2150, 2130, | |
| 403 | 2050, 2130, 2040, 2150, 2040, 2095, 2175, 2080, 2200, 1200, 1040, 940, 1100 | |
| 404 | }, | |
| 405 | #endif | |
| 406 | ||
| 407 | #if AC_USE_AMMUNATIONS | |
| 408 | ac_AmmuNationInfo[][] = | |
| 409 | {
| |
| 410 | {200, 30}, {600, 30}, {1200, 15},
| |
| 411 | {600, 15}, {800, 12}, {1000, 10},
| |
| 412 | {500, 60}, {2000, 90}, {3500, 120},
| |
| 413 | {4500, 150}, {300, 60}
| |
| 414 | }, | |
| 415 | ||
| 416 | Float:ac_AmmuNations[][] = | |
| 417 | {
| |
| 418 | {296.3255, -38.304, 1001.5156},
| |
| 419 | {295.7595, -80.5579, 1001.5156},
| |
| 420 | {290.1898, -109.482, 1001.5156},
| |
| 421 | {312.6785, -165.5487, 999.6016},
| |
| 422 | {308.2072, -141.0583, 999.6016}
| |
| 423 | }, | |
| 424 | #endif | |
| 425 | ||
| 426 | #if AC_USE_RESTAURANTS | |
| 427 | Float:ac_Restaurants[][] = | |
| 428 | {
| |
| 429 | {374.0, -119.641, 1001.4922},
| |
| 430 | {368.789, -6.857, 1001.8516},
| |
| 431 | {375.566, -68.222, 1001.5151}
| |
| 432 | }, | |
| 433 | #endif | |
| 434 | ||
| 435 | #if AC_USE_PAYNSPRAY | |
| 436 | Float:ac_PayNSpray[][] = | |
| 437 | {
| |
| 438 | {2064.2842, -1831.4736, 13.5469},
| |
| 439 | {-2425.7822, 1021.1392, 50.3977},
| |
| 440 | {-1420.5195, 2584.2305, 55.8433},
| |
| 441 | {487.6401, -1739.9479, 11.1385},
| |
| 442 | {1024.8651, -1024.087, 32.1016},
| |
| 443 | {-1904.7019, 284.5968, 41.0469},
| |
| 444 | {1975.2384, 2162.5088, 11.0703},
| |
| 445 | {2393.4456, 1491.5537, 10.5616},
| |
| 446 | {720.0854, -455.2807, 16.3359},
| |
| 447 | {-99.9417, 1117.9048, 19.7417}
| |
| 448 | }, | |
| 449 | #endif | |
| 450 | ||
| 451 | #if AC_USE_VENDING_MACHINES | |
| 452 | Float:ac_vMachines[][] = | |
| 453 | {
| |
| 454 | {-862.82, 1536.6, 21.98},
| |
| 455 | {2271.72, -76.46, 25.96},
| |
| 456 | {1277.83, 372.51, 18.95},
| |
| 457 | {662.42, -552.16, 15.71},
| |
| 458 | {201.01, -107.61, 0.89},
| |
| 459 | {-253.74, 2597.95, 62.24},
| |
| 460 | {-253.74, 2599.75, 62.24},
| |
| 461 | {-76.03, 1227.99, 19.12},
| |
| 462 | {-14.7, 1175.35, 18.95},
| |
| 463 | {-1455.11, 2591.66, 55.23},
| |
| 464 | {2352.17, -1357.15, 23.77},
| |
| 465 | {2325.97, -1645.13, 14.21},
| |
| 466 | {2139.51, -1161.48, 23.35},
| |
| 467 | {2153.23, -1016.14, 62.23},
| |
| 468 | {1928.73, -1772.44, 12.94},
| |
| 469 | {1154.72, -1460.89, 15.15},
| |
| 470 | {2480.85, -1959.27, 12.96},
| |
| 471 | {2060.11, -1897.64, 12.92},
| |
| 472 | {1729.78, -1943.04, 12.94},
| |
| 473 | {1634.1, -2237.53, 12.89},
| |
| 474 | {1789.21, -1369.26, 15.16},
| |
| 475 | {-2229.18, 286.41, 34.7},
| |
| 476 | {2319.99, 2532.85, 10.21},
| |
| 477 | {2845.72, 1295.04, 10.78},
| |
| 478 | {2503.14, 1243.69, 10.21},
| |
| 479 | {2647.69, 1129.66, 10.21},
| |
| 480 | {-2420.21, 984.57, 44.29},
| |
| 481 | {-2420.17, 985.94, 44.29},
| |
| 482 | {2085.77, 2071.35, 10.45},
| |
| 483 | {1398.84, 2222.6, 10.42},
| |
| 484 | {1659.46, 1722.85, 10.21},
| |
| 485 | {1520.14, 1055.26, 10.0},
| |
| 486 | {-1980.78, 142.66, 27.07},
| |
| 487 | {-2118.96, -423.64, 34.72},
| |
| 488 | {-2118.61, -422.41, 34.72},
| |
| 489 | {-2097.27, -398.33, 34.72},
| |
| 490 | {-2092.08, -490.05, 34.72},
| |
| 491 | {-2063.27, -490.05, 34.72},
| |
| 492 | {-2005.64, -490.05, 34.72},
| |
| 493 | {-2034.46, -490.05, 34.72},
| |
| 494 | {-2068.56, -398.33, 34.72},
| |
| 495 | {-2039.85, -398.33, 34.72},
| |
| 496 | {-2011.14, -398.33, 34.72},
| |
| 497 | {-1350.11, 492.28, 10.58},
| |
| 498 | {-1350.11, 493.85, 10.58},
| |
| 499 | {2222.36, 1602.64, 1000.06},
| |
| 500 | {2222.2, 1606.77, 1000.05},
| |
| 501 | {2155.9, 1606.77, 1000.05},
| |
| 502 | {2155.84, 1607.87, 1000.06},
| |
| 503 | {2209.9, 1607.19, 1000.05},
| |
| 504 | {2202.45, 1617.0, 1000.06},
| |
| 505 | {2209.24, 1621.21, 1000.06},
| |
| 506 | {2576.7, -1284.43, 1061.09},
| |
| 507 | {330.67, 178.5, 1020.07},
| |
| 508 | {331.92, 178.5, 1020.07},
| |
| 509 | {350.9, 206.08, 1008.47},
| |
| 510 | {361.56, 158.61, 1008.47},
| |
| 511 | {371.59, 178.45, 1020.07},
| |
| 512 | {374.89, 188.97, 1008.47},
| |
| 513 | {-19.03, -57.83, 1003.63},
| |
| 514 | {-36.14, -57.87, 1003.63},
| |
| 515 | {316.87, -140.35, 998.58},
| |
| 516 | {2225.2, -1153.42, 1025.9},
| |
| 517 | {-15.1, -140.22, 1003.63},
| |
| 518 | {-16.53, -140.29, 1003.63},
| |
| 519 | {-35.72, -140.22, 1003.63},
| |
| 520 | {373.82, -178.14, 1000.73},
| |
| 521 | {379.03, -178.88, 1000.73},
| |
| 522 | {495.96, -24.32, 1000.73},
| |
| 523 | {500.56, -1.36, 1000.73},
| |
| 524 | {501.82, -1.42, 1000.73},
| |
| 525 | {-33.87, -186.76, 1003.63},
| |
| 526 | {-32.44, -186.69, 1003.63},
| |
| 527 | {-16.11, -91.64, 1003.63},
| |
| 528 | {-17.54, -91.71, 1003.63}
| |
| 529 | }, | |
| 530 | #endif | |
| 531 | ||
| 532 | #if AC_USE_CASINOS | |
| 533 | Float:ac_Casinos[][] = | |
| 534 | {
| |
| 535 | {2241.2878, 1617.1624, 1006.1797, 2.0},
| |
| 536 | {2240.9736, 1604.6592, 1006.1797, 6.0},
| |
| 537 | {2242.5427, 1592.8726, 1006.1836, 6.0},
| |
| 538 | {2230.2124, 1592.1426, 1006.1832, 6.0},
| |
| 539 | {2230.4717, 1604.484, 1006.186, 6.0},
| |
| 540 | {2230.3298, 1616.9272, 1006.1799, 3.0},
| |
| 541 | {2251.9407, 1586.1736, 1006.186, 1.0},
| |
| 542 | {2218.6785, 1587.3448, 1006.1749, 1.0},
| |
| 543 | {2219.2773, 1591.7467, 1006.1867, 1.0},
| |
| 544 | {2218.5408, 1589.3229, 1006.184, 1.0},
| |
| 545 | {2218.6477, 1593.6279, 1006.1797, 1.0},
| |
| 546 | {2221.926, 1603.8285, 1006.1797, 1.0},
| |
| 547 | {2218.5095, 1603.8385, 1006.1797, 1.0},
| |
| 548 | {2219.9597, 1603.9216, 1006.1797, 1.0},
| |
| 549 | {2216.3054, 1603.7996, 1006.1819, 1.0},
| |
| 550 | {2218.731, 1619.8046, 1006.1794, 1.0},
| |
| 551 | {2218.9407, 1617.8413, 1006.1821, 1.0},
| |
| 552 | {2218.668, 1615.4681, 1006.1797, 1.0},
| |
| 553 | {2218.6418, 1613.2629, 1006.1797, 1.0},
| |
| 554 | {2252.4272, 1589.8412, 1006.1797, 5.0},
| |
| 555 | {2252.4229, 1596.6169, 1006.1797, 5.0},
| |
| 556 | {2255.1565, 1608.8784, 1006.186, 1.0},
| |
| 557 | {2254.8496, 1610.8605, 1006.1797, 1.0},
| |
| 558 | {2255.2917, 1612.9167, 1006.1797, 1.0},
| |
| 559 | {2255.033, 1614.8892, 1006.1797, 1.0},
| |
| 560 | {2255.1213, 1616.8284, 1006.1797, 1.0},
| |
| 561 | {2255.2161, 1618.8005, 1006.1797, 1.0},
| |
| 562 | {2268.5281, 1606.4894, 1006.1797, 1.0},
| |
| 563 | {2270.4922, 1606.8539, 1006.1797, 1.0},
| |
| 564 | {2272.5693, 1606.4473, 1006.1797, 1.0},
| |
| 565 | {2274.5391, 1607.0122, 1006.1797, 1.0},
| |
| 566 | {2271.8447, 1586.1633, 1006.1797, 1.0},
| |
| 567 | {2261.4844, 1586.1724, 1006.1797, 1.0},
| |
| 568 | {2257.4507, 1589.6555, 1006.1797, 5.0},
| |
| 569 | {2267.8994, 1589.8672, 1006.1797, 5.0},
| |
| 570 | {2262.8486, 1590.026, 1006.1797, 5.0},
| |
| 571 | {2272.6458, 1589.7704, 1006.1797, 5.0},
| |
| 572 | {2272.6533, 1596.5682, 1006.1797, 5.0},
| |
| 573 | {2270.4895, 1596.4606, 1006.1797, 5.0},
| |
| 574 | {2265.4441, 1596.4299, 1006.1797, 5.0},
| |
| 575 | {2260.0308, 1596.7987, 1006.1797, 5.0},
| |
| 576 | {2254.9907, 1596.241, 1006.1797, 5.0},
| |
| 577 | {1956.9524, 988.2533, 992.4688, 2.0},
| |
| 578 | {1961.6155, 993.0375, 992.4688, 2.0},
| |
| 579 | {1963.7998, 998.4406, 992.4745, 2.0},
| |
| 580 | {1936.2885, 987.1995, 992.4745, 2.0},
| |
| 581 | {1944.9768, 986.3937, 992.4688, 2.0},
| |
| 582 | {1940.7397, 990.9521, 992.4609, 2.0},
| |
| 583 | {1940.0966, 1005.8996, 992.4688, 6.0},
| |
| 584 | {1938.8785, 1014.1768, 992.4688, 6.0},
| |
| 585 | {1938.8811, 1021.4434, 992.4688, 6.0},
| |
| 586 | {1966.5975, 1006.6469, 992.4745, 6.0},
| |
| 587 | {1966.5979, 1014.1024, 992.4688, 6.0},
| |
| 588 | {1939.8351, 1029.912, 992.4688, 6.0},
| |
| 589 | {1956.854, 1047.3718, 992.4688, 6.0},
| |
| 590 | {1961.356, 1042.8112, 992.4688, 6.0},
| |
| 591 | {1963.811, 1037.1263, 992.4745, 6.0},
| |
| 592 | {1961.733, 1025.8929, 992.4688, 10.0},
| |
| 593 | {1961.708, 1010.3194, 992.4688, 10.0},
| |
| 594 | {1966.5989, 1029.7954, 992.4745, 6.0},
| |
| 595 | {1961.4139, 1017.8281, 992.4688, 10.0},
| |
| 596 | {1966.5985, 1021.7686, 992.4688, 6.0},
| |
| 597 | {1128.7106, -1.9779, 1000.6797, 1.0},
| |
| 598 | {1125.2388, 1.61, 1000.6797, 1.0},
| |
| 599 | {1125.1249, -5.0489, 1000.6797, 1.0},
| |
| 600 | {1127.4139, 3.0199, 1000.6797, 1.0},
| |
| 601 | {1135.0634, -3.8695, 1000.6797, 1.0},
| |
| 602 | {1135.0861, 0.6107, 1000.6797, 1.0},
| |
| 603 | {1132.8943, -1.7139, 1000.6797, 1.0},
| |
| 604 | {1125.3727, 3.0315, 1000.6797, 1.0},
| |
| 605 | {1119.0272, -1.4916, 1000.6924, 1.0}
| |
| 606 | }, | |
| 607 | #endif | |
| 608 | ||
| 609 | ac_MaxPassengers[] = | |
| 610 | {
| |
| 611 | 0x10331113, 0x11311131, 0x11331313, 0x80133301, 0x1381F110, | |
| 612 | 0x10311103, 0x10001F10, 0x11113311, 0x13113311, 0x31101100, | |
| 613 | 0x30002301, 0x11031311, 0x11111331, 0x10013111, 0x01131100, | |
| 614 | 0x11111110, 0x11100031, 0x11130111, 0x33113311, 0x11111101, | |
| 615 | 0x33101133, 0x10100510, 0x03133111, 0xFF11113F, 0x13330111, | |
| 616 | 0xFF131111, 0x0000FF3F | |
| 617 | }, | |
| 618 | ||
| 619 | ac_vMods[] = | |
| 620 | {
| |
| 621 | 0x033C2700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x021A27FA, 0x00000000, 0x00FFFE00, | |
| 622 | 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 623 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023B2785, 0x00000000, 0x00FFFE00, | |
| 624 | 0x00000007, 0x00000000, 0x00000000, 0x02BC4703, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 625 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 626 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 627 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03BA278A, 0x00000000, 0x00FFFE00, | |
| 628 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 629 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 630 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 631 | 0x028E078A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 632 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 633 | 0x02310744, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 634 | 0x00000007, 0x00000000, 0x00000000, 0x0228073A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 635 | 0x02BD4701, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023A2780, 0x00000000, 0x00FFFE00, | |
| 636 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 637 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 638 | 0x00000007, 0x00000000, 0x00000000, 0x0228077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 639 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 640 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 641 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 642 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 643 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 644 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 645 | 0x027A27CA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 646 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 647 | 0x0282278A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 648 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 649 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 650 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 651 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 652 | 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 653 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 654 | 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 655 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 656 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 657 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 658 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 659 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 660 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 661 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 662 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 663 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 664 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 665 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 666 | 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 667 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 668 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 669 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 670 | 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 671 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 672 | 0x00000007, 0x00000000, 0x00000000, 0x023E07C0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 673 | 0x03703730, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 674 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 675 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 676 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 677 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 678 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 679 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 680 | 0x00000007, 0x00000000, 0x00000000, 0x031D2775, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 681 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02BE4788, 0x00000000, 0x00FFFE00, | |
| 682 | 0x00000007, 0x0003C000, 0x00000000, 0x02010771, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 683 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 684 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 685 | 0x029A0FCE, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 686 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 687 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x03382700, 0x00000000, 0x00FFFE00, | |
| 688 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 689 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 690 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 691 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 692 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 693 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 694 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 695 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 696 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 697 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 698 | 0x00000007, 0x00000000, 0x00000000, 0x023F8795, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 699 | 0x029F078C, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x029627EA, 0x00000000, 0x00FFFE00, | |
| 700 | 0x00000007, 0x0003C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 701 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 702 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 703 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 704 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 705 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x0236C782, 0x00000000, 0x00FFFE00, | |
| 706 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 707 | 0x029E1FCA, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 708 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 709 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 710 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0xFC000437, 0x00000000, 0x021C0000, | |
| 711 | 0x02000700, 0x00000000, 0x00FFFE00, 0x03FE6007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 712 | 0x00001B87, 0x00000001, 0x01E00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 713 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 714 | 0x00000007, 0x00000000, 0x00000000, 0x039E07D2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, | |
| 715 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x023CC700, 0x00000000, 0x00FFFE00, | |
| 716 | 0x00000007, 0x00030000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 717 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 718 | 0x00000007, 0x00000000, 0x00000000, 0x038E07D6, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, | |
| 719 | 0x023D0709, 0x00000000, 0x00FFFE00, 0x00000007, 0x0000C000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 720 | 0x00000007, 0x00000000, 0x00000000, 0x029E1F8A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, | |
| 721 | 0x029C077A, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, 0x02BD076C, 0x00000000, 0x00FFFE00, | |
| 722 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 723 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 724 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 725 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 726 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0xFFFFFE00, 0x00000007, 0x00000000, 0x000001F8, | |
| 727 | 0x02000700, 0x00000000, 0x00FFFFFE, 0x00000007, 0xC0000000, 0x00002007, 0xFE000700, 0x00000003, 0x00FFFE00, | |
| 728 | 0x00000007, 0x00003C00, 0x00000600, 0xCE000700, 0xFF800000, 0x00FFFE01, 0x00000007, 0x3C000000, 0x00000000, | |
| 729 | 0x02000700, 0x000003FC, 0x00FFFE00, 0x00000007, 0x003C0000, 0x00001800, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 730 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 731 | 0x02000700, 0x007FE000, 0x00FFFE00, 0x00000007, 0x03C00000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 732 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000047, 0x0000003E, 0x3C000000, | |
| 733 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 734 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 735 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 736 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 737 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00001C00, 0x00FFFE00, | |
| 738 | 0x0000000F, 0x00000000, 0x0003C000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x000003C0, 0xC0000000, | |
| 739 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 740 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 741 | 0x029607C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 742 | 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 743 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 744 | 0x00000007, 0x00000000, 0x00000000, 0x03FFE7CF, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, | |
| 745 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 746 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 747 | 0x031727F1, 0x00000000, 0x00FFFE00, 0x00000007, 0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, | |
| 748 | 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 749 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 750 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 751 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 752 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 753 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 754 | 0x00000007, 0x00000000, 0x00000000, 0x025627F0, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 755 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 756 | 0x00000007, 0x00000000, 0x00000000, 0x039E07C2, 0x00000000, 0x00FFFE00, 0x00000007, 0x0003C000, 0x00000000, | |
| 757 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 758 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 759 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 760 | 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, | |
| 761 | 0x02000700, 0x00000000, 0x00FFFE00, 0x00000007, 0x00000000, 0x00000000, 0x02000700, 0x00000000, 0x00FFFE00, | |
| 762 | 0x00000007, 0x00000000, 0x00000000 | |
| 763 | }; | |
| 764 | ||
| 765 | static stock const Float:ac_wMinRange[] = | |
| 766 | {
| |
| 767 | 25.0, 25.0, 25.0, 30.0, 25.0, 35.0, | |
| 768 | 25.0, 35.0, 40.0, 40.0, 25.0, 55.0, | |
| 769 | 50.0, 50.0, 50.0, 4.0, 65.0 | |
| 770 | }; | |
| 771 | ||
| 772 | enum acInfo | |
| 773 | {
| |
| 774 | Float:acPosX, | |
| 775 | Float:acPosY, | |
| 776 | Float:acPosZ, | |
| 777 | Float:acDropJpX, | |
| 778 | Float:acDropJpY, | |
| 779 | Float:acDropJpZ, | |
| 780 | Float:acSpawnPosX, | |
| 781 | Float:acSpawnPosY, | |
| 782 | Float:acSpawnPosZ, | |
| 783 | Float:acSetVehHealth, | |
| 784 | Float:acLastPosX, | |
| 785 | Float:acLastPosY, | |
| 786 | Float:acSetPosX, | |
| 787 | Float:acSetPosY, | |
| 788 | Float:acSetPosZ, | |
| 789 | acSpeed, | |
| 790 | acHealth, | |
| 791 | acArmour, | |
| 792 | acMoney, | |
| 793 | acShotWeapon, | |
| 794 | acHoldWeapon, | |
| 795 | acLastWeapon, | |
| 796 | acEnterSeat, | |
| 797 | acEnterVeh, | |
| 798 | acKickVeh, | |
| 799 | acVeh, | |
| 800 | acSeat, | |
| 801 | acNextDialog, | |
| 802 | acDialog, | |
| 803 | acInt, | |
| 804 | acAnim, | |
| 805 | acSpecAct, | |
| 806 | acNextSpecAct, | |
| 807 | acLastSpecAct, | |
| 808 | acLastPickup, | |
| 809 | acReloadTick, | |
| 810 | acShotTick, | |
| 811 | acSpawnTick, | |
| 812 | acTimerTick, | |
| 813 | acSetPosTick, | |
| 814 | acUpdateTick, | |
| 815 | acEnterVehTick, | |
| 816 | acSpawnWeapon1, | |
| 817 | acSpawnWeapon2, | |
| 818 | acSpawnWeapon3, | |
| 819 | acSpawnAmmo1, | |
| 820 | acSpawnAmmo2, | |
| 821 | acSpawnAmmo3, | |
| 822 | acSpawnRes, | |
| 823 | acTimerID, | |
| 824 | acKickTimerID, | |
| 825 | acParachute, | |
| 826 | acIntRet, | |
| 827 | acKicked, | |
| 828 | acIp[16], | |
| 829 | acSet[12], | |
| 830 | acGtc[19], | |
| 831 | acWeapon[13], | |
| 832 | acAmmo[13], | |
| 833 | acSetWeapon[13], | |
| 834 | acGiveAmmo[13], | |
| 835 | acGtcSetWeapon[13], | |
| 836 | acGtcGiveAmmo[13], | |
| 837 | acNOPCount[12], | |
| 838 | acCheatCount[22], | |
| 839 | acCall[sizeof ac_Mtfc], | |
| 840 | acFloodCount[sizeof ac_Mtfc], | |
| 841 | bool:acNOPAllow[sizeof ac_NOPAllow], | |
| 842 | bool:acACAllow[sizeof ac_ACAllow], | |
| 843 | bool:acStuntBonus, | |
| 844 | bool:acModShop, | |
| 845 | bool:acUnFrozen, | |
| 846 | bool:acOnline, | |
| 847 | bool:acDeathRes, | |
| 848 | bool:acDmgRes, | |
| 849 | bool:acVehDmgRes, | |
| 850 | bool:acForceClass, | |
| 851 | bool:acClassRes, | |
| 852 | bool:acDead, | |
| 853 | bool:acTpToZ, | |
| 854 | bool:acIntEnterExits, | |
| 855 | bool:acSpec | |
| 856 | } | |
| 857 | ||
| 858 | enum acVehInfo | |
| 859 | {
| |
| 860 | Float:acVelX, | |
| 861 | Float:acVelY, | |
| 862 | Float:acVelZ, | |
| 863 | Float:acTrVelX, | |
| 864 | Float:acTrVelY, | |
| 865 | Float:acTrVelZ, | |
| 866 | Float:acPosX, | |
| 867 | Float:acPosY, | |
| 868 | Float:acPosZ, | |
| 869 | Float:acSpawnPosX, | |
| 870 | Float:acSpawnPosY, | |
| 871 | Float:acSpawnPosZ, | |
| 872 | Float:acSpawnZAngle, | |
| 873 | Float:acPosDiff, | |
| 874 | Float:acZAngle, | |
| 875 | Float:acHealth, | |
| 876 | acLastSpeed, | |
| 877 | acSpeedDiff, | |
| 878 | acTrSpeedDiff, | |
| 879 | acDriver, | |
| 880 | acPanels, | |
| 881 | acDoors, | |
| 882 | acTires, | |
| 883 | acInt, | |
| 884 | acSpeed, | |
| 885 | acTrSpeed, | |
| 886 | acPaintJob, | |
| 887 | bool:acSpawned | |
| 888 | } | |
| 889 | ||
| 890 | enum acPickInfo | |
| 891 | {
| |
| 892 | Float:acPosX, | |
| 893 | Float:acPosY, | |
| 894 | Float:acPosZ, | |
| 895 | acType, | |
| 896 | acWeapon | |
| 897 | } | |
| 898 | ||
| 899 | static | |
| 900 | Float:ac_ClassPos[AC_MAX_CLASSES][3], | |
| 901 | ac_ClassWeapon[AC_MAX_CLASSES][3], | |
| 902 | ac_ClassAmmo[AC_MAX_CLASSES][3], | |
| 903 | ||
| 904 | #if AC_USE_STATISTICS | |
| 905 | ac_sInfo[6], | |
| 906 | #endif | |
| 907 | ||
| 908 | ACInfo[MAX_PLAYERS][acInfo], | |
| 909 | ACVehInfo[MAX_VEHICLES][acVehInfo], | |
| 910 | ACPickInfo[MAX_PICKUPS][acPickInfo], | |
| 911 | ||
| 912 | bool:ac_IntEnterExits = true, | |
| 913 | bool:ac_StuntBonus = true, | |
| 914 | bool:ac_LagCompMode, | |
| 915 | #if !AC_USE_QUERY | |
| 916 | bool:ac_QueryEnable, | |
| 917 | #endif | |
| 918 | bool:ac_RconEnable, | |
| 919 | bool:ac_PedAnims; | |
| 920 | ||
| 921 | static stock bool:ac_VehFriendlyFire; | |
| 922 | ||
| 923 | ac_fpublic ac_AddStaticVehicle(vehicleid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle) | |
| 924 | {
| |
| 925 | ACVehInfo[vehicleid][acInt] = | |
| 926 | ACVehInfo[vehicleid][acSpeed] = | |
| 927 | ACVehInfo[vehicleid][acTires] = | |
| 928 | ACVehInfo[vehicleid][acDoors] = | |
| 929 | ACVehInfo[vehicleid][acPanels] = | |
| 930 | ACVehInfo[vehicleid][acLastSpeed] = | |
| 931 | ACVehInfo[vehicleid][acSpeedDiff] = 0; | |
| 932 | ACVehInfo[vehicleid][acPaintJob] = 3; | |
| 933 | ACVehInfo[vehicleid][acHealth] = 1000.0; | |
| 934 | ACVehInfo[vehicleid][acSpawned] = true; | |
| 935 | ACVehInfo[vehicleid][acTrSpeed] = -1; | |
| 936 | ACVehInfo[vehicleid][acPosDiff] = | |
| 937 | ACVehInfo[vehicleid][acVelX] = | |
| 938 | ACVehInfo[vehicleid][acVelY] = | |
| 939 | ACVehInfo[vehicleid][acVelZ] = 0.0; | |
| 940 | ACVehInfo[vehicleid][acSpawnPosX] = | |
| 941 | ACVehInfo[vehicleid][acPosX] = spawn_x; | |
| 942 | ACVehInfo[vehicleid][acSpawnPosY] = | |
| 943 | ACVehInfo[vehicleid][acPosY] = spawn_y; | |
| 944 | ACVehInfo[vehicleid][acSpawnPosZ] = | |
| 945 | ACVehInfo[vehicleid][acPosZ] = spawn_z; | |
| 946 | ACVehInfo[vehicleid][acSpawnZAngle] = | |
| 947 | ACVehInfo[vehicleid][acZAngle] = z_angle; | |
| 948 | ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID; | |
| 949 | return 1; | |
| 950 | } | |
| 951 | ||
| 952 | ac_fpublic ac_CreateVehicle(vehicleid, modelid, Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_rotation) | |
| 953 | {
| |
| 954 | ACVehInfo[vehicleid][acInt] = | |
| 955 | ACVehInfo[vehicleid][acSpeed] = | |
| 956 | ACVehInfo[vehicleid][acTires] = | |
| 957 | ACVehInfo[vehicleid][acDoors] = | |
| 958 | ACVehInfo[vehicleid][acPanels] = | |
| 959 | ACVehInfo[vehicleid][acLastSpeed] = | |
| 960 | ACVehInfo[vehicleid][acSpeedDiff] = 0; | |
| 961 | ACVehInfo[vehicleid][acPaintJob] = 3; | |
| 962 | ACVehInfo[vehicleid][acHealth] = 1000.0; | |
| 963 | ACVehInfo[vehicleid][acTrSpeed] = -1; | |
| 964 | ACVehInfo[vehicleid][acPosDiff] = | |
| 965 | ACVehInfo[vehicleid][acVelX] = | |
| 966 | ACVehInfo[vehicleid][acVelY] = | |
| 967 | ACVehInfo[vehicleid][acVelZ] = 0.0; | |
| 968 | ACVehInfo[vehicleid][acSpawnPosX] = | |
| 969 | ACVehInfo[vehicleid][acPosX] = ac_x; | |
| 970 | ACVehInfo[vehicleid][acSpawnPosY] = | |
| 971 | ACVehInfo[vehicleid][acPosY] = ac_y; | |
| 972 | ACVehInfo[vehicleid][acSpawnPosZ] = | |
| 973 | ACVehInfo[vehicleid][acPosZ] = ac_z; | |
| 974 | ACVehInfo[vehicleid][acSpawnZAngle] = | |
| 975 | ACVehInfo[vehicleid][acZAngle] = ac_rotation; | |
| 976 | if(!ac_IsATrainCarriageEx(modelid)) ACVehInfo[vehicleid][acSpawned] = true; | |
| 977 | ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID; | |
| 978 | return 1; | |
| 979 | } | |
| 980 | ||
| 981 | ac_fpublic ac_AddPlayerClass(classid, Float:spawn_x, Float:spawn_y, Float:spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) | |
| 982 | {
| |
| 983 | if(0 <= classid < AC_MAX_CLASSES) | |
| 984 | {
| |
| 985 | #undef AC_MAX_CLASSES | |
| 986 | ac_ClassPos[classid][0] = spawn_x; | |
| 987 | ac_ClassPos[classid][1] = spawn_y; | |
| 988 | ac_ClassPos[classid][2] = spawn_z; | |
| 989 | ac_ClassWeapon[classid][0] = weapon1; | |
| 990 | ac_ClassAmmo[classid][0] = weapon1_ammo; | |
| 991 | ac_ClassWeapon[classid][1] = weapon2; | |
| 992 | ac_ClassAmmo[classid][1] = weapon2_ammo; | |
| 993 | ac_ClassWeapon[classid][2] = weapon3; | |
| 994 | ac_ClassAmmo[classid][2] = weapon3_ammo; | |
| 995 | } | |
| 996 | return 1; | |
| 997 | } | |
| 998 | ||
| 999 | ac_fpublic ac_SetSpawnInfo(playerid, ac_team, ac_skin, Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) | |
| 1000 | {
| |
| 1001 | if(!SetSpawnInfo(playerid, ac_team, ac_skin, ac_x, ac_y, ac_z, ac_rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)) return 0; | |
| 1002 | ACInfo[playerid][acSpawnPosX] = ac_x; | |
| 1003 | ACInfo[playerid][acSpawnPosY] = ac_y; | |
| 1004 | ACInfo[playerid][acSpawnPosZ] = ac_z; | |
| 1005 | ACInfo[playerid][acSpawnWeapon1] = weapon1; | |
| 1006 | ACInfo[playerid][acSpawnAmmo1] = weapon1_ammo; | |
| 1007 | ACInfo[playerid][acSpawnWeapon2] = weapon2; | |
| 1008 | ACInfo[playerid][acSpawnAmmo2] = weapon2_ammo; | |
| 1009 | ACInfo[playerid][acSpawnWeapon3] = weapon3; | |
| 1010 | ACInfo[playerid][acSpawnAmmo3] = weapon3_ammo; | |
| 1011 | return 1; | |
| 1012 | } | |
| 1013 | ||
| 1014 | ac_fpublic ac_CreatePickup(pickupid, modelid, type, Float:ac_X, Float:ac_Y, Float:ac_Z) | |
| 1015 | {
| |
| 1016 | ACPickInfo[pickupid][acType] = 5; | |
| 1017 | #if AC_USE_PICKUP_WEAPONS | |
| 1018 | switch(type) | |
| 1019 | {
| |
| 1020 | case 2, 3, 15, 22: | |
| 1021 | {
| |
| 1022 | switch(modelid) | |
| 1023 | {
| |
| 1024 | case 370: ACPickInfo[pickupid][acType] = 1; | |
| 1025 | case 1240: ACPickInfo[pickupid][acType] = 2; | |
| 1026 | case 1242: ACPickInfo[pickupid][acType] = 3; | |
| 1027 | case 321..326, 331, 333..339, 341..353, 355..369, 371, 372: | |
| 1028 | {
| |
| 1029 | for(new ac_i = 46; ac_i >= 1; --ac_i) | |
| 1030 | {
| |
| 1031 | if(ac_wModel[ac_i] == modelid) | |
| 1032 | {
| |
| 1033 | ACPickInfo[pickupid][acType] = 4; | |
| 1034 | ACPickInfo[pickupid][acWeapon] = ac_i; | |
| 1035 | break; | |
| 1036 | } | |
| 1037 | } | |
| 1038 | } | |
| 1039 | } | |
| 1040 | } | |
| 1041 | } | |
| 1042 | #endif | |
| 1043 | ACPickInfo[pickupid][acPosX] = ac_X; | |
| 1044 | ACPickInfo[pickupid][acPosY] = ac_Y; | |
| 1045 | ACPickInfo[pickupid][acPosZ] = ac_Z; | |
| 1046 | return 1; | |
| 1047 | } | |
| 1048 | ||
| 1049 | #if AC_USE_PICKUP_WEAPONS\ | |
| 1050 | && defined Streamer_SetIntData | |
| 1051 | #if defined STREAMER_ENABLE_TAGS | |
| 1052 | ac_fpublic ac_CreateDynamicPickup(STREAMER_TAG_PICKUP:pickupid, modelid, type) | |
| 1053 | #else | |
| 1054 | ac_fpublic ac_CreateDynamicPickup(pickupid, modelid, type) | |
| 1055 | #endif | |
| 1056 | {
| |
| 1057 | Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 0); | |
| 1058 | switch(type) | |
| 1059 | {
| |
| 1060 | case 2, 3, 15, 22: | |
| 1061 | {
| |
| 1062 | switch(modelid) | |
| 1063 | {
| |
| 1064 | case 370: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 1); | |
| 1065 | case 1240: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 2); | |
| 1066 | case 1242: Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, 3); | |
| 1067 | case 321..326, 331, 333..339, 341..353, 355..369, 371, 372: | |
| 1068 | {
| |
| 1069 | for(new ac_i = 46; ac_i >= 1; --ac_i) | |
| 1070 | {
| |
| 1071 | if(ac_wModel[ac_i] == modelid) | |
| 1072 | {
| |
| 1073 | Streamer_SetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID, ac_i + 100); | |
| 1074 | break; | |
| 1075 | } | |
| 1076 | } | |
| 1077 | } | |
| 1078 | } | |
| 1079 | } | |
| 1080 | } | |
| 1081 | return 1; | |
| 1082 | } | |
| 1083 | #endif | |
| 1084 | ||
| 1085 | #if defined Streamer_UpdateEx | |
| 1086 | stock ac_Streamer_UpdateEx(playerid, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, type = -1, compensatedtime = -1, freezeplayer = 1) | |
| 1087 | {
| |
| 1088 | if(!Streamer_UpdateEx(playerid, x, y, z, worldid, interiorid, type, compensatedtime, freezeplayer)) return 0; | |
| 1089 | if(compensatedtime >= 0) | |
| 1090 | {
| |
| 1091 | ACInfo[playerid][acSet][7] = 4; | |
| 1092 | ACInfo[playerid][acTpToZ] = false; | |
| 1093 | ACInfo[playerid][acNOPCount][10] = 0; | |
| 1094 | ACInfo[playerid][acSetPosX] = x; | |
| 1095 | ACInfo[playerid][acSetPosY] = y; | |
| 1096 | ACInfo[playerid][acSetPosZ] = z; | |
| 1097 | ACInfo[playerid][acSetPosTick] = | |
| 1098 | ACInfo[playerid][acGtc][10] = GetTickCount() + 3850; | |
| 1099 | #if defined FreezeSyncPacket | |
| 1100 | if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false); | |
| 1101 | #endif | |
| 1102 | } | |
| 1103 | return 1; | |
| 1104 | } | |
| 1105 | ||
| 1106 | #if defined _ALS_Streamer_UpdateEx | |
| 1107 | #undef Streamer_UpdateEx | |
| 1108 | #else | |
| 1109 | #define _ALS_Streamer_UpdateEx | |
| 1110 | #endif | |
| 1111 | #define Streamer_UpdateEx ac_Streamer_UpdateEx | |
| 1112 | #endif | |
| 1113 | ||
| 1114 | #if defined GetPlayerVersion | |
| 1115 | stock ac_GetPlayerVersion(playerid, version[], len) | |
| 1116 | {
| |
| 1117 | new ac_ret = GetPlayerVersion(playerid, version, len); | |
| 1118 | for(new ac_i = ac_ret - 1; ac_i >= 0; --ac_i) | |
| 1119 | {
| |
| 1120 | if(version[ac_i] == '%') | |
| 1121 | {
| |
| 1122 | strdel(version, ac_i, ac_i + 1); | |
| 1123 | ac_ret--; | |
| 1124 | } | |
| 1125 | } | |
| 1126 | return ac_ret; | |
| 1127 | } | |
| 1128 | ||
| 1129 | #if defined _ALS_GetPlayerVersion | |
| 1130 | #undef GetPlayerVersion | |
| 1131 | #else | |
| 1132 | #define _ALS_GetPlayerVersion | |
| 1133 | #endif | |
| 1134 | #define GetPlayerVersion ac_GetPlayerVersion | |
| 1135 | #endif | |
| 1136 | ||
| 1137 | stock ac_GetPlayerFacingAngle(playerid, &Float:ang) | |
| 1138 | {
| |
| 1139 | if(!GetPlayerFacingAngle(playerid, ang)) return 0; | |
| 1140 | if(ang != ang) ang = 0.0; | |
| 1141 | ang = ac_AbsoluteAngle(ang); | |
| 1142 | return 1; | |
| 1143 | } | |
| 1144 | ||
| 1145 | #if defined _ALS_GetPlayerFacingAngle | |
| 1146 | #undef GetPlayerFacingAngle | |
| 1147 | #else | |
| 1148 | #define _ALS_GetPlayerFacingAngle | |
| 1149 | #endif | |
| 1150 | #define GetPlayerFacingAngle ac_GetPlayerFacingAngle | |
| 1151 | ||
| 1152 | stock ac_GetVehicleZAngle(vehicleid, &Float:z_angle) | |
| 1153 | {
| |
| 1154 | if(!GetVehicleZAngle(vehicleid, z_angle)) return 0; | |
| 1155 | if(z_angle != z_angle) z_angle = 0.0; | |
| 1156 | z_angle = ac_AbsoluteAngle(z_angle); | |
| 1157 | #undef ac_AbsoluteAngle | |
| 1158 | return 1; | |
| 1159 | } | |
| 1160 | ||
| 1161 | #if defined _ALS_GetVehicleZAngle | |
| 1162 | #undef GetVehicleZAngle | |
| 1163 | #else | |
| 1164 | #define _ALS_GetVehicleZAngle | |
| 1165 | #endif | |
| 1166 | #define GetVehicleZAngle ac_GetVehicleZAngle | |
| 1167 | ||
| 1168 | ac_fpublic ac_DestroyVehicle(vehicleid) | |
| 1169 | {
| |
| 1170 | if(!DestroyVehicle(vehicleid)) return 0; | |
| 1171 | ACVehInfo[vehicleid][acSpawned] = false; | |
| 1172 | new ac_gtc = GetTickCount() + 2650; | |
| 1173 | #if defined foreach | |
| 1174 | foreach(new ac_i : Player) | |
| 1175 | {
| |
| 1176 | if(ACInfo[ac_i][acVeh] == vehicleid) ACInfo[ac_i][acSetPosTick] = ACInfo[ac_i][acGtc][10] = ac_gtc; | |
| 1177 | } | |
| 1178 | #else | |
| 1179 | #if defined GetPlayerPoolSize | |
| 1180 | for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i) | |
| 1181 | #else | |
| 1182 | for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i) | |
| 1183 | #endif | |
| 1184 | {
| |
| 1185 | if(IsPlayerInVehicle(ac_i, vehicleid)) ACInfo[ac_i][acSetPosTick] = ACInfo[ac_i][acGtc][10] = ac_gtc; | |
| 1186 | } | |
| 1187 | #endif | |
| 1188 | return 1; | |
| 1189 | } | |
| 1190 | ||
| 1191 | ac_fpublic ac_DestroyPickup(pickupid) | |
| 1192 | {
| |
| 1193 | if(!DestroyPickup(pickupid)) return 0; | |
| 1194 | ACPickInfo[pickupid][acType] = 0; | |
| 1195 | #if AC_USE_PICKUP_WEAPONS | |
| 1196 | ACPickInfo[pickupid][acWeapon] = 0; | |
| 1197 | #if defined foreach | |
| 1198 | foreach(new ac_i : Player) | |
| 1199 | {
| |
| 1200 | #else | |
| 1201 | #if defined GetPlayerPoolSize | |
| 1202 | for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i) | |
| 1203 | #else | |
| 1204 | for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i) | |
| 1205 | #endif | |
| 1206 | {
| |
| 1207 | if(!IsPlayerConnected(ac_i)) continue; | |
| 1208 | #endif | |
| 1209 | if(ACInfo[ac_i][acLastPickup] == pickupid) ACInfo[ac_i][acLastPickup] = -1; | |
| 1210 | } | |
| 1211 | #endif | |
| 1212 | return 1; | |
| 1213 | } | |
| 1214 | ||
| 1215 | #if defined DestroyDynamicPickup | |
| 1216 | #if defined STREAMER_ENABLE_TAGS | |
| 1217 | ac_fpublic ac_DestroyDynamicPickup(STREAMER_TAG_PICKUP:pickupid) | |
| 1218 | #else | |
| 1219 | ac_fpublic ac_DestroyDynamicPickup(pickupid) | |
| 1220 | #endif | |
| 1221 | {
| |
| 1222 | if(!DestroyDynamicPickup(pickupid)) return 0; | |
| 1223 | #if AC_USE_PICKUP_WEAPONS | |
| 1224 | #if defined foreach | |
| 1225 | foreach(new ac_i : Player) | |
| 1226 | {
| |
| 1227 | #else | |
| 1228 | #if defined GetPlayerPoolSize | |
| 1229 | for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i) | |
| 1230 | #else | |
| 1231 | for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i) | |
| 1232 | #endif | |
| 1233 | {
| |
| 1234 | if(!IsPlayerConnected(ac_i)) continue; | |
| 1235 | #endif | |
| 1236 | if(ACInfo[ac_i][acLastPickup] > MAX_PICKUPS && | |
| 1237 | (ACInfo[ac_i][acLastPickup] - MAX_PICKUPS) == pickupid) ACInfo[ac_i][acLastPickup] = -1; | |
| 1238 | } | |
| 1239 | #endif | |
| 1240 | return 1; | |
| 1241 | } | |
| 1242 | #endif | |
| 1243 | ||
| 1244 | ac_fpublic ac_DisableInteriorEnterExits() | |
| 1245 | {
| |
| 1246 | ac_IntEnterExits = false; | |
| 1247 | return DisableInteriorEnterExits(); | |
| 1248 | } | |
| 1249 | ||
| 1250 | ac_fpublic ac_UsePlayerPedAnims() | |
| 1251 | {
| |
| 1252 | ac_PedAnims = true; | |
| 1253 | return UsePlayerPedAnims(); | |
| 1254 | } | |
| 1255 | ||
| 1256 | #if defined EnableVehicleFriendlyFire | |
| 1257 | ac_fpublic ac_EnableVehicleFriendlyFire() | |
| 1258 | {
| |
| 1259 | ac_VehFriendlyFire = true; | |
| 1260 | return EnableVehicleFriendlyFire(); | |
| 1261 | } | |
| 1262 | #endif | |
| 1263 | ||
| 1264 | ac_fpublic ac_EnableStuntBonusForAll(enable) | |
| 1265 | {
| |
| 1266 | ac_StuntBonus = (enable != 0); | |
| 1267 | #if defined foreach | |
| 1268 | foreach(new ac_i : Player) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus; | |
| 1269 | #else | |
| 1270 | #if defined GetPlayerPoolSize | |
| 1271 | for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i) | |
| 1272 | #else | |
| 1273 | for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i) | |
| 1274 | #endif | |
| 1275 | {
| |
| 1276 | if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acStuntBonus] = ac_StuntBonus; | |
| 1277 | } | |
| 1278 | #endif | |
| 1279 | return EnableStuntBonusForAll(enable); | |
| 1280 | } | |
| 1281 | ||
| 1282 | ac_fpublic ac_EnableStuntBonusForPlayer(playerid, enable) | |
| 1283 | {
| |
| 1284 | if(!EnableStuntBonusForPlayer(playerid, enable)) return 0; | |
| 1285 | ACInfo[playerid][acStuntBonus] = (enable != 0); | |
| 1286 | return 1; | |
| 1287 | } | |
| 1288 | ||
| 1289 | ac_fpublic ac_ShowPlayerDialog(playerid, dialogid) | |
| 1290 | {
| |
| 1291 | ACInfo[playerid][acDialog] = dialogid; | |
| 1292 | return 1; | |
| 1293 | } | |
| 1294 | ||
| 1295 | ac_fpublic ac_fs_ShowPlayerDialog(playerid, dialogid) | |
| 1296 | {
| |
| 1297 | ACInfo[playerid][acNextDialog] = dialogid; | |
| 1298 | return 1; | |
| 1299 | } | |
| 1300 | ||
| 1301 | ac_fpublic ac_TogglePlayerControllable(playerid, toggle) | |
| 1302 | {
| |
| 1303 | if(!TogglePlayerControllable(playerid, toggle)) return 0; | |
| 1304 | ACInfo[playerid][acUnFrozen] = (toggle != 0); | |
| 1305 | #if defined FreezeSyncPacket | |
| 1306 | if(toggle) FreezeSyncPacket(playerid, E_ALL_SYNC, false); | |
| 1307 | else if(ACInfo[playerid][acACAllow][33]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 1308 | #endif | |
| 1309 | return 1; | |
| 1310 | } | |
| 1311 | ||
| 1312 | ac_fpublic ac_TogglePlayerSpectating(playerid, toggle) | |
| 1313 | {
| |
| 1314 | if(!TogglePlayerSpectating(playerid, toggle)) return 0; | |
| 1315 | if(ACInfo[playerid][acSpec] || ACInfo[playerid][acSet][5] != -1) | |
| 1316 | {
| |
| 1317 | if(!toggle) | |
| 1318 | {
| |
| 1319 | if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][6] = 4; | |
| 1320 | else | |
| 1321 | {
| |
| 1322 | ACInfo[playerid][acSet][3] = | |
| 1323 | ACInfo[playerid][acSet][5] = | |
| 1324 | ACInfo[playerid][acSet][7] = | |
| 1325 | ACInfo[playerid][acSet][8] = | |
| 1326 | ACInfo[playerid][acNextSpecAct] = -1; | |
| 1327 | for(new ac_i = 12; ac_i >= 0; --ac_i) | |
| 1328 | {
| |
| 1329 | ACInfo[playerid][acSetWeapon][ac_i] = -1; | |
| 1330 | ACInfo[playerid][acGiveAmmo][ac_i] = -65535; | |
| 1331 | } | |
| 1332 | ACInfo[playerid][acForceClass] = | |
| 1333 | ACInfo[playerid][acUnFrozen] = true; | |
| 1334 | ACInfo[playerid][acSet][6] = 1; | |
| 1335 | #if defined FreezeSyncPacket | |
| 1336 | FreezeSyncPacket(playerid, E_ALL_SYNC, false); | |
| 1337 | #endif | |
| 1338 | } | |
| 1339 | ACInfo[playerid][acSpawnRes]++; | |
| 1340 | ACInfo[playerid][acSpec] = false; | |
| 1341 | ACInfo[playerid][acSpawnTick] = ACInfo[playerid][acNOPCount][9] = 0; | |
| 1342 | ACInfo[playerid][acGtc][12] = GetTickCount() + 2650; | |
| 1343 | } | |
| 1344 | } | |
| 1345 | else if(toggle) | |
| 1346 | {
| |
| 1347 | ACInfo[playerid][acSet][5] = 1; | |
| 1348 | ACInfo[playerid][acNOPCount][8] = 0; | |
| 1349 | ACInfo[playerid][acGtc][11] = GetTickCount() + 2650; | |
| 1350 | } | |
| 1351 | return 1; | |
| 1352 | } | |
| 1353 | ||
| 1354 | ac_fpublic ac_SpawnPlayer(playerid) | |
| 1355 | {
| |
| 1356 | if(!SpawnPlayer(playerid)) return 0; | |
| 1357 | if(ACInfo[playerid][acDead]) ACInfo[playerid][acSet][6] = 5; | |
| 1358 | else | |
| 1359 | {
| |
| 1360 | ACInfo[playerid][acSet][3] = | |
| 1361 | ACInfo[playerid][acSet][7] = | |
| 1362 | ACInfo[playerid][acSet][8] = | |
| 1363 | ACInfo[playerid][acNextSpecAct] = -1; | |
| 1364 | for(new ac_i = 12; ac_i >= 0; --ac_i) | |
| 1365 | {
| |
| 1366 | ACInfo[playerid][acSetWeapon][ac_i] = -1; | |
| 1367 | ACInfo[playerid][acGiveAmmo][ac_i] = -65535; | |
| 1368 | } | |
| 1369 | ACInfo[playerid][acUnFrozen] = true; | |
| 1370 | ACInfo[playerid][acSet][6] = 2; | |
| 1371 | #if defined FreezeSyncPacket | |
| 1372 | FreezeSyncPacket(playerid, E_ALL_SYNC, false); | |
| 1373 | #endif | |
| 1374 | } | |
| 1375 | ACInfo[playerid][acSpawnRes]++; | |
| 1376 | ACInfo[playerid][acSpawnTick] = ACInfo[playerid][acNOPCount][9] = 0; | |
| 1377 | ACInfo[playerid][acGtc][12] = GetTickCount() + 2650; | |
| 1378 | return 1; | |
| 1379 | } | |
| 1380 | ||
| 1381 | ac_fpublic ac_SetPlayerHealth(playerid, Float:ac_health) | |
| 1382 | {
| |
| 1383 | if(!SetPlayerHealth(playerid, ac_health)) return 0; | |
| 1384 | if(ac_health < 0.0) ac_health = 0.0; | |
| 1385 | ACInfo[playerid][acNOPCount][3] = 0; | |
| 1386 | ACInfo[playerid][acSet][1] = floatround(ac_health, floatround_tozero); | |
| 1387 | ACInfo[playerid][acGtc][2] = GetTickCount() + 2650; | |
| 1388 | #if defined FreezeSyncPacket | |
| 1389 | if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false); | |
| 1390 | #endif | |
| 1391 | return 1; | |
| 1392 | } | |
| 1393 | ||
| 1394 | ac_fpublic ac_SetPlayerArmour(playerid, Float:ac_armour) | |
| 1395 | {
| |
| 1396 | if(!SetPlayerArmour(playerid, ac_armour)) return 0; | |
| 1397 | if(ac_armour < 0.0) ac_armour = 0.0; | |
| 1398 | ACInfo[playerid][acNOPCount][5] = 0; | |
| 1399 | ACInfo[playerid][acSet][2] = floatround(ac_armour, floatround_tozero); | |
| 1400 | ACInfo[playerid][acGtc][4] = GetTickCount() + 2650; | |
| 1401 | #if defined FreezeSyncPacket | |
| 1402 | if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false); | |
| 1403 | #endif | |
| 1404 | return 1; | |
| 1405 | } | |
| 1406 | ||
| 1407 | ac_fpublic ac_GivePlayerWeapon(playerid, weaponid, ac_ammo) | |
| 1408 | {
| |
| 1409 | if(ac_IsValidWeapon(weaponid)) | |
| 1410 | {
| |
| 1411 | new ac_s = ac_wSlot[weaponid]; | |
| 1412 | ACInfo[playerid][acNOPCount][0] = ACInfo[playerid][acNOPCount][1] = 0; | |
| 1413 | if(16 <= weaponid <= 18 || 22 <= weaponid <= 43) | |
| 1414 | {
| |
| 1415 | if(3 <= ac_s <= 5 || (ACInfo[playerid][acSetWeapon][ac_s] == -1 | |
| 1416 | ? ACInfo[playerid][acWeapon][ac_s] : ACInfo[playerid][acSetWeapon][ac_s]) == weaponid) | |
| 1417 | {
| |
| 1418 | new ac_tmp; | |
| 1419 | if(ACInfo[playerid][acGiveAmmo][ac_s] == -65535) ac_tmp = ACInfo[playerid][acAmmo][ac_s] + ac_ammo; | |
| 1420 | else ac_tmp = ACInfo[playerid][acGiveAmmo][ac_s] + ac_ammo; | |
| 1421 | if(ac_tmp < -32768) | |
| 1422 | {
| |
| 1423 | ac_ammo -= ac_tmp + 32768; | |
| 1424 | ac_tmp = -32768; | |
| 1425 | } | |
| 1426 | else if(ac_tmp > 32767) | |
| 1427 | {
| |
| 1428 | ac_ammo -= ac_tmp - 32767; | |
| 1429 | ac_tmp = 32767; | |
| 1430 | } | |
| 1431 | ACInfo[playerid][acGiveAmmo][ac_s] = ac_tmp; | |
| 1432 | } | |
| 1433 | else | |
| 1434 | {
| |
| 1435 | if(ac_ammo < -32768) ac_ammo = -32768; | |
| 1436 | else if(ac_ammo > 32767) ac_ammo = 32767; | |
| 1437 | ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo; | |
| 1438 | } | |
| 1439 | ACInfo[playerid][acCheatCount][12] = ACInfo[playerid][acReloadTick] = 0; | |
| 1440 | } | |
| 1441 | else ACInfo[playerid][acGiveAmmo][ac_s] = -65535; | |
| 1442 | ACInfo[playerid][acSetWeapon][ac_s] = weaponid; | |
| 1443 | ACInfo[playerid][acGtcSetWeapon][ac_s] = | |
| 1444 | - | if(ACInfo[playerid][acWeapon][ac_s] > 0 || ACInfo[playerid][acSetWeapon][ac_s] > 0) |
| 1444 | + | |
| 1445 | } | |
| 1446 | return GivePlayerWeapon(playerid, weaponid, ac_ammo); | |
| 1447 | } | |
| 1448 | ||
| 1449 | ac_fpublic ac_SetPlayerAmmo(playerid, weaponid, ac_ammo) | |
| 1450 | {
| |
| 1451 | if(ac_ammo < -32768) ac_ammo = -32768; | |
| 1452 | else if(ac_ammo > 32767) ac_ammo = 32767; | |
| 1453 | if(16 <= weaponid <= 43) | |
| 1454 | {
| |
| 1455 | new ac_s = ac_wSlot[weaponid]; | |
| 1456 | if((ACInfo[playerid][acSetWeapon][ac_s] == -1 | |
| 1457 | ? ACInfo[playerid][acWeapon][ac_s] : ACInfo[playerid][acSetWeapon][ac_s]) == weaponid) | |
| 1458 | {
| |
| 1459 | ACInfo[playerid][acNOPCount][1] = 0; | |
| 1460 | ACInfo[playerid][acGiveAmmo][ac_s] = ac_ammo; | |
| 1461 | ACInfo[playerid][acGtcGiveAmmo][ac_s] = GetTickCount() + 2850; | |
| 1462 | } | |
| 1463 | } | |
| 1464 | return SetPlayerAmmo(playerid, weaponid, ac_ammo); | |
| 1465 | } | |
| 1466 | ||
| 1467 | ac_fpublic ac_ResetPlayerWeapons(playerid) | |
| 1468 | {
| |
| 1469 | if(!ResetPlayerWeapons(playerid)) return 0; | |
| 1470 | for(new ac_i = 12; ac_i >= 0; --ac_i) | |
| 1471 | {
| |
| 1472 | ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acAmmo][ac_i] = 0; | |
| 1473 | ACInfo[playerid][acSetWeapon][ac_i] = -1; | |
| 1474 | ACInfo[playerid][acGiveAmmo][ac_i] = -65535; | |
| 1475 | } | |
| 1476 | ACInfo[playerid][acGtc][6] = GetTickCount() + 2850; | |
| 1477 | return 1; | |
| 1478 | } | |
| 1479 | ||
| 1480 | ac_fpublic ac_GivePlayerMoney(playerid, ac_money) | |
| 1481 | {
| |
| 1482 | if(!GivePlayerMoney(playerid, ac_money)) return 0; | |
| 1483 | ACInfo[playerid][acNOPCount][11] = AC_MAX_MONEY_WARNINGS; | |
| 1484 | ACInfo[playerid][acMoney] += ac_money; | |
| 1485 | #undef AC_MAX_MONEY_WARNINGS | |
| 1486 | return 1; | |
| 1487 | } | |
| 1488 | ||
| 1489 | ac_fpublic ac_ResetPlayerMoney(playerid) | |
| 1490 | {
| |
| 1491 | if(!ResetPlayerMoney(playerid)) return 0; | |
| 1492 | ACInfo[playerid][acNOPCount][11] = 0; | |
| 1493 | ACInfo[playerid][acMoney] = 0; | |
| 1494 | return 1; | |
| 1495 | } | |
| 1496 | ||
| 1497 | ac_fpublic ac_GetPlayerMoney(playerid) return ACInfo[playerid][acMoney]; | |
| 1498 | ||
| 1499 | ac_fpublic ac_SetPlayerSpecialAction(playerid, ac_actionid) | |
| 1500 | - | (ac_actionid == SPECIAL_ACTION_NONE || 24 <= ac_actionid <= 25) && ACInfo[playerid][acVeh] || |
| 1500 | + | |
| 1501 | if(!SetPlayerSpecialAction(playerid, ac_actionid)) return 0; | |
| 1502 | if(ac_actionid == SPECIAL_ACTION_USEJETPACK || 24 <= ac_actionid <= 25 || | |
| 1503 | (ac_actionid == SPECIAL_ACTION_USECELLPHONE || ac_actionid == 68 || SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4) && ACInfo[playerid][acVeh] == 0 || | |
| 1504 | ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USECELLPHONE || | |
| 1505 | (ac_actionid == SPECIAL_ACTION_HANDSUP || SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_DRINK_SPRUNK) && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_ENTER_VEHICLE && ACInfo[playerid][acVeh] == 0 || | |
| 1506 | ac_actionid == SPECIAL_ACTION_NONE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_DUCK && | |
| 1507 | ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_ENTER_VEHICLE && ACInfo[playerid][acSpecAct] != SPECIAL_ACTION_HANDSUP) | |
| 1508 | {
| |
| 1509 | ACInfo[playerid][acNOPCount][6] = 0; | |
| 1510 | if((ac_actionid == 68 || SPECIAL_ACTION_HANDSUP <= ac_actionid <= SPECIAL_ACTION_USECELLPHONE || SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= 25) && | |
| 1511 | SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4 || | |
| 1512 | SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= 25 && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK || | |
| 1513 | (ac_actionid == SPECIAL_ACTION_NONE || 24 <= ac_actionid <= 25) && ACInfo[playerid][acVeh] > 0 || | |
| 1514 | 24 <= ac_actionid <= 25 && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) ACInfo[playerid][acNextSpecAct] = ac_actionid; | |
| 1515 | else | |
| 1516 | {
| |
| 1517 | if(ac_actionid == SPECIAL_ACTION_STOPUSECELLPHONE) ac_actionid = SPECIAL_ACTION_NONE; | |
| 1518 | else if(ac_actionid == SPECIAL_ACTION_USEJETPACK || ac_actionid == SPECIAL_ACTION_HANDSUP || | |
| 1519 | ac_actionid == 68 || SPECIAL_ACTION_DANCE1 <= ac_actionid <= SPECIAL_ACTION_DANCE4 || | |
| 1520 | SPECIAL_ACTION_DRINK_BEER <= ac_actionid <= SPECIAL_ACTION_DRINK_SPRUNK) ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct]; | |
| 1521 | else ACInfo[playerid][acNextSpecAct] = -1; | |
| 1522 | ACInfo[playerid][acSet][3] = ac_actionid; | |
| 1523 | ACInfo[playerid][acGtc][5] = GetTickCount() + 3250; | |
| 1524 | #if defined FreezeSyncPacket | |
| 1525 | if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false); | |
| 1526 | #endif | |
| 1527 | } | |
| 1528 | } | |
| 1529 | return 1; | |
| 1530 | } | |
| 1531 | ||
| 1532 | ac_fpublic ac_SetPlayerInterior(playerid, interiorid) | |
| 1533 | {
| |
| 1534 | if(!SetPlayerInterior(playerid, interiorid)) return 0; | |
| 1535 | ACInfo[playerid][acNOPCount][2] = 0; | |
| 1536 | ACInfo[playerid][acSet][0] = interiorid % 256; | |
| 1537 | ACInfo[playerid][acGtc][0] = GetTickCount() + 3250; | |
| 1538 | return 1; | |
| 1539 | } | |
| 1540 | ||
| 1541 | ac_fpublic ac_SetPlayerPos(playerid, Float:ac_x, Float:ac_y, Float:ac_z) | |
| 1542 | {
| |
| 1543 | if(!SetPlayerPos(playerid, ac_x, ac_y, ac_z)) return 0; | |
| 1544 | ACInfo[playerid][acSet][7] = 1; | |
| 1545 | ACInfo[playerid][acTpToZ] = false; | |
| 1546 | ACInfo[playerid][acNOPCount][10] = 0; | |
| 1547 | ACInfo[playerid][acSetPosX] = ac_x; | |
| 1548 | ACInfo[playerid][acSetPosY] = ac_y; | |
| 1549 | ACInfo[playerid][acSetPosZ] = ac_z; | |
| 1550 | ACInfo[playerid][acSetPosTick] = | |
| 1551 | ACInfo[playerid][acGtc][10] = GetTickCount() + 3850; | |
| 1552 | #if defined FreezeSyncPacket | |
| 1553 | if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false); | |
| 1554 | #endif | |
| 1555 | return 1; | |
| 1556 | } | |
| 1557 | ||
| 1558 | ac_fpublic ac_SetPlayerPosFindZ(playerid, Float:ac_x, Float:ac_y, Float:ac_z) | |
| 1559 | {
| |
| 1560 | if(!SetPlayerPosFindZ(playerid, ac_x, ac_y, ac_z)) return 0; | |
| 1561 | ACInfo[playerid][acSet][7] = 2; | |
| 1562 | ACInfo[playerid][acTpToZ] = true; | |
| 1563 | ACInfo[playerid][acNOPCount][10] = 0; | |
| 1564 | ACInfo[playerid][acSetPosX] = ac_x; | |
| 1565 | ACInfo[playerid][acSetPosY] = ac_y; | |
| 1566 | ACInfo[playerid][acSetPosTick] = | |
| 1567 | ACInfo[playerid][acGtc][10] = GetTickCount() + 3850; | |
| 1568 | #if defined FreezeSyncPacket | |
| 1569 | if(!ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, false); | |
| 1570 | #endif | |
| 1571 | return 1; | |
| 1572 | } | |
| 1573 | ||
| 1574 | ac_fpublic ac_SetPlayerVelocity(playerid, Float:ac_X, Float:ac_Y, Float:ac_Z) | |
| 1575 | {
| |
| 1576 | if(!SetPlayerVelocity(playerid, ac_X, ac_Y, ac_Z)) return 0; | |
| 1577 | ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_X, ac_Y, ac_Z); | |
| 1578 | ACInfo[playerid][acGtc][9] = GetTickCount() + 1650; | |
| 1579 | return 1; | |
| 1580 | } | |
| 1581 | ||
| 1582 | ac_fpublic ac_PutPlayerInVehicle(playerid, vehicleid, ac_seatid) | |
| 1583 | {
| |
| 1584 | if(!PutPlayerInVehicle(playerid, vehicleid, ac_seatid)) return 0; | |
| 1585 | if(!(SPECIAL_ACTION_DANCE1 <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DANCE4) && | |
| 1586 | !(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= SPECIAL_ACTION_DRINK_SPRUNK) && | |
| 1587 | GetPlayerVirtualWorld(playerid) == GetVehicleVirtualWorld(vehicleid)) | |
| 1588 | {
| |
| 1589 | new ac_model = GetVehicleModel(vehicleid); | |
| 1590 | ACInfo[playerid][acNOPCount][7] = 0; | |
| 1591 | ACInfo[playerid][acSet][8] = vehicleid; | |
| 1592 | if(ac_IsABusEx(ac_model) || ac_IsVehicleSeatOccupied(vehicleid, ac_seatid) || | |
| 1593 | ac_seatid > ac_GetMaxPassengers(ac_model)) ACInfo[playerid][acSet][4] = -1; | |
| 1594 | else ACInfo[playerid][acSet][4] = ac_seatid; | |
| 1595 | ACInfo[playerid][acGtc][1] = GetTickCount() + 2650; | |
| 1596 | } | |
| 1597 | return 1; | |
| 1598 | } | |
| 1599 | ||
| 1600 | ac_fpublic ac_RemovePlayerFromVehicle(playerid) | |
| 1601 | {
| |
| 1602 | if(!RemovePlayerFromVehicle(playerid)) return 0; | |
| 1603 | ACInfo[playerid][acSet][9] = 1; | |
| 1604 | ACInfo[playerid][acGtc][7] = GetTickCount() + 4650; | |
| 1605 | return 1; | |
| 1606 | } | |
| 1607 | ||
| 1608 | ac_fpublic ac_SetVehiclePos(vehicleid, Float:ac_x, Float:ac_y, Float:ac_z) | |
| 1609 | {
| |
| 1610 | if(!SetVehiclePos(vehicleid, ac_x, ac_y, ac_z)) return 0; | |
| 1611 | new ac_driver = ACVehInfo[vehicleid][acDriver]; | |
| 1612 | if(ac_driver != INVALID_PLAYER_ID) | |
| 1613 | {
| |
| 1614 | ACInfo[ac_driver][acSet][7] = 3; | |
| 1615 | ACInfo[ac_driver][acTpToZ] = false; | |
| 1616 | ACInfo[ac_driver][acNOPCount][10] = 0; | |
| 1617 | ACInfo[ac_driver][acSetPosX] = ac_x; | |
| 1618 | ACInfo[ac_driver][acSetPosY] = ac_y; | |
| 1619 | ACInfo[ac_driver][acSetPosZ] = ac_z; | |
| 1620 | ACInfo[ac_driver][acSetPosTick] = | |
| 1621 | ACInfo[ac_driver][acGtc][10] = GetTickCount() + 3850; | |
| 1622 | #if defined FreezeSyncPacket | |
| 1623 | if(!ACInfo[ac_driver][acUnFrozen]) FreezeSyncPacket(ac_driver, E_ALL_SYNC, false); | |
| 1624 | #endif | |
| 1625 | } | |
| 1626 | else | |
| 1627 | {
| |
| 1628 | ACVehInfo[vehicleid][acPosX] = ac_x; | |
| 1629 | ACVehInfo[vehicleid][acPosY] = ac_y; | |
| 1630 | ACVehInfo[vehicleid][acPosZ] = ac_z; | |
| 1631 | } | |
| 1632 | return 1; | |
| 1633 | } | |
| 1634 | ||
| 1635 | ac_fpublic ac_SetVehicleVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z) | |
| 1636 | {
| |
| 1637 | if(!SetVehicleVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0; | |
| 1638 | new ac_driver = ACVehInfo[vehicleid][acDriver]; | |
| 1639 | if(ac_driver != INVALID_PLAYER_ID) | |
| 1640 | {
| |
| 1641 | ACVehInfo[vehicleid][acVelX] = ac_X; | |
| 1642 | ACVehInfo[vehicleid][acVelY] = ac_Y; | |
| 1643 | ACVehInfo[vehicleid][acVelZ] = ac_Z; | |
| 1644 | ACVehInfo[vehicleid][acSpeed] = ac_GetSpeed(ac_X, ac_Y, ac_Z); | |
| 1645 | ACInfo[ac_driver][acGtc][8] = GetTickCount() + 1650; | |
| 1646 | } | |
| 1647 | return 1; | |
| 1648 | } | |
| 1649 | ||
| 1650 | ac_fpublic ac_SetVehicleAngularVelocity(vehicleid, Float:ac_X, Float:ac_Y, Float:ac_Z) | |
| 1651 | {
| |
| 1652 | if(!SetVehicleAngularVelocity(vehicleid, ac_X, ac_Y, ac_Z)) return 0; | |
| 1653 | new ac_driver = ACVehInfo[vehicleid][acDriver]; | |
| 1654 | if(ac_driver != INVALID_PLAYER_ID) | |
| 1655 | {
| |
| 1656 | ACVehInfo[vehicleid][acVelX] = ac_X; | |
| 1657 | ACVehInfo[vehicleid][acVelY] = ac_Y; | |
| 1658 | ACVehInfo[vehicleid][acVelZ] = ac_Z; | |
| 1659 | ACVehInfo[vehicleid][acSpeed] = ac_GetSpeed(ac_X, ac_Y, ac_Z); | |
| 1660 | ACInfo[ac_driver][acGtc][8] = GetTickCount() + 1650; | |
| 1661 | } | |
| 1662 | return 1; | |
| 1663 | } | |
| 1664 | ||
| 1665 | ac_fpublic ac_LinkVehicleToInterior(vehicleid, interiorid) | |
| 1666 | {
| |
| 1667 | if(!LinkVehicleToInterior(vehicleid, interiorid)) return 0; | |
| 1668 | ACVehInfo[vehicleid][acInt] = interiorid % 256; | |
| 1669 | return 1; | |
| 1670 | } | |
| 1671 | ||
| 1672 | ac_fpublic ac_ChangeVehiclePaintjob(vehicleid, paintjobid) | |
| 1673 | {
| |
| 1674 | ACVehInfo[vehicleid][acPaintJob] = paintjobid; | |
| 1675 | return ChangeVehiclePaintjob(vehicleid, paintjobid); | |
| 1676 | } | |
| 1677 | ||
| 1678 | ac_fpublic ac_SetVehicleHealth(vehicleid, Float:ac_health) | |
| 1679 | {
| |
| 1680 | if(!SetVehicleHealth(vehicleid, ac_health)) return 0; | |
| 1681 | new ac_driver = ACVehInfo[vehicleid][acDriver]; | |
| 1682 | if(ac_driver != INVALID_PLAYER_ID) | |
| 1683 | {
| |
| 1684 | ACInfo[ac_driver][acNOPCount][4] = 0; | |
| 1685 | ACInfo[ac_driver][acSetVehHealth] = ac_health; | |
| 1686 | ACInfo[ac_driver][acGtc][3] = GetTickCount() + 2650; | |
| 1687 | #if defined FreezeSyncPacket | |
| 1688 | if(!ACInfo[ac_driver][acUnFrozen]) FreezeSyncPacket(ac_driver, E_ALL_SYNC, false); | |
| 1689 | #endif | |
| 1690 | } | |
| 1691 | else ACVehInfo[vehicleid][acHealth] = ac_health; | |
| 1692 | return 1; | |
| 1693 | } | |
| 1694 | ||
| 1695 | ac_fpublic ac_RepairVehicle(vehicleid) | |
| 1696 | {
| |
| 1697 | if(!RepairVehicle(vehicleid)) return 0; | |
| 1698 | new ac_driver = ACVehInfo[vehicleid][acDriver]; | |
| 1699 | if(ac_driver != INVALID_PLAYER_ID) | |
| 1700 | {
| |
| 1701 | ACInfo[ac_driver][acNOPCount][4] = 0; | |
| 1702 | ACInfo[ac_driver][acSetVehHealth] = 1000.0; | |
| 1703 | ACInfo[ac_driver][acGtc][3] = GetTickCount() + 2650; | |
| 1704 | #if defined FreezeSyncPacket | |
| 1705 | if(!ACInfo[ac_driver][acUnFrozen]) FreezeSyncPacket(ac_driver, E_ALL_SYNC, false); | |
| 1706 | #endif | |
| 1707 | } | |
| 1708 | else ACVehInfo[vehicleid][acHealth] = 1000.0; | |
| 1709 | ACVehInfo[vehicleid][acPanels] = | |
| 1710 | ACVehInfo[vehicleid][acDoors] = | |
| 1711 | ACVehInfo[vehicleid][acTires] = 0; | |
| 1712 | return 1; | |
| 1713 | } | |
| 1714 | ||
| 1715 | ac_fpublic ac_UpdateVehicleDamageStatus(vehicleid, ac_panels, ac_doors, ac_lights, ac_tires) | |
| 1716 | {
| |
| 1717 | if(!UpdateVehicleDamageStatus(vehicleid, ac_panels, ac_doors, ac_lights, ac_tires)) return 0; | |
| 1718 | ACVehInfo[vehicleid][acPanels] = ac_panels; | |
| 1719 | ACVehInfo[vehicleid][acDoors] = ac_doors; | |
| 1720 | ACVehInfo[vehicleid][acTires] = ac_tires; | |
| 1721 | return 1; | |
| 1722 | } | |
| 1723 | ||
| 1724 | ac_fpublic ac_SetVehicleToRespawn(vehicleid) | |
| 1725 | {
| |
| 1726 | new ac_driver = ACVehInfo[vehicleid][acDriver]; | |
| 1727 | if(ac_driver != INVALID_PLAYER_ID) | |
| 1728 | {
| |
| 1729 | ACInfo[ac_driver][acGtc][8] = GetTickCount() + 1650; | |
| 1730 | ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID; | |
| 1731 | } | |
| 1732 | ACVehInfo[vehicleid][acPaintJob] = 3; | |
| 1733 | ACVehInfo[vehicleid][acHealth] = 1000.0; | |
| 1734 | ACVehInfo[vehicleid][acSpawned] = true; | |
| 1735 | ACVehInfo[vehicleid][acTrSpeed] = -1; | |
| 1736 | ACVehInfo[vehicleid][acPosDiff] = | |
| 1737 | ACVehInfo[vehicleid][acVelX] = | |
| 1738 | ACVehInfo[vehicleid][acVelY] = | |
| 1739 | ACVehInfo[vehicleid][acVelZ] = 0.0; | |
| 1740 | ACVehInfo[vehicleid][acSpeed] = | |
| 1741 | ACVehInfo[vehicleid][acTires] = | |
| 1742 | ACVehInfo[vehicleid][acDoors] = | |
| 1743 | ACVehInfo[vehicleid][acPanels] = | |
| 1744 | ACVehInfo[vehicleid][acLastSpeed] = | |
| 1745 | ACVehInfo[vehicleid][acSpeedDiff] = 0; | |
| 1746 | ACVehInfo[vehicleid][acPosX] = ACVehInfo[vehicleid][acSpawnPosX]; | |
| 1747 | ACVehInfo[vehicleid][acPosY] = ACVehInfo[vehicleid][acSpawnPosY]; | |
| 1748 | ACVehInfo[vehicleid][acPosZ] = ACVehInfo[vehicleid][acSpawnPosZ]; | |
| 1749 | ACVehInfo[vehicleid][acZAngle] = ACVehInfo[vehicleid][acSpawnZAngle]; | |
| 1750 | return SetVehicleToRespawn(vehicleid); | |
| 1751 | } | |
| 1752 | ||
| 1753 | ac_fpublic ac_EnableAntiCheat(code, enable) | |
| 1754 | {
| |
| 1755 | if(!(0 <= code < sizeof ac_ACAllow)) return 0; | |
| 1756 | if(code == 42) | |
| 1757 | {
| |
| 1758 | if(enable) | |
| 1759 | {
| |
| 1760 | if(!ac_ACAllow[code]) | |
| 1761 | {
| |
| 1762 | #if !AC_USE_QUERY | |
| 1763 | #if defined GetConsoleVarAsBool | |
| 1764 | ac_QueryEnable = (GetConsoleVarAsBool("query") != 0);
| |
| 1765 | #else | |
| 1766 | ac_QueryEnable = (GetServerVarAsBool("query") != 0);
| |
| 1767 | #endif | |
| 1768 | #endif | |
| 1769 | #if defined GetConsoleVarAsBool | |
| 1770 | ac_RconEnable = (GetConsoleVarAsBool("rcon") != 0);
| |
| 1771 | #else | |
| 1772 | ac_RconEnable = (GetServerVarAsBool("rcon") != 0);
| |
| 1773 | #endif | |
| 1774 | } | |
| 1775 | #if !AC_USE_QUERY | |
| 1776 | SendRconCommand("query 0");
| |
| 1777 | #endif | |
| 1778 | SendRconCommand("rcon 0");
| |
| 1779 | } | |
| 1780 | else | |
| 1781 | {
| |
| 1782 | static ac_strtmp[9]; | |
| 1783 | #if !AC_USE_QUERY | |
| 1784 | format(ac_strtmp, sizeof ac_strtmp, "query %b", ac_QueryEnable); | |
| 1785 | SendRconCommand(ac_strtmp); | |
| 1786 | #endif | |
| 1787 | format(ac_strtmp, sizeof ac_strtmp, "rcon %b", ac_RconEnable); | |
| 1788 | SendRconCommand(ac_strtmp); | |
| 1789 | } | |
| 1790 | } | |
| 1791 | ac_ACAllow[code] = (enable != 0); | |
| 1792 | if(enable) | |
| 1793 | {
| |
| 1794 | #if defined foreach | |
| 1795 | foreach(new ac_i : Player) | |
| 1796 | {
| |
| 1797 | #else | |
| 1798 | #if defined GetPlayerPoolSize | |
| 1799 | for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i) | |
| 1800 | #else | |
| 1801 | for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i) | |
| 1802 | #endif | |
| 1803 | {
| |
| 1804 | if(!IsPlayerConnected(ac_i)) continue; | |
| 1805 | #endif | |
| 1806 | ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code]; | |
| 1807 | switch(code) | |
| 1808 | {
| |
| 1809 | case 7: ACInfo[ac_i][acCheatCount][13] = 0; | |
| 1810 | case 9: ACInfo[ac_i][acCheatCount][15] = 0; | |
| 1811 | case 10: ACInfo[ac_i][acCheatCount][18] = ACInfo[ac_i][acCheatCount][14] = 0; | |
| 1812 | #if AC_USE_AMMUNATIONS | |
| 1813 | case 15: ACInfo[ac_i][acCheatCount][20] = 0; | |
| 1814 | #endif | |
| 1815 | case 17: ACInfo[ac_i][acCheatCount][7] = 0; | |
| 1816 | case 19: ACInfo[ac_i][acCheatCount][9] = 0; | |
| 1817 | case 20: ACInfo[ac_i][acCheatCount][10] = 0; | |
| 1818 | #if AC_USE_TUNING_GARAGES | |
| 1819 | case 23: ACInfo[ac_i][acCheatCount][21] = 0; | |
| 1820 | #endif | |
| 1821 | case 26: ACInfo[ac_i][acCheatCount][12] = ACInfo[ac_i][acCheatCount][8] = 0; | |
| 1822 | case 29: ACInfo[ac_i][acCheatCount][11] = ACInfo[ac_i][acCheatCount][6] = 0; | |
| 1823 | case 30: ACInfo[ac_i][acCheatCount][17] = 0; | |
| 1824 | case 34: ACInfo[ac_i][acCheatCount][5] = 0; | |
| 1825 | case 38: ACInfo[ac_i][acCheatCount][0] = 0; | |
| 1826 | case 47: ACInfo[ac_i][acCheatCount][16] = 0; | |
| 1827 | } | |
| 1828 | } | |
| 1829 | } | |
| 1830 | else | |
| 1831 | {
| |
| 1832 | #if defined foreach | |
| 1833 | foreach(new ac_i : Player) ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code]; | |
| 1834 | #else | |
| 1835 | #if defined GetPlayerPoolSize | |
| 1836 | for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i) | |
| 1837 | #else | |
| 1838 | for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i) | |
| 1839 | #endif | |
| 1840 | {
| |
| 1841 | if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acACAllow][code] = ac_ACAllow[code]; | |
| 1842 | } | |
| 1843 | #endif | |
| 1844 | } | |
| 1845 | #if AC_USE_CONFIG_FILES && AUTOSAVE_SETTINGS_IN_CONFIG | |
| 1846 | static ac_strtmp[10]; | |
| 1847 | new ac_string[415], File:ac_cfgFile = fopen(AC_CONFIG_FILE, io_write); | |
| 1848 | if(ac_cfgFile) | |
| 1849 | {
| |
| 1850 | for(new ac_i; ac_i < sizeof ac_ACAllow; ++ac_i) | |
| 1851 | {
| |
| 1852 | format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_ACAllow[ac_i], ac_i); | |
| 1853 | strcat(ac_string, ac_strtmp); | |
| 1854 | } | |
| 1855 | fwrite(ac_cfgFile, ac_string); | |
| 1856 | fclose(ac_cfgFile); | |
| 1857 | } | |
| 1858 | #endif | |
| 1859 | return 1; | |
| 1860 | } | |
| 1861 | ||
| 1862 | ac_fpublic ac_EnableAntiNOP(nopcode, enable) | |
| 1863 | {
| |
| 1864 | if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0; | |
| 1865 | ac_NOPAllow[nopcode] = (enable != 0); | |
| 1866 | #if defined foreach | |
| 1867 | foreach(new ac_i : Player) ACInfo[ac_i][acNOPAllow][nopcode] = ac_NOPAllow[nopcode]; | |
| 1868 | #else | |
| 1869 | #if defined GetPlayerPoolSize | |
| 1870 | for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i) | |
| 1871 | #else | |
| 1872 | for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i) | |
| 1873 | #endif | |
| 1874 | {
| |
| 1875 | if(IsPlayerConnected(ac_i)) ACInfo[ac_i][acNOPAllow][nopcode] = ac_NOPAllow[nopcode]; | |
| 1876 | } | |
| 1877 | #endif | |
| 1878 | #if AC_USE_CONFIG_FILES && AUTOSAVE_SETTINGS_IN_CONFIG | |
| 1879 | static ac_strtmp[10]; | |
| 1880 | new ac_string[87], File:ac_cfgFile = fopen(AC_NOP_CONFIG_FILE, io_write); | |
| 1881 | if(ac_cfgFile) | |
| 1882 | {
| |
| 1883 | for(new ac_i; ac_i < sizeof ac_NOPAllow; ++ac_i) | |
| 1884 | {
| |
| 1885 | format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_NOPAllow[ac_i], ac_i); | |
| 1886 | strcat(ac_string, ac_strtmp); | |
| 1887 | } | |
| 1888 | fwrite(ac_cfgFile, ac_string); | |
| 1889 | fclose(ac_cfgFile); | |
| 1890 | } | |
| 1891 | #endif | |
| 1892 | #undef AUTOSAVE_SETTINGS_IN_CONFIG | |
| 1893 | return 1; | |
| 1894 | } | |
| 1895 | ||
| 1896 | ac_fpublic ac_EnableAntiCheatForPlayer(playerid, code, enable) | |
| 1897 | {
| |
| 1898 | if(!(0 <= code < sizeof ac_ACAllow)) return -1; | |
| 1899 | ACInfo[playerid][acACAllow][code] = (enable != 0); | |
| 1900 | if(enable) | |
| 1901 | {
| |
| 1902 | switch(code) | |
| 1903 | {
| |
| 1904 | case 7: ACInfo[playerid][acCheatCount][13] = 0; | |
| 1905 | case 9: ACInfo[playerid][acCheatCount][15] = 0; | |
| 1906 | case 10: ACInfo[playerid][acCheatCount][18] = ACInfo[playerid][acCheatCount][14] = 0; | |
| 1907 | #if AC_USE_AMMUNATIONS | |
| 1908 | case 15: ACInfo[playerid][acCheatCount][20] = 0; | |
| 1909 | #endif | |
| 1910 | case 17: ACInfo[playerid][acCheatCount][7] = 0; | |
| 1911 | case 19: ACInfo[playerid][acCheatCount][9] = 0; | |
| 1912 | case 20: ACInfo[playerid][acCheatCount][10] = 0; | |
| 1913 | #if AC_USE_TUNING_GARAGES | |
| 1914 | case 23: ACInfo[playerid][acCheatCount][21] = 0; | |
| 1915 | #endif | |
| 1916 | case 26: ACInfo[playerid][acCheatCount][12] = ACInfo[playerid][acCheatCount][8] = 0; | |
| 1917 | case 29: ACInfo[playerid][acCheatCount][11] = ACInfo[playerid][acCheatCount][6] = 0; | |
| 1918 | case 30: ACInfo[playerid][acCheatCount][17] = 0; | |
| 1919 | case 34: ACInfo[playerid][acCheatCount][5] = 0; | |
| 1920 | case 38: ACInfo[playerid][acCheatCount][0] = 0; | |
| 1921 | case 47: ACInfo[playerid][acCheatCount][16] = 0; | |
| 1922 | } | |
| 1923 | } | |
| 1924 | return 1; | |
| 1925 | } | |
| 1926 | ||
| 1927 | ac_fpublic ac_EnableAntiNOPForPlayer(playerid, nopcode, enable) | |
| 1928 | {
| |
| 1929 | if(!(0 <= nopcode < sizeof ac_NOPAllow)) return -1; | |
| 1930 | ACInfo[playerid][acNOPAllow][nopcode] = (enable != 0); | |
| 1931 | return 1; | |
| 1932 | } | |
| 1933 | ||
| 1934 | ac_fpublic ac_IsAntiCheatEnabled(code) | |
| 1935 | {
| |
| 1936 | if(!(0 <= code < sizeof ac_ACAllow)) return 0; | |
| 1937 | return ac_ACAllow[code]; | |
| 1938 | } | |
| 1939 | ||
| 1940 | ac_fpublic ac_IsAntiNOPEnabled(nopcode) | |
| 1941 | {
| |
| 1942 | if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0; | |
| 1943 | return ac_NOPAllow[nopcode]; | |
| 1944 | } | |
| 1945 | ||
| 1946 | ac_fpublic ac_IsAntiCheatEnabledForPlayer(playerid, code) | |
| 1947 | {
| |
| 1948 | if(!(0 <= code < sizeof ac_ACAllow)) return 0; | |
| 1949 | return ACInfo[playerid][acACAllow][code]; | |
| 1950 | } | |
| 1951 | ||
| 1952 | ac_fpublic ac_IsAntiNOPEnabledForPlayer(playerid, nopcode) | |
| 1953 | {
| |
| 1954 | if(!(0 <= nopcode < sizeof ac_NOPAllow)) return 0; | |
| 1955 | return ACInfo[playerid][acNOPAllow][nopcode]; | |
| 1956 | } | |
| 1957 | ||
| 1958 | ac_fpublic ac_AntiCheatGetSpeed(playerid) return ACInfo[playerid][acSpeed]; | |
| 1959 | ||
| 1960 | ac_fpublic ac_AntiCheatGetAnimationIndex(playerid) return ACInfo[playerid][acAnim]; | |
| 1961 | ||
| 1962 | ac_fpublic ac_AntiCheatGetDialog(playerid) return ACInfo[playerid][acDialog]; | |
| 1963 | ||
| 1964 | ac_fpublic ac_AntiCheatGetInterior(playerid) return ACInfo[playerid][acInt]; | |
| 1965 | ||
| 1966 | ac_fpublic ac_AntiCheatGetEnterVehicle(playerid) return ACInfo[playerid][acEnterVeh]; | |
| 1967 | ||
| 1968 | ac_fpublic ac_AntiCheatGetEnterVehicleSeat(playerid) return ACInfo[playerid][acEnterSeat]; | |
| 1969 | ||
| 1970 | ac_fpublic ac_AntiCheatGetVehicleID(playerid) return ACInfo[playerid][acVeh]; | |
| 1971 | ||
| 1972 | ac_fpublic ac_AntiCheatGetVehicleSeat(playerid) return ACInfo[playerid][acSeat]; | |
| 1973 | ||
| 1974 | ac_fpublic ac_AntiCheatGetWeapon(playerid) return ACInfo[playerid][acHoldWeapon]; | |
| 1975 | ||
| 1976 | ac_fpublic ac_AntiCheatGetWeaponInSlot(playerid, slot) return ACInfo[playerid][acWeapon][slot]; | |
| 1977 | ||
| 1978 | ac_fpublic ac_AntiCheatGetAmmoInSlot(playerid, slot) return ACInfo[playerid][acAmmo][slot]; | |
| 1979 | ||
| 1980 | ac_fpublic ac_AntiCheatGetSpecialAction(playerid) return ACInfo[playerid][acSpecAct]; | |
| 1981 | ||
| 1982 | ac_fpublic ac_AntiCheatGetLastSpecialActio(playerid) return ACInfo[playerid][acLastSpecAct]; | |
| 1983 | ||
| 1984 | ac_fpublic ac_AntiCheatGetLastShotWeapon(playerid) return ACInfo[playerid][acShotWeapon]; | |
| 1985 | ||
| 1986 | ac_fpublic ac_AntiCheatGetLastPickup(playerid) return ACInfo[playerid][acLastPickup]; | |
| 1987 | ||
| 1988 | ac_fpublic ac_AntiCheatGetLastUpdateTime(playerid) return ACInfo[playerid][acUpdateTick]; | |
| 1989 | ||
| 1990 | ac_fpublic ac_AntiCheatGetLastReloadTime(playerid) return ACInfo[playerid][acReloadTick]; | |
| 1991 | ||
| 1992 | ac_fpublic ac_AntiCheatGetLastEnteredVehTi(playerid) return ACInfo[playerid][acEnterVehTick]; | |
| 1993 | ||
| 1994 | ac_fpublic ac_AntiCheatGetLastShotTime(playerid) return ACInfo[playerid][acShotTick]; | |
| 1995 | ||
| 1996 | ac_fpublic ac_AntiCheatGetLastSpawnTime(playerid) return ACInfo[playerid][acSpawnTick]; | |
| 1997 | ||
| 1998 | ac_fpublic ac_AntiCheatIntEnterExitsIsEnab(playerid) return ACInfo[playerid][acIntEnterExits]; | |
| 1999 | ||
| 2000 | ac_fpublic ac_AntiCheatStuntBonusIsEnabled(playerid) return ACInfo[playerid][acStuntBonus]; | |
| 2001 | ||
| 2002 | ac_fpublic ac_AntiCheatIsInModShop(playerid) return ACInfo[playerid][acModShop]; | |
| 2003 | ||
| 2004 | ac_fpublic ac_AntiCheatIsInSpectate(playerid) return ACInfo[playerid][acSpec]; | |
| 2005 | ||
| 2006 | ac_fpublic ac_AntiCheatIsFrozen(playerid) return !ACInfo[playerid][acUnFrozen]; | |
| 2007 | ||
| 2008 | ac_fpublic ac_AntiCheatIsDead(playerid) return ACInfo[playerid][acDead]; | |
| 2009 | ||
| 2010 | ac_fpublic ac_AntiCheatIsConnected(playerid) return ACInfo[playerid][acOnline]; | |
| 2011 | ||
| 2012 | ac_fpublic ac_AntiCheatKickWithDesync(playerid, code) | |
| 2013 | {
| |
| 2014 | if(ACInfo[playerid][acKicked] > 0) return -1; | |
| 2015 | new ac_gpp = GetPlayerPing(playerid) + 150; | |
| 2016 | ACInfo[playerid][acKickTimerID] = SetTimerEx("ac_KickTimer", (ac_gpp > AC_MAX_PING ? AC_MAX_PING : ac_gpp), false, "i", playerid);
| |
| 2017 | if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) | |
| 2018 | {
| |
| 2019 | if(code == 4) ACInfo[playerid][acKickVeh] = GetPlayerVehicleID(playerid); | |
| 2020 | ACInfo[playerid][acKicked] = 2; | |
| 2021 | } | |
| 2022 | else ACInfo[playerid][acKicked] = 1; | |
| 2023 | return 1; | |
| 2024 | } | |
| 2025 | ||
| 2026 | ac_fpublic ac_AntiCheatIsKickedWithDesync(playerid) return ACInfo[playerid][acKicked]; | |
| 2027 | ||
| 2028 | ac_fpublic ac_AntiCheatGetVehicleDriver(vehicleid) return ACVehInfo[vehicleid][acDriver]; | |
| 2029 | ||
| 2030 | ac_fpublic ac_AntiCheatGetVehicleInterior(vehicleid) return ACVehInfo[vehicleid][acInt]; | |
| 2031 | ||
| 2032 | ac_fpublic ac_AntiCheatGetVehiclePaintjob(vehicleid) return ACVehInfo[vehicleid][acPaintJob]; | |
| 2033 | ||
| 2034 | ac_fpublic ac_AntiCheatGetVehicleSpeed(vehicleid) return ACVehInfo[vehicleid][acSpeed]; | |
| 2035 | ||
| 2036 | ac_fpublic ac_AntiCheatIsVehicleSpawned(vehicleid) return ACVehInfo[vehicleid][acSpawned]; | |
| 2037 | ||
| 2038 | ac_fpublic ac_AntiCheatGetNextDialog(playerid) return ACInfo[playerid][acNextDialog]; | |
| 2039 | ||
| 2040 | #endif | |
| 2041 | ||
| 2042 | stock acc_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2) | |
| 2043 | {
| |
| 2044 | new ac_vehid = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2); | |
| 2045 | if(ac_vehid != INVALID_VEHICLE_ID) | |
| 2046 | {
| |
| 2047 | #if defined FILTERSCRIPT | |
| 2048 | CallRemoteFunction("ac_AddStaticVehicle", "iffff", ac_vehid, spawn_x, spawn_y, spawn_z, z_angle);
| |
| 2049 | #else | |
| 2050 | ac_AddStaticVehicle(ac_vehid, spawn_x, spawn_y, spawn_z, z_angle); | |
| 2051 | #endif | |
| 2052 | } | |
| 2053 | return ac_vehid; | |
| 2054 | } | |
| 2055 | ||
| 2056 | #if defined _ALS_AddStaticVehicle | |
| 2057 | #undef AddStaticVehicle | |
| 2058 | #else | |
| 2059 | #define _ALS_AddStaticVehicle | |
| 2060 | #endif | |
| 2061 | #define AddStaticVehicle acc_AddStaticVehicle | |
| 2062 | ||
| 2063 | #if defined OnVehicleSirenStateChange | |
| 2064 | stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren = 0) | |
| 2065 | {
| |
| 2066 | new ac_vehid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren); | |
| 2067 | #else | |
| 2068 | stock acc_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay) | |
| 2069 | {
| |
| 2070 | new ac_vehid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay); | |
| 2071 | #endif | |
| 2072 | if(ac_vehid != INVALID_VEHICLE_ID) | |
| 2073 | {
| |
| 2074 | #if defined FILTERSCRIPT | |
| 2075 | CallRemoteFunction("ac_AddStaticVehicle", "iffff", ac_vehid, spawn_x, spawn_y, spawn_z, z_angle);
| |
| 2076 | #else | |
| 2077 | ac_AddStaticVehicle(ac_vehid, spawn_x, spawn_y, spawn_z, z_angle); | |
| 2078 | #endif | |
| 2079 | } | |
| 2080 | return ac_vehid; | |
| 2081 | } | |
| 2082 | ||
| 2083 | #if defined _ALS_AddStaticVehicleEx | |
| 2084 | #undef AddStaticVehicleEx | |
| 2085 | #else | |
| 2086 | #define _ALS_AddStaticVehicleEx | |
| 2087 | #endif | |
| 2088 | #define AddStaticVehicleEx acc_AddStaticVehicleEx | |
| 2089 | ||
| 2090 | #if defined OnVehicleSirenStateChange | |
| 2091 | stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay, addsiren = 0) | |
| 2092 | {
| |
| 2093 | new ac_vehid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay, addsiren); | |
| 2094 | #else | |
| 2095 | stock acc_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay) | |
| 2096 | {
| |
| 2097 | new ac_vehid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay); | |
| 2098 | #endif | |
| 2099 | if(ac_vehid != INVALID_VEHICLE_ID && ac_vehid > 0) | |
| 2100 | {
| |
| 2101 | #if defined FILTERSCRIPT | |
| 2102 | CallRemoteFunction("ac_CreateVehicle", "iiffff", ac_vehid, vehicletype, x, y, z, rotation);
| |
| 2103 | #else | |
| 2104 | ac_CreateVehicle(ac_vehid, vehicletype, x, y, z, rotation); | |
| 2105 | #endif | |
| 2106 | } | |
| 2107 | return ac_vehid; | |
| 2108 | } | |
| 2109 | ||
| 2110 | #if defined _ALS_CreateVehicle | |
| 2111 | #undef CreateVehicle | |
| 2112 | #else | |
| 2113 | #define _ALS_CreateVehicle | |
| 2114 | #endif | |
| 2115 | #define CreateVehicle acc_CreateVehicle | |
| 2116 | ||
| 2117 | 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) | |
| 2118 | {
| |
| 2119 | new ac_class = AddPlayerClass(modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); | |
| 2120 | #if defined FILTERSCRIPT | |
| 2121 | CallRemoteFunction("ac_AddPlayerClass", "ifffiiiiii", ac_class, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
| |
| 2122 | #else | |
| 2123 | ac_AddPlayerClass(ac_class, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); | |
| 2124 | #endif | |
| 2125 | return ac_class; | |
| 2126 | } | |
| 2127 | ||
| 2128 | #if defined _ALS_AddPlayerClass | |
| 2129 | #undef AddPlayerClass | |
| 2130 | #else | |
| 2131 | #define _ALS_AddPlayerClass | |
| 2132 | #endif | |
| 2133 | #define AddPlayerClass acc_AddPlayerClass | |
| 2134 | ||
| 2135 | 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) | |
| 2136 | {
| |
| 2137 | new ac_class = AddPlayerClassEx(teamid, modelid, spawn_x, spawn_y, spawn_z, z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); | |
| 2138 | #if defined FILTERSCRIPT | |
| 2139 | CallRemoteFunction("ac_AddPlayerClass", "ifffiiiiii", ac_class, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
| |
| 2140 | #else | |
| 2141 | ac_AddPlayerClass(ac_class, spawn_x, spawn_y, spawn_z, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); | |
| 2142 | #endif | |
| 2143 | return ac_class; | |
| 2144 | } | |
| 2145 | ||
| 2146 | #if defined _ALS_AddPlayerClassEx | |
| 2147 | #undef AddPlayerClassEx | |
| 2148 | #else | |
| 2149 | #define _ALS_AddPlayerClassEx | |
| 2150 | #endif | |
| 2151 | #define AddPlayerClassEx acc_AddPlayerClassEx | |
| 2152 | ||
| 2153 | stock orig_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) | |
| 2154 | return SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); | |
| 2155 | ||
| 2156 | stock acc_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) | |
| 2157 | {
| |
| 2158 | #if defined FILTERSCRIPT | |
| 2159 | return CallRemoteFunction("ac_SetSpawnInfo", "iiiffffiiiiii", playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
| |
| 2160 | #else | |
| 2161 | return ac_SetSpawnInfo(playerid, team, skin, x, y, z, rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo); | |
| 2162 | #endif | |
| 2163 | } | |
| 2164 | ||
| 2165 | #if defined _ALS_SetSpawnInfo | |
| 2166 | #undef SetSpawnInfo | |
| 2167 | #else | |
| 2168 | #define _ALS_SetSpawnInfo | |
| 2169 | #endif | |
| 2170 | #define SetSpawnInfo acc_SetSpawnInfo | |
| 2171 | ||
| 2172 | stock acc_AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0) | |
| 2173 | {
| |
| 2174 | new ac_pickid = CreatePickup(model, type, X, Y, Z, virtualworld); | |
| 2175 | if(ac_pickid != -1) | |
| 2176 | {
| |
| 2177 | #if defined FILTERSCRIPT | |
| 2178 | return CallRemoteFunction("ac_CreatePickup", "iiifff", ac_pickid, model, type, X, Y, Z);
| |
| 2179 | #else | |
| 2180 | return ac_CreatePickup(ac_pickid, model, type, X, Y, Z); | |
| 2181 | #endif | |
| 2182 | } | |
| 2183 | return 0; | |
| 2184 | } | |
| 2185 | ||
| 2186 | #if defined _ALS_AddStaticPickup | |
| 2187 | #undef AddStaticPickup | |
| 2188 | #else | |
| 2189 | #define _ALS_AddStaticPickup | |
| 2190 | #endif | |
| 2191 | #define AddStaticPickup acc_AddStaticPickup | |
| 2192 | ||
| 2193 | stock acc_CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0) | |
| 2194 | {
| |
| 2195 | new ac_pickid = CreatePickup(model, type, X, Y, Z, virtualworld); | |
| 2196 | if(ac_pickid != -1) | |
| 2197 | {
| |
| 2198 | #if defined FILTERSCRIPT | |
| 2199 | CallRemoteFunction("ac_CreatePickup", "iiifff", ac_pickid, model, type, X, Y, Z);
| |
| 2200 | #else | |
| 2201 | ac_CreatePickup(ac_pickid, model, type, X, Y, Z); | |
| 2202 | #endif | |
| 2203 | } | |
| 2204 | return ac_pickid; | |
| 2205 | } | |
| 2206 | ||
| 2207 | #if defined _ALS_CreatePickup | |
| 2208 | #undef CreatePickup | |
| 2209 | #else | |
| 2210 | #define _ALS_CreatePickup | |
| 2211 | #endif | |
| 2212 | #define CreatePickup acc_CreatePickup | |
| 2213 | ||
| 2214 | #if defined CreateDynamicPickup | |
| 2215 | #if defined STREAMER_ENABLE_TAGS | |
| 2216 | stock STREAMER_TAG_PICKUP:acc_CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_PICKUP_SD, STREAMER_TAG_AREA:areaid = STREAMER_TAG_AREA:-1, priority = 0) | |
| 2217 | {
| |
| 2218 | new STREAMER_TAG_PICKUP:ac_pickid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority); | |
| 2219 | #else | |
| 2220 | stock acc_CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_PICKUP_SD, areaid = -1, priority = 0) | |
| 2221 | {
| |
| 2222 | new ac_pickid = CreateDynamicPickup(modelid, type, x, y, z, worldid, interiorid, playerid, streamdistance, areaid, priority); | |
| 2223 | #endif | |
| 2224 | if(_:ac_pickid > 0) | |
| 2225 | {
| |
| 2226 | #if defined FILTERSCRIPT | |
| 2227 | CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickid, modelid, type);
| |
| 2228 | #else | |
| 2229 | #if AC_USE_PICKUP_WEAPONS\ | |
| 2230 | && defined Streamer_SetIntData | |
| 2231 | ac_CreateDynamicPickup(ac_pickid, modelid, type); | |
| 2232 | #endif | |
| 2233 | #endif | |
| 2234 | } | |
| 2235 | return ac_pickid; | |
| 2236 | } | |
| 2237 | ||
| 2238 | #if defined _ALS_CreateDynamicPickup | |
| 2239 | #undef CreateDynamicPickup | |
| 2240 | #else | |
| 2241 | #define _ALS_CreateDynamicPickup | |
| 2242 | #endif | |
| 2243 | #define CreateDynamicPickup acc_CreateDynamicPickup | |
| 2244 | #endif | |
| 2245 | ||
| 2246 | #if defined CreateDynamicPickupEx | |
| 2247 | #if defined STREAMER_ENABLE_TAGS | |
| 2248 | stock STREAMER_TAG_PICKUP:acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = STREAMER_PICKUP_SD, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const STREAMER_TAG_AREA:areas[] = { STREAMER_TAG_AREA:-1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
| |
| 2249 | {
| |
| 2250 | new STREAMER_TAG_PICKUP:ac_pickid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas); | |
| 2251 | #else | |
| 2252 | stock acc_CreateDynamicPickupEx(modelid, type, Float:x, Float:y, Float:z, Float:streamdistance = STREAMER_PICKUP_SD, const worlds[] = { -1 }, const interiors[] = { -1 }, const players[] = { -1 }, const areas[] = { -1 }, priority = 0, maxworlds = sizeof worlds, maxinteriors = sizeof interiors, maxplayers = sizeof players, maxareas = sizeof areas)
| |
| 2253 | {
| |
| 2254 | new ac_pickid = CreateDynamicPickupEx(modelid, type, x, y, z, streamdistance, worlds, interiors, players, areas, priority, maxworlds, maxinteriors, maxplayers, maxareas); | |
| 2255 | #endif | |
| 2256 | if(_:ac_pickid > 0) | |
| 2257 | {
| |
| 2258 | #if defined FILTERSCRIPT | |
| 2259 | CallRemoteFunction("ac_CreateDynamicPickup", "iii", ac_pickid, modelid, type);
| |
| 2260 | #else | |
| 2261 | #if AC_USE_PICKUP_WEAPONS\ | |
| 2262 | && defined Streamer_SetIntData | |
| 2263 | ac_CreateDynamicPickup(ac_pickid, modelid, type); | |
| 2264 | #endif | |
| 2265 | #endif | |
| 2266 | } | |
| 2267 | return ac_pickid; | |
| 2268 | } | |
| 2269 | ||
| 2270 | #if defined _ALS_CreateDynamicPickupEx | |
| 2271 | #undef CreateDynamicPickupEx | |
| 2272 | #else | |
| 2273 | #define _ALS_CreateDynamicPickupEx | |
| 2274 | #endif | |
| 2275 | #define CreateDynamicPickupEx acc_CreateDynamicPickupEx | |
| 2276 | #endif | |
| 2277 | ||
| 2278 | stock acc_DestroyVehicle(vehicleid) | |
| 2279 | {
| |
| 2280 | #if defined FILTERSCRIPT | |
| 2281 | return CallRemoteFunction("ac_DestroyVehicle", "i", vehicleid);
| |
| 2282 | #else | |
| 2283 | return ac_DestroyVehicle(vehicleid); | |
| 2284 | #endif | |
| 2285 | } | |
| 2286 | ||
| 2287 | #if defined _ALS_DestroyVehicle | |
| 2288 | #undef DestroyVehicle | |
| 2289 | #else | |
| 2290 | #define _ALS_DestroyVehicle | |
| 2291 | #endif | |
| 2292 | #define DestroyVehicle acc_DestroyVehicle | |
| 2293 | ||
| 2294 | stock acc_DestroyPickup(pickup) | |
| 2295 | {
| |
| 2296 | #if defined FILTERSCRIPT | |
| 2297 | return CallRemoteFunction("ac_DestroyPickup", "i", pickup);
| |
| 2298 | #else | |
| 2299 | return ac_DestroyPickup(pickup); | |
| 2300 | #endif | |
| 2301 | } | |
| 2302 | ||
| 2303 | #if defined _ALS_DestroyPickup | |
| 2304 | #undef DestroyPickup | |
| 2305 | #else | |
| 2306 | #define _ALS_DestroyPickup | |
| 2307 | #endif | |
| 2308 | #define DestroyPickup acc_DestroyPickup | |
| 2309 | ||
| 2310 | #if defined DestroyDynamicPickup | |
| 2311 | #if defined STREAMER_ENABLE_TAGS | |
| 2312 | stock acc_DestroyDynamicPickup(STREAMER_TAG_PICKUP:pickupid) | |
| 2313 | #else | |
| 2314 | stock acc_DestroyDynamicPickup(pickupid) | |
| 2315 | #endif | |
| 2316 | {
| |
| 2317 | #if defined FILTERSCRIPT | |
| 2318 | return CallRemoteFunction("ac_DestroyDynamicPickup", "i", pickupid);
| |
| 2319 | #else | |
| 2320 | return ac_DestroyDynamicPickup(pickupid); | |
| 2321 | #endif | |
| 2322 | } | |
| 2323 | ||
| 2324 | #if defined _ALS_DestroyDynamicPickup | |
| 2325 | #undef DestroyDynamicPickup | |
| 2326 | #else | |
| 2327 | #define _ALS_DestroyDynamicPickup | |
| 2328 | #endif | |
| 2329 | #define DestroyDynamicPickup acc_DestroyDynamicPickup | |
| 2330 | #endif | |
| 2331 | ||
| 2332 | stock acc_DisableInteriorEnterExits() | |
| 2333 | {
| |
| 2334 | #if defined FILTERSCRIPT | |
| 2335 | return CallRemoteFunction("ac_DisableInteriorEnterExits", "");
| |
| 2336 | #else | |
| 2337 | return ac_DisableInteriorEnterExits(); | |
| 2338 | #endif | |
| 2339 | } | |
| 2340 | ||
| 2341 | #if defined _ALS_DisableInteriorEnterExits | |
| 2342 | #undef DisableInteriorEnterExits | |
| 2343 | #else | |
| 2344 | #define _ALS_DisableInteriorEnterExits | |
| 2345 | #endif | |
| 2346 | #define DisableInteriorEnterExits acc_DisableInteriorEnterExits | |
| 2347 | ||
| 2348 | stock acc_UsePlayerPedAnims() | |
| 2349 | {
| |
| 2350 | #if defined FILTERSCRIPT | |
| 2351 | return CallRemoteFunction("ac_UsePlayerPedAnims", "");
| |
| 2352 | #else | |
| 2353 | return ac_UsePlayerPedAnims(); | |
| 2354 | #endif | |
| 2355 | } | |
| 2356 | ||
| 2357 | #if defined _ALS_UsePlayerPedAnims | |
| 2358 | #undef UsePlayerPedAnims | |
| 2359 | #else | |
| 2360 | #define _ALS_UsePlayerPedAnims | |
| 2361 | #endif | |
| 2362 | #define UsePlayerPedAnims acc_UsePlayerPedAnims | |
| 2363 | ||
| 2364 | #if defined EnableVehicleFriendlyFire | |
| 2365 | stock acc_EnableVehicleFriendlyFire() | |
| 2366 | {
| |
| 2367 | #if defined FILTERSCRIPT | |
| 2368 | return CallRemoteFunction("ac_EnableVehicleFriendlyFire", "");
| |
| 2369 | #else | |
| 2370 | return ac_EnableVehicleFriendlyFire(); | |
| 2371 | #endif | |
| 2372 | } | |
| 2373 | ||
| 2374 | #if defined _ALS_EnableVehicleFriendlyFire | |
| 2375 | #undef EnableVehicleFriendlyFire | |
| 2376 | #else | |
| 2377 | #define _ALS_EnableVehicleFriendlyFire | |
| 2378 | #endif | |
| 2379 | #define EnableVehicleFriendlyFire acc_EnableVehicleFriendlyFire | |
| 2380 | #endif | |
| 2381 | ||
| 2382 | stock acc_EnableStuntBonusForAll(enable) | |
| 2383 | {
| |
| 2384 | #if defined FILTERSCRIPT | |
| 2385 | return CallRemoteFunction("ac_EnableStuntBonusForAll", "i", enable);
| |
| 2386 | #else | |
| 2387 | return ac_EnableStuntBonusForAll(enable); | |
| 2388 | #endif | |
| 2389 | } | |
| 2390 | ||
| 2391 | #if defined _ALS_EnableStuntBonusForAll | |
| 2392 | #undef EnableStuntBonusForAll | |
| 2393 | #else | |
| 2394 | #define _ALS_EnableStuntBonusForAll | |
| 2395 | #endif | |
| 2396 | #define EnableStuntBonusForAll acc_EnableStuntBonusForAll | |
| 2397 | ||
| 2398 | stock acc_EnableStuntBonusForPlayer(playerid, enable) | |
| 2399 | {
| |
| 2400 | #if defined FILTERSCRIPT | |
| 2401 | return CallRemoteFunction("ac_EnableStuntBonusForPlayer", "ii", playerid, enable);
| |
| 2402 | #else | |
| 2403 | return ac_EnableStuntBonusForPlayer(playerid, enable); | |
| 2404 | #endif | |
| 2405 | } | |
| 2406 | ||
| 2407 | #if defined _ALS_EnableStuntBonusForPlayer | |
| 2408 | #undef EnableStuntBonusForPlayer | |
| 2409 | #else | |
| 2410 | #define _ALS_EnableStuntBonusForPlayer | |
| 2411 | #endif | |
| 2412 | #define EnableStuntBonusForPlayer acc_EnableStuntBonusForPlayer | |
| 2413 | ||
| 2414 | stock orig_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]) return ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2); | |
| 2415 | ||
| 2416 | stock acc_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]) | |
| 2417 | {
| |
| 2418 | if(ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2)) | |
| 2419 | {
| |
| 2420 | #if defined FILTERSCRIPT | |
| 2421 | return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
| |
| 2422 | #else | |
| 2423 | return ac_ShowPlayerDialog(playerid, dialogid); | |
| 2424 | #endif | |
| 2425 | } | |
| 2426 | return 0; | |
| 2427 | } | |
| 2428 | ||
| 2429 | #if defined _ALS_ShowPlayerDialog | |
| 2430 | #undef ShowPlayerDialog | |
| 2431 | #else | |
| 2432 | #define _ALS_ShowPlayerDialog | |
| 2433 | #endif | |
| 2434 | #define ShowPlayerDialog acc_ShowPlayerDialog | |
| 2435 | ||
| 2436 | stock orig_TogglePlayerControllable(playerid, toggle) return TogglePlayerControllable(playerid, toggle); | |
| 2437 | ||
| 2438 | stock acc_TogglePlayerControllable(playerid, toggle) | |
| 2439 | {
| |
| 2440 | #if defined FILTERSCRIPT | |
| 2441 | return CallRemoteFunction("ac_TogglePlayerControllable", "ii", playerid, toggle);
| |
| 2442 | #else | |
| 2443 | return ac_TogglePlayerControllable(playerid, toggle); | |
| 2444 | #endif | |
| 2445 | } | |
| 2446 | ||
| 2447 | #if defined _ALS_TogglePlayerControllable | |
| 2448 | #undef TogglePlayerControllable | |
| 2449 | #else | |
| 2450 | #define _ALS_TogglePlayerControllable | |
| 2451 | #endif | |
| 2452 | #define TogglePlayerControllable acc_TogglePlayerControllable | |
| 2453 | ||
| 2454 | stock orig_TogglePlayerSpectating(playerid, toggle) return TogglePlayerSpectating(playerid, toggle); | |
| 2455 | ||
| 2456 | stock acc_TogglePlayerSpectating(playerid, toggle) | |
| 2457 | {
| |
| 2458 | #if defined FILTERSCRIPT | |
| 2459 | return CallRemoteFunction("ac_TogglePlayerSpectating", "ii", playerid, toggle);
| |
| 2460 | #else | |
| 2461 | return ac_TogglePlayerSpectating(playerid, toggle); | |
| 2462 | #endif | |
| 2463 | } | |
| 2464 | ||
| 2465 | #if defined _ALS_TogglePlayerSpectating | |
| 2466 | #undef TogglePlayerSpectating | |
| 2467 | #else | |
| 2468 | #define _ALS_TogglePlayerSpectating | |
| 2469 | #endif | |
| 2470 | #define TogglePlayerSpectating acc_TogglePlayerSpectating | |
| 2471 | ||
| 2472 | stock orig_SpawnPlayer(playerid) return SpawnPlayer(playerid); | |
| 2473 | ||
| 2474 | stock acc_SpawnPlayer(playerid) | |
| 2475 | {
| |
| 2476 | #if defined FILTERSCRIPT | |
| 2477 | return CallRemoteFunction("ac_SpawnPlayer", "i", playerid);
| |
| 2478 | #else | |
| 2479 | return ac_SpawnPlayer(playerid); | |
| 2480 | #endif | |
| 2481 | } | |
| 2482 | ||
| 2483 | #if defined _ALS_SpawnPlayer | |
| 2484 | #undef SpawnPlayer | |
| 2485 | #else | |
| 2486 | #define _ALS_SpawnPlayer | |
| 2487 | #endif | |
| 2488 | #define SpawnPlayer acc_SpawnPlayer | |
| 2489 | ||
| 2490 | stock orig_SetPlayerHealth(playerid, Float:health) return SetPlayerHealth(playerid, health); | |
| 2491 | ||
| 2492 | stock acc_SetPlayerHealth(playerid, Float:health) | |
| 2493 | {
| |
| 2494 | #if defined FILTERSCRIPT | |
| 2495 | return CallRemoteFunction("ac_SetPlayerHealth", "if", playerid, health);
| |
| 2496 | #else | |
| 2497 | return ac_SetPlayerHealth(playerid, health); | |
| 2498 | #endif | |
| 2499 | } | |
| 2500 | ||
| 2501 | #if defined _ALS_SetPlayerHealth | |
| 2502 | #undef SetPlayerHealth | |
| 2503 | #else | |
| 2504 | #define _ALS_SetPlayerHealth | |
| 2505 | #endif | |
| 2506 | #define SetPlayerHealth acc_SetPlayerHealth | |
| 2507 | ||
| 2508 | stock orig_SetPlayerArmour(playerid, Float:armour) return SetPlayerArmour(playerid, armour); | |
| 2509 | ||
| 2510 | stock acc_SetPlayerArmour(playerid, Float:armour) | |
| 2511 | {
| |
| 2512 | #if defined FILTERSCRIPT | |
| 2513 | return CallRemoteFunction("ac_SetPlayerArmour", "if", playerid, armour);
| |
| 2514 | #else | |
| 2515 | return ac_SetPlayerArmour(playerid, armour); | |
| 2516 | #endif | |
| 2517 | } | |
| 2518 | ||
| 2519 | #if defined _ALS_SetPlayerArmour | |
| 2520 | #undef SetPlayerArmour | |
| 2521 | #else | |
| 2522 | #define _ALS_SetPlayerArmour | |
| 2523 | #endif | |
| 2524 | #define SetPlayerArmour acc_SetPlayerArmour | |
| 2525 | ||
| 2526 | stock orig_GivePlayerWeapon(playerid, weaponid, ammo) return GivePlayerWeapon(playerid, weaponid, ammo); | |
| 2527 | ||
| 2528 | stock acc_GivePlayerWeapon(playerid, weaponid, ammo) | |
| 2529 | {
| |
| 2530 | if(!(0 <= playerid < MAX_PLAYERS)) return 0; | |
| 2531 | #if defined FILTERSCRIPT | |
| 2532 | return CallRemoteFunction("ac_GivePlayerWeapon", "iid", playerid, weaponid, ammo);
| |
| 2533 | #else | |
| 2534 | return ac_GivePlayerWeapon(playerid, weaponid, ammo); | |
| 2535 | #endif | |
| 2536 | } | |
| 2537 | ||
| 2538 | #if defined _ALS_GivePlayerWeapon | |
| 2539 | #undef GivePlayerWeapon | |
| 2540 | #else | |
| 2541 | #define _ALS_GivePlayerWeapon | |
| 2542 | #endif | |
| 2543 | #define GivePlayerWeapon acc_GivePlayerWeapon | |
| 2544 | ||
| 2545 | stock orig_SetPlayerAmmo(playerid, weaponslot, ammo) return SetPlayerAmmo(playerid, weaponslot, ammo); | |
| 2546 | ||
| 2547 | stock acc_SetPlayerAmmo(playerid, weaponslot, ammo) | |
| 2548 | {
| |
| 2549 | if(!(0 <= playerid < MAX_PLAYERS)) return 0; | |
| 2550 | #if defined FILTERSCRIPT | |
| 2551 | return CallRemoteFunction("ac_SetPlayerAmmo", "iid", playerid, weaponslot, ammo);
| |
| 2552 | #else | |
| 2553 | return ac_SetPlayerAmmo(playerid, weaponslot, ammo); | |
| 2554 | #endif | |
| 2555 | } | |
| 2556 | ||
| 2557 | #if defined _ALS_SetPlayerAmmo | |
| 2558 | #undef SetPlayerAmmo | |
| 2559 | #else | |
| 2560 | #define _ALS_SetPlayerAmmo | |
| 2561 | #endif | |
| 2562 | #define SetPlayerAmmo acc_SetPlayerAmmo | |
| 2563 | ||
| 2564 | stock orig_ResetPlayerWeapons(playerid) return ResetPlayerWeapons(playerid); | |
| 2565 | ||
| 2566 | stock acc_ResetPlayerWeapons(playerid) | |
| 2567 | {
| |
| 2568 | #if defined FILTERSCRIPT | |
| 2569 | return CallRemoteFunction("ac_ResetPlayerWeapons", "i", playerid);
| |
| 2570 | #else | |
| 2571 | return ac_ResetPlayerWeapons(playerid); | |
| 2572 | #endif | |
| 2573 | } | |
| 2574 | ||
| 2575 | #if defined _ALS_ResetPlayerWeapons | |
| 2576 | #undef ResetPlayerWeapons | |
| 2577 | #else | |
| 2578 | #define _ALS_ResetPlayerWeapons | |
| 2579 | #endif | |
| 2580 | #define ResetPlayerWeapons acc_ResetPlayerWeapons | |
| 2581 | ||
| 2582 | stock orig_GivePlayerMoney(playerid, money) return GivePlayerMoney(playerid, money); | |
| 2583 | ||
| 2584 | stock acc_GivePlayerMoney(playerid, money) | |
| 2585 | {
| |
| 2586 | #if defined FILTERSCRIPT | |
| 2587 | return CallRemoteFunction("ac_GivePlayerMoney", "id", playerid, money);
| |
| 2588 | #else | |
| 2589 | return ac_GivePlayerMoney(playerid, money); | |
| 2590 | #endif | |
| 2591 | } | |
| 2592 | ||
| 2593 | #if defined _ALS_GivePlayerMoney | |
| 2594 | #undef GivePlayerMoney | |
| 2595 | #else | |
| 2596 | #define _ALS_GivePlayerMoney | |
| 2597 | #endif | |
| 2598 | #define GivePlayerMoney acc_GivePlayerMoney | |
| 2599 | ||
| 2600 | stock orig_ResetPlayerMoney(playerid) return ResetPlayerMoney(playerid); | |
| 2601 | ||
| 2602 | stock acc_ResetPlayerMoney(playerid) | |
| 2603 | {
| |
| 2604 | #if defined FILTERSCRIPT | |
| 2605 | return CallRemoteFunction("ac_ResetPlayerMoney", "i", playerid);
| |
| 2606 | #else | |
| 2607 | return ac_ResetPlayerMoney(playerid); | |
| 2608 | #endif | |
| 2609 | } | |
| 2610 | ||
| 2611 | #if defined _ALS_ResetPlayerMoney | |
| 2612 | #undef ResetPlayerMoney | |
| 2613 | #else | |
| 2614 | #define _ALS_ResetPlayerMoney | |
| 2615 | #endif | |
| 2616 | #define ResetPlayerMoney acc_ResetPlayerMoney | |
| 2617 | ||
| 2618 | stock orig_GetPlayerMoney(playerid) return GetPlayerMoney(playerid); | |
| 2619 | ||
| 2620 | stock acc_GetPlayerMoney(playerid) | |
| 2621 | {
| |
| 2622 | if(!IsPlayerConnected(playerid)) return 0; | |
| 2623 | #if defined FILTERSCRIPT | |
| 2624 | return CallRemoteFunction("ac_GetPlayerMoney", "i", playerid);
| |
| 2625 | #else | |
| 2626 | return ac_GetPlayerMoney(playerid); | |
| 2627 | #endif | |
| 2628 | } | |
| 2629 | ||
| 2630 | #if defined _ALS_GetPlayerMoney | |
| 2631 | #undef GetPlayerMoney | |
| 2632 | #else | |
| 2633 | #define _ALS_GetPlayerMoney | |
| 2634 | #endif | |
| 2635 | #define GetPlayerMoney acc_GetPlayerMoney | |
| 2636 | ||
| 2637 | stock orig_SetPlayerSpecialAction(playerid, actionid) return SetPlayerSpecialAction(playerid, actionid); | |
| 2638 | ||
| 2639 | stock acc_SetPlayerSpecialAction(playerid, actionid) | |
| 2640 | {
| |
| 2641 | #if defined FILTERSCRIPT | |
| 2642 | return CallRemoteFunction("ac_SetPlayerSpecialAction", "ii", playerid, actionid);
| |
| 2643 | #else | |
| 2644 | return ac_SetPlayerSpecialAction(playerid, actionid); | |
| 2645 | #endif | |
| 2646 | } | |
| 2647 | ||
| 2648 | #if defined _ALS_SetPlayerSpecialAction | |
| 2649 | #undef SetPlayerSpecialAction | |
| 2650 | #else | |
| 2651 | #define _ALS_SetPlayerSpecialAction | |
| 2652 | #endif | |
| 2653 | #define SetPlayerSpecialAction acc_SetPlayerSpecialAction | |
| 2654 | ||
| 2655 | stock orig_SetPlayerInterior(playerid, interiorid) return SetPlayerInterior(playerid, interiorid); | |
| 2656 | ||
| 2657 | stock acc_SetPlayerInterior(playerid, interiorid) | |
| 2658 | {
| |
| 2659 | #if defined FILTERSCRIPT | |
| 2660 | return CallRemoteFunction("ac_SetPlayerInterior", "ii", playerid, interiorid);
| |
| 2661 | #else | |
| 2662 | return ac_SetPlayerInterior(playerid, interiorid); | |
| 2663 | #endif | |
| 2664 | } | |
| 2665 | ||
| 2666 | #if defined _ALS_SetPlayerInterior | |
| 2667 | #undef SetPlayerInterior | |
| 2668 | #else | |
| 2669 | #define _ALS_SetPlayerInterior | |
| 2670 | #endif | |
| 2671 | #define SetPlayerInterior acc_SetPlayerInterior | |
| 2672 | ||
| 2673 | stock orig_SetPlayerPos(playerid, Float:x, Float:y, Float:z) return SetPlayerPos(playerid, x, y, z); | |
| 2674 | ||
| 2675 | stock acc_SetPlayerPos(playerid, Float:x, Float:y, Float:z) | |
| 2676 | {
| |
| 2677 | #if defined FILTERSCRIPT | |
| 2678 | return CallRemoteFunction("ac_SetPlayerPos", "ifff", playerid, x, y, z);
| |
| 2679 | #else | |
| 2680 | return ac_SetPlayerPos(playerid, x, y, z); | |
| 2681 | #endif | |
| 2682 | } | |
| 2683 | ||
| 2684 | #if defined _ALS_SetPlayerPos | |
| 2685 | #undef SetPlayerPos | |
| 2686 | #else | |
| 2687 | #define _ALS_SetPlayerPos | |
| 2688 | #endif | |
| 2689 | #define SetPlayerPos acc_SetPlayerPos | |
| 2690 | ||
| 2691 | stock orig_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z) return SetPlayerPosFindZ(playerid, x, y, z); | |
| 2692 | ||
| 2693 | stock acc_SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z) | |
| 2694 | {
| |
| 2695 | #if defined FILTERSCRIPT | |
| 2696 | return CallRemoteFunction("ac_SetPlayerPosFindZ", "ifff", playerid, x, y, z);
| |
| 2697 | #else | |
| 2698 | return ac_SetPlayerPosFindZ(playerid, x, y, z); | |
| 2699 | #endif | |
| 2700 | } | |
| 2701 | ||
| 2702 | #if defined _ALS_SetPlayerPosFindZ | |
| 2703 | #undef SetPlayerPosFindZ | |
| 2704 | #else | |
| 2705 | #define _ALS_SetPlayerPosFindZ | |
| 2706 | #endif | |
| 2707 | #define SetPlayerPosFindZ acc_SetPlayerPosFindZ | |
| 2708 | ||
| 2709 | stock orig_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z) return SetPlayerVelocity(playerid, X, Y, Z); | |
| 2710 | ||
| 2711 | stock acc_SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z) | |
| 2712 | {
| |
| 2713 | #if defined FILTERSCRIPT | |
| 2714 | return CallRemoteFunction("ac_SetPlayerVelocity", "ifff", playerid, X, Y, Z);
| |
| 2715 | #else | |
| 2716 | return ac_SetPlayerVelocity(playerid, X, Y, Z); | |
| 2717 | #endif | |
| 2718 | } | |
| 2719 | ||
| 2720 | #if defined _ALS_SetPlayerVelocity | |
| 2721 | #undef SetPlayerVelocity | |
| 2722 | #else | |
| 2723 | #define _ALS_SetPlayerVelocity | |
| 2724 | #endif | |
| 2725 | #define SetPlayerVelocity acc_SetPlayerVelocity | |
| 2726 | ||
| 2727 | stock orig_PutPlayerInVehicle(playerid, vehicleid, seatid) return PutPlayerInVehicle(playerid, vehicleid, seatid); | |
| 2728 | ||
| 2729 | stock acc_PutPlayerInVehicle(playerid, vehicleid, seatid) | |
| 2730 | {
| |
| 2731 | #if defined FILTERSCRIPT | |
| 2732 | return CallRemoteFunction("ac_PutPlayerInVehicle", "iii", playerid, vehicleid, seatid);
| |
| 2733 | #else | |
| 2734 | return ac_PutPlayerInVehicle(playerid, vehicleid, seatid); | |
| 2735 | #endif | |
| 2736 | } | |
| 2737 | ||
| 2738 | #if defined _ALS_PutPlayerInVehicle | |
| 2739 | #undef PutPlayerInVehicle | |
| 2740 | #else | |
| 2741 | #define _ALS_PutPlayerInVehicle | |
| 2742 | #endif | |
| 2743 | #define PutPlayerInVehicle acc_PutPlayerInVehicle | |
| 2744 | ||
| 2745 | stock orig_RemovePlayerFromVehicle(playerid) return RemovePlayerFromVehicle(playerid); | |
| 2746 | ||
| 2747 | stock acc_RemovePlayerFromVehicle(playerid) | |
| 2748 | {
| |
| 2749 | #if defined FILTERSCRIPT | |
| 2750 | return CallRemoteFunction("ac_RemovePlayerFromVehicle", "i", playerid);
| |
| 2751 | #else | |
| 2752 | return ac_RemovePlayerFromVehicle(playerid); | |
| 2753 | #endif | |
| 2754 | } | |
| 2755 | ||
| 2756 | #if defined _ALS_RemovePlayerFromVehicle | |
| 2757 | #undef RemovePlayerFromVehicle | |
| 2758 | #else | |
| 2759 | #define _ALS_RemovePlayerFromVehicle | |
| 2760 | #endif | |
| 2761 | #define RemovePlayerFromVehicle acc_RemovePlayerFromVehicle | |
| 2762 | ||
| 2763 | stock orig_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z) return SetVehiclePos(vehicleid, x, y, z); | |
| 2764 | ||
| 2765 | stock acc_SetVehiclePos(vehicleid, Float:x, Float:y, Float:z) | |
| 2766 | {
| |
| 2767 | #if defined FILTERSCRIPT | |
| 2768 | return CallRemoteFunction("ac_SetVehiclePos", "ifff", vehicleid, x, y, z);
| |
| 2769 | #else | |
| 2770 | return ac_SetVehiclePos(vehicleid, x, y, z); | |
| 2771 | #endif | |
| 2772 | } | |
| 2773 | ||
| 2774 | #if defined _ALS_SetVehiclePos | |
| 2775 | #undef SetVehiclePos | |
| 2776 | #else | |
| 2777 | #define _ALS_SetVehiclePos | |
| 2778 | #endif | |
| 2779 | #define SetVehiclePos acc_SetVehiclePos | |
| 2780 | ||
| 2781 | stock orig_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z) return SetVehicleVelocity(vehicleid, X, Y, Z); | |
| 2782 | ||
| 2783 | stock acc_SetVehicleVelocity(vehicleid, Float:X, Float:Y, Float:Z) | |
| 2784 | {
| |
| 2785 | #if defined FILTERSCRIPT | |
| 2786 | return CallRemoteFunction("ac_SetVehicleVelocity", "ifff", vehicleid, X, Y, Z);
| |
| 2787 | #else | |
| 2788 | return ac_SetVehicleVelocity(vehicleid, X, Y, Z); | |
| 2789 | #endif | |
| 2790 | } | |
| 2791 | ||
| 2792 | #if defined _ALS_SetVehicleVelocity | |
| 2793 | #undef SetVehicleVelocity | |
| 2794 | #else | |
| 2795 | #define _ALS_SetVehicleVelocity | |
| 2796 | #endif | |
| 2797 | #define SetVehicleVelocity acc_SetVehicleVelocity | |
| 2798 | ||
| 2799 | stock orig_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z) return SetVehicleAngularVelocity(vehicleid, X, Y, Z); | |
| 2800 | ||
| 2801 | stock acc_SetVehicleAngularVelocity(vehicleid, Float:X, Float:Y, Float:Z) | |
| 2802 | {
| |
| 2803 | #if defined FILTERSCRIPT | |
| 2804 | return CallRemoteFunction("ac_SetVehicleAngularVelocity", "ifff", vehicleid, X, Y, Z);
| |
| 2805 | #else | |
| 2806 | return ac_SetVehicleAngularVelocity(vehicleid, X, Y, Z); | |
| 2807 | #endif | |
| 2808 | } | |
| 2809 | ||
| 2810 | #if defined _ALS_SetVehicleAngularVelocity | |
| 2811 | #undef SetVehicleAngularVelocity | |
| 2812 | #else | |
| 2813 | #define _ALS_SetVehicleAngularVelocity | |
| 2814 | #endif | |
| 2815 | #define SetVehicleAngularVelocity acc_SetVehicleAngularVelocity | |
| 2816 | ||
| 2817 | stock orig_LinkVehicleToInterior(vehicleid, interiorid) return LinkVehicleToInterior(vehicleid, interiorid); | |
| 2818 | ||
| 2819 | stock acc_LinkVehicleToInterior(vehicleid, interiorid) | |
| 2820 | {
| |
| 2821 | #if defined FILTERSCRIPT | |
| 2822 | return CallRemoteFunction("ac_LinkVehicleToInterior", "ii", vehicleid, interiorid);
| |
| 2823 | #else | |
| 2824 | return ac_LinkVehicleToInterior(vehicleid, interiorid); | |
| 2825 | #endif | |
| 2826 | } | |
| 2827 | ||
| 2828 | #if defined _ALS_LinkVehicleToInterior | |
| 2829 | #undef LinkVehicleToInterior | |
| 2830 | #else | |
| 2831 | #define _ALS_LinkVehicleToInterior | |
| 2832 | #endif | |
| 2833 | #define LinkVehicleToInterior acc_LinkVehicleToInterior | |
| 2834 | ||
| 2835 | stock orig_ChangeVehiclePaintjob(vehicleid, paintjobid) return ChangeVehiclePaintjob(vehicleid, paintjobid); | |
| 2836 | ||
| 2837 | stock acc_ChangeVehiclePaintjob(vehicleid, paintjobid) | |
| 2838 | {
| |
| 2839 | if(GetVehicleModel(vehicleid) <= 0) return 1; | |
| 2840 | #if defined FILTERSCRIPT | |
| 2841 | return CallRemoteFunction("ac_ChangeVehiclePaintjob", "ii", vehicleid, paintjobid);
| |
| 2842 | #else | |
| 2843 | return ac_ChangeVehiclePaintjob(vehicleid, paintjobid); | |
| 2844 | #endif | |
| 2845 | } | |
| 2846 | ||
| 2847 | #if defined _ALS_ChangeVehiclePaintjob | |
| 2848 | #undef ChangeVehiclePaintjob | |
| 2849 | #else | |
| 2850 | #define _ALS_ChangeVehiclePaintjob | |
| 2851 | #endif | |
| 2852 | #define ChangeVehiclePaintjob acc_ChangeVehiclePaintjob | |
| 2853 | ||
| 2854 | stock orig_SetVehicleHealth(vehicleid, Float:health) return SetVehicleHealth(vehicleid, health); | |
| 2855 | ||
| 2856 | stock acc_SetVehicleHealth(vehicleid, Float:health) | |
| 2857 | {
| |
| 2858 | if(health < 0.0) health = 0.0; | |
| 2859 | #if defined FILTERSCRIPT | |
| 2860 | return CallRemoteFunction("ac_SetVehicleHealth", "if", vehicleid, health);
| |
| 2861 | #else | |
| 2862 | return ac_SetVehicleHealth(vehicleid, health); | |
| 2863 | #endif | |
| 2864 | } | |
| 2865 | ||
| 2866 | #if defined _ALS_SetVehicleHealth | |
| 2867 | #undef SetVehicleHealth | |
| 2868 | #else | |
| 2869 | #define _ALS_SetVehicleHealth | |
| 2870 | #endif | |
| 2871 | #define SetVehicleHealth acc_SetVehicleHealth | |
| 2872 | ||
| 2873 | stock orig_RepairVehicle(vehicleid) return RepairVehicle(vehicleid); | |
| 2874 | ||
| 2875 | stock acc_RepairVehicle(vehicleid) | |
| 2876 | {
| |
| 2877 | #if defined FILTERSCRIPT | |
| 2878 | return CallRemoteFunction("ac_RepairVehicle", "i", vehicleid);
| |
| 2879 | #else | |
| 2880 | return ac_RepairVehicle(vehicleid); | |
| 2881 | #endif | |
| 2882 | } | |
| 2883 | ||
| 2884 | #if defined _ALS_RepairVehicle | |
| 2885 | #undef RepairVehicle | |
| 2886 | #else | |
| 2887 | #define _ALS_RepairVehicle | |
| 2888 | #endif | |
| 2889 | #define RepairVehicle acc_RepairVehicle | |
| 2890 | ||
| 2891 | stock orig_UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires) return UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires); | |
| 2892 | ||
| 2893 | stock acc_UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires) | |
| 2894 | {
| |
| 2895 | #if defined FILTERSCRIPT | |
| 2896 | return CallRemoteFunction("ac_UpdateVehicleDamageStatus", "iiiii", vehicleid, panels, doors, lights, tires);
| |
| 2897 | #else | |
| 2898 | return ac_UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires); | |
| 2899 | #endif | |
| 2900 | } | |
| 2901 | ||
| 2902 | #if defined _ALS_UpdateVehicleDamageStatus | |
| 2903 | #undef UpdateVehicleDamageStatus | |
| 2904 | #else | |
| 2905 | #define _ALS_UpdateVehicleDamageStatus | |
| 2906 | #endif | |
| 2907 | #define UpdateVehicleDamageStatus acc_UpdateVehicleDamageStatus | |
| 2908 | ||
| 2909 | stock orig_SetVehicleToRespawn(vehicleid) return SetVehicleToRespawn(vehicleid); | |
| 2910 | ||
| 2911 | stock acc_SetVehicleToRespawn(vehicleid) | |
| 2912 | {
| |
| 2913 | if(GetVehicleModel(vehicleid) <= 0) return 0; | |
| 2914 | #if defined FILTERSCRIPT | |
| 2915 | return CallRemoteFunction("ac_SetVehicleToRespawn", "i", vehicleid);
| |
| 2916 | #else | |
| 2917 | return ac_SetVehicleToRespawn(vehicleid); | |
| 2918 | #endif | |
| 2919 | } | |
| 2920 | ||
| 2921 | #if defined _ALS_SetVehicleToRespawn | |
| 2922 | #undef SetVehicleToRespawn | |
| 2923 | #else | |
| 2924 | #define _ALS_SetVehicleToRespawn | |
| 2925 | #endif | |
| 2926 | #define SetVehicleToRespawn acc_SetVehicleToRespawn | |
| 2927 | ||
| 2928 | stock EnableAntiCheat(code, enable) | |
| 2929 | {
| |
| 2930 | #if defined FILTERSCRIPT | |
| 2931 | return CallRemoteFunction("ac_EnableAntiCheat", "ii", code, enable);
| |
| 2932 | #else | |
| 2933 | return ac_EnableAntiCheat(code, enable); | |
| 2934 | #endif | |
| 2935 | } | |
| 2936 | ||
| 2937 | stock EnableAntiNOP(nopcode, enable) | |
| 2938 | {
| |
| 2939 | #if defined FILTERSCRIPT | |
| 2940 | return CallRemoteFunction("ac_EnableAntiNOP", "ii", nopcode, enable);
| |
| 2941 | #else | |
| 2942 | return ac_EnableAntiNOP(nopcode, enable); | |
| 2943 | #endif | |
| 2944 | } | |
| 2945 | ||
| 2946 | stock EnableAntiCheatForPlayer(playerid, code, enable) | |
| 2947 | {
| |
| 2948 | if(!IsPlayerConnected(playerid)) return 0; | |
| 2949 | #if defined FILTERSCRIPT | |
| 2950 | return CallRemoteFunction("ac_EnableAntiCheatForPlayer", "iii", playerid, code, enable);
| |
| 2951 | #else | |
| 2952 | return ac_EnableAntiCheatForPlayer(playerid, code, enable); | |
| 2953 | #endif | |
| 2954 | } | |
| 2955 | ||
| 2956 | stock EnableAntiNOPForPlayer(playerid, nopcode, enable) | |
| 2957 | {
| |
| 2958 | if(!IsPlayerConnected(playerid)) return 0; | |
| 2959 | #if defined FILTERSCRIPT | |
| 2960 | return CallRemoteFunction("ac_EnableAntiNOPForPlayer", "iii", playerid, nopcode, enable);
| |
| 2961 | #else | |
| 2962 | return ac_EnableAntiNOPForPlayer(playerid, nopcode, enable); | |
| 2963 | #endif | |
| 2964 | } | |
| 2965 | ||
| 2966 | stock IsAntiCheatEnabled(code) | |
| 2967 | {
| |
| 2968 | #if defined FILTERSCRIPT | |
| 2969 | return CallRemoteFunction("ac_IsAntiCheatEnabled", "i", code);
| |
| 2970 | #else | |
| 2971 | return ac_IsAntiCheatEnabled(code); | |
| 2972 | #endif | |
| 2973 | } | |
| 2974 | ||
| 2975 | stock IsAntiNOPEnabled(nopcode) | |
| 2976 | {
| |
| 2977 | #if defined FILTERSCRIPT | |
| 2978 | return CallRemoteFunction("ac_IsAntiNOPEnabled", "i", nopcode);
| |
| 2979 | #else | |
| 2980 | return ac_IsAntiNOPEnabled(nopcode); | |
| 2981 | #endif | |
| 2982 | } | |
| 2983 | ||
| 2984 | stock IsAntiCheatEnabledForPlayer(playerid, code) | |
| 2985 | {
| |
| 2986 | if(!IsPlayerConnected(playerid)) return 0; | |
| 2987 | #if defined FILTERSCRIPT | |
| 2988 | return CallRemoteFunction("ac_IsAntiCheatEnabledForPlayer", "ii", playerid, code);
| |
| 2989 | #else | |
| 2990 | return ac_IsAntiCheatEnabledForPlayer(playerid, code); | |
| 2991 | #endif | |
| 2992 | } | |
| 2993 | ||
| 2994 | stock IsAntiNOPEnabledForPlayer(playerid, nopcode) | |
| 2995 | {
| |
| 2996 | if(!IsPlayerConnected(playerid)) return 0; | |
| 2997 | #if defined FILTERSCRIPT | |
| 2998 | return CallRemoteFunction("ac_IsAntiNOPEnabledForPlayer", "ii", playerid, nopcode);
| |
| 2999 | #else | |
| 3000 | return ac_IsAntiNOPEnabledForPlayer(playerid, nopcode); | |
| 3001 | #endif | |
| 3002 | } | |
| 3003 | ||
| 3004 | stock AntiCheatGetSpeed(playerid) | |
| 3005 | {
| |
| 3006 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3007 | #if defined FILTERSCRIPT | |
| 3008 | return CallRemoteFunction("ac_AntiCheatGetSpeed", "i", playerid);
| |
| 3009 | #else | |
| 3010 | return ac_AntiCheatGetSpeed(playerid); | |
| 3011 | #endif | |
| 3012 | } | |
| 3013 | ||
| 3014 | stock AntiCheatGetAnimationIndex(playerid) | |
| 3015 | {
| |
| 3016 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3017 | #if defined FILTERSCRIPT | |
| 3018 | return CallRemoteFunction("ac_AntiCheatGetAnimationIndex", "i", playerid);
| |
| 3019 | #else | |
| 3020 | return ac_AntiCheatGetAnimationIndex(playerid); | |
| 3021 | #endif | |
| 3022 | } | |
| 3023 | ||
| 3024 | stock AntiCheatGetDialog(playerid) | |
| 3025 | {
| |
| 3026 | if(!IsPlayerConnected(playerid)) return -1; | |
| 3027 | #if defined FILTERSCRIPT | |
| 3028 | return CallRemoteFunction("ac_AntiCheatGetDialog", "i", playerid);
| |
| 3029 | #else | |
| 3030 | return ac_AntiCheatGetDialog(playerid); | |
| 3031 | #endif | |
| 3032 | } | |
| 3033 | ||
| 3034 | stock AntiCheatGetInterior(playerid) | |
| 3035 | {
| |
| 3036 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3037 | #if defined FILTERSCRIPT | |
| 3038 | return CallRemoteFunction("ac_AntiCheatGetInterior", "i", playerid);
| |
| 3039 | #else | |
| 3040 | return ac_AntiCheatGetInterior(playerid); | |
| 3041 | #endif | |
| 3042 | } | |
| 3043 | ||
| 3044 | stock AntiCheatGetEnterVehicle(playerid) | |
| 3045 | {
| |
| 3046 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3047 | #if defined FILTERSCRIPT | |
| 3048 | return CallRemoteFunction("ac_AntiCheatGetEnterVehicle", "i", playerid);
| |
| 3049 | #else | |
| 3050 | return ac_AntiCheatGetEnterVehicle(playerid); | |
| 3051 | #endif | |
| 3052 | } | |
| 3053 | ||
| 3054 | stock AntiCheatGetEnterVehicleSeat(playerid) | |
| 3055 | {
| |
| 3056 | if(!IsPlayerConnected(playerid)) return -1; | |
| 3057 | #if defined FILTERSCRIPT | |
| 3058 | return CallRemoteFunction("ac_AntiCheatGetEnterVehicleSeat", "i", playerid);
| |
| 3059 | #else | |
| 3060 | return ac_AntiCheatGetEnterVehicleSeat(playerid); | |
| 3061 | #endif | |
| 3062 | } | |
| 3063 | ||
| 3064 | stock AntiCheatGetVehicleID(playerid) | |
| 3065 | {
| |
| 3066 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3067 | #if defined FILTERSCRIPT | |
| 3068 | return CallRemoteFunction("ac_AntiCheatGetVehicleID", "i", playerid);
| |
| 3069 | #else | |
| 3070 | return ac_AntiCheatGetVehicleID(playerid); | |
| 3071 | #endif | |
| 3072 | } | |
| 3073 | ||
| 3074 | stock AntiCheatGetVehicleSeat(playerid) | |
| 3075 | {
| |
| 3076 | if(!IsPlayerConnected(playerid)) return -1; | |
| 3077 | #if defined FILTERSCRIPT | |
| 3078 | return CallRemoteFunction("ac_AntiCheatGetVehicleSeat", "i", playerid);
| |
| 3079 | #else | |
| 3080 | return ac_AntiCheatGetVehicleSeat(playerid); | |
| 3081 | #endif | |
| 3082 | } | |
| 3083 | ||
| 3084 | stock AntiCheatGetWeapon(playerid) | |
| 3085 | {
| |
| 3086 | if(!IsPlayerConnected(playerid)) return -1; | |
| 3087 | #if defined FILTERSCRIPT | |
| 3088 | return CallRemoteFunction("ac_AntiCheatGetWeapon", "i", playerid);
| |
| 3089 | #else | |
| 3090 | return ac_AntiCheatGetWeapon(playerid); | |
| 3091 | #endif | |
| 3092 | } | |
| 3093 | ||
| 3094 | stock AntiCheatGetWeaponInSlot(playerid, slot) | |
| 3095 | {
| |
| 3096 | if(!IsPlayerConnected(playerid)) return -1; | |
| 3097 | if(!(0 <= slot <= 12)) return -2; | |
| 3098 | #if defined FILTERSCRIPT | |
| 3099 | return CallRemoteFunction("ac_AntiCheatGetWeaponInSlot", "ii", playerid, slot);
| |
| 3100 | #else | |
| 3101 | return ac_AntiCheatGetWeaponInSlot(playerid, slot); | |
| 3102 | #endif | |
| 3103 | } | |
| 3104 | ||
| 3105 | stock AntiCheatGetAmmoInSlot(playerid, slot) | |
| 3106 | {
| |
| 3107 | if(!IsPlayerConnected(playerid)) return -1; | |
| 3108 | if(!(0 <= slot <= 12)) return -2; | |
| 3109 | #if defined FILTERSCRIPT | |
| 3110 | return CallRemoteFunction("ac_AntiCheatGetAmmoInSlot", "ii", playerid, slot);
| |
| 3111 | #else | |
| 3112 | return ac_AntiCheatGetAmmoInSlot(playerid, slot); | |
| 3113 | #endif | |
| 3114 | } | |
| 3115 | ||
| 3116 | stock AntiCheatGetSpecialAction(playerid) | |
| 3117 | {
| |
| 3118 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3119 | #if defined FILTERSCRIPT | |
| 3120 | return CallRemoteFunction("ac_AntiCheatGetSpecialAction", "i", playerid);
| |
| 3121 | #else | |
| 3122 | return ac_AntiCheatGetSpecialAction(playerid); | |
| 3123 | #endif | |
| 3124 | } | |
| 3125 | ||
| 3126 | stock AntiCheatGetLastSpecialAction(playerid) | |
| 3127 | {
| |
| 3128 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3129 | #if defined FILTERSCRIPT | |
| 3130 | return CallRemoteFunction("ac_AntiCheatGetLastSpecialActio", "i", playerid);
| |
| 3131 | #else | |
| 3132 | return ac_AntiCheatGetLastSpecialActio(playerid); | |
| 3133 | #endif | |
| 3134 | } | |
| 3135 | ||
| 3136 | stock AntiCheatGetLastShotWeapon(playerid) | |
| 3137 | {
| |
| 3138 | if(!IsPlayerConnected(playerid)) return -1; | |
| 3139 | #if defined FILTERSCRIPT | |
| 3140 | return CallRemoteFunction("ac_AntiCheatGetLastShotWeapon", "i", playerid);
| |
| 3141 | #else | |
| 3142 | return ac_AntiCheatGetLastShotWeapon(playerid); | |
| 3143 | #endif | |
| 3144 | } | |
| 3145 | ||
| 3146 | stock AntiCheatGetLastPickup(playerid) | |
| 3147 | {
| |
| 3148 | if(!IsPlayerConnected(playerid)) return -1; | |
| 3149 | #if defined FILTERSCRIPT | |
| 3150 | return CallRemoteFunction("ac_AntiCheatGetLastPickup", "i", playerid);
| |
| 3151 | #else | |
| 3152 | return ac_AntiCheatGetLastPickup(playerid); | |
| 3153 | #endif | |
| 3154 | } | |
| 3155 | ||
| 3156 | stock AntiCheatGetLastUpdateTime(playerid) | |
| 3157 | {
| |
| 3158 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3159 | #if defined FILTERSCRIPT | |
| 3160 | return CallRemoteFunction("ac_AntiCheatGetLastUpdateTime", "i", playerid);
| |
| 3161 | #else | |
| 3162 | return ac_AntiCheatGetLastUpdateTime(playerid); | |
| 3163 | #endif | |
| 3164 | } | |
| 3165 | ||
| 3166 | stock AntiCheatGetLastReloadTime(playerid) | |
| 3167 | {
| |
| 3168 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3169 | #if defined FILTERSCRIPT | |
| 3170 | return CallRemoteFunction("ac_AntiCheatGetLastReloadTime", "i", playerid);
| |
| 3171 | #else | |
| 3172 | return ac_AntiCheatGetLastReloadTime(playerid); | |
| 3173 | #endif | |
| 3174 | } | |
| 3175 | ||
| 3176 | stock AntiCheatGetLastEnteredVehTime(playerid) | |
| 3177 | {
| |
| 3178 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3179 | #if defined FILTERSCRIPT | |
| 3180 | return CallRemoteFunction("ac_AntiCheatGetLastEnteredVehTi", "i", playerid);
| |
| 3181 | #else | |
| 3182 | return ac_AntiCheatGetLastEnteredVehTi(playerid); | |
| 3183 | #endif | |
| 3184 | } | |
| 3185 | ||
| 3186 | stock AntiCheatGetLastShotTime(playerid) | |
| 3187 | {
| |
| 3188 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3189 | #if defined FILTERSCRIPT | |
| 3190 | return CallRemoteFunction("ac_AntiCheatGetLastShotTime", "i", playerid);
| |
| 3191 | #else | |
| 3192 | return ac_AntiCheatGetLastShotTime(playerid); | |
| 3193 | #endif | |
| 3194 | } | |
| 3195 | ||
| 3196 | stock AntiCheatGetLastSpawnTime(playerid) | |
| 3197 | {
| |
| 3198 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3199 | #if defined FILTERSCRIPT | |
| 3200 | return CallRemoteFunction("ac_AntiCheatGetLastSpawnTime", "i", playerid);
| |
| 3201 | #else | |
| 3202 | return ac_AntiCheatGetLastSpawnTime(playerid); | |
| 3203 | #endif | |
| 3204 | } | |
| 3205 | ||
| 3206 | stock AntiCheatIntEnterExitsIsEnabled(playerid) | |
| 3207 | {
| |
| 3208 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3209 | #if defined FILTERSCRIPT | |
| 3210 | return CallRemoteFunction("ac_AntiCheatIntEnterExitsIsEnab", "i", playerid);
| |
| 3211 | #else | |
| 3212 | return ac_AntiCheatIntEnterExitsIsEnab(playerid); | |
| 3213 | #endif | |
| 3214 | } | |
| 3215 | ||
| 3216 | stock AntiCheatStuntBonusIsEnabled(playerid) | |
| 3217 | {
| |
| 3218 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3219 | #if defined FILTERSCRIPT | |
| 3220 | return CallRemoteFunction("ac_AntiCheatStuntBonusIsEnabled", "i", playerid);
| |
| 3221 | #else | |
| 3222 | return ac_AntiCheatStuntBonusIsEnabled(playerid); | |
| 3223 | #endif | |
| 3224 | } | |
| 3225 | ||
| 3226 | stock AntiCheatIsInModShop(playerid) | |
| 3227 | {
| |
| 3228 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3229 | #if defined FILTERSCRIPT | |
| 3230 | return CallRemoteFunction("ac_AntiCheatIsInModShop", "i", playerid);
| |
| 3231 | #else | |
| 3232 | return ac_AntiCheatIsInModShop(playerid); | |
| 3233 | #endif | |
| 3234 | } | |
| 3235 | ||
| 3236 | stock AntiCheatIsInSpectate(playerid) | |
| 3237 | {
| |
| 3238 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3239 | #if defined FILTERSCRIPT | |
| 3240 | return CallRemoteFunction("ac_AntiCheatIsInSpectate", "i", playerid);
| |
| 3241 | #else | |
| 3242 | return ac_AntiCheatIsInSpectate(playerid); | |
| 3243 | #endif | |
| 3244 | } | |
| 3245 | ||
| 3246 | stock AntiCheatIsFrozen(playerid) | |
| 3247 | {
| |
| 3248 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3249 | #if defined FILTERSCRIPT | |
| 3250 | return CallRemoteFunction("ac_AntiCheatIsFrozen", "i", playerid);
| |
| 3251 | #else | |
| 3252 | return ac_AntiCheatIsFrozen(playerid); | |
| 3253 | #endif | |
| 3254 | } | |
| 3255 | ||
| 3256 | stock AntiCheatIsDead(playerid) | |
| 3257 | {
| |
| 3258 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3259 | #if defined FILTERSCRIPT | |
| 3260 | return CallRemoteFunction("ac_AntiCheatIsDead", "i", playerid);
| |
| 3261 | #else | |
| 3262 | return ac_AntiCheatIsDead(playerid); | |
| 3263 | #endif | |
| 3264 | } | |
| 3265 | ||
| 3266 | stock AntiCheatIsConnected(playerid) | |
| 3267 | {
| |
| 3268 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3269 | #if defined FILTERSCRIPT | |
| 3270 | return CallRemoteFunction("ac_AntiCheatIsConnected", "i", playerid);
| |
| 3271 | #else | |
| 3272 | return ac_AntiCheatIsConnected(playerid); | |
| 3273 | #endif | |
| 3274 | } | |
| 3275 | ||
| 3276 | stock AntiCheatKickWithDesync(playerid, code) | |
| 3277 | {
| |
| 3278 | if(!IsPlayerConnected(playerid)) return 0; | |
| 3279 | #if defined FILTERSCRIPT | |
| 3280 | return CallRemoteFunction("ac_AntiCheatKickWithDesync", "ii", playerid, code);
| |
| 3281 | #else | |
| 3282 | return ac_AntiCheatKickWithDesync(playerid, code); | |
| 3283 | #endif | |
| 3284 | } | |
| 3285 | ||
| 3286 | stock AntiCheatIsKickedWithDesync(playerid) | |
| 3287 | {
| |
| 3288 | if(!IsPlayerConnected(playerid)) return 3; | |
| 3289 | #if defined FILTERSCRIPT | |
| 3290 | return CallRemoteFunction("ac_AntiCheatIsKickedWithDesync", "i", playerid);
| |
| 3291 | #else | |
| 3292 | return ac_AntiCheatIsKickedWithDesync(playerid); | |
| 3293 | #endif | |
| 3294 | } | |
| 3295 | ||
| 3296 | stock AntiCheatGetVehicleDriver(vehicleid) | |
| 3297 | {
| |
| 3298 | if(GetVehicleModel(vehicleid) <= 0) return INVALID_PLAYER_ID; | |
| 3299 | #if defined FILTERSCRIPT | |
| 3300 | return CallRemoteFunction("ac_AntiCheatGetVehicleDriver", "i", vehicleid);
| |
| 3301 | #else | |
| 3302 | return ac_AntiCheatGetVehicleDriver(vehicleid); | |
| 3303 | #endif | |
| 3304 | } | |
| 3305 | ||
| 3306 | stock AntiCheatGetVehicleInterior(vehicleid) | |
| 3307 | {
| |
| 3308 | if(GetVehicleModel(vehicleid) <= 0) return 0; | |
| 3309 | #if defined FILTERSCRIPT | |
| 3310 | return CallRemoteFunction("ac_AntiCheatGetVehicleInterior", "i", vehicleid);
| |
| 3311 | #else | |
| 3312 | return ac_AntiCheatGetVehicleInterior(vehicleid); | |
| 3313 | #endif | |
| 3314 | } | |
| 3315 | ||
| 3316 | stock AntiCheatGetVehiclePaintjob(vehicleid) | |
| 3317 | {
| |
| 3318 | if(GetVehicleModel(vehicleid) <= 0) return 3; | |
| 3319 | #if defined FILTERSCRIPT | |
| 3320 | return CallRemoteFunction("ac_AntiCheatGetVehiclePaintjob", "i", vehicleid);
| |
| 3321 | #else | |
| 3322 | return ac_AntiCheatGetVehiclePaintjob(vehicleid); | |
| 3323 | #endif | |
| 3324 | } | |
| 3325 | ||
| 3326 | stock AntiCheatGetVehicleSpeed(vehicleid) | |
| 3327 | {
| |
| 3328 | if(GetVehicleModel(vehicleid) <= 0) return 0; | |
| 3329 | #if defined FILTERSCRIPT | |
| 3330 | return CallRemoteFunction("ac_AntiCheatGetVehicleSpeed", "i", vehicleid);
| |
| 3331 | #else | |
| 3332 | return ac_AntiCheatGetVehicleSpeed(vehicleid); | |
| 3333 | #endif | |
| 3334 | } | |
| 3335 | ||
| 3336 | stock AntiCheatIsVehicleSpawned(vehicleid) | |
| 3337 | {
| |
| 3338 | if(GetVehicleModel(vehicleid) <= 0) return 0; | |
| 3339 | #if defined FILTERSCRIPT | |
| 3340 | return CallRemoteFunction("ac_AntiCheatIsVehicleSpawned", "i", vehicleid);
| |
| 3341 | #else | |
| 3342 | return ac_AntiCheatIsVehicleSpawned(vehicleid); | |
| 3343 | #endif | |
| 3344 | } | |
| 3345 | ||
| 3346 | #if defined FILTERSCRIPT | |
| 3347 | ||
| 3348 | static fs_AntiCheatGetNextDialog(playerid) | |
| 3349 | {
| |
| 3350 | if(!IsPlayerConnected(playerid)) return -1; | |
| 3351 | return CallRemoteFunction("ac_AntiCheatGetNextDialog", "i", playerid);
| |
| 3352 | } | |
| 3353 | ||
| 3354 | static fs_AntiCheatSetDialog(playerid, dialogid) | |
| 3355 | {
| |
| 3356 | if(!(0 <= playerid < MAX_PLAYERS)) return 0; | |
| 3357 | return CallRemoteFunction("ac_ShowPlayerDialog", "id", playerid, dialogid);
| |
| 3358 | } | |
| 3359 | ||
| 3360 | static fs_AntiCheatSetNextDialog(playerid, dialogid) | |
| 3361 | {
| |
| 3362 | if(!(0 <= playerid < MAX_PLAYERS)) return 0; | |
| 3363 | return CallRemoteFunction("ac_fs_ShowPlayerDialog", "id", playerid, dialogid);
| |
| 3364 | } | |
| 3365 | ||
| 3366 | #else | |
| 3367 | ||
| 3368 | public OnGameModeInit() | |
| 3369 | {
| |
| 3370 | #if AC_USE_CONFIG_FILES | |
| 3371 | if(!ac_LoadCfg()) printf(CFG_OPENING_ERROR, AC_CONFIG_FILE); | |
| 3372 | if(!ac_LoadNOPCfg()) printf(CFG_OPENING_ERROR, AC_NOP_CONFIG_FILE); | |
| 3373 | #endif | |
| 3374 | if(ac_ACAllow[42]) | |
| 3375 | {
| |
| 3376 | #if !AC_USE_QUERY | |
| 3377 | #if defined GetConsoleVarAsBool | |
| 3378 | ac_QueryEnable = (GetConsoleVarAsBool("query") != 0);
| |
| 3379 | #else | |
| 3380 | ac_QueryEnable = (GetServerVarAsBool("query") != 0);
| |
| 3381 | #endif | |
| 3382 | SendRconCommand("query 0");
| |
| 3383 | #endif | |
| 3384 | #undef AC_USE_QUERY | |
| 3385 | #if defined GetConsoleVarAsBool | |
| 3386 | ac_RconEnable = (GetConsoleVarAsBool("rcon") != 0);
| |
| 3387 | #else | |
| 3388 | ac_RconEnable = (GetServerVarAsBool("rcon") != 0);
| |
| 3389 | #endif | |
| 3390 | SendRconCommand("rcon 0");
| |
| 3391 | } | |
| 3392 | #if defined GetConsoleVarAsInt | |
| 3393 | ac_LagCompMode = (GetConsoleVarAsInt("lagcompmode") != 0);
| |
| 3394 | #else | |
| 3395 | ac_LagCompMode = (GetServerVarAsInt("lagcompmode") != 0);
| |
| 3396 | #endif | |
| 3397 | print(" ");
| |
| 3398 | print("--------------------------------------");
| |
| 3399 | print(LOADED_MSG_1); | |
| 3400 | printf(LOADED_MSG_2, NEX_AC_VERSION); | |
| 3401 | print(LOADED_MSG_3); | |
| 3402 | print("--------------------------------------\n");
| |
| 3403 | #if defined ac_OnGameModeInit | |
| 3404 | new ac_a = ac_OnGameModeInit(); | |
| 3405 | #endif | |
| 3406 | static ac_strtmp[10]; | |
| 3407 | #if defined GetConsoleVarAsString | |
| 3408 | GetConsoleVarAsString("version", ac_strtmp, sizeof ac_strtmp);
| |
| 3409 | #else | |
| 3410 | GetServerVarAsString("version", ac_strtmp, sizeof ac_strtmp);
| |
| 3411 | #endif | |
| 3412 | if(strfind(ac_strtmp, AC_SERVER_VERSION) == -1 && strfind(ac_strtmp, AC_SERVER_DL_VERSION) == -1) print(VERSION_WARNING); | |
| 3413 | #undef AC_SERVER_DL_VERSION | |
| 3414 | #undef AC_SERVER_VERSION | |
| 3415 | #if defined ac_OnGameModeInit | |
| 3416 | return ac_a; | |
| 3417 | #else | |
| 3418 | return 1; | |
| 3419 | #endif | |
| 3420 | } | |
| 3421 | ||
| 3422 | #if defined _ALS_OnGameModeInit | |
| 3423 | #undef OnGameModeInit | |
| 3424 | #else | |
| 3425 | #define _ALS_OnGameModeInit | |
| 3426 | #endif | |
| 3427 | #define OnGameModeInit ac_OnGameModeInit | |
| 3428 | #if defined ac_OnGameModeInit | |
| 3429 | forward ac_OnGameModeInit(); | |
| 3430 | #endif | |
| 3431 | ||
| 3432 | #if AC_USE_STATISTICS | |
| 3433 | public OnGameModeExit() | |
| 3434 | {
| |
| 3435 | #if defined ac_OnGameModeExit | |
| 3436 | new ac_a = ac_OnGameModeExit(); | |
| 3437 | #endif | |
| 3438 | print(" ");
| |
| 3439 | print("--------------------------------------");
| |
| 3440 | print(STATS_STRING_1); | |
| 3441 | print(STATS_STRING_2); | |
| 3442 | printf(STATS_STRING_3, ac_sInfo[0]); | |
| 3443 | printf(STATS_STRING_4, ac_sInfo[1]); | |
| 3444 | printf(STATS_STRING_5, ac_sInfo[2]); | |
| 3445 | printf(STATS_STRING_6, ac_sInfo[3]); | |
| 3446 | printf(STATS_STRING_7, ac_sInfo[4]); | |
| 3447 | printf(STATS_STRING_8, ac_sInfo[5]); | |
| 3448 | print("--------------------------------------\n");
| |
| 3449 | #if defined ac_OnGameModeExit | |
| 3450 | return ac_a; | |
| 3451 | #else | |
| 3452 | return 1; | |
| 3453 | #endif | |
| 3454 | } | |
| 3455 | ||
| 3456 | #if defined _ALS_OnGameModeExit | |
| 3457 | #undef OnGameModeExit | |
| 3458 | #else | |
| 3459 | #define _ALS_OnGameModeExit | |
| 3460 | #endif | |
| 3461 | #define OnGameModeExit ac_OnGameModeExit | |
| 3462 | #if defined ac_OnGameModeExit | |
| 3463 | forward ac_OnGameModeExit(); | |
| 3464 | #endif | |
| 3465 | - | new bool:ac_rslt; |
| 3465 | + | |
| 3466 | ||
| 3467 | public OnPlayerConnect(playerid) | |
| 3468 | {
| |
| 3469 | ACInfo[playerid][acVeh] = | |
| 3470 | ACInfo[playerid][acKicked] = | |
| 3471 | ACInfo[playerid][acKickVeh] = 0; | |
| 3472 | GetPlayerIp(playerid, ACInfo[playerid][acIp], 16); | |
| 3473 | #if AC_USE_NPC | |
| 3474 | if(IsPlayerNPC(playerid)) | |
| 3475 | - | GetLocalIP(0, ac_strtmp); |
| 3475 | + | |
| 3476 | if(ac_ACAllow[36]) | |
| 3477 | {
| |
| 3478 | #if defined GetLocalIP | |
| 3479 | new ac_i, bool:ac_rslt; | |
| 3480 | static ac_strtmp[16]; | |
| 3481 | ac_strtmp = "127.0.0.1"; | |
| 3482 | while(ac_strtmp[0]) | |
| 3483 | {
| |
| 3484 | if(!strcmp(ACInfo[playerid][acIp], ac_strtmp)) | |
| 3485 | {
| |
| 3486 | ac_rslt = true; | |
| 3487 | break; | |
| 3488 | } | |
| 3489 | GetLocalIP(ac_i, ac_strtmp); | |
| 3490 | ac_i++; | |
| 3491 | } | |
| 3492 | if(!ac_rslt) | |
| 3493 | {
| |
| 3494 | #if defined DEBUG | |
| 3495 | printf("[Nex-AC debug] NPC's IP: '%s'", ACInfo[playerid][acIp]);
| |
| 3496 | #endif | |
| 3497 | ac_KickWithCode(playerid, "", 0, 36); | |
| 3498 | } | |
| 3499 | #else | |
| 3500 | if(strcmp(ACInfo[playerid][acIp], "127.0.0.1")) ac_KickWithCode(playerid, "", 0, 36); | |
| 3501 | #endif | |
| 3502 | } | |
| 3503 | ACInfo[playerid][acTimerID] = 0; | |
| 3504 | } | |
| 3505 | else | |
| 3506 | {
| |
| 3507 | #else | |
| 3508 | if(ac_ACAllow[36] && IsPlayerNPC(playerid)) ac_KickWithCode(playerid, "", 0, 36); | |
| 3509 | #endif | |
| 3510 | if(ac_ACAllow[48] && ACInfo[playerid][acOnline]) ac_KickWithCode(playerid, "", 0, 48, 1); | |
| 3511 | #if defined GetPlayerVersion | |
| 3512 | if(ac_ACAllow[41]) | |
| 3513 | {
| |
| 3514 | static ac_ver[24]; | |
| 3515 | GetPlayerVersion(playerid, ac_ver, sizeof ac_ver); | |
| 3516 | if(strfind(ac_ver, AC_CLIENT_VERSION) == -1) | |
| 3517 | {
| |
| 3518 | #if defined DEBUG | |
| 3519 | printf(DEBUG_CODE_2, playerid, ac_ver); | |
| 3520 | #endif | |
| 3521 | ac_KickWithCode(playerid, "", 0, 41); | |
| 3522 | } | |
| 3523 | } | |
| 3524 | #else | |
| 3525 | #pragma unused DEBUG_CODE_2 | |
| 3526 | #endif | |
| 3527 | #undef AC_CLIENT_VERSION | |
| 3528 | new ac_i = AC_MAX_CONNECTS_FROM_IP; | |
| 3529 | if(ac_ACAllow[40]) | |
| 3530 | {
| |
| 3531 | #if defined foreach | |
| 3532 | foreach(new ac_j : Player) | |
| 3533 | {
| |
| 3534 | if(ac_j != playerid) | |
| 3535 | #else | |
| 3536 | #if defined GetPlayerPoolSize | |
| 3537 | for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j) | |
| 3538 | #else | |
| 3539 | for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j) | |
| 3540 | #endif | |
| 3541 | {
| |
| 3542 | #if AC_USE_NPC | |
| 3543 | if(ac_j != playerid && IsPlayerConnected(ac_j) && !IsPlayerNPC(ac_j)) | |
| 3544 | #else | |
| 3545 | if(ac_j != playerid && IsPlayerConnected(ac_j)) | |
| 3546 | #endif | |
| 3547 | #endif | |
| 3548 | {
| |
| 3549 | if(!strcmp(ACInfo[playerid][acIp], ACInfo[ac_j][acIp], false)) | |
| 3550 | {
| |
| 3551 | ac_i--; | |
| 3552 | if(ac_i < 1) | |
| 3553 | {
| |
| 3554 | #if defined DEBUG | |
| 3555 | printf(DEBUG_CODE_3, playerid, AC_MAX_CONNECTS_FROM_IP); | |
| 3556 | #endif | |
| 3557 | ac_KickWithCode(playerid, "", 0, 40); | |
| 3558 | break; | |
| 3559 | } | |
| 3560 | } | |
| 3561 | } | |
| 3562 | } | |
| 3563 | } | |
| 3564 | ACInfo[playerid][acSpec] = | |
| 3565 | ACInfo[playerid][acForceClass] = | |
| 3566 | ACInfo[playerid][acDeathRes] = false; | |
| 3567 | ACInfo[playerid][acClassRes] = | |
| 3568 | ACInfo[playerid][acDead] = true; | |
| 3569 | ACInfo[playerid][acIntEnterExits] = ac_IntEnterExits; | |
| 3570 | ACInfo[playerid][acStuntBonus] = ac_StuntBonus; | |
| 3571 | ACInfo[playerid][acCheatCount][0] = | |
| 3572 | ACInfo[playerid][acHoldWeapon] = | |
| 3573 | ACInfo[playerid][acLastWeapon] = | |
| 3574 | ACInfo[playerid][acSpawnRes] = | |
| 3575 | ACInfo[playerid][acMoney] = | |
| 3576 | ACInfo[playerid][acAnim] = | |
| 3577 | ACInfo[playerid][acInt] = 0; | |
| 3578 | ACInfo[playerid][acSet][11] = | |
| 3579 | ACInfo[playerid][acSet][10] = | |
| 3580 | ACInfo[playerid][acSet][0] = | |
| 3581 | ACInfo[playerid][acNextDialog] = | |
| 3582 | ACInfo[playerid][acDialog] = -1; | |
| 3583 | ACInfo[playerid][acDropJpX] = | |
| 3584 | ACInfo[playerid][acDropJpY] = | |
| 3585 | ACInfo[playerid][acDropJpZ] = 25000.0; | |
| 3586 | for(ac_i = 12; ac_i >= 0; --ac_i) | |
| 3587 | {
| |
| 3588 | ACInfo[playerid][acSetWeapon][ac_i] = -1; | |
| 3589 | ACInfo[playerid][acGiveAmmo][ac_i] = -65535; | |
| 3590 | } | |
| 3591 | for(ac_i = sizeof(ac_Mtfc) - 1; ac_i >= 0; --ac_i) ACInfo[playerid][acFloodCount][ac_i] = 0; | |
| 3592 | memcpy(ACInfo[playerid][acNOPAllow], ac_NOPAllow, 0, sizeof(ac_NOPAllow) * 4, sizeof ac_NOPAllow); | |
| 3593 | memcpy(ACInfo[playerid][acACAllow], ac_ACAllow, 0, sizeof(ac_ACAllow) * 4, sizeof ac_ACAllow); | |
| 3594 | if(ACInfo[playerid][acKicked] < 1) | |
| 3595 | {
| |
| 3596 | ACInfo[playerid][acTimerTick] = GetTickCount(); | |
| 3597 | ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
| |
| 3598 | } | |
| 3599 | #if AC_USE_NPC | |
| 3600 | } | |
| 3601 | #endif | |
| 3602 | ACInfo[playerid][acOnline] = true; | |
| 3603 | #if defined ac_OnPlayerConnect | |
| 3604 | return ac_OnPlayerConnect(playerid); | |
| 3605 | #else | |
| 3606 | return 1; | |
| 3607 | #endif | |
| 3608 | } | |
| 3609 | ||
| 3610 | #if defined _ALS_OnPlayerConnect | |
| 3611 | #undef OnPlayerConnect | |
| 3612 | #else | |
| 3613 | #define _ALS_OnPlayerConnect | |
| 3614 | #endif | |
| 3615 | #define OnPlayerConnect ac_OnPlayerConnect | |
| 3616 | #if defined ac_OnPlayerConnect | |
| 3617 | forward ac_OnPlayerConnect(playerid); | |
| 3618 | #endif | |
| 3619 | ||
| 3620 | public OnPlayerDisconnect(playerid, reason) | |
| 3621 | {
| |
| 3622 | #if AC_USE_NPC | |
| 3623 | if(!IsPlayerNPC(playerid)) | |
| 3624 | {
| |
| 3625 | #endif | |
| 3626 | KillTimer(ACInfo[playerid][acTimerID]); | |
| 3627 | #if defined BlockIpAddress && AC_MAX_CONNECTS_FROM_IP < 2 | |
| 3628 | if(ACInfo[playerid][acACAllow][37]) | |
| 3629 | {
| |
| 3630 | #if defined GetConsoleVarAsInt | |
| 3631 | BlockIpAddress(ACInfo[playerid][acIp], (AC_MIN_TIME_RECONNECT * 1000) - (reason > 0 ? 0 : GetConsoleVarAsInt("playertimeout")));
| |
| 3632 | #else | |
| 3633 | BlockIpAddress(ACInfo[playerid][acIp], (AC_MIN_TIME_RECONNECT * 1000) - (reason > 0 ? 0 : GetServerVarAsInt("playertimeout")));
| |
| 3634 | #endif | |
| 3635 | } | |
| 3636 | #endif | |
| 3637 | #undef AC_MAX_CONNECTS_FROM_IP | |
| 3638 | #undef AC_MIN_TIME_RECONNECT | |
| 3639 | #if AC_USE_NPC | |
| 3640 | } | |
| 3641 | #endif | |
| 3642 | KillTimer(ACInfo[playerid][acKickTimerID]); | |
| 3643 | new ac_vehid = ACInfo[playerid][acKickVeh]; | |
| 3644 | if(ac_vehid > 0) | |
| 3645 | {
| |
| 3646 | if(ACVehInfo[ac_vehid][acDriver] == playerid) ACVehInfo[ac_vehid][acDriver] = INVALID_PLAYER_ID; | |
| 3647 | if(ACInfo[playerid][acKicked] == 2) | |
| 3648 | {
| |
| 3649 | LinkVehicleToInterior(ac_vehid, ACVehInfo[ac_vehid][acInt]); | |
| 3650 | SetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]); | |
| 3651 | SetVehiclePos(ac_vehid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]); | |
| 3652 | SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]); | |
| 3653 | ChangeVehiclePaintjob(ac_vehid, ACVehInfo[ac_vehid][acPaintJob]); | |
| 3654 | } | |
| 3655 | } | |
| 3656 | if((ac_vehid = ACInfo[playerid][acVeh]) > 0) | |
| 3657 | {
| |
| 3658 | if(ACVehInfo[ac_vehid][acDriver] == playerid) ACVehInfo[ac_vehid][acDriver] = INVALID_PLAYER_ID; | |
| 3659 | if(ACInfo[playerid][acKicked] == 2) | |
| 3660 | {
| |
| 3661 | LinkVehicleToInterior(ac_vehid, ACVehInfo[ac_vehid][acInt]); | |
| 3662 | SetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]); | |
| 3663 | SetVehiclePos(ac_vehid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]); | |
| 3664 | SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]); | |
| 3665 | ChangeVehiclePaintjob(ac_vehid, ACVehInfo[ac_vehid][acPaintJob]); | |
| 3666 | } | |
| 3667 | } | |
| 3668 | ACInfo[playerid][acOnline] = false; | |
| 3669 | if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acKicked] = 3; | |
| 3670 | #if defined ac_OnPlayerDisconnect | |
| 3671 | return ac_OnPlayerDisconnect(playerid, reason); | |
| 3672 | #else | |
| 3673 | return 1; | |
| 3674 | #endif | |
| 3675 | } | |
| 3676 | ||
| 3677 | #if defined _ALS_OnPlayerDisconnect | |
| 3678 | #undef OnPlayerDisconnect | |
| 3679 | #else | |
| 3680 | #define _ALS_OnPlayerDisconnect | |
| 3681 | #endif | |
| 3682 | #define OnPlayerDisconnect ac_OnPlayerDisconnect | |
| 3683 | #if defined ac_OnPlayerDisconnect | |
| 3684 | forward ac_OnPlayerDisconnect(playerid, reason); | |
| 3685 | #endif | |
| 3686 | ||
| 3687 | public OnPlayerSpawn(playerid) | |
| 3688 | {
| |
| 3689 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 3690 | new ac_i, bool:ac_ur; | |
| 3691 | #if AC_USE_NPC | |
| 3692 | if(!IsPlayerNPC(playerid)) | |
| 3693 | {
| |
| 3694 | #endif | |
| 3695 | new ac_gtc = GetTickCount(); | |
| 3696 | if(ACInfo[playerid][acSpec] && ACInfo[playerid][acSet][6] < 2) | |
| 3697 | {
| |
| 3698 | ACInfo[playerid][acSet][3] = | |
| 3699 | ACInfo[playerid][acSet][7] = | |
| 3700 | ACInfo[playerid][acSet][8] = -1; | |
| 3701 | ACInfo[playerid][acSpec] = false; | |
| 3702 | } | |
| 3703 | else | |
| 3704 | {
| |
| 3705 | if(ACInfo[playerid][acACAllow][27] && | |
| 3706 | (ACInfo[playerid][acSpawnRes] < 1 || ac_gtc - ACInfo[playerid][acSpawnTick] < 1000)) | |
| 3707 | {
| |
| 3708 | #if defined DEBUG | |
| 3709 | printf("[Nex-AC debug] Spawn res: %d, respawn time: %d",
| |
| 3710 | ACInfo[playerid][acSpawnRes], ac_gtc - ACInfo[playerid][acSpawnTick]); | |
| 3711 | #endif | |
| 3712 | ac_KickWithCode(playerid, "", 0, 27); | |
| 3713 | #if defined OnCheatDetected | |
| 3714 | ACInfo[playerid][acSpawnRes] = 1; | |
| 3715 | #endif | |
| 3716 | } | |
| 3717 | if(ACInfo[playerid][acSpawnRes] > 0) ACInfo[playerid][acSpawnRes]--; | |
| 3718 | if(!(1 <= ACInfo[playerid][acSet][6] <= 2)) | |
| 3719 | {
| |
| 3720 | for(ac_i = 11; ac_i >= 0; --ac_i) ACInfo[playerid][acSet][ac_i] = -1; | |
| 3721 | ac_ur = true; | |
| 3722 | } | |
| 3723 | } | |
| 3724 | if(!(1 <= ACInfo[playerid][acSet][6] <= 2)) | |
| 3725 | {
| |
| 3726 | for(ac_i = 12; ac_i >= 0; --ac_i) | |
| 3727 | {
| |
| 3728 | ACInfo[playerid][acSetWeapon][ac_i] = -1; | |
| 3729 | ACInfo[playerid][acGiveAmmo][ac_i] = -65535; | |
| 3730 | } | |
| 3731 | ACInfo[playerid][acNextSpecAct] = -1; | |
| 3732 | ACInfo[playerid][acUnFrozen] = true; | |
| 3733 | #if defined FreezeSyncPacket | |
| 3734 | FreezeSyncPacket(playerid, E_ALL_SYNC, false); | |
| 3735 | #endif | |
| 3736 | } | |
| 3737 | for(ac_i = 12; ac_i >= 0; --ac_i) | |
| 3738 | {
| |
| 3739 | ACInfo[playerid][acWeapon][ac_i] = | |
| 3740 | ACInfo[playerid][acAmmo][ac_i] = 0; | |
| 3741 | } | |
| 3742 | ACInfo[playerid][acModShop] = | |
| 3743 | ACInfo[playerid][acForceClass] = | |
| 3744 | ACInfo[playerid][acClassRes] = | |
| 3745 | ACInfo[playerid][acDmgRes] = | |
| 3746 | ACInfo[playerid][acDead] = false; | |
| 3747 | ACInfo[playerid][acLastPickup] = | |
| 3748 | ACInfo[playerid][acEnterSeat] = | |
| 3749 | ACInfo[playerid][acSet][6] = | |
| 3750 | ACInfo[playerid][acSeat] = -1; | |
| 3751 | ACInfo[playerid][acCheatCount][5] = | |
| 3752 | ACInfo[playerid][acCheatCount][6] = | |
| 3753 | ACInfo[playerid][acCheatCount][7] = | |
| 3754 | ACInfo[playerid][acCheatCount][8] = | |
| 3755 | ACInfo[playerid][acCheatCount][9] = | |
| 3756 | ACInfo[playerid][acCheatCount][11] = | |
| 3757 | ACInfo[playerid][acCheatCount][12] = | |
| 3758 | ACInfo[playerid][acCheatCount][14] = | |
| 3759 | ACInfo[playerid][acCheatCount][16] = | |
| 3760 | ACInfo[playerid][acCheatCount][18] = | |
| 3761 | ACInfo[playerid][acLastSpecAct] = | |
| 3762 | ACInfo[playerid][acHoldWeapon] = | |
| 3763 | ACInfo[playerid][acLastWeapon] = | |
| 3764 | ACInfo[playerid][acParachute] = | |
| 3765 | ACInfo[playerid][acEnterVeh] = | |
| 3766 | ACInfo[playerid][acShotWeapon] = | |
| 3767 | ACInfo[playerid][acKickVeh] = | |
| 3768 | ACInfo[playerid][acSpecAct] = | |
| 3769 | ACInfo[playerid][acIntRet] = | |
| 3770 | ACInfo[playerid][acSpeed] = | |
| 3771 | ACInfo[playerid][acVeh] = 0; | |
| 3772 | ACInfo[playerid][acSetPosTick] = ac_gtc + 2650; | |
| 3773 | ACInfo[playerid][acGtc][6] = ac_gtc + 1650; | |
| 3774 | if(ac_IsValidWeapon(ACInfo[playerid][acSpawnWeapon1])) | |
| 3775 | {
| |
| 3776 | ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon1]]; | |
| 3777 | ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon1]; | |
| 3778 | ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo1]; | |
| 3779 | } | |
| 3780 | if(ac_IsValidWeapon(ACInfo[playerid][acSpawnWeapon2])) | |
| 3781 | {
| |
| 3782 | ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon2]]; | |
| 3783 | ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon2]; | |
| 3784 | ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo2]; | |
| 3785 | } | |
| 3786 | if(ac_IsValidWeapon(ACInfo[playerid][acSpawnWeapon3])) | |
| 3787 | {
| |
| 3788 | ac_i = ac_wSlot[ACInfo[playerid][acSpawnWeapon3]]; | |
| 3789 | ACInfo[playerid][acWeapon][ac_i] = ACInfo[playerid][acSpawnWeapon3]; | |
| 3790 | ACInfo[playerid][acAmmo][ac_i] = ACInfo[playerid][acSpawnAmmo3]; | |
| 3791 | } | |
| 3792 | #if AC_USE_NPC | |
| 3793 | } | |
| 3794 | #endif | |
| 3795 | #if defined ac_OnPlayerSpawn | |
| 3796 | ac_i = ac_OnPlayerSpawn(playerid); | |
| 3797 | #endif | |
| 3798 | if(ac_ur) | |
| 3799 | {
| |
| 3800 | if(ACInfo[playerid][acSet][0] == -1) SetPlayerInterior(playerid, 0); | |
| 3801 | if(ACInfo[playerid][acSet][1] == -1) SetPlayerHealth(playerid, 100.0); | |
| 3802 | if(ACInfo[playerid][acSet][2] == -1) SetPlayerArmour(playerid, 0.0); | |
| 3803 | } | |
| 3804 | #if defined ac_OnPlayerSpawn | |
| 3805 | return ac_i; | |
| 3806 | #else | |
| 3807 | return 1; | |
| 3808 | #endif | |
| 3809 | } | |
| 3810 | ||
| 3811 | #if defined _ALS_OnPlayerSpawn | |
| 3812 | #undef OnPlayerSpawn | |
| 3813 | #else | |
| 3814 | #define _ALS_OnPlayerSpawn | |
| 3815 | #endif | |
| 3816 | #define OnPlayerSpawn ac_OnPlayerSpawn | |
| 3817 | #if defined ac_OnPlayerSpawn | |
| 3818 | forward ac_OnPlayerSpawn(playerid); | |
| 3819 | #endif | |
| 3820 | ||
| 3821 | public OnPlayerDeath(playerid, killerid, reason) | |
| 3822 | {
| |
| 3823 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 3824 | if(ACInfo[playerid][acACAllow][28] && | |
| 3825 | (ACInfo[playerid][acDead] || !ACInfo[playerid][acDeathRes] && | |
| 3826 | (reason != WEAPON_COLLISION && reason != 255 || killerid != INVALID_PLAYER_ID))) | |
| 3827 | {
| |
| 3828 | #if defined DEBUG | |
| 3829 | printf("[Nex-AC debug] Is dead: %d, death res: %d, killerid: %d, reason: %d",
| |
| 3830 | ACInfo[playerid][acDead], ACInfo[playerid][acDeathRes], killerid, reason); | |
| 3831 | #endif | |
| 3832 | ac_KickWithCode(playerid, "", 0, 28); | |
| 3833 | } | |
| 3834 | ACInfo[playerid][acDead] = true; | |
| 3835 | ACInfo[playerid][acDeathRes] = false; | |
| 3836 | if(ACInfo[playerid][acSpawnRes] < 1) ACInfo[playerid][acSpawnTick] = GetTickCount(); | |
| 3837 | ACInfo[playerid][acSpawnRes] = 1; | |
| 3838 | #if defined ac_OnPlayerDeath | |
| 3839 | return ac_OnPlayerDeath(playerid, killerid, reason); | |
| 3840 | #else | |
| 3841 | return 1; | |
| 3842 | #endif | |
| 3843 | } | |
| 3844 | ||
| 3845 | #if defined _ALS_OnPlayerDeath | |
| 3846 | #undef OnPlayerDeath | |
| 3847 | #else | |
| 3848 | #define _ALS_OnPlayerDeath | |
| 3849 | #endif | |
| 3850 | #define OnPlayerDeath ac_OnPlayerDeath | |
| 3851 | #if defined ac_OnPlayerDeath | |
| 3852 | forward ac_OnPlayerDeath(playerid, killerid, reason); | |
| 3853 | #endif | |
| 3854 | ||
| 3855 | #if defined OnPlayerWeaponShot | |
| 3856 | public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) | |
| 3857 | #else | |
| 3858 | public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid) | |
| 3859 | #endif | |
| 3860 | {
| |
| 3861 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 3862 | #if defined OnPlayerWeaponShot | |
| 3863 | if(ACInfo[playerid][acACAllow][47] && | |
| 3864 | (amount < 0.0 || issuerid != INVALID_PLAYER_ID && !(0 <= issuerid < MAX_PLAYERS) || !(3 <= bodypart <= 9) || !ac_IsValidDamageReason(weaponid))) | |
| 3865 | {
| |
| 3866 | #if defined DEBUG | |
| 3867 | printf("[Nex-AC debug] Issuerid: %d, amount: %f, weaponid: %d, bodypart: %d", issuerid, amount, weaponid, bodypart);
| |
| 3868 | #endif | |
| 3869 | ac_KickWithCode(playerid, "", 0, 47, 4); | |
| 3870 | return 1; | |
| 3871 | } | |
| 3872 | #else | |
| 3873 | if(ACInfo[playerid][acACAllow][47] && | |
| 3874 | (amount < 0.0 || issuerid != INVALID_PLAYER_ID && !(0 <= issuerid < MAX_PLAYERS) || !ac_IsValidDamageReason(weaponid))) | |
| 3875 | {
| |
| 3876 | #if defined DEBUG | |
| 3877 | printf("[Nex-AC debug] Issuerid: %d, amount: %f, weaponid: %d", issuerid, amount, weaponid);
| |
| 3878 | #endif | |
| 3879 | ac_KickWithCode(playerid, "", 0, 47, 4); | |
| 3880 | return 1; | |
| 3881 | } | |
| 3882 | #endif | |
| 3883 | #if defined IsPlayerDying | |
| 3884 | if(!IsPlayerDying(playerid)) ACInfo[playerid][acDeathRes] = true; | |
| 3885 | #else | |
| 3886 | if(!ACInfo[playerid][acDead]) ACInfo[playerid][acDeathRes] = true; | |
| 3887 | #endif | |
| 3888 | #if defined ac_OnPlayerTakeDamage | |
| 3889 | #if defined OnPlayerWeaponShot | |
| 3890 | return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid, bodypart); | |
| 3891 | #else | |
| 3892 | return ac_OnPlayerTakeDamage(playerid, issuerid, amount, weaponid); | |
| 3893 | #endif | |
| 3894 | #else | |
| 3895 | return 0; | |
| 3896 | #endif | |
| 3897 | } | |
| 3898 | ||
| 3899 | #if defined _ALS_OnPlayerTakeDamage | |
| 3900 | #undef OnPlayerTakeDamage | |
| 3901 | #else | |
| 3902 | #define _ALS_OnPlayerTakeDamage | |
| 3903 | #endif | |
| 3904 | #define OnPlayerTakeDamage ac_OnPlayerTakeDamage | |
| 3905 | #if defined ac_OnPlayerTakeDamage | |
| 3906 | #if defined OnPlayerWeaponShot | |
| 3907 | forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart); | |
| 3908 | #else | |
| 3909 | forward ac_OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid); | |
| 3910 | #endif | |
| 3911 | #endif | |
| 3912 | ||
| 3913 | #if defined OnPlayerWeaponShot | |
| 3914 | public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart) | |
| 3915 | #else | |
| 3916 | public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid) | |
| 3917 | #endif | |
| 3918 | {
| |
| 3919 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 3920 | #if defined OnPlayerWeaponShot | |
| 3921 | if(ACInfo[playerid][acACAllow][47]) | |
| 3922 | {
| |
| 3923 | if(amount < 0.0 || !(0 <= damagedid < MAX_PLAYERS) || !(3 <= bodypart <= 9) || !ac_IsValidWeapon(weaponid)) | |
| 3924 | {
| |
| 3925 | #if defined DEBUG | |
| 3926 | printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d, bodypart: %d",
| |
| 3927 | damagedid, amount, weaponid, bodypart); | |
| 3928 | #endif | |
| 3929 | ac_KickWithCode(playerid, "", 0, 47, 3); | |
| 3930 | return 1; | |
| 3931 | } | |
| 3932 | new ac_s = ac_wSlot[weaponid]; | |
| 3933 | #if defined IsPlayerDying | |
| 3934 | if(!IsPlayerDying(playerid)) | |
| 3935 | #else | |
| 3936 | if(!ACInfo[playerid][acDead]) | |
| 3937 | #endif | |
| 3938 | {
| |
| 3939 | if(ACInfo[playerid][acWeapon][ac_s] != weaponid && | |
| 3940 | ACInfo[playerid][acSetWeapon][ac_s] != weaponid && weaponid != WEAPON_FLAMETHROWER && | |
| 3941 | GetTickCount() - ACInfo[playerid][acGtc][6] > GetPlayerPing(playerid)) | |
| 3942 | {
| |
| 3943 | #if defined DEBUG | |
| 3944 | printf("[Nex-AC debug] Damagedid: %d, amount: %f, AC weapon: %d, weaponid: %d, bodypart: %d",
| |
| 3945 | damagedid, amount, ACInfo[playerid][acWeapon][ac_s], weaponid, bodypart); | |
| 3946 | #endif | |
| 3947 | ac_KickWithCode(playerid, "", 0, 47, 5); | |
| 3948 | return 1; | |
| 3949 | } | |
| 3950 | } | |
| 3951 | } | |
| 3952 | #else | |
| 3953 | if(ACInfo[playerid][acACAllow][47]) | |
| 3954 | {
| |
| 3955 | if(amount < 0.0 || !(0 <= damagedid < MAX_PLAYERS) || !ac_IsValidWeapon(weaponid)) | |
| 3956 | {
| |
| 3957 | #if defined DEBUG | |
| 3958 | printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d", damagedid, amount, weaponid);
| |
| 3959 | #endif | |
| 3960 | ac_KickWithCode(playerid, "", 0, 47, 3); | |
| 3961 | return 1; | |
| 3962 | } | |
| 3963 | new ac_s = ac_wSlot[weaponid]; | |
| 3964 | #if defined IsPlayerDying | |
| 3965 | if(!IsPlayerDying(playerid)) | |
| 3966 | #else | |
| 3967 | if(!ACInfo[playerid][acDead]) | |
| 3968 | #endif | |
| 3969 | {
| |
| 3970 | if(ACInfo[playerid][acWeapon][ac_s] != weaponid && | |
| 3971 | ACInfo[playerid][acSetWeapon][ac_s] != weaponid && weaponid != WEAPON_FLAMETHROWER && | |
| 3972 | GetTickCount() - ACInfo[playerid][acGtc][6] > GetPlayerPing(playerid)) | |
| 3973 | {
| |
| 3974 | #if defined DEBUG | |
| 3975 | printf("[Nex-AC debug] Damagedid: %d, amount: %f, AC weapon: %d, weaponid: %d",
| |
| 3976 | damagedid, amount, ACInfo[playerid][acWeapon][ac_s], weaponid); | |
| 3977 | #endif | |
| 3978 | ac_KickWithCode(playerid, "", 0, 47, 5); | |
| 3979 | return 1; | |
| 3980 | } | |
| 3981 | } | |
| 3982 | } | |
| 3983 | #endif | |
| 3984 | #if defined ac_OnPlayerGiveDamage | |
| 3985 | #if defined OnPlayerWeaponShot | |
| 3986 | return ac_OnPlayerGiveDamage(playerid, damagedid, amount, weaponid, bodypart); | |
| 3987 | #else | |
| 3988 | return ac_OnPlayerGiveDamage(playerid, damagedid, amount, weaponid); | |
| 3989 | #endif | |
| 3990 | #else | |
| 3991 | return 0; | |
| 3992 | #endif | |
| 3993 | } | |
| 3994 | ||
| 3995 | #if defined _ALS_OnPlayerGiveDamage | |
| 3996 | #undef OnPlayerGiveDamage | |
| 3997 | #else | |
| 3998 | #define _ALS_OnPlayerGiveDamage | |
| 3999 | #endif | |
| 4000 | #define OnPlayerGiveDamage ac_OnPlayerGiveDamage | |
| 4001 | #if defined ac_OnPlayerGiveDamage | |
| 4002 | #if defined OnPlayerWeaponShot | |
| 4003 | forward ac_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart); | |
| 4004 | #else | |
| 4005 | forward ac_OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid); | |
| 4006 | #endif | |
| 4007 | #endif | |
| 4008 | ||
| 4009 | #endif | |
| 4010 | ||
| 4011 | #if defined FILTERSCRIPT | |
| 4012 | ||
| 4013 | public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) | |
| 4014 | {
| |
| 4015 | if(dialogid != AntiCheatGetDialog(playerid)) | |
| 4016 | {
| |
| 4017 | new ac_nd = fs_AntiCheatGetNextDialog(playerid); | |
| 4018 | if(dialogid == ac_nd) fs_AntiCheatSetDialog(playerid, ac_nd); | |
| 4019 | } | |
| 4020 | fs_AntiCheatSetNextDialog(playerid, -1); | |
| 4021 | #if defined ac_fs_OnDialogResponse | |
| 4022 | return ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext); | |
| 4023 | #else | |
| 4024 | return 0; | |
| 4025 | #endif | |
| 4026 | } | |
| 4027 | ||
| 4028 | #if defined _ALS_OnDialogResponse | |
| 4029 | #undef OnDialogResponse | |
| 4030 | #else | |
| 4031 | #define _ALS_OnDialogResponse | |
| 4032 | #endif | |
| 4033 | #define OnDialogResponse ac_fs_OnDialogResponse | |
| 4034 | #if defined ac_fs_OnDialogResponse | |
| 4035 | forward ac_fs_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]); | |
| 4036 | #endif | |
| 4037 | ||
| 4038 | #else | |
| 4039 | ||
| 4040 | public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) | |
| 4041 | {
| |
| 4042 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 4043 | new ac_i = GetTickCount(); | |
| 4044 | if(ACInfo[playerid][acACAllow][49]) | |
| 4045 | {
| |
| 4046 | if(ac_i - ACInfo[playerid][acCall][0] < ac_Mtfc[0][0]) ac_FloodDetect(playerid, 0); | |
| 4047 | else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 4048 | else ACInfo[playerid][acFloodCount][0] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 4049 | } | |
| 4050 | if(ACInfo[playerid][acACAllow][39] && (dialogid != ACInfo[playerid][acDialog] || listitem < -1)) | |
| 4051 | {
| |
| 4052 | #if defined DEBUG | |
| 4053 | printf("[Nex-AC debug] AC dialog: %d, dialogid: %d, listitem: %d, playerid: %d",
| |
| 4054 | ACInfo[playerid][acDialog], dialogid, listitem, playerid); | |
| 4055 | #endif | |
| 4056 | ac_KickWithCode(playerid, "", 0, 39); | |
| 4057 | return 1; | |
| 4058 | } | |
| 4059 | ACInfo[playerid][acDialog] = -1; | |
| 4060 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][0] = ac_i; | |
| 4061 | if(ACInfo[playerid][acACAllow][45]) | |
| 4062 | {
| |
| 4063 | for(ac_i = strlen(inputtext) - 1; ac_i >= 0; --ac_i) | |
| 4064 | {
| |
| 4065 | if(inputtext[ac_i] == '%') strdel(inputtext, ac_i, ac_i + 1); | |
| 4066 | } | |
| 4067 | } | |
| 4068 | #if defined ac_OnDialogResponse | |
| 4069 | return ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext); | |
| 4070 | #else | |
| 4071 | return 0; | |
| 4072 | #endif | |
| 4073 | } | |
| 4074 | ||
| 4075 | #if defined _ALS_OnDialogResponse | |
| 4076 | #undef OnDialogResponse | |
| 4077 | #else | |
| 4078 | #define _ALS_OnDialogResponse | |
| 4079 | #endif | |
| 4080 | #define OnDialogResponse ac_OnDialogResponse | |
| 4081 | #if defined ac_OnDialogResponse | |
| 4082 | forward ac_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]); | |
| 4083 | #endif | |
| 4084 | ||
| 4085 | public OnEnterExitModShop(playerid, enterexit, interiorid) | |
| 4086 | {
| |
| 4087 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4088 | #if !AC_USE_TUNING_GARAGES | |
| 4089 | if(ACInfo[playerid][acACAllow][23]) ac_KickWithCode(playerid, "", 0, 23, 1); | |
| 4090 | #else | |
| 4091 | if(ACInfo[playerid][acACAllow][23] && | |
| 4092 | (!(0 <= enterexit <= 1) || !(0 <= interiorid <= 3))) ac_KickWithCode(playerid, "", 0, 23, 1); | |
| 4093 | #endif | |
| 4094 | new ac_i = GetTickCount(); | |
| 4095 | if(ACInfo[playerid][acACAllow][49]) | |
| 4096 | {
| |
| 4097 | if(ac_i - ACInfo[playerid][acCall][1] < ac_Mtfc[1][0]) ac_FloodDetect(playerid, 1); | |
| 4098 | else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 4099 | else ACInfo[playerid][acFloodCount][1] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 4100 | } | |
| 4101 | ACInfo[playerid][acModShop] = (enterexit != 0); | |
| 4102 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][1] = ac_i; | |
| 4103 | ACInfo[playerid][acSetPosTick] = ACInfo[playerid][acGtc][18] = ac_i + 3850; | |
| 4104 | new ac_vehid = ACInfo[playerid][acVeh]; | |
| 4105 | if(ACInfo[playerid][acKicked] < 1) | |
| 4106 | {
| |
| 4107 | ac_i = interiorid % 256; | |
| 4108 | ACVehInfo[ac_vehid][acInt] = ac_i; | |
| 4109 | #if defined foreach | |
| 4110 | foreach(new ac_j : Player) | |
| 4111 | {
| |
| 4112 | if(ACInfo[ac_j][acVeh] == ac_vehid) ACInfo[ac_j][acInt] = ac_i; | |
| 4113 | } | |
| 4114 | #else | |
| 4115 | #if defined GetPlayerPoolSize | |
| 4116 | for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j) | |
| 4117 | #else | |
| 4118 | for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j) | |
| 4119 | #endif | |
| 4120 | {
| |
| 4121 | if(IsPlayerInVehicle(ac_j, ac_vehid)) ACInfo[ac_j][acInt] = ac_i; | |
| 4122 | } | |
| 4123 | #endif | |
| 4124 | } | |
| 4125 | else | |
| 4126 | {
| |
| 4127 | #if defined foreach | |
| 4128 | foreach(new ac_j : Player) | |
| 4129 | {
| |
| 4130 | if(ACInfo[ac_j][acVeh] == ac_vehid) | |
| 4131 | {
| |
| 4132 | if(ACInfo[ac_j][acUnFrozen]) ACInfo[ac_j][acIntRet] = 2; | |
| 4133 | else ACInfo[ac_j][acIntRet] = 1; | |
| 4134 | } | |
| 4135 | } | |
| 4136 | #else | |
| 4137 | #if defined GetPlayerPoolSize | |
| 4138 | for(new ac_j = GetPlayerPoolSize(); ac_j >= 0; --ac_j) | |
| 4139 | #else | |
| 4140 | for(new ac_j = MAX_PLAYERS - 1; ac_j >= 0; --ac_j) | |
| 4141 | #endif | |
| 4142 | {
| |
| 4143 | if(IsPlayerInVehicle(ac_j, ac_vehid)) | |
| 4144 | {
| |
| 4145 | if(ACInfo[ac_j][acUnFrozen]) ACInfo[ac_j][acIntRet] = 2; | |
| 4146 | else ACInfo[ac_j][acIntRet] = 1; | |
| 4147 | } | |
| 4148 | } | |
| 4149 | #endif | |
| 4150 | } | |
| 4151 | #if defined ac_OnEnterExitModShop | |
| 4152 | return ac_OnEnterExitModShop(playerid, enterexit, interiorid); | |
| 4153 | #else | |
| 4154 | return 1; | |
| 4155 | #endif | |
| 4156 | } | |
| 4157 | ||
| 4158 | #if defined _ALS_OnEnterExitModShop | |
| 4159 | #undef OnEnterExitModShop | |
| 4160 | #else | |
| 4161 | #define _ALS_OnEnterExitModShop | |
| 4162 | #endif | |
| 4163 | #define OnEnterExitModShop ac_OnEnterExitModShop | |
| 4164 | #if defined ac_OnEnterExitModShop | |
| 4165 | forward ac_OnEnterExitModShop(playerid, enterexit, interiorid); | |
| 4166 | #endif | |
| 4167 | ||
| 4168 | public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) | |
| 4169 | {
| |
| 4170 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4171 | if(ACInfo[playerid][acIntRet] > 0) | |
| 4172 | {
| |
| 4173 | SetPlayerInterior(playerid, ACInfo[playerid][acInt]); | |
| 4174 | if(ACInfo[playerid][acIntRet] == 2) TogglePlayerControllable(playerid, 1); | |
| 4175 | ACInfo[playerid][acIntRet] = 0; | |
| 4176 | } | |
| 4177 | else if(newinteriorid != ACInfo[playerid][acSet][0]) | |
| 4178 | {
| |
| 4179 | if(ACInfo[playerid][acSet][0] == -1) | |
| 4180 | {
| |
| 4181 | if(ACInfo[playerid][acVeh] > 0) | |
| 4182 | {
| |
| 4183 | if(ACInfo[playerid][acACAllow][3] && newinteriorid != ACInfo[playerid][acInt]) | |
| 4184 | {
| |
| 4185 | #if defined DEBUG | |
| 4186 | printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d, veh: %d",
| |
| 4187 | ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid, ACInfo[playerid][acVeh]); | |
| 4188 | #endif | |
| 4189 | ac_KickWithCode(playerid, "", 0, 3, 1); | |
| 4190 | } | |
| 4191 | } | |
| 4192 | else if(ACInfo[playerid][acIntEnterExits]) ACInfo[playerid][acSetPosTick] = GetTickCount() + 3850; | |
| 4193 | else if(ACInfo[playerid][acACAllow][2] && newinteriorid != ACInfo[playerid][acInt]) | |
| 4194 | {
| |
| 4195 | #if defined DEBUG | |
| 4196 | printf("[Nex-AC debug] AC interior: %d, acInt (last): %d, newinteriorid: %d, oldinteriorid: %d",
| |
| 4197 | ACInfo[playerid][acSet][0], ACInfo[playerid][acInt], newinteriorid, oldinteriorid); | |
| 4198 | #endif | |
| 4199 | ac_KickWithCode(playerid, "", 0, 2, 1); | |
| 4200 | } | |
| 4201 | } | |
| 4202 | } | |
| 4203 | else ACInfo[playerid][acSet][0] = -1; | |
| 4204 | if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acInt] = newinteriorid % 256; | |
| 4205 | #if defined ac_OnPlayerInteriorChange | |
| 4206 | return ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid); | |
| 4207 | #else | |
| 4208 | return 1; | |
| 4209 | #endif | |
| 4210 | } | |
| 4211 | ||
| 4212 | #if defined _ALS_OnPlayerInteriorChange | |
| 4213 | #undef OnPlayerInteriorChange | |
| 4214 | #else | |
| 4215 | #define _ALS_OnPlayerInteriorChange | |
| 4216 | #endif | |
| 4217 | #define OnPlayerInteriorChange ac_OnPlayerInteriorChange | |
| 4218 | #if defined ac_OnPlayerInteriorChange | |
| 4219 | forward ac_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid); | |
| 4220 | #endif | |
| 4221 | ||
| 4222 | public OnRconLoginAttempt(ip[], password[], success) | |
| 4223 | {
| |
| 4224 | static ac_ipTables[MAX_PLAYERS][2], ac_ipIndex; | |
| 4225 | new ac_i, ac_currentIp = ac_IpToInt(ip); | |
| 4226 | for(; ac_i < sizeof ac_ipTables; ++ac_i) | |
| 4227 | {
| |
| 4228 | if(ac_ipTables[ac_i][0] == ac_currentIp) | |
| 4229 | {
| |
| 4230 | if(success) ac_ipTables[ac_i][1] = 0; | |
| 4231 | else if(ac_ACAllow[42]) | |
| 4232 | {
| |
| 4233 | if(++ac_ipTables[ac_i][1] > AC_MAX_RCON_LOGIN_ATTEMPT) | |
| 4234 | {
| |
| 4235 | #if defined DEBUG | |
| 4236 | printf(DEBUG_CODE_4, ip, password); | |
| 4237 | #endif | |
| 4238 | ac_ipTables[ac_i][1] = 0; | |
| 4239 | ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 1); | |
| 4240 | } | |
| 4241 | #if defined OnCheatWarning | |
| 4242 | else OnCheatWarning(INVALID_PLAYER_ID, ip, 1, 42, 1, ac_ipTables[ac_i][1]); | |
| 4243 | #endif | |
| 4244 | } | |
| 4245 | ac_i = -1; | |
| 4246 | break; | |
| 4247 | } | |
| 4248 | } | |
| 4249 | if(ac_i != -1 && !success) | |
| 4250 | {
| |
| 4251 | ac_ipTables[ac_ipIndex][0] = ac_currentIp; | |
| 4252 | if(ac_ACAllow[42]) | |
| 4253 | {
| |
| 4254 | if(++ac_ipTables[ac_ipIndex][1] > AC_MAX_RCON_LOGIN_ATTEMPT) | |
| 4255 | {
| |
| 4256 | #undef AC_MAX_RCON_LOGIN_ATTEMPT | |
| 4257 | #if defined DEBUG | |
| 4258 | printf(DEBUG_CODE_4, ip, password, ac_ipTables[ac_ipIndex][1]); | |
| 4259 | #endif | |
| 4260 | ac_ipTables[ac_ipIndex][1] = 0; | |
| 4261 | ac_KickWithCode(INVALID_PLAYER_ID, ip, 1, 42, 2); | |
| 4262 | } | |
| 4263 | #if defined OnCheatWarning | |
| 4264 | else OnCheatWarning(INVALID_PLAYER_ID, ip, 1, 42, 2, ac_ipTables[ac_ipIndex][1]); | |
| 4265 | #endif | |
| 4266 | } | |
| 4267 | if(++ac_ipIndex >= sizeof ac_ipTables) ac_ipIndex = 0; | |
| 4268 | ac_ipTables[ac_ipIndex][1] = 0; | |
| 4269 | } | |
| 4270 | #if defined ac_OnRconLoginAttempt | |
| 4271 | return ac_OnRconLoginAttempt(ip, password, success); | |
| 4272 | #else | |
| 4273 | return 1; | |
| 4274 | #endif | |
| 4275 | } | |
| 4276 | ||
| 4277 | #if defined _ALS_OnRconLoginAttempt | |
| 4278 | #undef OnRconLoginAttempt | |
| 4279 | #else | |
| 4280 | #define _ALS_OnRconLoginAttempt | |
| 4281 | #endif | |
| 4282 | #define OnRconLoginAttempt ac_OnRconLoginAttempt | |
| 4283 | #if defined ac_OnRconLoginAttempt | |
| 4284 | forward ac_OnRconLoginAttempt(ip[], password[], success); | |
| 4285 | #endif | |
| 4286 | ||
| 4287 | public OnPlayerUpdate(playerid) | |
| 4288 | {
| |
| 4289 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4290 | new ac_gtc = GetTickCount(), ac_gpp; | |
| 4291 | #if AC_USE_NPC | |
| 4292 | if(!IsPlayerNPC(playerid)) | |
| 4293 | {
| |
| 4294 | #endif | |
| 4295 | new ac_w, ac_sa = GetPlayerState(playerid); | |
| 4296 | #if defined GetPlayerSyncWeapon | |
| 4297 | if(ac_sa != PLAYER_STATE_SPECTATING && (ac_w = GetPlayerSyncWeapon(playerid)) != -1) | |
| 4298 | #else | |
| 4299 | if(ac_sa != PLAYER_STATE_SPECTATING && (ac_w = GetPlayerWeapon(playerid)) != -1) | |
| 4300 | #endif | |
| 4301 | {
| |
| 4302 | ac_gpp = GetPlayerPing(playerid); | |
| 4303 | new ac_a = GetPlayerAmmo(playerid), ac_s = ac_wSlot[ac_w]; | |
| 4304 | if(ACInfo[playerid][acSetWeapon][ac_s] > 0) | |
| 4305 | {
| |
| 4306 | if(ACInfo[playerid][acSetWeapon][ac_s] == ac_w) | |
| 4307 | {
| |
| 4308 | ACInfo[playerid][acSetWeapon][ac_s] = -1; | |
| 4309 | ACInfo[playerid][acWeapon][ac_s] = ac_w; | |
| 4310 | } | |
| 4311 | #if defined GetPlayerSyncWeapon | |
| 4312 | else if(ac_gtc - ACInfo[playerid][acGtcSetWeapon][ac_s] > ac_gpp) | |
| 4313 | #else | |
| 4314 | else if(!(PLAYER_STATE_DRIVER <= ac_sa <= PLAYER_STATE_PASSENGER) && | |
| 4315 | ac_gtc - ACInfo[playerid][acGtcSetWeapon][ac_s] > ac_gpp) | |
| 4316 | #endif | |
| 4317 | {
| |
| 4318 | #if defined FreezeSyncPacket | |
| 4319 | if(!ACInfo[playerid][acACAllow][33] || ACInfo[playerid][acUnFrozen]) | |
| 4320 | {
| |
| 4321 | #endif | |
| 4322 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][0]) | |
| 4323 | {
| |
| 4324 | if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS) | |
| 4325 | {
| |
| 4326 | #if defined DEBUG | |
| 4327 | printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon"); | |
| 4328 | printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSetWeapon][ac_s], ac_w);
| |
| 4329 | #endif | |
| 4330 | #if defined OnCheatDetected | |
| 4331 | ac_KickWithCode(playerid, "", 0, 52, 1); | |
| 4332 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4333 | ACInfo[playerid][acSetWeapon][ac_s] = -1; | |
| 4334 | #else | |
| 4335 | return ac_KickWithCode(playerid, "", 0, 52, 1); | |
| 4336 | #endif | |
| 4337 | } | |
| 4338 | #if defined OnNOPWarning | |
| 4339 | else OnNOPWarning(playerid, 1, ACInfo[playerid][acNOPCount][0]); | |
| 4340 | #endif | |
| 4341 | } | |
| 4342 | else if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSetWeapon][ac_s] = -1; | |
| 4343 | #if defined FreezeSyncPacket | |
| 4344 | } | |
| 4345 | #endif | |
| 4346 | } | |
| 4347 | } | |
| 4348 | if(ACInfo[playerid][acGiveAmmo][ac_s] != -65535) | |
| 4349 | {
| |
| 4350 | if(ACInfo[playerid][acGiveAmmo][ac_s] == ac_a || | |
| 4351 | ACInfo[playerid][acGiveAmmo][ac_s] > ac_a && !(ac_a < 0 <= ACInfo[playerid][acGiveAmmo][ac_s]) && | |
| 4352 | ac_gtc - ACInfo[playerid][acGtcGiveAmmo][ac_s] > ac_gpp) | |
| 4353 | {
| |
| 4354 | ACInfo[playerid][acGiveAmmo][ac_s] = -65535; | |
| 4355 | ACInfo[playerid][acAmmo][ac_s] = ac_a; | |
| 4356 | } | |
| 4357 | else if(ac_gtc - ACInfo[playerid][acGtcGiveAmmo][ac_s] > ac_gpp) | |
| 4358 | {
| |
| 4359 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][1]) | |
| 4360 | {
| |
| 4361 | if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS) | |
| 4362 | {
| |
| 4363 | #if defined DEBUG | |
| 4364 | printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo"); | |
| 4365 | printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
| |
| 4366 | ACInfo[playerid][acGiveAmmo][ac_s], ac_a, ac_w); | |
| 4367 | #endif | |
| 4368 | #if defined OnCheatDetected | |
| 4369 | ac_KickWithCode(playerid, "", 0, 52, 2); | |
| 4370 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4371 | ACInfo[playerid][acGiveAmmo][ac_s] = -65535; | |
| 4372 | #else | |
| 4373 | return ac_KickWithCode(playerid, "", 0, 52, 2); | |
| 4374 | #endif | |
| 4375 | } | |
| 4376 | #if defined OnNOPWarning | |
| 4377 | else OnNOPWarning(playerid, 2, ACInfo[playerid][acNOPCount][1]); | |
| 4378 | #endif | |
| 4379 | } | |
| 4380 | else if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acGiveAmmo][ac_s] = -65535; | |
| 4381 | } | |
| 4382 | } | |
| 4383 | #if AC_USE_AMMUNATIONS || AC_USE_TUNING_GARAGES | |
| 4384 | new ac_money = orig_GetPlayerMoney(playerid); | |
| 4385 | #endif | |
| 4386 | #if AC_USE_AMMUNATIONS | |
| 4387 | if(ACInfo[playerid][acSet][10] != -1) | |
| 4388 | {
| |
| 4389 | if(ac_money < ACInfo[playerid][acMoney] && | |
| 4390 | ACInfo[playerid][acMoney] - ac_money >= ACInfo[playerid][acSet][10]) ACInfo[playerid][acSet][10] = -1; | |
| 4391 | else if(ac_gtc - ACInfo[playerid][acGtc][16] > ac_gpp) | |
| 4392 | {
| |
| 4393 | if(ACInfo[playerid][acACAllow][15]) | |
| 4394 | {
| |
| 4395 | if(++ACInfo[playerid][acCheatCount][20] > AC_MAX_NOP_WARNINGS) | |
| 4396 | {
| |
| 4397 | #if defined DEBUG | |
| 4398 | printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
| |
| 4399 | ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]); | |
| 4400 | #endif | |
| 4401 | #if defined OnCheatDetected | |
| 4402 | ac_KickWithCode(playerid, "", 0, 15, 3); | |
| 4403 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4404 | ACInfo[playerid][acSet][10] = -1; | |
| 4405 | #else | |
| 4406 | return ac_KickWithCode(playerid, "", 0, 15, 3); | |
| 4407 | #endif | |
| 4408 | } | |
| 4409 | #if defined OnCheatWarning | |
| 4410 | else OnCheatWarning(playerid, "", 0, 15, 3, ACInfo[playerid][acCheatCount][20]); | |
| 4411 | #endif | |
| 4412 | } | |
| 4413 | else if(++ACInfo[playerid][acCheatCount][20] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][10] = -1; | |
| 4414 | } | |
| 4415 | } | |
| 4416 | #endif | |
| 4417 | new ac_i = GetPlayerInterior(playerid), Float:ac_pX, Float:ac_pY, Float:ac_pZ, Float:ac_tmp; | |
| 4418 | GetPlayerPos(playerid, ac_pX, ac_pY, ac_pZ); | |
| 4419 | if(ACInfo[playerid][acHoldWeapon] != ac_w) | |
| 4420 | {
| |
| 4421 | if(ACInfo[playerid][acWeapon][ac_s] != ac_w && ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp) | |
| 4422 | {
| |
| 4423 | #if AC_USE_PICKUP_WEAPONS | |
| 4424 | #if defined Streamer_GetDistanceToItem\ | |
| 4425 | && defined Streamer_GetIntData | |
| 4426 | if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS) Streamer_GetDistanceToItem(ac_pX, ac_pY, ac_pZ, STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_tmp); | |
| 4427 | if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w && | |
| 4428 | ac_a <= (3 <= ac_s <= 5 ? (ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) && | |
| 4429 | IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX], | |
| 4430 | ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) || | |
| 4431 | ACInfo[playerid][acLastPickup] > MAX_PICKUPS && | |
| 4432 | Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) == ac_w + 100 && | |
| 4433 | ac_a <= (3 <= ac_s <= 5 ? (ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) && ac_tmp <= 15.0) | |
| 4434 | #else | |
| 4435 | if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w && | |
| 4436 | ac_a <= (3 <= ac_s <= 5 ? (ACInfo[playerid][acAmmo][ac_s] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) && | |
| 4437 | IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX], | |
| 4438 | ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ])) | |
| 4439 | #endif | |
| 4440 | {
| |
| 4441 | ACInfo[playerid][acWeapon][ac_s] = ac_w; | |
| 4442 | ACInfo[playerid][acAmmo][ac_s] = ac_a; | |
| 4443 | } | |
| 4444 | - | if(ac_w == 40 || ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute] > 0) |
| 4444 | + | |
| 4445 | {
| |
| 4446 | #endif | |
| 4447 | #if AC_USE_AMMUNATIONS | |
| 4448 | - | ACInfo[playerid][acParachute] = 0; |
| 4448 | + | |
| 4449 | {
| |
| 4450 | ACInfo[playerid][acCheatCount][20] = 0; | |
| 4451 | if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0]; | |
| 4452 | else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0]; | |
| 4453 | if(3 <= ac_s <= 5) ACInfo[playerid][acAmmo][ac_s] += ac_AmmuNationInfo[ac_w - 22][1]; | |
| 4454 | else ACInfo[playerid][acAmmo][ac_s] = ac_AmmuNationInfo[ac_w - 22][1]; | |
| 4455 | ACInfo[playerid][acWeapon][ac_s] = ac_w; | |
| 4456 | ACInfo[playerid][acGtc][16] = ac_gtc + 2850; | |
| 4457 | } | |
| 4458 | else | |
| 4459 | {
| |
| 4460 | #endif | |
| 4461 | if(ac_w == WEAPON_BOMB || ac_w == WEAPON_PARACHUTE && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute] > 0) | |
| 4462 | {
| |
| 4463 | if(ac_w == WEAPON_PARACHUTE) ACInfo[playerid][acParachute] = 0; | |
| 4464 | ACInfo[playerid][acWeapon][ac_s] = ac_w; | |
| 4465 | ACInfo[playerid][acAmmo][ac_s] = ac_a; | |
| 4466 | } | |
| 4467 | else if(ACInfo[playerid][acACAllow][15] && ACInfo[playerid][acSetWeapon][ac_s] == -1) | |
| 4468 | {
| |
| 4469 | #if defined DEBUG | |
| 4470 | printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
| |
| 4471 | ACInfo[playerid][acWeapon][ac_s], ACInfo[playerid][acAmmo][ac_s], ac_w, ac_a); | |
| 4472 | #endif | |
| 4473 | #if defined OnCheatDetected | |
| 4474 | ac_KickWithCode(playerid, "", 0, 15, 1); | |
| 4475 | - | 7 <= ac_s <= 9 && ac_w != 38 && ACInfo[playerid][acGiveAmmo][ac_s] == -65535 && |
| 4475 | + | |
| 4476 | ACInfo[playerid][acWeapon][ac_s] = ac_w; | |
| 4477 | ACInfo[playerid][acAmmo][ac_s] = ac_a; | |
| 4478 | #else | |
| 4479 | return ac_KickWithCode(playerid, "", 0, 15, 1); | |
| 4480 | - | 7 <= ac_s <= 9 && ac_w != 38 && ACInfo[playerid][acGiveAmmo][ac_s] == -65535 && |
| 4480 | + | |
| 4481 | } | |
| 4482 | #if AC_USE_AMMUNATIONS | |
| 4483 | } | |
| 4484 | #endif | |
| 4485 | #if AC_USE_PICKUP_WEAPONS | |
| 4486 | } | |
| 4487 | #endif | |
| 4488 | } | |
| 4489 | } | |
| 4490 | #if defined GetPlayerSyncWeapon | |
| 4491 | else if(ACInfo[playerid][acAmmo][ac_s] != ac_a && | |
| 4492 | 7 <= ac_s <= 9 && ac_w != WEAPON_MINIGUN && ACInfo[playerid][acGiveAmmo][ac_s] == -65535 && | |
| 4493 | ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp) | |
| 4494 | #else | |
| 4495 | else if(ACInfo[playerid][acAmmo][ac_s] != ac_a && | |
| 4496 | !(PLAYER_STATE_DRIVER <= ac_sa <= PLAYER_STATE_PASSENGER) && | |
| 4497 | 7 <= ac_s <= 9 && ac_w != WEAPON_MINIGUN && ACInfo[playerid][acGiveAmmo][ac_s] == -65535 && | |
| 4498 | ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp) | |
| 4499 | #endif | |
| 4500 | {
| |
| 4501 | if(ACInfo[playerid][acACAllow][16] && | |
| 4502 | (ACInfo[playerid][acAmmo][ac_s] == 0 || ac_a > ACInfo[playerid][acAmmo][ac_s] || | |
| 4503 | ac_a < 0 < ACInfo[playerid][acAmmo][ac_s])) | |
| 4504 | {
| |
| 4505 | #if defined DEBUG | |
| 4506 | printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
| |
| 4507 | ACInfo[playerid][acAmmo][ac_s], ac_a, ac_w); | |
| 4508 | #endif | |
| 4509 | #if defined OnCheatDetected | |
| 4510 | ac_KickWithCode(playerid, "", 0, 16, 1); | |
| 4511 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4512 | #else | |
| 4513 | return ac_KickWithCode(playerid, "", 0, 16, 1); | |
| 4514 | #endif | |
| 4515 | } | |
| 4516 | ACInfo[playerid][acAmmo][ac_s] = ac_a; | |
| 4517 | } | |
| 4518 | GetPlayerHealth(playerid, ac_tmp); | |
| 4519 | new ac_health = floatround(ac_tmp, floatround_tozero); | |
| 4520 | if(ACInfo[playerid][acSet][1] != -1) | |
| 4521 | {
| |
| 4522 | if(ACInfo[playerid][acSet][1] > 255) | |
| 4523 | {
| |
| 4524 | ac_health += 256 * (((ACInfo[playerid][acSet][1] - (ACInfo[playerid][acSet][1] % 256)) / 256) - 1); | |
| 4525 | if(ACInfo[playerid][acSet][1] - ac_health > 255) ac_health += 256; | |
| 4526 | } | |
| 4527 | if(ACInfo[playerid][acSet][1] == ac_health || ACInfo[playerid][acDmgRes] || | |
| 4528 | ACInfo[playerid][acSet][1] > ac_health && ac_gtc - ACInfo[playerid][acGtc][2] > ac_gpp) | |
| 4529 | {
| |
| 4530 | ACInfo[playerid][acSet][1] = -1; | |
| 4531 | ACInfo[playerid][acCheatCount][9] = 0; | |
| 4532 | ACInfo[playerid][acDmgRes] = false; | |
| 4533 | #if defined FreezeSyncPacket | |
| 4534 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 4535 | #endif | |
| 4536 | } | |
| 4537 | else if(ac_gtc - ACInfo[playerid][acGtc][2] > ac_gpp) | |
| 4538 | {
| |
| 4539 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][3]) | |
| 4540 | {
| |
| 4541 | if(++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS) | |
| 4542 | {
| |
| 4543 | #if defined DEBUG | |
| 4544 | printf(DEBUG_CODE_5, playerid, "SetPlayerHealth"); | |
| 4545 | printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acSet][1], ac_health);
| |
| 4546 | #endif | |
| 4547 | #if defined OnCheatDetected | |
| 4548 | ac_KickWithCode(playerid, "", 0, 52, 3); | |
| 4549 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4550 | #if defined FreezeSyncPacket | |
| 4551 | else if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 4552 | #endif | |
| 4553 | ACInfo[playerid][acSet][1] = -1; | |
| 4554 | #else | |
| 4555 | return ac_KickWithCode(playerid, "", 0, 52, 3); | |
| 4556 | #endif | |
| 4557 | } | |
| 4558 | #if defined OnNOPWarning | |
| 4559 | else OnNOPWarning(playerid, 3, ACInfo[playerid][acNOPCount][3]); | |
| 4560 | #endif | |
| 4561 | } | |
| 4562 | else if(++ACInfo[playerid][acNOPCount][3] > AC_MAX_NOP_WARNINGS) | |
| 4563 | {
| |
| 4564 | ACInfo[playerid][acSet][1] = -1; | |
| 4565 | #if defined FreezeSyncPacket | |
| 4566 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 4567 | #endif | |
| 4568 | } | |
| 4569 | } | |
| 4570 | } | |
| 4571 | else if(ACInfo[playerid][acACAllow][12]) | |
| 4572 | {
| |
| 4573 | if(ACInfo[playerid][acHealth] > 255) | |
| 4574 | {
| |
| 4575 | ac_health += 256 * (((ACInfo[playerid][acHealth] - (ACInfo[playerid][acHealth] % 256)) / 256) - 1); | |
| 4576 | if(ACInfo[playerid][acHealth] - ac_health > 255) ac_health += 256; | |
| 4577 | } | |
| 4578 | if(ac_health > ACInfo[playerid][acHealth]) | |
| 4579 | {
| |
| 4580 | #if AC_USE_RESTAURANTS | |
| 4581 | if(ac_health - ACInfo[playerid][acHealth] > 70 || !ac_InRestaurant(playerid, ac_i)) | |
| 4582 | {
| |
| 4583 | #endif | |
| 4584 | #if AC_USE_VENDING_MACHINES | |
| 4585 | if(ac_health - ACInfo[playerid][acHealth] > 35 || !ac_NearVendingMachine(playerid, ac_i)) | |
| 4586 | {
| |
| 4587 | #endif | |
| 4588 | #if defined DEBUG | |
| 4589 | printf("[Nex-AC debug] AC health: %d, health: %d", ACInfo[playerid][acHealth], ac_health);
| |
| 4590 | #endif | |
| 4591 | #if defined OnCheatDetected | |
| 4592 | ac_KickWithCode(playerid, "", 0, 12); | |
| 4593 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4594 | #else | |
| 4595 | return ac_KickWithCode(playerid, "", 0, 12); | |
| 4596 | #endif | |
| 4597 | #if AC_USE_VENDING_MACHINES | |
| 4598 | } | |
| 4599 | #endif | |
| 4600 | #if AC_USE_RESTAURANTS | |
| 4601 | } | |
| 4602 | #endif | |
| 4603 | } | |
| 4604 | } | |
| 4605 | GetPlayerArmour(playerid, ac_tmp); | |
| 4606 | new ac_armour = floatround(ac_tmp, floatround_tozero); | |
| 4607 | if(ACInfo[playerid][acSet][2] != -1) | |
| 4608 | {
| |
| 4609 | if(ACInfo[playerid][acSet][2] > 255) | |
| 4610 | {
| |
| 4611 | ac_armour += 256 * (((ACInfo[playerid][acSet][2] - (ACInfo[playerid][acSet][2] % 256)) / 256) - 1); | |
| 4612 | if(ACInfo[playerid][acSet][2] - ac_armour > 255) ac_armour += 256; | |
| 4613 | } | |
| 4614 | if(ACInfo[playerid][acSet][2] == ac_armour || ACInfo[playerid][acDmgRes] || | |
| 4615 | ACInfo[playerid][acSet][2] > ac_armour && ac_gtc - ACInfo[playerid][acGtc][4] > ac_gpp) | |
| 4616 | {
| |
| 4617 | ACInfo[playerid][acSet][2] = -1; | |
| 4618 | ACInfo[playerid][acCheatCount][9] = 0; | |
| 4619 | ACInfo[playerid][acDmgRes] = false; | |
| 4620 | #if defined FreezeSyncPacket | |
| 4621 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 4622 | #endif | |
| 4623 | } | |
| 4624 | else if(ac_gtc - ACInfo[playerid][acGtc][4] > ac_gpp) | |
| 4625 | {
| |
| 4626 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][5]) | |
| 4627 | {
| |
| 4628 | if(++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS) | |
| 4629 | {
| |
| 4630 | #if defined DEBUG | |
| 4631 | printf(DEBUG_CODE_5, playerid, "SetPlayerArmour"); | |
| 4632 | printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acSet][2], ac_armour);
| |
| 4633 | #endif | |
| 4634 | #if defined OnCheatDetected | |
| 4635 | ac_KickWithCode(playerid, "", 0, 52, 4); | |
| 4636 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4637 | #if defined FreezeSyncPacket | |
| 4638 | else if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 4639 | #endif | |
| 4640 | ACInfo[playerid][acSet][2] = -1; | |
| 4641 | #else | |
| 4642 | return ac_KickWithCode(playerid, "", 0, 52, 4); | |
| 4643 | #endif | |
| 4644 | } | |
| 4645 | #if defined OnNOPWarning | |
| 4646 | else OnNOPWarning(playerid, 4, ACInfo[playerid][acNOPCount][5]); | |
| 4647 | #endif | |
| 4648 | } | |
| 4649 | else if(++ACInfo[playerid][acNOPCount][5] > AC_MAX_NOP_WARNINGS) | |
| 4650 | {
| |
| 4651 | ACInfo[playerid][acSet][2] = -1; | |
| 4652 | #if defined FreezeSyncPacket | |
| 4653 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 4654 | #endif | |
| 4655 | } | |
| 4656 | } | |
| 4657 | } | |
| 4658 | else if(ACInfo[playerid][acACAllow][13]) | |
| 4659 | {
| |
| 4660 | if(ACInfo[playerid][acArmour] > 255) | |
| 4661 | {
| |
| 4662 | ac_armour += 256 * (((ACInfo[playerid][acArmour] - (ACInfo[playerid][acArmour] % 256)) / 256) - 1); | |
| 4663 | if(ACInfo[playerid][acArmour] - ac_armour > 255) ac_armour += 256; | |
| 4664 | } | |
| 4665 | if(ac_armour > ACInfo[playerid][acArmour]) | |
| 4666 | {
| |
| 4667 | #if AC_USE_AMMUNATIONS | |
| 4668 | if(ac_armour == 100 && ac_InAmmuNation(playerid, ac_i)) | |
| 4669 | {
| |
| 4670 | ACInfo[playerid][acCheatCount][20] = 0; | |
| 4671 | if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += 200; | |
| 4672 | else ACInfo[playerid][acSet][10] = 200; | |
| 4673 | ACInfo[playerid][acGtc][16] = ac_gtc + 2850; | |
| 4674 | } | |
| 4675 | else | |
| 4676 | {
| |
| 4677 | #endif | |
| 4678 | #if defined DEBUG | |
| 4679 | printf("[Nex-AC debug] AC armour: %d, armour: %d", ACInfo[playerid][acArmour], ac_armour);
| |
| 4680 | #endif | |
| 4681 | #if defined OnCheatDetected | |
| 4682 | ac_KickWithCode(playerid, "", 0, 13); | |
| 4683 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4684 | #else | |
| 4685 | return ac_KickWithCode(playerid, "", 0, 13); | |
| 4686 | #endif | |
| 4687 | #if AC_USE_AMMUNATIONS | |
| 4688 | } | |
| 4689 | #endif | |
| 4690 | } | |
| 4691 | } | |
| 4692 | if(ac_health < ACInfo[playerid][acHealth] || ac_armour < ACInfo[playerid][acArmour]) | |
| 4693 | {
| |
| 4694 | ACInfo[playerid][acDmgRes] = ACInfo[playerid][acVehDmgRes] = false; | |
| 4695 | ACInfo[playerid][acCheatCount][9] = 0; | |
| 4696 | } | |
| 4697 | else if(ACInfo[playerid][acACAllow][19] && | |
| 4698 | ACInfo[playerid][acDmgRes] && ac_gtc - ACInfo[playerid][acGtc][13] > ac_gpp) | |
| 4699 | {
| |
| 4700 | ACInfo[playerid][acDmgRes] = ACInfo[playerid][acVehDmgRes] = false; | |
| 4701 | if(++ACInfo[playerid][acCheatCount][9] > AC_MAX_GODMODE_WARNINGS) | |
| 4702 | {
| |
| 4703 | #undef AC_MAX_GODMODE_WARNINGS | |
| 4704 | #if defined DEBUG | |
| 4705 | printf("[Nex-AC debug] AC health: %d, health: %d, AC armour: %d, armour: %d",
| |
| 4706 | ACInfo[playerid][acHealth], ac_health, ACInfo[playerid][acArmour], ac_armour); | |
| 4707 | #endif | |
| 4708 | #if defined OnCheatDetected | |
| 4709 | ac_KickWithCode(playerid, "", 0, 19); | |
| 4710 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4711 | ACInfo[playerid][acCheatCount][9] = 0; | |
| 4712 | #else | |
| 4713 | return ac_KickWithCode(playerid, "", 0, 19); | |
| 4714 | #endif | |
| 4715 | } | |
| 4716 | #if defined OnCheatWarning | |
| 4717 | else OnCheatWarning(playerid, "", 0, 19, 0, ACInfo[playerid][acCheatCount][9]); | |
| 4718 | #endif | |
| 4719 | } | |
| 4720 | #if AC_USE_TUNING_GARAGES | |
| 4721 | if(ACInfo[playerid][acSet][11] != -1) | |
| 4722 | {
| |
| 4723 | if(ac_money < ACInfo[playerid][acMoney] && | |
| 4724 | ACInfo[playerid][acMoney] - ac_money >= ACInfo[playerid][acSet][11]) ACInfo[playerid][acSet][11] = -1; | |
| 4725 | else if(ac_gtc - ACInfo[playerid][acGtc][17] > ac_gpp) | |
| 4726 | {
| |
| 4727 | if(ACInfo[playerid][acACAllow][23]) | |
| 4728 | {
| |
| 4729 | if(++ACInfo[playerid][acCheatCount][21] > AC_MAX_NOP_WARNINGS) | |
| 4730 | {
| |
| 4731 | #if defined DEBUG | |
| 4732 | printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
| |
| 4733 | ac_money, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][11]); | |
| 4734 | #endif | |
| 4735 | #if defined OnCheatDetected | |
| 4736 | ac_KickWithCode(playerid, "", 0, 23, 3); | |
| 4737 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4738 | ACInfo[playerid][acSet][11] = -1; | |
| 4739 | #else | |
| 4740 | return ac_KickWithCode(playerid, "", 0, 23, 3); | |
| 4741 | #endif | |
| 4742 | } | |
| 4743 | #if defined OnCheatWarning | |
| 4744 | else OnCheatWarning(playerid, "", 0, 23, 3, ACInfo[playerid][acCheatCount][21]); | |
| 4745 | #endif | |
| 4746 | } | |
| 4747 | else if(++ACInfo[playerid][acCheatCount][21] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][11] = -1; | |
| 4748 | } | |
| 4749 | } | |
| 4750 | #endif | |
| 4751 | if(ACInfo[playerid][acSet][0] != -1 && ac_gtc - ACInfo[playerid][acGtc][0] > ac_gpp) | |
| 4752 | {
| |
| 4753 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][2] && ac_i != ACInfo[playerid][acSet][0]) | |
| 4754 | {
| |
| 4755 | if(++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS) | |
| 4756 | {
| |
| 4757 | #if defined DEBUG | |
| 4758 | printf(DEBUG_CODE_5, playerid, "SetPlayerInterior"); | |
| 4759 | printf("[Nex-AC debug] AC interior: %d, interiorid: %d", ACInfo[playerid][acSet][0], ac_i);
| |
| 4760 | #endif | |
| 4761 | #if defined OnCheatDetected | |
| 4762 | ac_KickWithCode(playerid, "", 0, 52, 5); | |
| 4763 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4764 | ACInfo[playerid][acSet][0] = -1; | |
| 4765 | #else | |
| 4766 | return ac_KickWithCode(playerid, "", 0, 52, 5); | |
| 4767 | #endif | |
| 4768 | } | |
| 4769 | #if defined OnNOPWarning | |
| 4770 | else OnNOPWarning(playerid, 5, ACInfo[playerid][acNOPCount][2]); | |
| 4771 | #endif | |
| 4772 | } | |
| 4773 | else if(++ACInfo[playerid][acNOPCount][2] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][0] = -1; | |
| 4774 | } | |
| 4775 | if(ACInfo[playerid][acSet][5] != -1 && ac_gtc - ACInfo[playerid][acGtc][11] > ac_gpp) | |
| 4776 | {
| |
| 4777 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][8]) | |
| 4778 | {
| |
| 4779 | if(++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS) | |
| 4780 | {
| |
| 4781 | #if defined DEBUG | |
| 4782 | printf(DEBUG_CODE_5, playerid, "TogglePlayerSpectating"); | |
| 4783 | #endif | |
| 4784 | #if defined OnCheatDetected | |
| 4785 | ac_KickWithCode(playerid, "", 0, 52, 6); | |
| 4786 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4787 | ACInfo[playerid][acSet][5] = -1; | |
| 4788 | #else | |
| 4789 | return ac_KickWithCode(playerid, "", 0, 52, 6); | |
| 4790 | #endif | |
| 4791 | } | |
| 4792 | #if defined OnNOPWarning | |
| 4793 | else OnNOPWarning(playerid, 6, ACInfo[playerid][acNOPCount][8]); | |
| 4794 | #endif | |
| 4795 | } | |
| 4796 | else if(++ACInfo[playerid][acNOPCount][8] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][5] = -1; | |
| 4797 | } | |
| 4798 | if(ACInfo[playerid][acSet][6] != -1 && ac_gtc - ACInfo[playerid][acGtc][12] > ac_gpp) | |
| 4799 | {
| |
| 4800 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][9]) | |
| 4801 | {
| |
| 4802 | if(++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS) | |
| 4803 | {
| |
| 4804 | #if defined DEBUG | |
| 4805 | printf(DEBUG_CODE_5, playerid, "SpawnPlayer"); | |
| 4806 | printf("[Nex-AC debug] acSet[6]: %d", ACInfo[playerid][acSet][6]);
| |
| 4807 | #endif | |
| 4808 | #if defined OnCheatDetected | |
| 4809 | ac_KickWithCode(playerid, "", 0, 52, 7); | |
| 4810 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4811 | ACInfo[playerid][acSet][6] = -1; | |
| 4812 | #else | |
| 4813 | return ac_KickWithCode(playerid, "", 0, 52, 7); | |
| 4814 | #endif | |
| 4815 | } | |
| 4816 | #if defined OnNOPWarning | |
| 4817 | else OnNOPWarning(playerid, 7, ACInfo[playerid][acNOPCount][9]); | |
| 4818 | #endif | |
| 4819 | } | |
| 4820 | else if(++ACInfo[playerid][acNOPCount][9] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][6] = -1; | |
| 4821 | } | |
| 4822 | new ac_vehid = GetPlayerVehicleID(playerid); | |
| 4823 | if(ACInfo[playerid][acSet][9] != -1 && ac_vehid > 0 && ac_gtc - ACInfo[playerid][acGtc][7] > ac_gpp) | |
| 4824 | {
| |
| 4825 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][11]) | |
| 4826 | {
| |
| 4827 | new Float:ac_vX, Float:ac_vY, Float:ac_vZ; | |
| 4828 | GetVehicleVelocity(ac_vehid, ac_vX, ac_vY, ac_vZ); | |
| 4829 | if(ac_GetSpeed(ac_vX, ac_vY, ac_vZ) <= 30) | |
| 4830 | {
| |
| 4831 | #if defined DEBUG | |
| 4832 | printf(DEBUG_CODE_5, playerid, "RemovePlayerFromVehicle"); | |
| 4833 | printf("[Nex-AC debug] Veh model: %d, veh: %d", GetVehicleModel(ac_vehid), ac_vehid);
| |
| 4834 | #endif | |
| 4835 | #if defined OnCheatDetected | |
| 4836 | ac_KickWithCode(playerid, "", 0, 52, 8); | |
| 4837 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4838 | ACInfo[playerid][acSet][9] = -1; | |
| 4839 | #else | |
| 4840 | return ac_KickWithCode(playerid, "", 0, 52, 8); | |
| 4841 | #endif | |
| 4842 | } | |
| 4843 | } | |
| 4844 | else ACInfo[playerid][acSet][9] = -1; | |
| 4845 | } | |
| 4846 | ac_s = GetPlayerVehicleSeat(playerid); | |
| 4847 | if(ACInfo[playerid][acSet][8] != -1) | |
| 4848 | {
| |
| 4849 | if(ACInfo[playerid][acSet][8] == ac_vehid && | |
| 4850 | (ACInfo[playerid][acSet][4] == ac_s || ACInfo[playerid][acSet][4] == -1)) | |
| 4851 | {
| |
| 4852 | if(ACInfo[playerid][acVeh] > 0) | |
| 4853 | {
| |
| 4854 | new ac_t = ACInfo[playerid][acVeh]; | |
| 4855 | if(ACVehInfo[ac_t][acDriver] == playerid) ACVehInfo[ac_t][acDriver] = INVALID_PLAYER_ID; | |
| 4856 | if(ac_IsAnAircraftEx(GetVehicleModel(ac_t))) ACInfo[playerid][acParachute] = 2; | |
| 4857 | } | |
| 4858 | if(ac_s == 0) | |
| 4859 | {
| |
| 4860 | ACVehInfo[ac_vehid][acDriver] = playerid; | |
| 4861 | GetVehicleZAngle(ac_vehid, ACVehInfo[ac_vehid][acZAngle]); | |
| 4862 | ACInfo[playerid][acGtc][8] = ac_gtc + 1650; | |
| 4863 | ACInfo[playerid][acSetVehHealth] = -1.0; | |
| 4864 | ACInfo[playerid][acLastPosX] = ac_pX; | |
| 4865 | ACInfo[playerid][acLastPosY] = ac_pY; | |
| 4866 | } | |
| 4867 | ACInfo[playerid][acEnterVeh] = | |
| 4868 | ACInfo[playerid][acCheatCount][10] = 0; | |
| 4869 | ACInfo[playerid][acVehDmgRes] = false; | |
| 4870 | ACInfo[playerid][acEnterSeat] = | |
| 4871 | ACInfo[playerid][acSet][9] = | |
| 4872 | ACInfo[playerid][acSet][8] = | |
| 4873 | ACInfo[playerid][acSet][7] = -1; | |
| 4874 | ACInfo[playerid][acSeat] = ac_s; | |
| 4875 | } | |
| 4876 | else if(ac_gtc - ACInfo[playerid][acGtc][1] > ac_gpp) | |
| 4877 | {
| |
| 4878 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][7] && | |
| 4879 | ACInfo[playerid][acSet][4] != -1 && ACVehInfo[ACInfo[playerid][acSet][8]][acSpawned] && | |
| 4880 | IsVehicleStreamedIn(ACInfo[playerid][acSet][8], playerid)) | |
| 4881 | {
| |
| 4882 | if(++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS) | |
| 4883 | {
| |
| 4884 | #if defined DEBUG | |
| 4885 | printf(DEBUG_CODE_5, playerid, "PutPlayerInVehicle"); | |
| 4886 | printf("[Nex-AC debug] AC veh: %d, veh: %d, AC seat: %d, seatid: %d",
| |
| 4887 | ACInfo[playerid][acSet][8], ac_vehid, ACInfo[playerid][acSet][4], ac_s); | |
| 4888 | #endif | |
| 4889 | #if defined OnCheatDetected | |
| 4890 | ac_KickWithCode(playerid, "", 0, 52, 9); | |
| 4891 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4892 | ACInfo[playerid][acSet][8] = -1; | |
| 4893 | #else | |
| 4894 | return ac_KickWithCode(playerid, "", 0, 52, 9); | |
| 4895 | #endif | |
| 4896 | } | |
| 4897 | #if defined OnNOPWarning | |
| 4898 | else OnNOPWarning(playerid, 9, ACInfo[playerid][acNOPCount][7]); | |
| 4899 | - | ACInfo[playerid][acPosX] = ac_pX; |
| 4899 | + | |
| 4900 | - | ACInfo[playerid][acPosY] = ac_pY; |
| 4900 | + | |
| 4901 | else if(++ACInfo[playerid][acNOPCount][7] > AC_MAX_NOP_WARNINGS) ACInfo[playerid][acSet][8] = -1; | |
| 4902 | } | |
| 4903 | } | |
| 4904 | else | |
| 4905 | {
| |
| 4906 | new Float:ac_dist_set = 25000.0; | |
| 4907 | if(ACInfo[playerid][acSet][7] != -1) | |
| 4908 | {
| |
| 4909 | ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ac_pZ : ACInfo[playerid][acSetPosZ])); | |
| 4910 | if(ac_dist_set < 15.0) | |
| 4911 | {
| |
| 4912 | ACInfo[playerid][acSet][7] = -1; | |
| 4913 | ACInfo[playerid][acGtc][10] = 0; | |
| 4914 | ACInfo[playerid][acPosX] = ACInfo[playerid][acLastPosX] = ac_pX; | |
| 4915 | ACInfo[playerid][acPosY] = ACInfo[playerid][acLastPosY] = ac_pY; | |
| 4916 | ACInfo[playerid][acPosZ] = ac_pZ; | |
| 4917 | #if defined FreezeSyncPacket | |
| 4918 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 4919 | #endif | |
| 4920 | } | |
| 4921 | else if(ac_gtc - ACInfo[playerid][acGtc][10] > ac_gpp) | |
| 4922 | {
| |
| 4923 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][10]) | |
| 4924 | {
| |
| 4925 | if(++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS) | |
| 4926 | {
| |
| 4927 | #if defined DEBUG | |
| 4928 | printf(DEBUG_CODE_5, playerid, "SetPlayerPos"); | |
| 4929 | printf("[Nex-AC debug] Dist: %f, acSet[7]: %d", ac_dist_set, ACInfo[playerid][acSet][7]);
| |
| 4930 | #endif | |
| 4931 | #if defined OnCheatDetected | |
| 4932 | ac_KickWithCode(playerid, "", 0, 52, 10); | |
| 4933 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4934 | #if defined FreezeSyncPacket | |
| 4935 | else if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 4936 | #endif | |
| 4937 | ACInfo[playerid][acSet][7] = -1; | |
| 4938 | #else | |
| 4939 | return ac_KickWithCode(playerid, "", 0, 52, 10); | |
| 4940 | #endif | |
| 4941 | } | |
| 4942 | #if defined OnNOPWarning | |
| 4943 | else OnNOPWarning(playerid, 10, ACInfo[playerid][acNOPCount][10]); | |
| 4944 | #endif | |
| 4945 | } | |
| 4946 | else if(++ACInfo[playerid][acNOPCount][10] > AC_MAX_NOP_WARNINGS) | |
| 4947 | {
| |
| 4948 | ACInfo[playerid][acSet][7] = -1; | |
| 4949 | #if defined FreezeSyncPacket | |
| 4950 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 4951 | #endif | |
| 4952 | } | |
| 4953 | } | |
| 4954 | } | |
| 4955 | new Float:ac_vX, Float:ac_vY, Float:ac_vZ, ac_specact = GetPlayerSpecialAction(playerid), | |
| 4956 | Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]); | |
| 4957 | if(ac_vehid > 0) | |
| 4958 | {
| |
| 4959 | if(ACInfo[playerid][acVeh] > 0) | |
| 4960 | {
| |
| 4961 | if(ACInfo[playerid][acVeh] != ac_vehid) | |
| 4962 | {
| |
| 4963 | if(ACInfo[playerid][acACAllow][4]) | |
| 4964 | {
| |
| 4965 | #if defined DEBUG | |
| 4966 | printf("[Nex-AC debug] AC veh: %d, veh: %d", ACInfo[playerid][acVeh], ac_vehid);
| |
| 4967 | #endif | |
| 4968 | #if defined OnCheatDetected | |
| 4969 | ac_KickWithCode(playerid, "", 0, 4, 2); | |
| 4970 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4971 | #else | |
| 4972 | return ac_KickWithCode(playerid, "", 0, 4, 2); | |
| 4973 | #endif | |
| 4974 | } | |
| 4975 | } | |
| 4976 | else if(ACInfo[playerid][acACAllow][50] && ACInfo[playerid][acSeat] != ac_s) | |
| 4977 | {
| |
| 4978 | #if defined DEBUG | |
| 4979 | printf("[Nex-AC debug] AC seat: %d, seatid: %d, veh model: %d, veh: %d",
| |
| 4980 | ACInfo[playerid][acSeat], ac_s, GetVehicleModel(ac_vehid), ac_vehid); | |
| 4981 | #endif | |
| 4982 | #if defined OnCheatDetected | |
| 4983 | ac_KickWithCode(playerid, "", 0, 50); | |
| 4984 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 4985 | #else | |
| 4986 | return ac_KickWithCode(playerid, "", 0, 50); | |
| 4987 | #endif | |
| 4988 | } | |
| 4989 | } | |
| 4990 | if(ac_sa == PLAYER_STATE_DRIVER) | |
| 4991 | {
| |
| 4992 | if(ACInfo[playerid][acACAllow][32] && ACVehInfo[ac_vehid][acDriver] != playerid && | |
| 4993 | ACVehInfo[ac_vehid][acDriver] != INVALID_PLAYER_ID) | |
| 4994 | {
| |
| 4995 | #if defined DEBUG | |
| 4996 | printf("[Nex-AC debug] AC driver: %d, driver: %d, veh: %d",
| |
| 4997 | ACVehInfo[ac_vehid][acDriver], playerid, ac_vehid); | |
| 4998 | #endif | |
| 4999 | #if defined OnCheatDetected | |
| 5000 | ac_KickWithCode(playerid, "", 0, 32); | |
| 5001 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5002 | #else | |
| 5003 | return SetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]); | |
| 5004 | #endif | |
| 5005 | } | |
| 5006 | new Float:ac_vHealth; | |
| 5007 | GetVehicleHealth(ac_vehid, ac_vHealth); | |
| 5008 | if(ACInfo[playerid][acSetVehHealth] != -1.0) | |
| 5009 | {
| |
| 5010 | if(ACInfo[playerid][acSetVehHealth] == ac_vHealth || | |
| 5011 | ACInfo[playerid][acSetVehHealth] > ac_vHealth && ac_gtc - ACInfo[playerid][acGtc][3] > ac_gpp) | |
| 5012 | {
| |
| 5013 | ACInfo[playerid][acSetVehHealth] = -1.0; | |
| 5014 | ACInfo[playerid][acCheatCount][10] = 0; | |
| 5015 | ACInfo[playerid][acVehDmgRes] = false; | |
| 5016 | #if defined FreezeSyncPacket | |
| 5017 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 5018 | #endif | |
| 5019 | } | |
| 5020 | else if(ac_gtc - ACInfo[playerid][acGtc][3] > ac_gpp) | |
| 5021 | {
| |
| 5022 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][4]) | |
| 5023 | {
| |
| 5024 | if(++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS) | |
| 5025 | {
| |
| 5026 | #if defined DEBUG | |
| 5027 | printf(DEBUG_CODE_5, playerid, "SetVehicleHealth"); | |
| 5028 | printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d",
| |
| 5029 | ACInfo[playerid][acSetVehHealth], ac_vHealth, ac_vehid); | |
| 5030 | #endif | |
| 5031 | #if defined OnCheatDetected | |
| 5032 | ac_KickWithCode(playerid, "", 0, 52, 11); | |
| 5033 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5034 | #if defined FreezeSyncPacket | |
| 5035 | else if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 5036 | #endif | |
| 5037 | ACInfo[playerid][acSetVehHealth] = -1.0; | |
| 5038 | #else | |
| 5039 | return ac_KickWithCode(playerid, "", 0, 52, 11); | |
| 5040 | #endif | |
| 5041 | } | |
| 5042 | #if defined OnNOPWarning | |
| 5043 | else OnNOPWarning(playerid, 11, ACInfo[playerid][acNOPCount][4]); | |
| 5044 | #endif | |
| 5045 | } | |
| 5046 | else if(++ACInfo[playerid][acNOPCount][4] > AC_MAX_NOP_WARNINGS) | |
| 5047 | {
| |
| 5048 | ACInfo[playerid][acSetVehHealth] = -1.0; | |
| 5049 | #if defined FreezeSyncPacket | |
| 5050 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 5051 | #endif | |
| 5052 | } | |
| 5053 | } | |
| 5054 | } | |
| 5055 | else if(ACInfo[playerid][acACAllow][11] && | |
| 5056 | (ac_vHealth != ac_vHealth || ac_vHealth > ACVehInfo[ac_vehid][acHealth] && | |
| 5057 | !ACInfo[playerid][acModShop] && ac_vHealth)) | |
| 5058 | {
| |
| 5059 | #if AC_USE_PAYNSPRAY | |
| 5060 | if(!ac_InPayNSpray(playerid, ac_i)) | |
| 5061 | {
| |
| 5062 | #endif | |
| 5063 | #if defined DEBUG | |
| 5064 | printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d, playerid: %d",
| |
| 5065 | ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid, playerid); | |
| 5066 | #endif | |
| 5067 | #if defined OnCheatDetected | |
| 5068 | ac_KickWithCode(playerid, "", 0, 11); | |
| 5069 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5070 | #endif | |
| 5071 | SetVehicleHealth(ac_vehid, ACVehInfo[ac_vehid][acHealth]); | |
| 5072 | #if AC_USE_PAYNSPRAY | |
| 5073 | } | |
| 5074 | #endif | |
| 5075 | } | |
| 5076 | if(ACInfo[playerid][acVehDmgRes]) | |
| 5077 | {
| |
| 5078 | if(ac_vHealth < ACVehInfo[ac_vehid][acHealth]) | |
| 5079 | {
| |
| 5080 | ACInfo[playerid][acDmgRes] = ACInfo[playerid][acVehDmgRes] = false; | |
| 5081 | ACInfo[playerid][acCheatCount][10] = 0; | |
| 5082 | } | |
| 5083 | else if(ACInfo[playerid][acACAllow][20] && ac_gtc - ACInfo[playerid][acGtc][14] > ac_gpp) | |
| 5084 | {
| |
| 5085 | ACInfo[playerid][acDmgRes] = ACInfo[playerid][acVehDmgRes] = false; | |
| 5086 | if(++ACInfo[playerid][acCheatCount][10] > AC_MAX_GODMODE_VEH_WARNINGS) | |
| 5087 | {
| |
| 5088 | #undef AC_MAX_GODMODE_VEH_WARNINGS | |
| 5089 | #if defined DEBUG | |
| 5090 | printf("[Nex-AC debug] AC veh health: %f, veh health: %f, veh: %d",
| |
| 5091 | ACVehInfo[ac_vehid][acHealth], ac_vHealth, ac_vehid); | |
| 5092 | #endif | |
| 5093 | #if defined OnCheatDetected | |
| 5094 | ac_KickWithCode(playerid, "", 0, 20); | |
| 5095 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5096 | ACInfo[playerid][acCheatCount][10] = 0; | |
| 5097 | #else | |
| 5098 | return ac_KickWithCode(playerid, "", 0, 20); | |
| 5099 | #endif | |
| 5100 | } | |
| 5101 | - | (ACInfo[playerid][acPosZ] >= -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 || |
| 5101 | + | |
| 5102 | else OnCheatWarning(playerid, "", 0, 20, 0, ACInfo[playerid][acCheatCount][10]); | |
| 5103 | #endif | |
| 5104 | } | |
| 5105 | } | |
| 5106 | - | (ACInfo[playerid][acPosZ] >= -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 || |
| 5106 | + | |
| 5107 | new Float:ac_zAngle, ac_vsp = ac_GetSpeed(ac_vX, ac_vY, ac_vZ); | |
| 5108 | GetVehicleZAngle(ac_vehid, ac_zAngle); | |
| 5109 | if(ac_dist > 0.8) | |
| 5110 | {
| |
| 5111 | if(ac_dist >= 80.0 && ac_dist - ACVehInfo[ac_vehid][acPosDiff] > (ac_dist / 2.6) * 1.8 && | |
| 5112 | ac_dist_set >= 80.0 && ac_dist_set - ACVehInfo[ac_vehid][acPosDiff] > (ac_dist_set / 2.6) * 1.8) | |
| 5113 | {
| |
| 5114 | #if defined VectorSize | |
| 5115 | if(ACInfo[playerid][acACAllow][3] && ac_gtc - ACInfo[playerid][acGtc][18] > ac_gpp && | |
| 5116 | (ACInfo[playerid][acPosZ] >= -90.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 || | |
| 5117 | VectorSize(ac_pX - ACInfo[playerid][acPosX], ac_pY - ACInfo[playerid][acPosY], 0.0) >= 180.0 || | |
| 5118 | ++ACInfo[playerid][acCheatCount][19] > AC_MAX_TELEPORT_GLITCH_WARNINGS)) | |
| 5119 | #else | |
| 5120 | if(ACInfo[playerid][acACAllow][3] && ac_gtc - ACInfo[playerid][acGtc][18] > ac_gpp && | |
| 5121 | (ACInfo[playerid][acPosZ] >= -90.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 || | |
| 5122 | floatsqroot(floatpower(ac_pX - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_pY - ACInfo[playerid][acPosY], 2.0)) >= 180.0 || | |
| 5123 | ++ACInfo[playerid][acCheatCount][19] > AC_MAX_TELEPORT_GLITCH_WARNINGS)) | |
| 5124 | #endif | |
| 5125 | - | ACInfo[playerid][acLastPosX] = ac_pX; |
| 5125 | + | |
| 5126 | - | ACInfo[playerid][acLastPosY] = ac_pY; |
| 5126 | + | |
| 5127 | printf("[Nex-AC debug] Dist: %f, dist set: %f, old pos diff: %f, speed: %d, veh: %d",
| |
| 5128 | ac_dist, ac_dist_set, ACVehInfo[ac_vehid][acPosDiff], ac_vsp, ac_vehid); | |
| 5129 | #endif | |
| 5130 | #if defined OnCheatDetected | |
| 5131 | ac_KickWithCode(playerid, "", 0, 3, 2); | |
| 5132 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5133 | ACInfo[playerid][acCheatCount][19] = 0; | |
| 5134 | #else | |
| 5135 | return ac_KickWithCode(playerid, "", 0, 3, 2); | |
| 5136 | #endif | |
| 5137 | } | |
| 5138 | ACInfo[playerid][acLastPosX] = ac_pX; | |
| 5139 | ACInfo[playerid][acLastPosY] = ac_pY; | |
| 5140 | } | |
| 5141 | else if(ac_vsp < 12 && ac_gtc - ACInfo[playerid][acGtc][10] > ac_gpp) | |
| 5142 | {
| |
| 5143 | if(ac_dist >= 40.0 && ac_dist_set >= 40.0) | |
| 5144 | {
| |
| 5145 | if(ACInfo[playerid][acACAllow][3]) | |
| 5146 | {
| |
| 5147 | #if defined DEBUG | |
| 5148 | printf("[Nex-AC debug] Speed: %d, dist: %f, dist set: %f", ac_vsp, ac_dist, ac_dist_set);
| |
| 5149 | #endif | |
| 5150 | #if defined OnCheatDetected | |
| 5151 | ac_KickWithCode(playerid, "", 0, 3, 4); | |
| 5152 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5153 | #else | |
| 5154 | return ac_KickWithCode(playerid, "", 0, 3, 4); | |
| 5155 | #endif | |
| 5156 | } | |
| 5157 | } | |
| 5158 | else if(ACInfo[playerid][acACAllow][1]) | |
| 5159 | {
| |
| 5160 | if(++ACInfo[playerid][acCheatCount][2] > AC_MAX_AIR_VEH_WARNINGS) | |
| 5161 | {
| |
| 5162 | #if defined DEBUG | |
| 5163 | printf("[Nex-AC debug] Speed: %d, dist: %f, veh: %d", ac_vsp, ac_dist, ac_vehid);
| |
| 5164 | #endif | |
| 5165 | #if defined OnCheatDetected | |
| 5166 | ac_KickWithCode(playerid, "", 0, 1, 1); | |
| 5167 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5168 | ACInfo[playerid][acCheatCount][2] = 0; | |
| 5169 | #else | |
| 5170 | return ac_KickWithCode(playerid, "", 0, 1, 1); | |
| 5171 | #endif | |
| 5172 | } | |
| 5173 | - | if(ac_spDiff > 230) |
| 5173 | + | |
| 5174 | else OnCheatWarning(playerid, "", 0, 1, 1, ACInfo[playerid][acCheatCount][2]); | |
| 5175 | #endif | |
| 5176 | } | |
| 5177 | } | |
| 5178 | } | |
| 5179 | if(ac_gtc - ACInfo[playerid][acGtc][8] > ac_gpp) | |
| 5180 | {
| |
| 5181 | ac_i = GetVehicleModel(ac_vehid); | |
| 5182 | new ac_spDiff = ac_vsp - ACVehInfo[ac_vehid][acSpeed]; | |
| 5183 | if(ACInfo[playerid][acACAllow][10]) | |
| 5184 | {
| |
| 5185 | if(ac_spDiff > 230 || ac_vsp > 630) | |
| 5186 | {
| |
| 5187 | #if defined DEBUG | |
| 5188 | printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d, veh: %d",
| |
| 5189 | ac_vsp, ACVehInfo[ac_vehid][acSpeed], ac_i, ac_vehid); | |
| 5190 | #endif | |
| 5191 | #if defined OnCheatDetected | |
| 5192 | ac_KickWithCode(playerid, "", 0, 10, 3); | |
| 5193 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5194 | #else | |
| 5195 | return ac_KickWithCode(playerid, "", 0, 10, 3); | |
| 5196 | #endif | |
| 5197 | } | |
| 5198 | else if(ac_spDiff >= 20 && | |
| 5199 | ACVehInfo[ac_vehid][acSpeedDiff] <= ac_spDiff && ACVehInfo[ac_vehid][acHealth] <= ac_vHealth && | |
| 5200 | !(ac_IsValidVehicleModel(ac_i) && (ac_spDiff < 65 && (ac_i == 432 || ac_i == 449 || ac_IsATrainLoco(ac_i)) || | |
| 5201 | ac_spDiff < 45 && ac_IsABmx(ac_i) && floatabs(ac_vX) <= 0.5 && floatabs(ac_vY) <= 0.5 && floatabs(ac_vZ) <= 0.5 || | |
| 5202 | ac_i != 449 && !ac_IsATrainLoco(ac_i) && !ac_IsABmx(ac_i) && ACVehInfo[ac_vehid][acHealth] < 250.0))) | |
| 5203 | {
| |
| 5204 | ACInfo[playerid][acCheatCount][14] += (1 * AC_SPEEDHACK_VEH_RESET_DELAY); | |
| 5205 | if(ACInfo[playerid][acCheatCount][14] > AC_MAX_SPEEDHACK_VEH_WARNINGS) | |
| 5206 | {
| |
| 5207 | #if defined DEBUG | |
| 5208 | printf("[Nex-AC debug] Speed: %d, old speed: %d, veh model: %d, veh: %d",
| |
| 5209 | ac_vsp, ACVehInfo[ac_vehid][acSpeed], ac_i, ac_vehid); | |
| 5210 | #endif | |
| 5211 | #if defined OnCheatDetected | |
| 5212 | ac_KickWithCode(playerid, "", 0, 10, 1); | |
| 5213 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5214 | ACInfo[playerid][acCheatCount][14] = 0; | |
| 5215 | #else | |
| 5216 | return ac_KickWithCode(playerid, "", 0, 10, 1); | |
| 5217 | #endif | |
| 5218 | } | |
| 5219 | #if defined OnCheatWarning | |
| 5220 | else OnCheatWarning(playerid, "", 0, 10, 1, floatround(ACInfo[playerid][acCheatCount][14] / AC_SPEEDHACK_VEH_RESET_DELAY)); | |
| 5221 | #endif | |
| 5222 | } | |
| 5223 | } | |
| 5224 | if(ACInfo[playerid][acACAllow][25] && | |
| 5225 | ac_vsp > 15 && ac_abs(ac_spDiff) < 25 && | |
| 5226 | floatround(floatabs(ac_zAngle - ACVehInfo[ac_vehid][acZAngle])) == 180 && | |
| 5227 | (ac_vX < 0.0) != (ACVehInfo[ac_vehid][acVelX] < 0.0) && | |
| 5228 | (ac_vY < 0.0) != (ACVehInfo[ac_vehid][acVelY] < 0.0) && | |
| 5229 | (ac_vZ < 0.0) != (ACVehInfo[ac_vehid][acVelZ] < 0.0)) | |
| 5230 | {
| |
| 5231 | #undef ac_abs | |
| 5232 | #if defined DEBUG | |
| 5233 | printf("[Nex-AC debug] Speed: %d, speed diff: %d, z angle: %f, old z angle: %f, veh: %d",
| |
| 5234 | ac_vsp, ac_spDiff, ac_zAngle, ACVehInfo[ac_vehid][acZAngle], ac_vehid); | |
| 5235 | #endif | |
| 5236 | #if defined OnCheatDetected | |
| 5237 | ac_KickWithCode(playerid, "", 0, 25); | |
| 5238 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5239 | #else | |
| 5240 | return ac_KickWithCode(playerid, "", 0, 25); | |
| 5241 | #endif | |
| 5242 | } | |
| 5243 | if(ac_IsAnAircraftEx(ac_i)) | |
| 5244 | {
| |
| 5245 | if(ACInfo[playerid][acACAllow][10] && (ac_sa = ac_GetSpeed(ac_vX, ac_vY)) > 270) | |
| 5246 | {
| |
| 5247 | #if defined DEBUG | |
| 5248 | printf("[Nex-AC debug] Speed (x, y): %d, veh model: %d, veh: %d", ac_sa, ac_i, ac_vehid);
| |
| 5249 | #endif | |
| 5250 | #if defined OnCheatDetected | |
| 5251 | ac_KickWithCode(playerid, "", 0, 10, 2); | |
| 5252 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5253 | #else | |
| 5254 | return ac_KickWithCode(playerid, "", 0, 10, 2); | |
| 5255 | #endif | |
| 5256 | } | |
| 5257 | } | |
| 5258 | else if(ACInfo[playerid][acACAllow][8]) | |
| 5259 | {
| |
| 5260 | ac_tmp = ac_pZ - ACInfo[playerid][acPosZ]; | |
| 5261 | if(ac_vZ >= 0.1 && ac_vZ > ACVehInfo[ac_vehid][acVelZ] && | |
| 5262 | floatabs(ACInfo[playerid][acPosX] - ac_pX) < ac_tmp / 2.0 && | |
| 5263 | floatabs(ACInfo[playerid][acPosY] - ac_pY) < ac_tmp / 2.0 || | |
| 5264 | ac_vZ >= 0.0 && ac_tmp <= -1.0 || ac_vZ <= 0.0 && ac_tmp >= 1.0) | |
| 5265 | {
| |
| 5266 | if(++ACInfo[playerid][acCheatCount][3] > (ac_IsABmxEx(ac_i) ? AC_MAX_FLYHACK_BIKE_WARNINGS : AC_MAX_FLYHACK_VEH_WARNINGS)) | |
| 5267 | {
| |
| 5268 | #undef AC_MAX_FLYHACK_BIKE_WARNINGS | |
| 5269 | #if defined DEBUG | |
| 5270 | printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, veh: %d",
| |
| 5271 | ac_vZ, ACVehInfo[ac_vehid][acVelZ], ACInfo[playerid][acPosX] - ac_pX, ACInfo[playerid][acPosY] - ac_pY, ac_tmp, ac_vehid); | |
| 5272 | #endif | |
| 5273 | #if defined OnCheatDetected | |
| 5274 | ac_KickWithCode(playerid, "", 0, 8, 1); | |
| 5275 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5276 | ACInfo[playerid][acCheatCount][3] = 0; | |
| 5277 | #else | |
| 5278 | return ac_KickWithCode(playerid, "", 0, 8, 1); | |
| 5279 | #endif | |
| 5280 | } | |
| 5281 | #if defined OnCheatWarning | |
| 5282 | else OnCheatWarning(playerid, "", 0, 8, 1, ACInfo[playerid][acCheatCount][3]); | |
| 5283 | #endif | |
| 5284 | } | |
| 5285 | } | |
| 5286 | ACVehInfo[ac_vehid][acSpeedDiff] = ac_spDiff; | |
| 5287 | } | |
| 5288 | ACVehInfo[ac_vehid][acPosX] = ac_pX; | |
| 5289 | ACVehInfo[ac_vehid][acPosY] = ac_pY; | |
| 5290 | ACVehInfo[ac_vehid][acPosZ] = ac_pZ; | |
| 5291 | ACVehInfo[ac_vehid][acVelX] = ac_vX; | |
| 5292 | ACVehInfo[ac_vehid][acVelY] = ac_vY; | |
| 5293 | ACVehInfo[ac_vehid][acVelZ] = ac_vZ; | |
| 5294 | ACVehInfo[ac_vehid][acSpeed] = ac_vsp; | |
| 5295 | ACVehInfo[ac_vehid][acPosDiff] = ac_dist; | |
| 5296 | if(ACInfo[playerid][acSetVehHealth] == -1.0) ACVehInfo[ac_vehid][acHealth] = ac_vHealth; | |
| 5297 | ACVehInfo[ac_vehid][acZAngle] = ac_zAngle; | |
| 5298 | } | |
| 5299 | ACInfo[playerid][acSeat] = ac_s; | |
| 5300 | } | |
| 5301 | else | |
| 5302 | {
| |
| 5303 | GetPlayerVelocity(playerid, ac_vX, ac_vY, ac_vZ); | |
| 5304 | ac_s = ac_GetSpeed(ac_vX, ac_vY, ac_vZ); | |
| 5305 | if(ACInfo[playerid][acAnim] != (ac_sa = GetPlayerAnimationIndex(playerid))) | |
| 5306 | {
| |
| 5307 | if(ac_sa == -1) | |
| 5308 | {
| |
| 5309 | if(ACInfo[playerid][acACAllow][24]) | |
| 5310 | - | if(ac_sa == 1231 && ac_w != 46 && 1 <= ac_i <= 311 && ac_i != 74) |
| 5310 | + | |
| 5311 | #if defined OnCheatDetected | |
| 5312 | ac_KickWithCode(playerid, "", 0, 24); | |
| 5313 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5314 | #else | |
| 5315 | return ac_KickWithCode(playerid, "", 0, 24); | |
| 5316 | #endif | |
| 5317 | } | |
| 5318 | } | |
| 5319 | else if(ACInfo[playerid][acACAllow][30] && !ac_PedAnims) | |
| 5320 | {
| |
| 5321 | ac_i = GetPlayerSkin(playerid); | |
| 5322 | if(ac_sa == 1231 && ac_w != WEAPON_PARACHUTE && 1 <= ac_i < AC_MAX_SKINS && ac_i != 74) | |
| 5323 | {
| |
| 5324 | #undef AC_MAX_SKINS | |
| 5325 | if(++ACInfo[playerid][acCheatCount][17] > AC_MAX_CJ_RUN_WARNINGS) | |
| 5326 | {
| |
| 5327 | #undef AC_MAX_CJ_RUN_WARNINGS | |
| 5328 | #if defined DEBUG | |
| 5329 | printf("[Nex-AC debug] Skin: %d, old anim: %d, weaponid: %d",
| |
| 5330 | ac_i, ACInfo[playerid][acAnim], ac_w); | |
| 5331 | #endif | |
| 5332 | #if defined OnCheatDetected | |
| 5333 | ac_KickWithCode(playerid, "", 0, 30); | |
| 5334 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5335 | ACInfo[playerid][acCheatCount][17] = 0; | |
| 5336 | #else | |
| 5337 | return ac_KickWithCode(playerid, "", 0, 30); | |
| 5338 | #endif | |
| 5339 | } | |
| 5340 | #if defined OnCheatWarning | |
| 5341 | else OnCheatWarning(playerid, "", 0, 30, 0, ACInfo[playerid][acCheatCount][17]); | |
| 5342 | #endif | |
| 5343 | } | |
| 5344 | else ACInfo[playerid][acCheatCount][17] = 0; | |
| 5345 | } | |
| 5346 | } | |
| 5347 | else if(ACInfo[playerid][acACAllow][7]) | |
| 5348 | {
| |
| 5349 | if(ac_sa == 157 || ac_sa == 159 || ac_sa == 161 || ac_sa == 1058) | |
| 5350 | {
| |
| 5351 | if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_FLYHACK_WARNINGS) | |
| 5352 | {
| |
| 5353 | #if defined DEBUG | |
| 5354 | printf("[Nex-AC debug] Anim: %d, old anim: %d, old veh: %d",
| |
| 5355 | ac_sa, ACInfo[playerid][acAnim], ACInfo[playerid][acVeh]); | |
| 5356 | #endif | |
| 5357 | #if defined OnCheatDetected | |
| 5358 | ac_KickWithCode(playerid, "", 0, 7, 2); | |
| 5359 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5360 | ACInfo[playerid][acCheatCount][13] = 0; | |
| 5361 | #else | |
| 5362 | return ac_KickWithCode(playerid, "", 0, 7, 2); | |
| 5363 | #endif | |
| 5364 | } | |
| 5365 | #if defined OnCheatWarning | |
| 5366 | else OnCheatWarning(playerid, "", 0, 7, 2, ACInfo[playerid][acCheatCount][13]); | |
| 5367 | #endif | |
| 5368 | } | |
| 5369 | else if(1538 <= ac_sa <= 1544 && ac_s > 36 && ACInfo[playerid][acSpeed] < ac_s) | |
| 5370 | {
| |
| 5371 | if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_FLYHACK_WARNINGS) | |
| 5372 | {
| |
| 5373 | #if defined DEBUG | |
| 5374 | printf("[Nex-AC debug] Speed: %d, old speed: %d, anim: %d",
| |
| 5375 | ac_s, ACInfo[playerid][acSpeed], ac_sa); | |
| 5376 | #endif | |
| 5377 | #if defined OnCheatDetected | |
| 5378 | ac_KickWithCode(playerid, "", 0, 7, 3); | |
| 5379 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5380 | ACInfo[playerid][acCheatCount][13] = 0; | |
| 5381 | #else | |
| 5382 | return ac_KickWithCode(playerid, "", 0, 7, 3); | |
| 5383 | #endif | |
| 5384 | } | |
| 5385 | #if defined OnCheatWarning | |
| 5386 | else OnCheatWarning(playerid, "", 0, 7, 3, ACInfo[playerid][acCheatCount][13]); | |
| 5387 | #endif | |
| 5388 | } | |
| 5389 | else | |
| 5390 | {
| |
| 5391 | #if defined VectorSize | |
| 5392 | ac_tmp = VectorSize(ac_vX, ac_vY, 0.0); | |
| 5393 | #else | |
| 5394 | ac_tmp = floatsqroot(floatpower(ac_vX, 2.0) + floatpower(ac_vY, 2.0)); | |
| 5395 | #endif | |
| 5396 | if(958 <= ac_sa <= 979 && (ac_vZ > 0.1 || ac_tmp > 0.9)) | |
| 5397 | {
| |
| 5398 | if(++ACInfo[playerid][acCheatCount][13] > AC_MAX_FLYHACK_WARNINGS) | |
| 5399 | {
| |
| 5400 | #undef AC_MAX_FLYHACK_WARNINGS | |
| 5401 | #if defined DEBUG | |
| 5402 | printf("[Nex-AC debug] Anim: %d, old anim: %d, weaponid: %d, spec act: %d, vel x, y: %f, vel z: %f",
| |
| 5403 | ac_sa, ACInfo[playerid][acAnim], ac_w, ac_specact, ac_tmp, ac_vZ); | |
| 5404 | #endif | |
| 5405 | #if defined OnCheatDetected | |
| 5406 | ac_KickWithCode(playerid, "", 0, 7, 1); | |
| 5407 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5408 | ACInfo[playerid][acCheatCount][13] = 0; | |
| 5409 | #else | |
| 5410 | return ac_KickWithCode(playerid, "", 0, 7, 1); | |
| 5411 | #endif | |
| 5412 | } | |
| 5413 | #if defined OnCheatWarning | |
| 5414 | else OnCheatWarning(playerid, "", 0, 7, 1, ACInfo[playerid][acCheatCount][13]); | |
| 5415 | #endif | |
| 5416 | } | |
| 5417 | else ACInfo[playerid][acCheatCount][13] = 0; | |
| 5418 | } | |
| 5419 | } | |
| 5420 | if(ACInfo[playerid][acSet][3] != -1) | |
| 5421 | {
| |
| 5422 | if(ac_specact == ACInfo[playerid][acSet][3]) | |
| 5423 | {
| |
| 5424 | ACInfo[playerid][acSet][3] = -1; | |
| 5425 | #if defined FreezeSyncPacket | |
| 5426 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 5427 | #endif | |
| 5428 | } | |
| 5429 | else if(ac_gtc - ACInfo[playerid][acGtc][5] > ac_gpp) | |
| 5430 | {
| |
| 5431 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][6] && | |
| 5432 | ac_specact != SPECIAL_ACTION_DUCK && | |
| 5433 | !(SPECIAL_ACTION_ENTER_VEHICLE <= ac_specact <= SPECIAL_ACTION_EXIT_VEHICLE)) | |
| 5434 | {
| |
| 5435 | if(++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS) | |
| 5436 | {
| |
| 5437 | #if defined DEBUG | |
| 5438 | printf(DEBUG_CODE_5, playerid, "SetPlayerSpecialAction"); | |
| 5439 | printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSet][3], ac_specact);
| |
| 5440 | #endif | |
| 5441 | #if defined OnCheatDetected | |
| 5442 | ac_KickWithCode(playerid, "", 0, 52, 12); | |
| 5443 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5444 | #if defined FreezeSyncPacket | |
| 5445 | else if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 5446 | #endif | |
| 5447 | ACInfo[playerid][acSet][3] = -1; | |
| 5448 | #else | |
| 5449 | return ac_KickWithCode(playerid, "", 0, 52, 12); | |
| 5450 | #endif | |
| 5451 | } | |
| 5452 | #if defined OnNOPWarning | |
| 5453 | else OnNOPWarning(playerid, 12, ACInfo[playerid][acNOPCount][6]); | |
| 5454 | #endif | |
| 5455 | } | |
| 5456 | else if(++ACInfo[playerid][acNOPCount][6] > AC_MAX_NOP_WARNINGS) | |
| 5457 | {
| |
| 5458 | ACInfo[playerid][acSet][3] = -1; | |
| 5459 | #if defined FreezeSyncPacket | |
| 5460 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) FreezeSyncPacket(playerid, E_ALL_SYNC, true); | |
| 5461 | #endif | |
| 5462 | } | |
| 5463 | #undef AC_MAX_NOP_WARNINGS | |
| 5464 | } | |
| 5465 | } | |
| 5466 | else if(ac_specact != ACInfo[playerid][acSpecAct]) | |
| 5467 | {
| |
| 5468 | if(ac_specact == ACInfo[playerid][acNextSpecAct]) ACInfo[playerid][acNextSpecAct] = -1; | |
| 5469 | else if(ACInfo[playerid][acACAllow][18]) | |
| 5470 | {
| |
| 5471 | switch(ac_specact) | |
| 5472 | {
| |
| 5473 | case SPECIAL_ACTION_NONE: | |
| 5474 | {
| |
| 5475 | switch(ACInfo[playerid][acSpecAct]) | |
| 5476 | {
| |
| 5477 | case SPECIAL_ACTION_USECELLPHONE, 24, 25: | |
| 5478 | {
| |
| 5479 | #if defined OnCheatDetected | |
| 5480 | ac_KickWithCode(playerid, "", 0, 18, 1); | |
| 5481 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5482 | #else | |
| 5483 | return ac_KickWithCode(playerid, "", 0, 18, 1); | |
| 5484 | #endif | |
| 5485 | } | |
| 5486 | } | |
| 5487 | } | |
| 5488 | case SPECIAL_ACTION_DUCK: | |
| 5489 | {
| |
| 5490 | if(ACInfo[playerid][acSpecAct] > SPECIAL_ACTION_NONE && | |
| 5491 | !(SPECIAL_ACTION_DRINK_BEER <= ACInfo[playerid][acSpecAct] <= 24)) | |
| 5492 | {
| |
| 5493 | #if defined DEBUG | |
| 5494 | printf("[Nex-AC debug] AC spec act: %d, spec act: %d", ACInfo[playerid][acSpecAct], ac_specact);
| |
| 5495 | #endif | |
| 5496 | #if defined OnCheatDetected | |
| 5497 | ac_KickWithCode(playerid, "", 0, 18, 2); | |
| 5498 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5499 | #else | |
| 5500 | return ac_KickWithCode(playerid, "", 0, 18, 2); | |
| 5501 | #endif | |
| 5502 | } | |
| 5503 | } | |
| 5504 | case SPECIAL_ACTION_USEJETPACK: | |
| 5505 | {
| |
| 5506 | if((ac_tmp = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acDropJpX], ACInfo[playerid][acDropJpY], ACInfo[playerid][acDropJpZ])) >= 15.0) | |
| 5507 | {
| |
| 5508 | #if defined DEBUG | |
| 5509 | printf("[Nex-AC debug] AC spec act: %d, spec act: %d, dist: %f",
| |
| 5510 | ACInfo[playerid][acSpecAct], ac_specact, ac_tmp); | |
| 5511 | #endif | |
| 5512 | #if defined OnCheatDetected | |
| 5513 | ac_KickWithCode(playerid, "", 0, 18, 3); | |
| 5514 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5515 | #else | |
| 5516 | return ac_KickWithCode(playerid, "", 0, 18, 3); | |
| 5517 | #endif | |
| 5518 | } | |
| 5519 | else ACInfo[playerid][acNextSpecAct] = ACInfo[playerid][acSpecAct]; | |
| 5520 | ACInfo[playerid][acDropJpX] = | |
| 5521 | ACInfo[playerid][acDropJpY] = | |
| 5522 | ACInfo[playerid][acDropJpZ] = 25000.0; | |
| 5523 | } | |
| 5524 | case SPECIAL_ACTION_ENTER_VEHICLE: | |
| 5525 | {
| |
| 5526 | switch(ACInfo[playerid][acSpecAct]) | |
| 5527 | {
| |
| 5528 | case SPECIAL_ACTION_DANCE1, SPECIAL_ACTION_DANCE2, SPECIAL_ACTION_DANCE3, SPECIAL_ACTION_DANCE4, SPECIAL_ACTION_USECELLPHONE, 68: | |
| 5529 | {
| |
| 5530 | #if defined OnCheatDetected | |
| 5531 | ac_KickWithCode(playerid, "", 0, 18, 4); | |
| 5532 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5533 | #else | |
| 5534 | return ac_KickWithCode(playerid, "", 0, 18, 4); | |
| 5535 | #endif | |
| 5536 | } | |
| 5537 | } | |
| 5538 | } | |
| 5539 | default: | |
| 5540 | {
| |
| 5541 | if(!((SPECIAL_ACTION_DRINK_BEER <= ac_specact <= 24 && | |
| 5542 | ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_DUCK || | |
| 5543 | ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_ENTER_VEHICLE) && | |
| 5544 | ac_specact == ACInfo[playerid][acLastSpecAct]) && | |
| 5545 | (ACInfo[playerid][acVeh] == 0 || ac_specact != SPECIAL_ACTION_EXIT_VEHICLE && | |
| 5546 | !(24 <= ac_specact <= 25) && ac_specact != SPECIAL_ACTION_USECELLPHONE)) | |
| 5547 | {
| |
| 5548 | #if defined DEBUG | |
| 5549 | printf("[Nex-AC debug] AC spec act: %d, spec act: %d, Last spec act: %d, old veh: %d",
| |
| 5550 | ACInfo[playerid][acSpecAct], ac_specact, ACInfo[playerid][acLastSpecAct], ACInfo[playerid][acVeh]); | |
| 5551 | #endif | |
| 5552 | #if defined OnCheatDetected | |
| 5553 | ac_KickWithCode(playerid, "", 0, 18, 5); | |
| 5554 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5555 | #else | |
| 5556 | return ac_KickWithCode(playerid, "", 0, 18, 5); | |
| 5557 | #endif | |
| 5558 | } | |
| 5559 | } | |
| 5560 | - | (ACInfo[playerid][acPosZ] >= -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 || |
| 5560 | + | |
| 5561 | } | |
| 5562 | ACInfo[playerid][acLastSpecAct] = ACInfo[playerid][acSpecAct]; | |
| 5563 | } | |
| 5564 | ac_a = GetPlayerSurfingVehicleID(playerid); | |
| 5565 | - | (ACInfo[playerid][acPosZ] >= -95.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 || |
| 5565 | + | |
| 5566 | {
| |
| 5567 | if(ac_dist > 0.7) | |
| 5568 | {
| |
| 5569 | if(ac_dist >= 40.0 && ac_dist_set >= 40.0) | |
| 5570 | {
| |
| 5571 | #if defined VectorSize | |
| 5572 | if(ACInfo[playerid][acACAllow][2] && !ACInfo[playerid][acIntEnterExits] && | |
| 5573 | (ACInfo[playerid][acPosZ] >= -90.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 || | |
| 5574 | VectorSize(ac_pX - ACInfo[playerid][acPosX], ac_pY - ACInfo[playerid][acPosY], 0.0) >= 180.0 || | |
| 5575 | ++ACInfo[playerid][acCheatCount][19] > AC_MAX_TELEPORT_GLITCH_WARNINGS)) | |
| 5576 | #else | |
| 5577 | if(ACInfo[playerid][acACAllow][2] && !ACInfo[playerid][acIntEnterExits] && | |
| 5578 | (ACInfo[playerid][acPosZ] >= -90.0 || ac_pZ - ACInfo[playerid][acPosZ] < 40.0 || | |
| 5579 | floatsqroot(floatpower(ac_pX - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_pY - ACInfo[playerid][acPosY], 2.0)) >= 180.0 || | |
| 5580 | ++ACInfo[playerid][acCheatCount][19] > AC_MAX_TELEPORT_GLITCH_WARNINGS)) | |
| 5581 | #endif | |
| 5582 | {
| |
| 5583 | #undef AC_MAX_TELEPORT_GLITCH_WARNINGS | |
| 5584 | #if defined DEBUG | |
| 5585 | - | ACInfo[playerid][acLastPosX] = ac_pX; |
| 5585 | + | |
| 5586 | - | ACInfo[playerid][acLastPosY] = ac_pY; |
| 5586 | + | |
| 5587 | #endif | |
| 5588 | #if defined OnCheatDetected | |
| 5589 | ac_KickWithCode(playerid, "", 0, 2, 2); | |
| 5590 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5591 | ACInfo[playerid][acCheatCount][19] = 0; | |
| 5592 | #else | |
| 5593 | return ac_KickWithCode(playerid, "", 0, 2, 2); | |
| 5594 | #endif | |
| 5595 | } | |
| 5596 | ACInfo[playerid][acLastPosX] = ac_pX; | |
| 5597 | ACInfo[playerid][acLastPosY] = ac_pY; | |
| 5598 | } | |
| 5599 | else if(ac_s < ac_dist * (ac_dist < 1.0 ? 14.0 : 5.0) && ac_gtc - ACInfo[playerid][acGtc][10] > ac_gpp) | |
| 5600 | {
| |
| 5601 | if(ac_s < 3 && (ac_dist >= 30.0 && ac_dist_set >= 30.0 || | |
| 5602 | ac_dist >= 20.0 && ac_dist_set >= 20.0 && ac_gtc - ACInfo[playerid][acUpdateTick] < 1500)) | |
| 5603 | {
| |
| 5604 | if(ACInfo[playerid][acACAllow][2]) | |
| 5605 | {
| |
| 5606 | #if defined DEBUG | |
| 5607 | printf("[Nex-AC debug] Speed: %d, dist: %f, dist set: %f", ac_s, ac_dist, ac_dist_set);
| |
| 5608 | #endif | |
| 5609 | #if defined OnCheatDetected | |
| 5610 | ac_KickWithCode(playerid, "", 0, 2, 3); | |
| 5611 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5612 | #else | |
| 5613 | return ac_KickWithCode(playerid, "", 0, 2, 3); | |
| 5614 | #endif | |
| 5615 | } | |
| 5616 | } | |
| 5617 | else if(ACInfo[playerid][acACAllow][0] && (ac_s || ac_dist >= 3.0)) | |
| 5618 | {
| |
| 5619 | if(++ACInfo[playerid][acCheatCount][1] > AC_MAX_AIR_WARNINGS) | |
| 5620 | {
| |
| 5621 | #undef AC_MAX_AIR_WARNINGS | |
| 5622 | #if defined DEBUG | |
| 5623 | printf("[Nex-AC debug] Speed: %d, dist: %f", ac_s, ac_dist);
| |
| 5624 | #endif | |
| 5625 | #if defined OnCheatDetected | |
| 5626 | ac_KickWithCode(playerid, "", 0, 0); | |
| 5627 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5628 | ACInfo[playerid][acCheatCount][1] = 0; | |
| 5629 | #else | |
| 5630 | return ac_KickWithCode(playerid, "", 0, 0); | |
| 5631 | #endif | |
| 5632 | } | |
| 5633 | #if defined OnCheatWarning | |
| 5634 | else OnCheatWarning(playerid, "", 0, 0, 0, ACInfo[playerid][acCheatCount][1]); | |
| 5635 | #endif | |
| 5636 | } | |
| 5637 | } | |
| 5638 | } | |
| 5639 | if(ac_gtc - ACInfo[playerid][acGtc][9] > ac_gpp) | |
| 5640 | {
| |
| 5641 | if(ACInfo[playerid][acACAllow][9] && ACInfo[playerid][acSpeed] < ac_s) | |
| 5642 | {
| |
| 5643 | if(ac_s > 530) | |
| 5644 | {
| |
| 5645 | #if defined DEBUG | |
| 5646 | printf("[Nex-AC debug] Speed: %d, old speed: %d", ac_s, ACInfo[playerid][acSpeed]);
| |
| 5647 | #endif | |
| 5648 | #if defined OnCheatDetected | |
| 5649 | ac_KickWithCode(playerid, "", 0, 9, 1); | |
| 5650 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5651 | #else | |
| 5652 | return ac_KickWithCode(playerid, "", 0, 9, 1); | |
| 5653 | #endif | |
| 5654 | } | |
| 5655 | else | |
| 5656 | {
| |
| 5657 | ac_i = ac_GetSpeed(ac_vX, ac_vY); | |
| 5658 | ac_tmp = ac_pZ - ACInfo[playerid][acPosZ]; | |
| 5659 | if((ac_s > 257 || ac_i > 180 || floatabs(ac_vZ) > 1.0 && floatabs(ac_tmp) < 2.0) && | |
| 5660 | ACInfo[playerid][acHealth] <= ac_health) | |
| 5661 | {
| |
| 5662 | if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_SPEEDHACK_WARNINGS) | |
| 5663 | {
| |
| 5664 | #if defined DEBUG | |
| 5665 | printf("[Nex-AC debug] Speed: %d, speed x, y: %d, vel z: %f, pos diff z: %f, old speed: %d",
| |
| 5666 | ac_s, ac_i, ac_vZ, ac_tmp, ACInfo[playerid][acSpeed]); | |
| 5667 | #endif | |
| 5668 | #if defined OnCheatDetected | |
| 5669 | ac_KickWithCode(playerid, "", 0, 9, 2); | |
| 5670 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5671 | ACInfo[playerid][acCheatCount][15] = 0; | |
| 5672 | #else | |
| 5673 | return ac_KickWithCode(playerid, "", 0, 9, 2); | |
| 5674 | #endif | |
| 5675 | } | |
| 5676 | #if defined OnCheatWarning | |
| 5677 | else OnCheatWarning(playerid, "", 0, 9, 2, ACInfo[playerid][acCheatCount][15]); | |
| 5678 | #endif | |
| 5679 | } | |
| 5680 | else ACInfo[playerid][acCheatCount][15] = 0; | |
| 5681 | } | |
| 5682 | } | |
| 5683 | ACInfo[playerid][acSpeed] = ac_s; | |
| 5684 | } | |
| 5685 | } | |
| 5686 | else if(ac_gtc - ACInfo[playerid][acGtc][9] > ac_gpp) | |
| 5687 | {
| |
| 5688 | if(ACInfo[playerid][acACAllow][9] && ac_a != INVALID_VEHICLE_ID) | |
| 5689 | {
| |
| 5690 | GetVehicleVelocity(ac_a, ac_vX, ac_vY, ac_vZ); | |
| 5691 | new ac_vsp = ac_GetSpeed(ac_vX, ac_vY, ac_vZ); | |
| 5692 | if(ac_s - ac_vsp > 230) | |
| 5693 | {
| |
| 5694 | if(++ACInfo[playerid][acCheatCount][15] > AC_MAX_SPEEDHACK_WARNINGS) | |
| 5695 | {
| |
| 5696 | #undef AC_MAX_SPEEDHACK_WARNINGS | |
| 5697 | #if defined DEBUG | |
| 5698 | printf("[Nex-AC debug] Speed: %d, old speed: %d, veh speed: %d",
| |
| 5699 | ac_s, ACInfo[playerid][acSpeed], ac_vsp); | |
| 5700 | #endif | |
| 5701 | #if defined OnCheatDetected | |
| 5702 | ac_KickWithCode(playerid, "", 0, 9, 3); | |
| 5703 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5704 | ACInfo[playerid][acCheatCount][15] = 0; | |
| 5705 | #else | |
| 5706 | return ac_KickWithCode(playerid, "", 0, 9, 3); | |
| 5707 | #endif | |
| 5708 | } | |
| 5709 | #if defined OnCheatWarning | |
| 5710 | else OnCheatWarning(playerid, "", 0, 9, 3, ACInfo[playerid][acCheatCount][15]); | |
| 5711 | #endif | |
| 5712 | } | |
| 5713 | else ACInfo[playerid][acCheatCount][15] = 0; | |
| 5714 | } | |
| 5715 | ACInfo[playerid][acSpeed] = ac_s; | |
| 5716 | } | |
| 5717 | ACInfo[playerid][acAnim] = ac_sa; | |
| 5718 | } | |
| 5719 | ACInfo[playerid][acSpecAct] = ac_specact; | |
| 5720 | ACInfo[playerid][acHealth] = ac_health; | |
| 5721 | ACInfo[playerid][acArmour] = ac_armour; | |
| 5722 | } | |
| 5723 | ACInfo[playerid][acVeh] = ac_vehid; | |
| 5724 | if(ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp) ACInfo[playerid][acHoldWeapon] = ac_w; | |
| 5725 | ACInfo[playerid][acLastWeapon] = ac_w; | |
| 5726 | ACInfo[playerid][acPosX] = ac_pX; | |
| 5727 | ACInfo[playerid][acPosY] = ac_pY; | |
| 5728 | ACInfo[playerid][acPosZ] = ac_pZ; | |
| 5729 | } | |
| 5730 | #if AC_USE_NPC | |
| 5731 | } | |
| 5732 | #endif | |
| 5733 | ACInfo[playerid][acUpdateTick] = ac_gtc; | |
| 5734 | #if defined ac_OnPlayerUpdate | |
| 5735 | ac_gpp = ac_OnPlayerUpdate(playerid); | |
| 5736 | #endif | |
| 5737 | #if !defined FreezeSyncPacket | |
| 5738 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) return 0; | |
| 5739 | #endif | |
| 5740 | #if defined ac_OnPlayerUpdate | |
| 5741 | return ac_gpp; | |
| 5742 | #else | |
| 5743 | return 1; | |
| 5744 | #endif | |
| 5745 | } | |
| 5746 | ||
| 5747 | #if defined _ALS_OnPlayerUpdate | |
| 5748 | #undef OnPlayerUpdate | |
| 5749 | #else | |
| 5750 | #define _ALS_OnPlayerUpdate | |
| 5751 | #endif | |
| 5752 | #define OnPlayerUpdate ac_OnPlayerUpdate | |
| 5753 | #if defined ac_OnPlayerUpdate | |
| 5754 | forward ac_OnPlayerUpdate(playerid); | |
| 5755 | #endif | |
| 5756 | ||
| 5757 | public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) | |
| 5758 | {
| |
| 5759 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5760 | #if AC_USE_NPC | |
| 5761 | if(!IsPlayerNPC(playerid)) | |
| 5762 | {
| |
| 5763 | #endif | |
| 5764 | if((newkeys & KEY_SECONDARY_ATTACK) && ACInfo[playerid][acSpecAct] == SPECIAL_ACTION_USEJETPACK && | |
| 5765 | GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_USEJETPACK) | |
| 5766 | {
| |
| 5767 | ACInfo[playerid][acDropJpX] = ACInfo[playerid][acPosX]; | |
| 5768 | ACInfo[playerid][acDropJpY] = ACInfo[playerid][acPosY]; | |
| 5769 | ACInfo[playerid][acDropJpZ] = ACInfo[playerid][acPosZ]; | |
| 5770 | } | |
| 5771 | #if defined GetPlayerSyncWeapon | |
| 5772 | new ac_w = GetPlayerSyncWeapon(playerid); | |
| 5773 | #else | |
| 5774 | new ac_w = GetPlayerWeapon(playerid); | |
| 5775 | #endif | |
| 5776 | if((newkeys & KEY_CROUCH) && (24 <= ac_w <= 25 || 33 <= ac_w <= 34)) ACInfo[playerid][acCheatCount][12] = 0; | |
| 5777 | #if AC_USE_NPC | |
| 5778 | } | |
| 5779 | #endif | |
| 5780 | #if defined ac_OnPlayerKeyStateChange | |
| 5781 | return ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys); | |
| 5782 | #else | |
| 5783 | return 1; | |
| 5784 | #endif | |
| 5785 | } | |
| 5786 | ||
| 5787 | #if defined _ALS_OnPlayerKeyStateChange | |
| 5788 | #undef OnPlayerKeyStateChange | |
| 5789 | #else | |
| 5790 | #define _ALS_OnPlayerKeyStateChange | |
| 5791 | #endif | |
| 5792 | #define OnPlayerKeyStateChange ac_OnPlayerKeyStateChange | |
| 5793 | #if defined ac_OnPlayerKeyStateChange | |
| 5794 | forward ac_OnPlayerKeyStateChange(playerid, newkeys, oldkeys); | |
| 5795 | #endif | |
| 5796 | ||
| 5797 | public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) | |
| 5798 | {
| |
| 5799 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 5800 | new ac_gtc = GetTickCount(); | |
| 5801 | if(ACInfo[playerid][acACAllow][49]) | |
| 5802 | {
| |
| 5803 | if(ac_gtc - ACInfo[playerid][acCall][2] < ac_Mtfc[2][0]) ac_FloodDetect(playerid, 2); | |
| 5804 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 5805 | else ACInfo[playerid][acFloodCount][2] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 5806 | } | |
| 5807 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][2] = ac_gtc; | |
| 5808 | #if defined ac_OnPlayerClickMap | |
| 5809 | return ac_OnPlayerClickMap(playerid, fX, fY, fZ); | |
| 5810 | #else | |
| 5811 | return 0; | |
| 5812 | #endif | |
| 5813 | } | |
| 5814 | ||
| 5815 | #if defined _ALS_OnPlayerClickMap | |
| 5816 | #undef OnPlayerClickMap | |
| 5817 | #else | |
| 5818 | #define _ALS_OnPlayerClickMap | |
| 5819 | #endif | |
| 5820 | #define OnPlayerClickMap ac_OnPlayerClickMap | |
| 5821 | #if defined ac_OnPlayerClickMap | |
| 5822 | forward ac_OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ); | |
| 5823 | #endif | |
| 5824 | ||
| 5825 | public OnPlayerClickPlayer(playerid, clickedplayerid, source) | |
| 5826 | {
| |
| 5827 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 5828 | new ac_gtc = GetTickCount(); | |
| 5829 | if(ACInfo[playerid][acACAllow][49]) | |
| 5830 | {
| |
| 5831 | if(ac_gtc - ACInfo[playerid][acCall][3] < ac_Mtfc[3][0]) | |
| 5832 | {
| |
| 5833 | ac_FloodDetect(playerid, 3); | |
| 5834 | return 1; | |
| 5835 | } | |
| 5836 | if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 5837 | else ACInfo[playerid][acFloodCount][3] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 5838 | } | |
| 5839 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][3] = ac_gtc; | |
| 5840 | #if defined ac_OnPlayerClickPlayer | |
| 5841 | return ac_OnPlayerClickPlayer(playerid, clickedplayerid, source); | |
| 5842 | #else | |
| 5843 | return 0; | |
| 5844 | #endif | |
| 5845 | } | |
| 5846 | ||
| 5847 | #if defined _ALS_OnPlayerClickPlayer | |
| 5848 | #undef OnPlayerClickPlayer | |
| 5849 | #else | |
| 5850 | #define _ALS_OnPlayerClickPlayer | |
| 5851 | #endif | |
| 5852 | #define OnPlayerClickPlayer ac_OnPlayerClickPlayer | |
| 5853 | #if defined ac_OnPlayerClickPlayer | |
| 5854 | forward ac_OnPlayerClickPlayer(playerid, clickedplayerid, source); | |
| 5855 | #endif | |
| 5856 | ||
| 5857 | #if defined OnPlayerClickTextDraw | |
| 5858 | public OnPlayerClickTextDraw(playerid, Text:clickedid) | |
| 5859 | {
| |
| 5860 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 5861 | new ac_gtc = GetTickCount(); | |
| 5862 | if(ACInfo[playerid][acACAllow][49]) | |
| 5863 | {
| |
| 5864 | if(ac_gtc - ACInfo[playerid][acCall][4] < ac_Mtfc[4][0]) | |
| 5865 | {
| |
| 5866 | ac_FloodDetect(playerid, 4); | |
| 5867 | return 1; | |
| 5868 | } | |
| 5869 | if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 5870 | else ACInfo[playerid][acFloodCount][4] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 5871 | } | |
| 5872 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][4] = ac_gtc; | |
| 5873 | #if defined ac_OnPlayerClickTextDraw | |
| 5874 | return ac_OnPlayerClickTextDraw(playerid, clickedid); | |
| 5875 | #else | |
| 5876 | return 0; | |
| 5877 | #endif | |
| 5878 | } | |
| 5879 | ||
| 5880 | #if defined _ALS_OnPlayerClickTextDraw | |
| 5881 | #undef OnPlayerClickTextDraw | |
| 5882 | #else | |
| 5883 | #define _ALS_OnPlayerClickTextDraw | |
| 5884 | #endif | |
| 5885 | #define OnPlayerClickTextDraw ac_OnPlayerClickTextDraw | |
| 5886 | #if defined ac_OnPlayerClickTextDraw | |
| 5887 | forward ac_OnPlayerClickTextDraw(playerid, Text:clickedid); | |
| 5888 | #endif | |
| 5889 | #endif | |
| 5890 | ||
| 5891 | public OnPlayerCommandText(playerid, cmdtext[]) | |
| 5892 | {
| |
| 5893 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 5894 | #if AC_USE_NPC | |
| 5895 | if(!IsPlayerNPC(playerid)) | |
| 5896 | {
| |
| 5897 | #endif | |
| 5898 | new ac_gtc = GetTickCount(); | |
| 5899 | if(ACInfo[playerid][acACAllow][49]) | |
| 5900 | {
| |
| 5901 | if(ac_gtc - ACInfo[playerid][acCall][5] < ac_Mtfc[5][0]) | |
| 5902 | {
| |
| 5903 | ac_FloodDetect(playerid, 5); | |
| 5904 | return 1; | |
| 5905 | } | |
| 5906 | if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 5907 | else ACInfo[playerid][acFloodCount][5] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 5908 | } | |
| 5909 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][5] = ac_gtc; | |
| 5910 | #if AC_USE_NPC | |
| 5911 | } | |
| 5912 | #endif | |
| 5913 | #if defined ac_OnPlayerCommandText | |
| 5914 | return ac_OnPlayerCommandText(playerid, cmdtext); | |
| 5915 | #else | |
| 5916 | return 0; | |
| 5917 | #endif | |
| 5918 | } | |
| 5919 | ||
| 5920 | #if defined _ALS_OnPlayerCommandText | |
| 5921 | #undef OnPlayerCommandText | |
| 5922 | #else | |
| 5923 | #define _ALS_OnPlayerCommandText | |
| 5924 | #endif | |
| 5925 | #define OnPlayerCommandText ac_OnPlayerCommandText | |
| 5926 | #if defined ac_OnPlayerCommandText | |
| 5927 | forward ac_OnPlayerCommandText(playerid, cmdtext[]); | |
| 5928 | #endif | |
| 5929 | ||
| 5930 | public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) | |
| 5931 | {
| |
| 5932 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5933 | new ac_gtc = GetTickCount(); | |
| 5934 | if(ACInfo[playerid][acACAllow][49]) | |
| 5935 | {
| |
| 5936 | if(ac_gtc - ACInfo[playerid][acCall][6] < ac_Mtfc[6][0]) ac_FloodDetect(playerid, 6); | |
| 5937 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 5938 | else ACInfo[playerid][acFloodCount][6] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 5939 | } | |
| 5940 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][6] = ac_gtc; | |
| 5941 | new ac_model = GetVehicleModel(vehicleid); | |
| 5942 | if(ACInfo[playerid][acACAllow][44] && | |
| 5943 | (ac_model <= 0 || !IsVehicleStreamedIn(vehicleid, playerid) && !ac_IsATrainCarriageEx(ac_model))) | |
| 5944 | {
| |
| 5945 | #if defined DEBUG | |
| 5946 | printf("[Nex-AC debug] Veh: %d, veh model: %d, ispassenger: %d", vehicleid, ac_model, ispassenger);
| |
| 5947 | #endif | |
| 5948 | return ac_KickWithCode(playerid, "", 0, 44, 1); | |
| 5949 | } | |
| 5950 | #if defined SetVehicleFakePosForPlayer\ | |
| 5951 | && defined SetVehicleFakeZAngleForPlayer | |
| 5952 | if(ACInfo[playerid][acACAllow][5] && !ac_IsATrainPartEx(ac_model)) | |
| 5953 | {
| |
| 5954 | new Float:ac_dist = GetVehicleDistanceFromPoint(vehicleid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]); | |
| 5955 | if(ac_dist >= 30.0 || ac_dist >= 20.0 && ac_model != 553 && ac_model != 577 && ac_model != 592) | |
| 5956 | {
| |
| 5957 | #if defined DEBUG | |
| 5958 | printf("[Nex-AC debug] Veh model: %d, veh: %d, dist: %f, ispassenger: %d, playerid: %d",
| |
| 5959 | ac_model, vehicleid, ac_dist, ispassenger, playerid); | |
| 5960 | #endif | |
| 5961 | #if defined OnCheatDetected | |
| 5962 | ac_KickWithCode(playerid, "", 0, 5, 3); | |
| 5963 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 5964 | #endif | |
| 5965 | SetVehicleFakeZAngleForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acZAngle]); | |
| 5966 | SetVehicleFakePosForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]); | |
| 5967 | } | |
| 5968 | } | |
| 5969 | #endif | |
| 5970 | new ac_doors, ac_tmp; | |
| 5971 | GetVehicleParamsEx(vehicleid, ac_tmp, ac_tmp, ac_tmp, ac_doors, ac_tmp, ac_tmp, ac_tmp); | |
| 5972 | if(ispassenger || ac_doors != VEHICLE_PARAMS_ON) | |
| 5973 | {
| |
| 5974 | if(ac_doors != VEHICLE_PARAMS_ON) ACInfo[playerid][acEnterSeat] = -1; | |
| 5975 | else ACInfo[playerid][acEnterSeat] = ispassenger; | |
| 5976 | if(ACInfo[playerid][acEnterVeh] != vehicleid) | |
| 5977 | {
| |
| 5978 | ACInfo[playerid][acEnterVeh] = vehicleid; | |
| 5979 | if(ac_model == 570 || ac_IsABoatEx(ac_model)) ACInfo[playerid][acEnterVehTick] = 0; | |
| 5980 | else ACInfo[playerid][acEnterVehTick] = ac_gtc; | |
| 5981 | } | |
| 5982 | } | |
| 5983 | else if(ACInfo[playerid][acEnterVeh] != vehicleid || | |
| 5984 | ACInfo[playerid][acEnterSeat] != -1 && ACInfo[playerid][acEnterSeat] != ispassenger) | |
| 5985 | {
| |
| 5986 | ACInfo[playerid][acEnterSeat] = -1; | |
| 5987 | ACInfo[playerid][acEnterVeh] = 0; | |
| 5988 | } | |
| 5989 | #if defined ac_OnPlayerEnterVehicle | |
| 5990 | return ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger); | |
| 5991 | #else | |
| 5992 | return 1; | |
| 5993 | #endif | |
| 5994 | } | |
| 5995 | ||
| 5996 | #if defined _ALS_OnPlayerEnterVehicle | |
| 5997 | #undef OnPlayerEnterVehicle | |
| 5998 | #else | |
| 5999 | #define _ALS_OnPlayerEnterVehicle | |
| 6000 | #endif | |
| 6001 | #define OnPlayerEnterVehicle ac_OnPlayerEnterVehicle | |
| 6002 | #if defined ac_OnPlayerEnterVehicle | |
| 6003 | forward ac_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger); | |
| 6004 | #endif | |
| 6005 | ||
| 6006 | public OnPlayerExitVehicle(playerid, vehicleid) | |
| 6007 | {
| |
| 6008 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6009 | new ac_gtc = GetTickCount(); | |
| 6010 | if(ACInfo[playerid][acACAllow][49]) | |
| 6011 | {
| |
| 6012 | if(ac_gtc - ACInfo[playerid][acCall][7] < ac_Mtfc[7][0]) ac_FloodDetect(playerid, 7); | |
| 6013 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 6014 | else ACInfo[playerid][acFloodCount][7] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 6015 | } | |
| 6016 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][7] = ac_gtc; | |
| 6017 | if(ACInfo[playerid][acACAllow][44] && !IsVehicleStreamedIn(vehicleid, playerid)) | |
| 6018 | {
| |
| 6019 | #if defined DEBUG | |
| 6020 | printf("[Nex-AC debug] Veh: %d, veh model: %d", vehicleid, GetVehicleModel(vehicleid));
| |
| 6021 | #endif | |
| 6022 | return ac_KickWithCode(playerid, "", 0, 44, 5); | |
| 6023 | } | |
| 6024 | if(ac_IsAnAircraftEx(GetVehicleModel(ACInfo[playerid][acVeh]))) ACInfo[playerid][acParachute] = 1; | |
| 6025 | else if(ACInfo[playerid][acParachute] != 2) ACInfo[playerid][acParachute] = 0; | |
| 6026 | #if defined ac_OnPlayerExitVehicle | |
| 6027 | return ac_OnPlayerExitVehicle(playerid, vehicleid); | |
| 6028 | #else | |
| 6029 | return 1; | |
| 6030 | #endif | |
| 6031 | } | |
| 6032 | ||
| 6033 | #if defined _ALS_OnPlayerExitVehicle | |
| 6034 | #undef OnPlayerExitVehicle | |
| 6035 | #else | |
| 6036 | #define _ALS_OnPlayerExitVehicle | |
| 6037 | #endif | |
| 6038 | #define OnPlayerExitVehicle ac_OnPlayerExitVehicle | |
| 6039 | #if defined ac_OnPlayerExitVehicle | |
| 6040 | forward ac_OnPlayerExitVehicle(playerid, vehicleid); | |
| 6041 | #endif | |
| 6042 | ||
| 6043 | #if defined OnPlayerPickUpDynamicPickup\ | |
| 6044 | && defined Streamer_GetDistanceToItem | |
| 6045 | #if defined STREAMER_ENABLE_TAGS | |
| 6046 | public OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP:pickupid) | |
| 6047 | #else | |
| 6048 | public OnPlayerPickUpDynamicPickup(playerid, pickupid) | |
| 6049 | #endif | |
| 6050 | {
| |
| 6051 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6052 | new ac_i = GetTickCount(); | |
| 6053 | if(ACInfo[playerid][acACAllow][49]) | |
| 6054 | {
| |
| 6055 | if(ac_i - ACInfo[playerid][acCall][8] < ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8); | |
| 6056 | else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 6057 | else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 6058 | } | |
| 6059 | if(ACInfo[playerid][acACAllow][6]) | |
| 6060 | {
| |
| 6061 | new Float:ac_dist, Float:ac_dist_set; | |
| 6062 | Streamer_GetDistanceToItem(ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ], STREAMER_TYPE_PICKUP, pickupid, ac_dist); | |
| 6063 | Streamer_GetDistanceToItem(ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], (ACInfo[playerid][acTpToZ] ? ACInfo[playerid][acPosZ] : ACInfo[playerid][acSetPosZ]), STREAMER_TYPE_PICKUP, pickupid, ac_dist_set); | |
| 6064 | if(ac_dist >= 15.0 && (ACInfo[playerid][acSet][7] == -1 || ac_dist_set >= 15.0)) | |
| 6065 | {
| |
| 6066 | #if defined DEBUG | |
| 6067 | printf("[Nex-AC debug] Dyn pickupid: %d, dist: %f, dist set: %f, acSet[7]: %d, playerid: %d",
| |
| 6068 | _:pickupid, ac_dist, ac_dist_set, ACInfo[playerid][acSet][7], playerid); | |
| 6069 | #endif | |
| 6070 | #if defined OnCheatDetected | |
| 6071 | ac_KickWithCode(playerid, "", 0, 6, 2); | |
| 6072 | #endif | |
| 6073 | return 0; | |
| 6074 | } | |
| 6075 | } | |
| 6076 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i; | |
| 6077 | #if AC_USE_PICKUP_WEAPONS\ | |
| 6078 | && defined Streamer_GetIntData | |
| 6079 | switch((ac_i = Streamer_GetIntData(STREAMER_TYPE_PICKUP, pickupid, E_STREAMER_EXTRA_ID))) | |
| 6080 | {
| |
| 6081 | case 1: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK; | |
| 6082 | case 2: ACInfo[playerid][acHealth] = 100; | |
| 6083 | case 3: ACInfo[playerid][acArmour] = 100; | |
| 6084 | default: | |
| 6085 | {
| |
| 6086 | if(ac_i > 100) | |
| 6087 | {
| |
| 6088 | ac_i -= 100; | |
| 6089 | new ac_s = ac_wSlot[ac_i]; | |
| 6090 | if(ACInfo[playerid][acWeapon][ac_s] == ac_i || | |
| 6091 | 3 <= ac_s <= 5 && ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i]; | |
| 6092 | } | |
| 6093 | } | |
| 6094 | } | |
| 6095 | #endif | |
| 6096 | ACInfo[playerid][acLastPickup] = _:pickupid + MAX_PICKUPS; | |
| 6097 | #if defined ac_OnPlayerPickUpDynamicPickup | |
| 6098 | return ac_OnPlayerPickUpDynamicPickup(playerid, pickupid); | |
| 6099 | #else | |
| 6100 | return 1; | |
| 6101 | #endif | |
| 6102 | } | |
| 6103 | ||
| 6104 | #if defined _ALS_OnPlayerPickUpDynamicPicku\ | |
| 6105 | || defined _ALS_OnPlayerPickUpDynPickup\ | |
| 6106 | || defined _ALS_OnPlayerPickUpDynamicPick || defined _ALS_OnPlayerPickUpDynamicPUp | |
| 6107 | #undef OnPlayerPickUpDynamicPickup | |
| 6108 | #else | |
| 6109 | #define _ALS_OnPlayerPickUpDynamicPicku | |
| 6110 | #define _ALS_OnPlayerPickUpDynPickup | |
| 6111 | #define _ALS_OnPlayerPickUpDynamicPick | |
| 6112 | #define _ALS_OnPlayerPickUpDynamicPUp | |
| 6113 | #endif | |
| 6114 | #define OnPlayerPickUpDynamicPickup ac_OnPlayerPickUpDynamicPickup | |
| 6115 | #if defined ac_OnPlayerPickUpDynamicPickup | |
| 6116 | #if defined STREAMER_ENABLE_TAGS | |
| 6117 | forward ac_OnPlayerPickUpDynamicPickup(playerid, STREAMER_TAG_PICKUP:pickupid); | |
| 6118 | #else | |
| 6119 | forward ac_OnPlayerPickUpDynamicPickup(playerid, pickupid); | |
| 6120 | #endif | |
| 6121 | #endif | |
| 6122 | #endif | |
| 6123 | ||
| 6124 | public OnPlayerPickUpPickup(playerid, pickupid) | |
| 6125 | {
| |
| 6126 | if(ACInfo[playerid][acKicked] > 0 || !(0 <= pickupid < MAX_PICKUPS)) return 0; | |
| 6127 | #if defined Streamer_GetItemStreamerID\ | |
| 6128 | && defined IsValidDynamicPickup | |
| 6129 | #if defined STREAMER_ENABLE_TAGS | |
| 6130 | new STREAMER_TAG_PICKUP:streamerid = STREAMER_TAG_PICKUP:Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid); | |
| 6131 | #else | |
| 6132 | new streamerid = Streamer_GetItemStreamerID(playerid, STREAMER_TYPE_PICKUP, pickupid); | |
| 6133 | #endif | |
| 6134 | if(!IsValidDynamicPickup(streamerid)) | |
| 6135 | {
| |
| 6136 | #endif | |
| 6137 | new ac_i = GetTickCount(); | |
| 6138 | if(ACInfo[playerid][acACAllow][49]) | |
| 6139 | {
| |
| 6140 | if(ac_i - ACInfo[playerid][acCall][8] < ac_Mtfc[8][0]) ac_FloodDetect(playerid, 8); | |
| 6141 | else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 6142 | else ACInfo[playerid][acFloodCount][8] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 6143 | } | |
| 6144 | if(ACInfo[playerid][acACAllow][6]) | |
| 6145 | {
| |
| 6146 | #if defined VectorSize | |
| 6147 | new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]), | |
| 6148 | Float:ac_dist_set = VectorSize(ACInfo[playerid][acSetPosX] - ACPickInfo[pickupid][acPosX], ACInfo[playerid][acSetPosY] - ACPickInfo[pickupid][acPosY], (ACInfo[playerid][acTpToZ] ? ACPickInfo[pickupid][acPosZ] : ACInfo[playerid][acSetPosZ]) - ACPickInfo[pickupid][acPosZ]); | |
| 6149 | #else | |
| 6150 | new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACPickInfo[pickupid][acPosX], ACPickInfo[pickupid][acPosY], ACPickInfo[pickupid][acPosZ]), | |
| 6151 | Float:ac_dist_set = floatsqroot(floatpower(ACInfo[playerid][acSetPosX] - ACPickInfo[pickupid][acPosX], 2.0) + floatpower(ACInfo[playerid][acSetPosY] - ACPickInfo[pickupid][acPosY], 2.0) + floatpower((ACInfo[playerid][acTpToZ] ? ACPickInfo[pickupid][acPosZ] : ACInfo[playerid][acSetPosZ]) - ACPickInfo[pickupid][acPosZ], 2.0)); | |
| 6152 | #endif | |
| 6153 | if(ac_dist >= 15.0 && (ACInfo[playerid][acSet][7] == -1 || ac_dist_set >= 15.0)) | |
| 6154 | {
| |
| 6155 | #if defined DEBUG | |
| 6156 | printf("[Nex-AC debug] Pickupid: %d, dist: %f, dist set: %f, acSet[7]: %d, playerid: %d",
| |
| 6157 | pickupid, ac_dist, ac_dist_set, ACInfo[playerid][acSet][7], playerid); | |
| 6158 | #endif | |
| 6159 | #if defined OnCheatDetected | |
| 6160 | ac_KickWithCode(playerid, "", 0, 6, 1); | |
| 6161 | #endif | |
| 6162 | return 0; | |
| 6163 | } | |
| 6164 | } | |
| 6165 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][8] = ac_i; | |
| 6166 | #if AC_USE_PICKUP_WEAPONS | |
| 6167 | switch(ACPickInfo[pickupid][acType]) | |
| 6168 | {
| |
| 6169 | case 1: ACInfo[playerid][acSpecAct] = SPECIAL_ACTION_USEJETPACK; | |
| 6170 | case 2: ACInfo[playerid][acHealth] = 100; | |
| 6171 | case 3: ACInfo[playerid][acArmour] = 100; | |
| 6172 | case 4: | |
| 6173 | {
| |
| 6174 | ac_i = ACPickInfo[pickupid][acWeapon]; | |
| 6175 | new ac_s = ac_wSlot[ac_i]; | |
| 6176 | if(ACInfo[playerid][acWeapon][ac_s] == ac_i || | |
| 6177 | 3 <= ac_s <= 5 && ACInfo[playerid][acWeapon][ac_s] > 0) ACInfo[playerid][acAmmo][ac_s] += ac_pAmmo[ac_i]; | |
| 6178 | } | |
| 6179 | } | |
| 6180 | #endif | |
| 6181 | ACInfo[playerid][acLastPickup] = pickupid; | |
| 6182 | #if defined Streamer_GetItemStreamerID\ | |
| 6183 | && defined IsValidDynamicPickup | |
| 6184 | } | |
| 6185 | #endif | |
| 6186 | #if defined ac_OnPlayerPickUpPickup | |
| 6187 | return ac_OnPlayerPickUpPickup(playerid, pickupid); | |
| 6188 | #else | |
| 6189 | return 1; | |
| 6190 | #endif | |
| 6191 | } | |
| 6192 | ||
| 6193 | #if defined _ALS_OnPlayerPickUpPickup | |
| 6194 | #undef OnPlayerPickUpPickup | |
| 6195 | #else | |
| 6196 | #define _ALS_OnPlayerPickUpPickup | |
| 6197 | #endif | |
| 6198 | #define OnPlayerPickUpPickup ac_OnPlayerPickUpPickup | |
| 6199 | - | #if defined IsPlayerSpawned |
| 6199 | + | |
| 6200 | forward ac_OnPlayerPickUpPickup(playerid, pickupid); | |
| 6201 | #endif | |
| 6202 | ||
| 6203 | public OnPlayerRequestClass(playerid, classid) | |
| 6204 | {
| |
| 6205 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6206 | new ac_i; | |
| 6207 | #if !defined PAWNRAKNET_INC_ | |
| 6208 | if(!ACInfo[playerid][acForceClass]) | |
| 6209 | {
| |
| 6210 | #if defined WC_IsPlayerSpawned | |
| 6211 | if(WC_IsPlayerSpawned(playerid)) return 0; | |
| 6212 | #elseif defined IsPlayerSpawned | |
| 6213 | if(IsPlayerSpawned(playerid)) return 0; | |
| 6214 | #else | |
| 6215 | ac_i = GetPlayerState(playerid); | |
| 6216 | if(PLAYER_STATE_ONFOOT <= ac_i < PLAYER_STATE_WASTED || ac_i == PLAYER_STATE_SPAWNED) return 0; | |
| 6217 | #endif | |
| 6218 | } | |
| 6219 | #endif | |
| 6220 | #if AC_USE_NPC | |
| 6221 | if(!IsPlayerNPC(playerid)) | |
| 6222 | {
| |
| 6223 | #endif | |
| 6224 | ac_i = GetTickCount(); | |
| 6225 | if(ACInfo[playerid][acACAllow][49]) | |
| 6226 | {
| |
| 6227 | if(ac_i - ACInfo[playerid][acCall][9] < ac_Mtfc[9][0]) ac_FloodDetect(playerid, 9); | |
| 6228 | else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 6229 | else ACInfo[playerid][acFloodCount][9] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 6230 | } | |
| 6231 | ACInfo[playerid][acClassRes] = true; | |
| 6232 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][9] = ac_i; | |
| 6233 | ACInfo[playerid][acSpawnPosX] = ac_ClassPos[classid][0]; | |
| 6234 | ACInfo[playerid][acSpawnPosY] = ac_ClassPos[classid][1]; | |
| 6235 | ACInfo[playerid][acSpawnPosZ] = ac_ClassPos[classid][2]; | |
| 6236 | ACInfo[playerid][acSpawnWeapon1] = ac_ClassWeapon[classid][0]; | |
| 6237 | ACInfo[playerid][acSpawnAmmo1] = ac_ClassAmmo[classid][0]; | |
| 6238 | ACInfo[playerid][acSpawnWeapon2] = ac_ClassWeapon[classid][1]; | |
| 6239 | ACInfo[playerid][acSpawnAmmo2] = ac_ClassAmmo[classid][1]; | |
| 6240 | ACInfo[playerid][acSpawnWeapon3] = ac_ClassWeapon[classid][2]; | |
| 6241 | ACInfo[playerid][acSpawnAmmo3] = ac_ClassAmmo[classid][2]; | |
| 6242 | #if AC_USE_NPC | |
| 6243 | } | |
| 6244 | #endif | |
| 6245 | #if defined ac_OnPlayerRequestClass | |
| 6246 | return ac_OnPlayerRequestClass(playerid, classid); | |
| 6247 | #else | |
| 6248 | return 1; | |
| 6249 | #endif | |
| 6250 | } | |
| 6251 | ||
| 6252 | #if defined _ALS_OnPlayerRequestClass | |
| 6253 | #undef OnPlayerRequestClass | |
| 6254 | #else | |
| 6255 | #define _ALS_OnPlayerRequestClass | |
| 6256 | #endif | |
| 6257 | #define OnPlayerRequestClass ac_OnPlayerRequestClass | |
| 6258 | #if defined ac_OnPlayerRequestClass | |
| 6259 | forward ac_OnPlayerRequestClass(playerid, classid); | |
| 6260 | #endif | |
| 6261 | ||
| 6262 | public OnPlayerSelectedMenuRow(playerid, row) | |
| 6263 | {
| |
| 6264 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6265 | new ac_gtc = GetTickCount(); | |
| 6266 | if(ACInfo[playerid][acACAllow][49]) | |
| 6267 | {
| |
| 6268 | if(ac_gtc - ACInfo[playerid][acCall][10] < ac_Mtfc[10][0]) ac_FloodDetect(playerid, 10); | |
| 6269 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 6270 | else ACInfo[playerid][acFloodCount][10] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 6271 | } | |
| 6272 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][10] = ac_gtc; | |
| 6273 | #if defined ac_OnPlayerSelectedMenuRow | |
| 6274 | return ac_OnPlayerSelectedMenuRow(playerid, row); | |
| 6275 | #else | |
| 6276 | return 1; | |
| 6277 | #endif | |
| 6278 | } | |
| 6279 | ||
| 6280 | #if defined _ALS_OnPlayerSelectedMenuRow | |
| 6281 | #undef OnPlayerSelectedMenuRow | |
| 6282 | #else | |
| 6283 | #define _ALS_OnPlayerSelectedMenuRow | |
| 6284 | #endif | |
| 6285 | #define OnPlayerSelectedMenuRow ac_OnPlayerSelectedMenuRow | |
| 6286 | #if defined ac_OnPlayerSelectedMenuRow | |
| 6287 | forward ac_OnPlayerSelectedMenuRow(playerid, row); | |
| 6288 | #endif | |
| 6289 | ||
| 6290 | public OnPlayerStateChange(playerid, newstate, oldstate) | |
| 6291 | {
| |
| 6292 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6293 | #if AC_USE_NPC | |
| 6294 | if(!IsPlayerNPC(playerid)) | |
| 6295 | {
| |
| 6296 | #endif | |
| 6297 | new ac_i = GetTickCount(), ac_s = GetPlayerPing(playerid); | |
| 6298 | if(ACInfo[playerid][acACAllow][49]) | |
| 6299 | {
| |
| 6300 | if(ac_i - ACInfo[playerid][acCall][11] < ac_Mtfc[11][0]) | |
| 6301 | {
| |
| 6302 | if(newstate != PLAYER_STATE_ONFOOT || oldstate != PLAYER_STATE_SPAWNED) | |
| 6303 | {
| |
| 6304 | new ac_model; | |
| 6305 | if(oldstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(ACInfo[playerid][acVeh]); | |
| 6306 | else if(newstate == PLAYER_STATE_DRIVER) ac_model = GetVehicleModel(GetPlayerVehicleID(playerid)); | |
| 6307 | if(!ac_IsABoatEx(ac_model)) ac_FloodDetect(playerid, 11); | |
| 6308 | } | |
| 6309 | } | |
| 6310 | else if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 6311 | else ACInfo[playerid][acFloodCount][11] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 6312 | } | |
| 6313 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][11] = ac_i; | |
| 6314 | switch(oldstate) | |
| 6315 | {
| |
| 6316 | case PLAYER_STATE_NONE, PLAYER_STATE_WASTED: | |
| 6317 | {
| |
| 6318 | if(ACInfo[playerid][acACAllow][48] && !(PLAYER_STATE_SPAWNED <= newstate <= PLAYER_STATE_SPECTATING)) | |
| 6319 | {
| |
| 6320 | #if defined DEBUG | |
| 6321 | printf("[Nex-AC debug] Newstate: %d, oldstate: %d", newstate, oldstate);
| |
| 6322 | #endif | |
| 6323 | ac_KickWithCode(playerid, "", 0, 48, 2); | |
| 6324 | - | (ACInfo[playerid][acPosZ] >= -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 || |
| 6324 | + | |
| 6325 | } | |
| 6326 | case PLAYER_STATE_DRIVER: | |
| 6327 | {
| |
| 6328 | new ac_t = ACInfo[playerid][acVeh]; | |
| 6329 | - | (ACInfo[playerid][acPosZ] >= -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 || |
| 6329 | + | |
| 6330 | ac_t = GetVehicleModel(ac_t); | |
| 6331 | if(1 <= ACInfo[playerid][acHealth] < 5 && ac_IsABikeEx(ac_t)) ACInfo[playerid][acHealth] = 5; | |
| 6332 | new Float:ac_x, Float:ac_y, Float:ac_z; | |
| 6333 | GetPlayerPos(playerid, ac_x, ac_y, ac_z); | |
| 6334 | #if defined VectorSize | |
| 6335 | if(ACInfo[playerid][acACAllow][2] && | |
| 6336 | newstate == PLAYER_STATE_ONFOOT && ac_i - ACInfo[playerid][acGtc][10] > ac_s && | |
| 6337 | (ACInfo[playerid][acPosZ] >= -90.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 || | |
| 6338 | VectorSize(ac_x - ACInfo[playerid][acPosX], ac_y - ACInfo[playerid][acPosY], 0.0) >= 180.0)) | |
| 6339 | #else | |
| 6340 | if(ACInfo[playerid][acACAllow][2] && | |
| 6341 | newstate == PLAYER_STATE_ONFOOT && ac_i - ACInfo[playerid][acGtc][10] > ac_s && | |
| 6342 | (ACInfo[playerid][acPosZ] >= -90.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 || | |
| 6343 | floatsqroot(floatpower(ac_x - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_y - ACInfo[playerid][acPosY], 2.0)) >= 180.0)) | |
| 6344 | #endif | |
| 6345 | {
| |
| 6346 | if(!ac_IsAnAircraftEx(ac_t)) ac_z = ACInfo[playerid][acPosZ]; | |
| 6347 | if((ac_x = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ac_z)) >= 50.0) | |
| 6348 | {
| |
| 6349 | #if defined DEBUG | |
| 6350 | printf("[Nex-AC debug] Veh model: %d, veh: %d, dist: %f", ac_t, ACInfo[playerid][acVeh], ac_x);
| |
| 6351 | #endif | |
| 6352 | ac_KickWithCode(playerid, "", 0, 2, 4); | |
| 6353 | } | |
| 6354 | - | (ACInfo[playerid][acPosZ] >= -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 || |
| 6354 | + | |
| 6355 | GetPlayerVelocity(playerid, ac_x, ac_y, ac_z); | |
| 6356 | ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_x, ac_y, ac_z); | |
| 6357 | if(ACInfo[playerid][acSet][7] == 3) ACInfo[playerid][acSet][7] = -1; | |
| 6358 | ACInfo[playerid][acGtc][15] = ACInfo[playerid][acGtc][9] = ac_i + 1650; | |
| 6359 | - | (ACInfo[playerid][acPosZ] >= -95.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 || |
| 6359 | + | |
| 6360 | case PLAYER_STATE_PASSENGER: | |
| 6361 | {
| |
| 6362 | new Float:ac_x, Float:ac_y, Float:ac_z; | |
| 6363 | GetPlayerPos(playerid, ac_x, ac_y, ac_z); | |
| 6364 | #if defined VectorSize | |
| 6365 | if(ACInfo[playerid][acACAllow][2] && | |
| 6366 | newstate == PLAYER_STATE_ONFOOT && ac_i - ACInfo[playerid][acGtc][10] > ac_s && | |
| 6367 | (ACInfo[playerid][acPosZ] >= -90.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 || | |
| 6368 | VectorSize(ac_x - ACInfo[playerid][acPosX], ac_y - ACInfo[playerid][acPosY], 0.0) >= 180.0)) | |
| 6369 | #else | |
| 6370 | if(ACInfo[playerid][acACAllow][2] && | |
| 6371 | newstate == PLAYER_STATE_ONFOOT && ac_i - ACInfo[playerid][acGtc][10] > ac_s && | |
| 6372 | (ACInfo[playerid][acPosZ] >= -90.0 || ac_z - ACInfo[playerid][acPosZ] < 40.0 || | |
| 6373 | floatsqroot(floatpower(ac_x - ACInfo[playerid][acPosX], 2.0) + floatpower(ac_y - ACInfo[playerid][acPosY], 2.0)) >= 180.0)) | |
| 6374 | #endif | |
| 6375 | {
| |
| 6376 | new ac_vehid = ACInfo[playerid][acVeh], ac_model = GetVehicleModel(ac_vehid); | |
| 6377 | ac_s = ACVehInfo[ac_vehid][acDriver]; | |
| 6378 | ac_x = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]); | |
| 6379 | if(ac_x >= 180.0 || ac_x >= 50.0 && (ac_s == INVALID_PLAYER_ID || ac_i - ACInfo[ac_s][acUpdateTick] < 2000) && !ac_IsATrainPartEx(ac_model)) | |
| 6380 | {
| |
| 6381 | #if defined DEBUG | |
| 6382 | - | !(PLAYER_STATE_WASTED <= newstate <= PLAYER_STATE_SPAWNED) && ac_i > ACInfo[playerid][acGtc][0] + ac_s) |
| 6382 | + | |
| 6383 | else printf("[Nex-AC debug] Veh model: %d, veh: %d, driver AFK time: %d, dist: %f", ac_model, ac_vehid, ac_i - ACInfo[ac_s][acUpdateTick], ac_x);
| |
| 6384 | #endif | |
| 6385 | ac_KickWithCode(playerid, "", 0, 2, 5); | |
| 6386 | } | |
| 6387 | } | |
| 6388 | GetPlayerVelocity(playerid, ac_x, ac_y, ac_z); | |
| 6389 | ACInfo[playerid][acSpeed] = ac_GetSpeed(ac_x, ac_y, ac_z); | |
| 6390 | ACInfo[playerid][acGtc][15] = ACInfo[playerid][acGtc][9] = ac_i + 1650; | |
| 6391 | } | |
| 6392 | case PLAYER_STATE_SPECTATING: | |
| 6393 | {
| |
| 6394 | if(ACInfo[playerid][acACAllow][48] && | |
| 6395 | !(PLAYER_STATE_WASTED <= newstate <= PLAYER_STATE_SPAWNED) && ac_i - ACInfo[playerid][acGtc][0] > ac_s) | |
| 6396 | {
| |
| 6397 | #if defined DEBUG | |
| 6398 | printf("[Nex-AC debug] Newstate: %d", newstate);
| |
| 6399 | #endif | |
| 6400 | ac_KickWithCode(playerid, "", 0, 48, 3); | |
| 6401 | } | |
| 6402 | } | |
| 6403 | } | |
| 6404 | switch(newstate) | |
| 6405 | {
| |
| 6406 | case PLAYER_STATE_ONFOOT: | |
| 6407 | {
| |
| 6408 | ACInfo[playerid][acSet][9] = -1; | |
| 6409 | if(PLAYER_STATE_DRIVER <= oldstate <= PLAYER_STATE_PASSENGER) | |
| 6410 | {
| |
| 6411 | GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]); | |
| 6412 | ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX]; | |
| 6413 | ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY]; | |
| 6414 | } | |
| 6415 | } | |
| 6416 | case PLAYER_STATE_DRIVER, PLAYER_STATE_PASSENGER: | |
| 6417 | {
| |
| 6418 | ACInfo[playerid][acSet][9] = -1; | |
| 6419 | new ac_vehid = GetPlayerVehicleID(playerid), ac_seat = GetPlayerVehicleSeat(playerid); | |
| 6420 | ac_s = GetVehicleModel(ac_vehid); | |
| 6421 | if(ac_s <= 0) | |
| 6422 | {
| |
| 6423 | if(ACInfo[playerid][acACAllow][44]) | |
| 6424 | {
| |
| 6425 | #if defined DEBUG | |
| 6426 | printf("[Nex-AC debug] Veh model: %d, veh: %d, seatid: %d", ac_s, ac_vehid, ac_seat);
| |
| 6427 | #endif | |
| 6428 | ac_KickWithCode(playerid, "", 0, 44, 2); | |
| 6429 | } | |
| 6430 | } | |
| 6431 | else if(ACInfo[playerid][acSet][8] == -1) | |
| 6432 | {
| |
| 6433 | if(ACInfo[playerid][acACAllow][44]) | |
| 6434 | {
| |
| 6435 | new ac_maxseats = ac_GetMaxPassengers(ac_s); | |
| 6436 | if(newstate == PLAYER_STATE_DRIVER) | |
| 6437 | {
| |
| 6438 | if(ac_seat != 0 || ac_maxseats == 15) | |
| 6439 | {
| |
| 6440 | #if defined DEBUG | |
| 6441 | printf("[Nex-AC debug] Veh model: %d, veh: %d, seatid: %d", ac_s, ac_vehid, ac_seat);
| |
| 6442 | #endif | |
| 6443 | ac_KickWithCode(playerid, "", 0, 44, 3); | |
| 6444 | } | |
| 6445 | } | |
| 6446 | else if(ac_seat < 1 || ac_maxseats == 15 || ac_seat > ac_maxseats && !ac_IsABusEx(ac_s) && ac_s != 570) | |
| 6447 | {
| |
| 6448 | #if defined DEBUG | |
| 6449 | printf("[Nex-AC debug] Veh model: %d, veh: %d, max seats: %d, seatid: %d",
| |
| 6450 | ac_s, ac_vehid, ac_maxseats, ac_seat); | |
| 6451 | #endif | |
| 6452 | ac_KickWithCode(playerid, "", 0, 44, 4); | |
| 6453 | } | |
| 6454 | } | |
| 6455 | if(ACInfo[playerid][acACAllow][4] && !ACInfo[playerid][acSpec]) | |
| 6456 | {
| |
| 6457 | if(ACInfo[playerid][acEnterVeh] != ac_vehid || | |
| 6458 | ACInfo[playerid][acEnterSeat] != -1 && ACInfo[playerid][acEnterSeat] != _:!!ac_seat || | |
| 6459 | ac_i - ACInfo[playerid][acEnterVehTick] < 300) | |
| 6460 | {
| |
| 6461 | #if defined DEBUG | |
| 6462 | printf("[Nex-AC debug] Entered veh: %d, veh: %d, entered seat: %d, seat: %d, veh model: %d, enter time: %d",
| |
| 6463 | ACInfo[playerid][acEnterVeh], ac_vehid, ACInfo[playerid][acEnterSeat], ac_seat, ac_s, ac_i - ACInfo[playerid][acEnterVehTick]); | |
| 6464 | #endif | |
| 6465 | ac_KickWithCode(playerid, "", 0, 4, 1); | |
| 6466 | } | |
| 6467 | else | |
| 6468 | {
| |
| 6469 | new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]); | |
| 6470 | if(newstate == PLAYER_STATE_DRIVER) | |
| 6471 | {
| |
| 6472 | if(ac_dist >= 30.0 || ac_dist >= 20.0 && ac_s != 553 && ac_s != 577 && ac_s != 592) | |
| 6473 | {
| |
| 6474 | #if defined DEBUG | |
| 6475 | printf("[Nex-AC debug] Veh model: %d, veh: %d, dist: %f", ac_s, ac_vehid, ac_dist);
| |
| 6476 | #endif | |
| 6477 | ac_KickWithCode(playerid, "", 0, 4, 3); | |
| 6478 | } | |
| 6479 | } | |
| 6480 | else if(ac_dist >= 80.0 || ac_dist >= 30.0 && ac_i - ACInfo[playerid][acUpdateTick] >= 1500) | |
| 6481 | {
| |
| 6482 | #if defined DEBUG | |
| 6483 | printf("[Nex-AC debug] Veh model: %d, veh: %d, AFK time: %d, dist: %f",
| |
| 6484 | ac_s, ac_vehid, ac_i - ACInfo[playerid][acUpdateTick], ac_dist); | |
| 6485 | #endif | |
| 6486 | ac_KickWithCode(playerid, "", 0, 4, 4); | |
| 6487 | } | |
| 6488 | #if defined SetVehicleFakePosForPlayer\ | |
| 6489 | && defined SetVehicleFakeZAngleForPlayer | |
| 6490 | if(ACInfo[playerid][acKicked] < 1 && !ac_IsATrainPartEx(ac_s)) | |
| 6491 | {
| |
| 6492 | ac_dist = GetPlayerDistanceFromPoint(playerid, ACVehInfo[ac_vehid][acPosX], ACVehInfo[ac_vehid][acPosY], ACVehInfo[ac_vehid][acPosZ]); | |
| 6493 | if(newstate == PLAYER_STATE_DRIVER) | |
| 6494 | {
| |
| 6495 | if(ac_dist >= 30.0 || ac_dist >= 20.0 && ac_s != 553 && ac_s != 577 && ac_s != 592) | |
| 6496 | {
| |
| 6497 | #if defined DEBUG | |
| 6498 | printf("[Nex-AC debug] Veh model: %d, veh: %d, dist: %f", ac_s, ac_vehid, ac_dist);
| |
| 6499 | #endif | |
| 6500 | ac_KickWithCode(playerid, "", 0, 4, 5); | |
| 6501 | } | |
| 6502 | } | |
| 6503 | else if(ac_dist >= 80.0 || ac_dist >= 30.0 && ac_i - ACInfo[playerid][acUpdateTick] >= 1500) | |
| 6504 | {
| |
| 6505 | #if defined DEBUG | |
| 6506 | printf("[Nex-AC debug] Veh model: %d, veh: %d, AFK time: %d, dist: %f",
| |
| 6507 | ac_s, ac_vehid, ac_i - ACInfo[playerid][acUpdateTick], ac_dist); | |
| 6508 | #endif | |
| 6509 | ac_KickWithCode(playerid, "", 0, 4, 6); | |
| 6510 | } | |
| 6511 | } | |
| 6512 | #endif | |
| 6513 | } | |
| 6514 | } | |
| 6515 | if(newstate == PLAYER_STATE_DRIVER && ACInfo[playerid][acKicked] < 1) | |
| 6516 | {
| |
| 6517 | ACVehInfo[ac_vehid][acDriver] = playerid; | |
| 6518 | GetPlayerPos(playerid, ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ]); | |
| 6519 | ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX]; | |
| 6520 | ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY]; | |
| 6521 | ACInfo[playerid][acSetVehHealth] = -1.0; | |
| 6522 | ACInfo[playerid][acCheatCount][10] = 0; | |
| 6523 | ACInfo[playerid][acVehDmgRes] = false; | |
| 6524 | } | |
| 6525 | ACInfo[playerid][acEnterSeat] = -1; | |
| 6526 | ACInfo[playerid][acEnterVeh] = 0; | |
| 6527 | } | |
| 6528 | } | |
| 6529 | case PLAYER_STATE_SPAWNED: | |
| 6530 | {
| |
| 6531 | ACInfo[playerid][acPosX] = ACInfo[playerid][acSpawnPosX]; | |
| 6532 | ACInfo[playerid][acPosY] = ACInfo[playerid][acSpawnPosY]; | |
| 6533 | ACInfo[playerid][acPosZ] = ACInfo[playerid][acSpawnPosZ]; | |
| 6534 | ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX]; | |
| 6535 | ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY]; | |
| 6536 | } | |
| 6537 | case PLAYER_STATE_SPECTATING: | |
| 6538 | {
| |
| 6539 | if(ACInfo[playerid][acACAllow][21] && !ACInfo[playerid][acSpec] && | |
| 6540 | ACInfo[playerid][acSet][5] == -1) ac_KickWithCode(playerid, "", 0, 21); | |
| 6541 | if(ACInfo[playerid][acKicked] < 1) | |
| 6542 | {
| |
| 6543 | ACInfo[playerid][acHealth] = 100; | |
| 6544 | ACInfo[playerid][acSet][5] = -1; | |
| 6545 | ACInfo[playerid][acSpec] = true; | |
| 6546 | } | |
| 6547 | } | |
| 6548 | } | |
| 6549 | #if AC_USE_NPC | |
| 6550 | } | |
| 6551 | #endif | |
| 6552 | #if defined ac_OnPlayerStateChange | |
| 6553 | return ac_OnPlayerStateChange(playerid, newstate, oldstate); | |
| 6554 | #else | |
| 6555 | return 1; | |
| 6556 | #endif | |
| 6557 | } | |
| 6558 | ||
| 6559 | #if defined _ALS_OnPlayerStateChange | |
| 6560 | #undef OnPlayerStateChange | |
| 6561 | #else | |
| 6562 | #define _ALS_OnPlayerStateChange | |
| 6563 | #endif | |
| 6564 | #define OnPlayerStateChange ac_OnPlayerStateChange | |
| 6565 | #if defined ac_OnPlayerStateChange | |
| 6566 | forward ac_OnPlayerStateChange(playerid, newstate, oldstate); | |
| 6567 | #endif | |
| 6568 | ||
| 6569 | #if defined OnPlayerWeaponShot | |
| 6570 | public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) | |
| 6571 | {
| |
| 6572 | #if defined IsPlayerDying | |
| 6573 | if(ACInfo[playerid][acKicked] > 0 || IsPlayerDying(playerid)) return 0; | |
| 6574 | #else | |
| 6575 | if(ACInfo[playerid][acKicked] > 0 || ACInfo[playerid][acDead]) return 0; | |
| 6576 | #endif | |
| 6577 | if(ACInfo[playerid][acACAllow][22] && !ac_LagCompMode) | |
| 6578 | {
| |
| 6579 | #if defined OnCheatDetected | |
| 6580 | ac_KickWithCode(playerid, "", 0, 22); | |
| 6581 | #endif | |
| 6582 | return 0; | |
| 6583 | } | |
| 6584 | if(ACInfo[playerid][acACAllow][47] && | |
| 6585 | (!(BULLET_HIT_TYPE_NONE <= hittype <= BULLET_HIT_TYPE_PLAYER_OBJECT) || | |
| 6586 | hittype == BULLET_HIT_TYPE_PLAYER && !(0 <= hitid < MAX_PLAYERS) || | |
| 6587 | hittype == BULLET_HIT_TYPE_VEHICLE && !(1 <= hitid < MAX_VEHICLES) || | |
| 6588 | hittype == BULLET_HIT_TYPE_OBJECT && !(1 <= hitid < MAX_OBJECTS) || | |
| 6589 | - | if(ac_dist >= 50.0 || ac_dist >= 15.0 && !IsPlayerInAnyVehicle(playerid) && |
| 6589 | + | |
| 6590 | !ac_IsBulletWeapon(weaponid))) | |
| 6591 | {
| |
| 6592 | #if defined DEBUG | |
| 6593 | printf("[Nex-AC debug] Hittype: %d, hitid: %d, weaponid: %d", hittype, hitid, weaponid);
| |
| 6594 | #endif | |
| 6595 | return ac_KickWithCode(playerid, "", 0, 47, 1); | |
| 6596 | } | |
| 6597 | new Float:ac_oX, Float:ac_oY, Float:ac_oZ, Float:ac_hX, Float:ac_hY, Float:ac_hZ; | |
| 6598 | GetPlayerLastShotVectors(playerid, ac_oX, ac_oY, ac_oZ, ac_hX, ac_hY, ac_hZ); | |
| 6599 | if(ACInfo[playerid][acACAllow][34]) | |
| 6600 | {
| |
| 6601 | new Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ac_oX, ac_oY, ac_oZ); | |
| 6602 | if(ac_dist >= 80.0 || ac_dist >= 15.0 && ACInfo[playerid][acVeh] == 0 && | |
| 6603 | !IsVehicleStreamedIn(GetPlayerSurfingVehicleID(playerid), playerid) && | |
| 6604 | GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID) | |
| 6605 | {
| |
| 6606 | if(++ACInfo[playerid][acCheatCount][5] > AC_MAX_AFK_GHOST_WARNINGS) | |
| 6607 | {
| |
| 6608 | #undef AC_MAX_AFK_GHOST_WARNINGS | |
| 6609 | #if defined DEBUG | |
| 6610 | printf("[Nex-AC debug] Weaponid: %d, origin dist: %f", weaponid, ac_dist);
| |
| 6611 | #endif | |
| 6612 | #if defined OnCheatDetected | |
| 6613 | ac_KickWithCode(playerid, "", 0, 34); | |
| 6614 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6615 | ACInfo[playerid][acCheatCount][5] = 0; | |
| 6616 | #else | |
| 6617 | return ac_KickWithCode(playerid, "", 0, 34); | |
| 6618 | #endif | |
| 6619 | } | |
| 6620 | #if defined OnCheatWarning | |
| 6621 | else OnCheatWarning(playerid, "", 0, 34, 0, ACInfo[playerid][acCheatCount][5]); | |
| 6622 | #endif | |
| 6623 | } | |
| 6624 | else ACInfo[playerid][acCheatCount][5] = 0; | |
| 6625 | } | |
| 6626 | new ac_gtc = GetTickCount(), ac_gpp = GetPlayerPing(playerid); | |
| 6627 | if(ACInfo[playerid][acACAllow][29]) | |
| 6628 | {
| |
| 6629 | if(hittype > BULLET_HIT_TYPE_NONE) | |
| 6630 | {
| |
| 6631 | if(fX == 0.0 && fY == 0.0 && fZ == 0.0 || ac_oX == ac_hX && ac_oY == ac_hY || | |
| 6632 | ac_oX == ACInfo[playerid][acPosX] || ac_oY == ACInfo[playerid][acPosY] || ac_oZ == ACInfo[playerid][acPosZ]) | |
| 6633 | {
| |
| 6634 | if(++ACInfo[playerid][acCheatCount][11] > AC_MAX_SILENT_AIM_WARNINGS) | |
| 6635 | {
| |
| 6636 | #undef AC_MAX_SILENT_AIM_WARNINGS | |
| 6637 | #if defined DEBUG | |
| 6638 | printf("[Nex-AC debug] Hittype: %d, weaponid: %d, pZ: %f, oZ: %f, fX, fY, fZ: %f, %f, %f",
| |
| 6639 | hittype, weaponid, ACInfo[playerid][acPosZ], ac_oZ, fX, fY, fZ); | |
| 6640 | #endif | |
| 6641 | #if defined OnCheatDetected | |
| 6642 | ac_KickWithCode(playerid, "", 0, 29, 1); | |
| 6643 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6644 | ACInfo[playerid][acCheatCount][11] = 0; | |
| 6645 | #else | |
| 6646 | return ac_KickWithCode(playerid, "", 0, 29, 1); | |
| 6647 | #endif | |
| 6648 | } | |
| 6649 | #if defined OnCheatWarning | |
| 6650 | else OnCheatWarning(playerid, "", 0, 29, 1, ACInfo[playerid][acCheatCount][11]); | |
| 6651 | #endif | |
| 6652 | } | |
| 6653 | - | if(ac_dist >= 50.0 || ac_dist >= 20.0 && !IsPlayerInAnyVehicle(hitid) && |
| 6653 | + | |
| 6654 | {
| |
| 6655 | if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID) | |
| 6656 | {
| |
| 6657 | #if defined IsPlayerDying | |
| 6658 | if(!IsPlayerDying(hitid)) | |
| 6659 | #else | |
| 6660 | if(!ACInfo[hitid][acDead]) | |
| 6661 | #endif | |
| 6662 | {
| |
| 6663 | if(ac_gtc - ACInfo[hitid][acSetPosTick] > ac_gpp && ac_gtc - ACInfo[hitid][acUpdateTick] < 1500) | |
| 6664 | {
| |
| 6665 | new Float:ac_dist = GetPlayerDistanceFromPoint(hitid, ac_hX, ac_hY, ac_hZ); | |
| 6666 | if(ac_dist >= 50.0 || ac_dist >= 20.0 && ACInfo[hitid][acVeh] == 0 && | |
| 6667 | !IsVehicleStreamedIn(GetPlayerSurfingVehicleID(hitid), hitid) && | |
| 6668 | GetPlayerSurfingObjectID(hitid) == INVALID_OBJECT_ID) | |
| 6669 | {
| |
| 6670 | if(++ACInfo[playerid][acCheatCount][6] > AC_MAX_PRO_AIM_WARNINGS) | |
| 6671 | {
| |
| 6672 | #undef AC_MAX_PRO_AIM_WARNINGS | |
| 6673 | #if defined DEBUG | |
| 6674 | printf("[Nex-AC debug] Weaponid: %d, hit dist: %f", weaponid, ac_dist);
| |
| 6675 | #endif | |
| 6676 | #if defined OnCheatDetected | |
| 6677 | ac_KickWithCode(playerid, "", 0, 29, 2); | |
| 6678 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6679 | ACInfo[playerid][acCheatCount][6] = 0; | |
| 6680 | #else | |
| 6681 | return ac_KickWithCode(playerid, "", 0, 29, 2); | |
| 6682 | #endif | |
| 6683 | } | |
| 6684 | #if defined OnCheatWarning | |
| 6685 | else OnCheatWarning(playerid, "", 0, 29, 2, ACInfo[playerid][acCheatCount][6]); | |
| 6686 | #endif | |
| 6687 | } | |
| 6688 | else ACInfo[playerid][acCheatCount][6] = 0; | |
| 6689 | } | |
| 6690 | } | |
| 6691 | } | |
| 6692 | ACInfo[playerid][acCheatCount][11] = 0; | |
| 6693 | } | |
| 6694 | } | |
| 6695 | else ACInfo[playerid][acCheatCount][11] = 0; | |
| 6696 | } | |
| 6697 | new ac_i, ac_t, bool:ac_ur, bool:ac_ur2; | |
| 6698 | switch(hittype) | |
| 6699 | {
| |
| 6700 | case BULLET_HIT_TYPE_PLAYER: | |
| 6701 | {
| |
| 6702 | if(hitid != INVALID_PLAYER_ID && ACInfo[hitid][acACAllow][19] && ACInfo[hitid][acUnFrozen]) | |
| 6703 | {
| |
| 6704 | #if AC_USE_NPC | |
| 6705 | #if defined IsPlayerDying | |
| 6706 | if(!IsPlayerDying(hitid) && !IsPlayerNPC(hitid)) | |
| 6707 | #else | |
| 6708 | if(!ACInfo[hitid][acDead] && !IsPlayerNPC(hitid)) | |
| 6709 | #endif | |
| 6710 | #elseif defined IsPlayerDying | |
| 6711 | if(!IsPlayerDying(hitid)) | |
| 6712 | #else | |
| 6713 | if(!ACInfo[hitid][acDead]) | |
| 6714 | #endif | |
| 6715 | {
| |
| 6716 | if(ac_gtc - ACInfo[hitid][acSetPosTick] > ac_gpp && | |
| 6717 | IsPlayerInRangeOfPoint(hitid, ac_wMinRange[weaponid - 22], ac_oX, ac_oY, ac_oZ) && | |
| 6718 | !(SPECIAL_ACTION_ENTER_VEHICLE <= ACInfo[hitid][acSpecAct] <= SPECIAL_ACTION_EXIT_VEHICLE)) | |
| 6719 | {
| |
| 6720 | ac_t = GetPlayerTeam(playerid); | |
| 6721 | if(ac_t == NO_TEAM || ac_t != GetPlayerTeam(hitid)) | |
| 6722 | {
| |
| 6723 | #if AC_USE_RESTAURANTS | |
| 6724 | if(!ac_InRestaurant(hitid, ACInfo[hitid][acInt])) | |
| 6725 | {
| |
| 6726 | #endif | |
| 6727 | #if AC_USE_AMMUNATIONS | |
| 6728 | if(!ac_InAmmuNation(hitid, ACInfo[hitid][acInt])) | |
| 6729 | {
| |
| 6730 | #endif | |
| 6731 | #if AC_USE_CASINOS | |
| 6732 | if(!ac_InCasino(hitid, ACInfo[hitid][acInt])) | |
| 6733 | {
| |
| 6734 | #endif | |
| 6735 | ac_ur = true; | |
| 6736 | #if AC_USE_CASINOS | |
| 6737 | } | |
| 6738 | #endif | |
| 6739 | #if AC_USE_AMMUNATIONS | |
| 6740 | } | |
| 6741 | #endif | |
| 6742 | #if AC_USE_RESTAURANTS | |
| 6743 | } | |
| 6744 | #endif | |
| 6745 | } | |
| 6746 | } | |
| 6747 | } | |
| 6748 | } | |
| 6749 | } | |
| 6750 | case BULLET_HIT_TYPE_VEHICLE: | |
| 6751 | {
| |
| 6752 | if(hitid != INVALID_VEHICLE_ID) | |
| 6753 | {
| |
| 6754 | ac_i = ACVehInfo[hitid][acDriver]; | |
| 6755 | #if AC_USE_NPC | |
| 6756 | if(ac_i != INVALID_PLAYER_ID && !IsPlayerNPC(ac_i)) | |
| 6757 | #else | |
| 6758 | if(ac_i != INVALID_PLAYER_ID) | |
| 6759 | #endif | |
| 6760 | {
| |
| 6761 | if(ACInfo[ac_i][acACAllow][20] && ACInfo[ac_i][acUnFrozen] && | |
| 6762 | ACVehInfo[hitid][acHealth] >= 250.0 && ac_gtc - ACInfo[ac_i][acSetPosTick] > ac_gpp) | |
| 6763 | {
| |
| 6764 | ac_t = GetPlayerTeam(playerid); | |
| 6765 | if(!ac_VehFriendlyFire || ac_t == NO_TEAM || ac_t != GetPlayerTeam(ac_i)) | |
| 6766 | {
| |
| 6767 | ac_t = GetVehicleModel(hitid); | |
| 6768 | new Float:ac_wX, Float:ac_wY, Float:ac_wZ; | |
| 6769 | GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSFRONT, ac_hX, ac_hY, ac_hZ); | |
| 6770 | GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSREAR, ac_oX, ac_oY, ac_oZ); | |
| 6771 | GetVehicleModelInfo(ac_t, VEHICLE_MODEL_INFO_WHEELSMID, ac_wX, ac_wY, ac_wZ); | |
| 6772 | #if defined VectorSize | |
| 6773 | if(VectorSize(ac_hX - fX, ac_hY - fY, ac_hZ - fZ) > 1.2 && | |
| 6774 | VectorSize(-ac_hX - fX, ac_hY - fY, ac_hZ - fZ) > 1.2 && | |
| 6775 | VectorSize(ac_oX - fX, ac_oY - fY, ac_oZ - fZ) > 1.2 && | |
| 6776 | VectorSize(-ac_oX - fX, ac_oY - fY, ac_oZ - fZ) > 1.2 && | |
| 6777 | (ac_wX == 0.0 && ac_wY == 0.0 && ac_wZ == 0.0 || VectorSize(ac_wX - fX, ac_wY - fY, ac_wZ - fZ) > 1.2 && | |
| 6778 | VectorSize(-ac_wX - fX, ac_wY - fY, ac_wZ - fZ) > 1.2)) ac_ur2 = true; | |
| 6779 | #else | |
| 6780 | if(floatsqroot(floatpower(ac_hX - fX, 2.0) + floatpower(ac_hY - fY, 2.0) + floatpower(ac_hZ - fZ, 2.0)) > 1.2 && | |
| 6781 | floatsqroot(floatpower(-ac_hX - fX, 2.0) + floatpower(ac_hY - fY, 2.0) + floatpower(ac_hZ - fZ, 2.0)) > 1.2 && | |
| 6782 | floatsqroot(floatpower(ac_oX - fX, 2.0) + floatpower(ac_oY - fY, 2.0) + floatpower(ac_oZ - fZ, 2.0)) > 1.2 && | |
| 6783 | floatsqroot(floatpower(-ac_oX - fX, 2.0) + floatpower(ac_oY - fY, 2.0) + floatpower(ac_oZ - fZ, 2.0)) > 1.2 && | |
| 6784 | (ac_wX == 0.0 && ac_wY == 0.0 && ac_wZ == 0.0 || floatsqroot(floatpower(ac_wX - fX, 2.0) + floatpower(ac_wY - fY, 2.0) + floatpower(ac_wZ - fZ, 2.0)) > 1.2 && | |
| 6785 | floatsqroot(floatpower(-ac_wX - fX, 2.0) + floatpower(ac_wY - fY, 2.0) + floatpower(ac_wZ - fZ, 2.0)) > 1.2)) ac_ur2 = true; | |
| 6786 | #endif | |
| 6787 | } | |
| 6788 | } | |
| 6789 | } | |
| 6790 | } | |
| 6791 | } | |
| 6792 | } | |
| 6793 | new ac_s = ac_wSlot[weaponid]; | |
| 6794 | ac_t = GetPlayerState(playerid); | |
| 6795 | - | if((ac_i = GetPlayerSyncWeapon(playerid)) != weaponid || |
| 6795 | + | |
| 6796 | {
| |
| 6797 | if(ac_t == PLAYER_STATE_DRIVER) | |
| 6798 | - | if((ac_i = GetPlayerWeapon(playerid)) != weaponid && ac_t != PLAYER_STATE_PASSENGER || |
| 6798 | + | |
| 6799 | #if defined DEBUG | |
| 6800 | printf("[Nex-AC debug] Weaponid: %d, state: %d, veh model: %d, veh: %d",
| |
| 6801 | weaponid, ac_t, GetVehicleModel(ACInfo[playerid][acVeh]), ACInfo[playerid][acVeh]); | |
| 6802 | #endif | |
| 6803 | return ac_KickWithCode(playerid, "", 0, 47, 6); | |
| 6804 | } | |
| 6805 | else | |
| 6806 | {
| |
| 6807 | - | ac_i, ACInfo[playerid][acWeapon][ac_s], weaponid, ac_t); |
| 6807 | + | |
| 6808 | if(ACInfo[playerid][acLastWeapon] != weaponid || | |
| 6809 | ACInfo[playerid][acWeapon][ac_s] != weaponid && ACInfo[playerid][acSetWeapon][ac_s] != weaponid) | |
| 6810 | #else | |
| 6811 | if(ACInfo[playerid][acLastWeapon] != weaponid && ac_t != PLAYER_STATE_PASSENGER || | |
| 6812 | ACInfo[playerid][acWeapon][ac_s] != weaponid && ACInfo[playerid][acSetWeapon][ac_s] != weaponid) | |
| 6813 | #endif | |
| 6814 | {
| |
| 6815 | if(++ACInfo[playerid][acCheatCount][16] > AC_MAX_FAKE_WEAPON_WARNINGS) | |
| 6816 | {
| |
| 6817 | #undef AC_MAX_FAKE_WEAPON_WARNINGS | |
| 6818 | #if defined DEBUG | |
| 6819 | printf("[Nex-AC debug] Armed weapon: %d, AC weapon: %d, weaponid: %d, state: %d",
| |
| 6820 | ACInfo[playerid][acLastWeapon], ACInfo[playerid][acWeapon][ac_s], weaponid, ac_t); | |
| 6821 | #endif | |
| 6822 | ac_KickWithCode(playerid, "", 0, 47, 2); | |
| 6823 | #if defined OnCheatDetected | |
| 6824 | ACInfo[playerid][acCheatCount][16] = 0; | |
| 6825 | #endif | |
| 6826 | } | |
| 6827 | - | if(weaponid != 38 && ac_t != PLAYER_STATE_PASSENGER) |
| 6827 | + | |
| 6828 | else OnCheatWarning(playerid, "", 0, 47, 2, ACInfo[playerid][acCheatCount][16]); | |
| 6829 | #endif | |
| 6830 | return 0; | |
| 6831 | } | |
| 6832 | else ACInfo[playerid][acCheatCount][16] = 0; | |
| 6833 | } | |
| 6834 | } | |
| 6835 | if(ACInfo[playerid][acACAllow][26]) | |
| 6836 | {
| |
| 6837 | ac_i = ac_gtc - ACInfo[playerid][acShotTick]; | |
| 6838 | if(ACInfo[playerid][acShotWeapon] == weaponid) | |
| 6839 | {
| |
| 6840 | if(weaponid != WEAPON_MINIGUN && ac_t != PLAYER_STATE_PASSENGER) | |
| 6841 | {
| |
| 6842 | if(ac_gtc - ACInfo[playerid][acReloadTick] < 110) | |
| 6843 | {
| |
| 6844 | #if defined DEBUG | |
| 6845 | printf("[Nex-AC debug] Weaponid: %d, Reload time: %d, state: %d",
| |
| 6846 | weaponid, ac_gtc - ACInfo[playerid][acReloadTick], ac_t); | |
| 6847 | #endif | |
| 6848 | #if defined OnCheatDetected | |
| 6849 | ac_KickWithCode(playerid, "", 0, 26, 4); | |
| 6850 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6851 | ACInfo[playerid][acReloadTick] = 0; | |
| 6852 | #else | |
| 6853 | return ac_KickWithCode(playerid, "", 0, 26, 4); | |
| 6854 | #endif | |
| 6855 | } | |
| 6856 | else if(ac_i < 30 || ac_i < 50 && ac_s != 4) | |
| 6857 | {
| |
| 6858 | if(++ACInfo[playerid][acCheatCount][8] > AC_MAX_RAPID_FIRE_WARNINGS) | |
| 6859 | {
| |
| 6860 | #undef AC_MAX_RAPID_FIRE_WARNINGS | |
| 6861 | #if defined DEBUG | |
| 6862 | printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
| |
| 6863 | #endif | |
| 6864 | #if defined OnCheatDetected | |
| 6865 | ac_KickWithCode(playerid, "", 0, 26, 1); | |
| 6866 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6867 | ACInfo[playerid][acCheatCount][8] = 0; | |
| 6868 | #else | |
| 6869 | return ac_KickWithCode(playerid, "", 0, 26, 1); | |
| 6870 | #endif | |
| 6871 | } | |
| 6872 | #if defined OnCheatWarning | |
| 6873 | else OnCheatWarning(playerid, "", 0, 26, 1, ACInfo[playerid][acCheatCount][8]); | |
| 6874 | #endif | |
| 6875 | } | |
| 6876 | else ACInfo[playerid][acCheatCount][8] = 0; | |
| 6877 | if(weaponid == 25 && ac_i < 600 || (weaponid == 24 || 33 <= weaponid <= 34) && ac_i < 380) | |
| 6878 | {
| |
| 6879 | if(++ACInfo[playerid][acCheatCount][12] > AC_MAX_AUTO_C_WARNINGS) | |
| 6880 | {
| |
| 6881 | #undef AC_MAX_AUTO_C_WARNINGS | |
| 6882 | #if defined DEBUG | |
| 6883 | printf("[Nex-AC debug] Fire rate: %d, weaponid: %d", ac_i, weaponid);
| |
| 6884 | #endif | |
| 6885 | #if defined OnCheatDetected | |
| 6886 | ac_KickWithCode(playerid, "", 0, 26, 2); | |
| 6887 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6888 | ACInfo[playerid][acCheatCount][12] = 0; | |
| 6889 | #else | |
| 6890 | return ac_KickWithCode(playerid, "", 0, 26, 2); | |
| 6891 | #endif | |
| 6892 | } | |
| 6893 | #if defined OnCheatWarning | |
| 6894 | else OnCheatWarning(playerid, "", 0, 26, 2, ACInfo[playerid][acCheatCount][12]); | |
| 6895 | #endif | |
| 6896 | } | |
| 6897 | } | |
| 6898 | } | |
| 6899 | else if(ac_i < 30) | |
| 6900 | {
| |
| 6901 | #if defined DEBUG | |
| 6902 | printf("[Nex-AC debug] Fire rate: %d, weaponid: %d, last weapon: %d",
| |
| 6903 | ac_i, weaponid, ACInfo[playerid][acShotWeapon]); | |
| 6904 | #endif | |
| 6905 | #if defined OnCheatDetected | |
| 6906 | ac_KickWithCode(playerid, "", 0, 26, 3); | |
| 6907 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6908 | #else | |
| 6909 | return ac_KickWithCode(playerid, "", 0, 26, 3); | |
| 6910 | #endif | |
| 6911 | } | |
| 6912 | if(GetPlayerWeaponState(playerid) == WEAPONSTATE_LAST_BULLET) ACInfo[playerid][acReloadTick] = ac_gtc; | |
| 6913 | } | |
| 6914 | if(ACInfo[playerid][acACAllow][17] && ac_t != PLAYER_STATE_PASSENGER && | |
| 6915 | ACInfo[playerid][acGiveAmmo][ac_s] == -65535 && ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp) | |
| 6916 | {
| |
| 6917 | ac_t = GetPlayerAmmo(playerid); | |
| 6918 | if(ACInfo[playerid][acAmmo][ac_s] == 0) | |
| 6919 | {
| |
| 6920 | #if defined DEBUG | |
| 6921 | printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d", weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t);
| |
| 6922 | - | case 38: |
| 6922 | + | |
| 6923 | #if defined OnCheatDetected | |
| 6924 | ac_KickWithCode(playerid, "", 0, 17, 1); | |
| 6925 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6926 | ACInfo[playerid][acAmmo][ac_s] = ac_t; | |
| 6927 | #else | |
| 6928 | return ac_KickWithCode(playerid, "", 0, 17, 1); | |
| 6929 | #endif | |
| 6930 | } | |
| 6931 | if(ACInfo[playerid][acAmmo][ac_s] < ac_t) | |
| 6932 | {
| |
| 6933 | switch(weaponid) | |
| 6934 | {
| |
| 6935 | case WEAPON_MINIGUN: | |
| 6936 | {
| |
| 6937 | if(++ACInfo[playerid][acCheatCount][7] > 9) | |
| 6938 | {
| |
| 6939 | #if defined DEBUG | |
| 6940 | printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d, acCheatCount[7]: %d",
| |
| 6941 | weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t, ACInfo[playerid][acCheatCount][7]); | |
| 6942 | #endif | |
| 6943 | #if defined OnCheatDetected | |
| 6944 | ac_KickWithCode(playerid, "", 0, 17, 2); | |
| 6945 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6946 | ACInfo[playerid][acCheatCount][7] = 0; | |
| 6947 | ACInfo[playerid][acAmmo][ac_s] = ac_t; | |
| 6948 | #else | |
| 6949 | return ac_KickWithCode(playerid, "", 0, 17, 2); | |
| 6950 | #endif | |
| 6951 | } | |
| 6952 | #if defined OnCheatWarning | |
| 6953 | else OnCheatWarning(playerid, "", 0, 17, 2, ACInfo[playerid][acCheatCount][7]); | |
| 6954 | #endif | |
| 6955 | } | |
| 6956 | default: | |
| 6957 | {
| |
| 6958 | if(ac_t - ACInfo[playerid][acAmmo][ac_s] > 6) | |
| 6959 | {
| |
| 6960 | #if defined DEBUG | |
| 6961 | printf("[Nex-AC debug] Weaponid: %d, AC ammo: %d, ammo: %d",
| |
| 6962 | weaponid, ACInfo[playerid][acAmmo][ac_s], ac_t); | |
| 6963 | #endif | |
| 6964 | #if defined OnCheatDetected | |
| 6965 | ac_KickWithCode(playerid, "", 0, 17, 3); | |
| 6966 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 6967 | ACInfo[playerid][acCheatCount][7] = 0; | |
| 6968 | ACInfo[playerid][acAmmo][ac_s] = ac_t; | |
| 6969 | #else | |
| 6970 | return ac_KickWithCode(playerid, "", 0, 17, 3); | |
| 6971 | #endif | |
| 6972 | } | |
| 6973 | } | |
| 6974 | } | |
| 6975 | } | |
| 6976 | else ACInfo[playerid][acCheatCount][7] = 0; | |
| 6977 | } | |
| 6978 | if(ACInfo[playerid][acAmmo][ac_s] != 0) ACInfo[playerid][acAmmo][ac_s]--; | |
| 6979 | if(ACInfo[playerid][acAmmo][ac_s] < -32768) ACInfo[playerid][acAmmo][ac_s] += 65536; | |
| 6980 | ACInfo[playerid][acShotWeapon] = weaponid; | |
| 6981 | ACInfo[playerid][acShotTick] = ac_gtc; | |
| 6982 | #if defined ac_OnPlayerWeaponShot | |
| 6983 | ac_i = ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ); | |
| 6984 | if(ac_i) | |
| 6985 | {
| |
| 6986 | #endif | |
| 6987 | if(ACInfo[playerid][acACAllow][33] && !ACInfo[playerid][acUnFrozen]) return 0; | |
| 6988 | if(ac_ur) | |
| 6989 | {
| |
| 6990 | ACInfo[hitid][acDmgRes] = true; | |
| 6991 | ACInfo[hitid][acGtc][13] = ac_gtc + 165; | |
| 6992 | } | |
| 6993 | if(ac_ur2) | |
| 6994 | {
| |
| 6995 | ac_t = ACVehInfo[hitid][acDriver]; | |
| 6996 | ACInfo[ac_t][acVehDmgRes] = true; | |
| 6997 | ACInfo[ac_t][acGtc][14] = ac_gtc + 165; | |
| 6998 | } | |
| 6999 | #if defined ac_OnPlayerWeaponShot | |
| 7000 | } | |
| 7001 | return ac_i; | |
| 7002 | #else | |
| 7003 | return 1; | |
| 7004 | #endif | |
| 7005 | } | |
| 7006 | ||
| 7007 | #if defined _ALS_OnPlayerWeaponShot | |
| 7008 | #undef OnPlayerWeaponShot | |
| 7009 | #else | |
| 7010 | #define _ALS_OnPlayerWeaponShot | |
| 7011 | #endif | |
| 7012 | #define OnPlayerWeaponShot ac_OnPlayerWeaponShot | |
| 7013 | #if defined ac_OnPlayerWeaponShot | |
| 7014 | forward ac_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ); | |
| 7015 | #endif | |
| 7016 | #endif | |
| 7017 | ||
| 7018 | public OnVehicleMod(playerid, vehicleid, componentid) | |
| 7019 | {
| |
| 7020 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7021 | new ac_i = GetTickCount(); | |
| 7022 | if(ACInfo[playerid][acACAllow][49]) | |
| 7023 | {
| |
| 7024 | if(ac_i - ACInfo[playerid][acCall][12] < ac_Mtfc[12][0]) return ac_FloodDetect(playerid, 12); | |
| 7025 | if(ac_i - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7026 | else ACInfo[playerid][acFloodCount][12] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7027 | } | |
| 7028 | if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop]) | |
| 7029 | {
| |
| 7030 | #if defined OnCheatDetected | |
| 7031 | ac_KickWithCode(playerid, "", 0, 23, 2); | |
| 7032 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7033 | #else | |
| 7034 | return ac_KickWithCode(playerid, "", 0, 23, 2); | |
| 7035 | #endif | |
| 7036 | } | |
| 7037 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][12] = ac_i; | |
| 7038 | #if AC_USE_TUNING_GARAGES | |
| 7039 | ACInfo[playerid][acGtc][17] = ac_i + 3250; | |
| 7040 | #endif | |
| 7041 | if(ACInfo[playerid][acACAllow][43] && !ac_IsCompatible((ac_i = GetVehicleModel(vehicleid)), componentid)) | |
| 7042 | {
| |
| 7043 | #if defined DEBUG | |
| 7044 | printf("[Nex-AC debug] Veh model: %d, veh: %d, componentid: %d", ac_i, vehicleid, componentid);
| |
| 7045 | #endif | |
| 7046 | return ac_KickWithCode(playerid, "", 0, 43, 1); | |
| 7047 | } | |
| 7048 | #if AC_USE_TUNING_GARAGES | |
| 7049 | ac_i = componentid - 1000; | |
| 7050 | if(ACInfo[playerid][acSet][11] != -1) ACInfo[playerid][acSet][11] += ac_cPrice[ac_i]; | |
| 7051 | else ACInfo[playerid][acSet][11] = ac_cPrice[ac_i]; | |
| 7052 | ACInfo[playerid][acCheatCount][21] = 0; | |
| 7053 | #endif | |
| 7054 | #if defined ac_OnVehicleMod | |
| 7055 | return ac_OnVehicleMod(playerid, vehicleid, componentid); | |
| 7056 | #else | |
| 7057 | return 1; | |
| 7058 | #endif | |
| 7059 | } | |
| 7060 | ||
| 7061 | #if defined _ALS_OnVehicleMod | |
| 7062 | #undef OnVehicleMod | |
| 7063 | #else | |
| 7064 | #define _ALS_OnVehicleMod | |
| 7065 | #endif | |
| 7066 | #define OnVehicleMod ac_OnVehicleMod | |
| 7067 | #if defined ac_OnVehicleMod | |
| 7068 | forward ac_OnVehicleMod(playerid, vehicleid, componentid); | |
| 7069 | #endif | |
| 7070 | ||
| 7071 | public OnVehiclePaintjob(playerid, vehicleid, paintjobid) | |
| 7072 | {
| |
| 7073 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7074 | new ac_gtc = GetTickCount(); | |
| 7075 | if(ACInfo[playerid][acACAllow][49]) | |
| 7076 | {
| |
| 7077 | if(ac_gtc - ACInfo[playerid][acCall][13] < ac_Mtfc[13][0]) ac_FloodDetect(playerid, 13); | |
| 7078 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7079 | else ACInfo[playerid][acFloodCount][13] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7080 | } | |
| 7081 | if(ACInfo[playerid][acACAllow][43] && !(0 <= paintjobid <= 2) && paintjobid != 255) | |
| 7082 | {
| |
| 7083 | #if defined DEBUG | |
| 7084 | printf("[Nex-AC debug] Veh model: %d, veh: %d, paintjobid: %d", GetVehicleModel(vehicleid), vehicleid, paintjobid);
| |
| 7085 | #endif | |
| 7086 | ac_KickWithCode(playerid, "", 0, 43, 2); | |
| 7087 | } | |
| 7088 | else if(ACInfo[playerid][acACAllow][23] && !ACInfo[playerid][acModShop]) ac_KickWithCode(playerid, "", 0, 23, 4); | |
| 7089 | if(ACInfo[playerid][acKicked] < 1) | |
| 7090 | {
| |
| 7091 | if(paintjobid == 255) ACVehInfo[vehicleid][acPaintJob] = 3; | |
| 7092 | else ACVehInfo[vehicleid][acPaintJob] = paintjobid; | |
| 7093 | } | |
| 7094 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][13] = ac_gtc; | |
| 7095 | #if defined ac_OnVehiclePaintjob | |
| 7096 | return ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid); | |
| 7097 | #else | |
| 7098 | return 1; | |
| 7099 | #endif | |
| 7100 | } | |
| 7101 | ||
| 7102 | #if defined _ALS_OnVehiclePaintjob | |
| 7103 | #undef OnVehiclePaintjob | |
| 7104 | #else | |
| 7105 | #define _ALS_OnVehiclePaintjob | |
| 7106 | #endif | |
| 7107 | #define OnVehiclePaintjob ac_OnVehiclePaintjob | |
| 7108 | #if defined ac_OnVehiclePaintjob | |
| 7109 | forward ac_OnVehiclePaintjob(playerid, vehicleid, paintjobid); | |
| 7110 | #endif | |
| 7111 | ||
| 7112 | public OnVehicleRespray(playerid, vehicleid, color1, color2) | |
| 7113 | {
| |
| 7114 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7115 | new ac_gtc = GetTickCount(); | |
| 7116 | if(ACInfo[playerid][acACAllow][49]) | |
| 7117 | {
| |
| 7118 | if(ac_gtc - ACInfo[playerid][acCall][14] < ac_Mtfc[14][0]) return ac_FloodDetect(playerid, 14); | |
| 7119 | if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7120 | else ACInfo[playerid][acFloodCount][14] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7121 | } | |
| 7122 | #if !AC_USE_TUNING_GARAGES && !AC_USE_PAYNSPRAY | |
| 7123 | if(ACInfo[playerid][acACAllow][23]) | |
| 7124 | {
| |
| 7125 | #if defined DEBUG | |
| 7126 | printf("[Nex-AC debug] Veh model: %d, veh: %d, color1: %d, color2: %d",
| |
| 7127 | GetVehicleModel(vehicleid), vehicleid, color1, color2); | |
| 7128 | #endif | |
| 7129 | #if defined OnCheatDetected | |
| 7130 | ac_KickWithCode(playerid, "", 0, 23, 5); | |
| 7131 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7132 | #else | |
| 7133 | return ac_KickWithCode(playerid, "", 0, 23, 5); | |
| 7134 | #endif | |
| 7135 | } | |
| 7136 | #endif | |
| 7137 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][14] = ac_gtc; | |
| 7138 | #if defined ac_OnVehicleRespray | |
| 7139 | return ac_OnVehicleRespray(playerid, vehicleid, color1, color2); | |
| 7140 | #else | |
| 7141 | return 1; | |
| 7142 | #endif | |
| 7143 | } | |
| 7144 | ||
| 7145 | #if defined _ALS_OnVehicleRespray | |
| 7146 | #undef OnVehicleRespray | |
| 7147 | #else | |
| 7148 | #define _ALS_OnVehicleRespray | |
| 7149 | #endif | |
| 7150 | #define OnVehicleRespray ac_OnVehicleRespray | |
| 7151 | #if defined ac_OnVehicleRespray | |
| 7152 | forward ac_OnVehicleRespray(playerid, vehicleid, color1, color2); | |
| 7153 | #endif | |
| 7154 | ||
| 7155 | public OnVehicleSpawn(vehicleid) | |
| 7156 | {
| |
| 7157 | ACVehInfo[vehicleid][acPaintJob] = 3; | |
| 7158 | ACVehInfo[vehicleid][acHealth] = 1000.0; | |
| 7159 | ACVehInfo[vehicleid][acSpawned] = true; | |
| 7160 | ACVehInfo[vehicleid][acTrSpeed] = -1; | |
| 7161 | ACVehInfo[vehicleid][acPosDiff] = | |
| 7162 | ACVehInfo[vehicleid][acVelX] = | |
| 7163 | ACVehInfo[vehicleid][acVelY] = | |
| 7164 | ACVehInfo[vehicleid][acVelZ] = 0.0; | |
| 7165 | ACVehInfo[vehicleid][acSpeed] = | |
| 7166 | ACVehInfo[vehicleid][acTires] = | |
| 7167 | ACVehInfo[vehicleid][acDoors] = | |
| 7168 | ACVehInfo[vehicleid][acPanels] = | |
| 7169 | ACVehInfo[vehicleid][acLastSpeed] = | |
| 7170 | ACVehInfo[vehicleid][acSpeedDiff] = 0; | |
| 7171 | ACVehInfo[vehicleid][acPosX] = ACVehInfo[vehicleid][acSpawnPosX]; | |
| 7172 | ACVehInfo[vehicleid][acPosY] = ACVehInfo[vehicleid][acSpawnPosY]; | |
| 7173 | ACVehInfo[vehicleid][acPosZ] = ACVehInfo[vehicleid][acSpawnPosZ]; | |
| 7174 | ACVehInfo[vehicleid][acZAngle] = ACVehInfo[vehicleid][acSpawnZAngle]; | |
| 7175 | ACVehInfo[vehicleid][acDriver] = INVALID_PLAYER_ID; | |
| 7176 | new ac_gtc = GetTickCount() + 2650; | |
| 7177 | #if defined foreach | |
| 7178 | foreach(new ac_i : Player) | |
| 7179 | {
| |
| 7180 | if(ACInfo[ac_i][acVeh] == vehicleid) ACInfo[ac_i][acSetPosTick] = ACInfo[ac_i][acGtc][10] = ac_gtc; | |
| 7181 | } | |
| 7182 | #else | |
| 7183 | #if defined GetPlayerPoolSize | |
| 7184 | for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i) | |
| 7185 | #else | |
| 7186 | for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i) | |
| 7187 | #endif | |
| 7188 | {
| |
| 7189 | if(IsPlayerInVehicle(ac_i, vehicleid)) ACInfo[ac_i][acSetPosTick] = ACInfo[ac_i][acGtc][10] = ac_gtc; | |
| 7190 | } | |
| 7191 | #endif | |
| 7192 | #if defined ac_OnVehicleSpawn | |
| 7193 | return ac_OnVehicleSpawn(vehicleid); | |
| 7194 | #else | |
| 7195 | return 1; | |
| 7196 | #endif | |
| 7197 | } | |
| 7198 | ||
| 7199 | #if defined _ALS_OnVehicleSpawn | |
| 7200 | #undef OnVehicleSpawn | |
| 7201 | #else | |
| 7202 | #define _ALS_OnVehicleSpawn | |
| 7203 | #endif | |
| 7204 | #define OnVehicleSpawn ac_OnVehicleSpawn | |
| 7205 | #if defined ac_OnVehicleSpawn | |
| 7206 | forward ac_OnVehicleSpawn(vehicleid); | |
| 7207 | #endif | |
| 7208 | ||
| 7209 | public OnVehicleDeath(vehicleid, killerid) | |
| 7210 | {
| |
| 7211 | #if AC_USE_NPC | |
| 7212 | if(0 <= killerid < MAX_PLAYERS && !IsPlayerNPC(killerid)) | |
| 7213 | #else | |
| 7214 | if(0 <= killerid < MAX_PLAYERS) | |
| 7215 | #endif | |
| 7216 | {
| |
| 7217 | new ac_gtc = GetTickCount(); | |
| 7218 | if(ACInfo[killerid][acACAllow][49]) | |
| 7219 | {
| |
| 7220 | if(ac_gtc - ACInfo[killerid][acCall][15] < ac_Mtfc[15][0]) ac_FloodDetect(killerid, 15); | |
| 7221 | else if(ac_gtc - ACInfo[killerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(killerid, 27); | |
| 7222 | else ACInfo[killerid][acFloodCount][15] = ACInfo[killerid][acFloodCount][27] = 0; | |
| 7223 | } | |
| 7224 | ACInfo[killerid][acCall][27] = ACInfo[killerid][acCall][15] = ac_gtc; | |
| 7225 | } | |
| 7226 | new Float:ac_vHealth; | |
| 7227 | GetVehicleHealth(vehicleid, ac_vHealth); | |
| 7228 | if(ac_vHealth < 250.0) ACVehInfo[vehicleid][acSpawned] = false; | |
| 7229 | #if defined ac_OnVehicleDeath | |
| 7230 | return ac_OnVehicleDeath(vehicleid, killerid); | |
| 7231 | #else | |
| 7232 | return 1; | |
| 7233 | #endif | |
| 7234 | } | |
| 7235 | ||
| 7236 | #if defined _ALS_OnVehicleDeath | |
| 7237 | #undef OnVehicleDeath | |
| 7238 | #else | |
| 7239 | #define _ALS_OnVehicleDeath | |
| 7240 | #endif | |
| 7241 | #define OnVehicleDeath ac_OnVehicleDeath | |
| 7242 | #if defined ac_OnVehicleDeath | |
| 7243 | forward ac_OnVehicleDeath(vehicleid, killerid); | |
| 7244 | #endif | |
| 7245 | ||
| 7246 | public OnPlayerText(playerid, text[]) | |
| 7247 | {
| |
| 7248 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7249 | #if AC_USE_NPC | |
| 7250 | if(!IsPlayerNPC(playerid)) | |
| 7251 | {
| |
| 7252 | #endif | |
| 7253 | new ac_gtc = GetTickCount(); | |
| 7254 | if(ACInfo[playerid][acACAllow][49]) | |
| 7255 | {
| |
| 7256 | if(ac_gtc - ACInfo[playerid][acCall][16] < ac_Mtfc[16][0]) return ac_FloodDetect(playerid, 16); | |
| 7257 | if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7258 | else ACInfo[playerid][acFloodCount][16] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7259 | } | |
| 7260 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][16] = ac_gtc; | |
| 7261 | #if AC_USE_NPC | |
| 7262 | } | |
| 7263 | #endif | |
| 7264 | #if defined ac_OnPlayerText | |
| 7265 | return ac_OnPlayerText(playerid, text); | |
| 7266 | #else | |
| 7267 | return 1; | |
| 7268 | #endif | |
| 7269 | } | |
| 7270 | ||
| 7271 | #if defined _ALS_OnPlayerText | |
| 7272 | #undef OnPlayerText | |
| 7273 | #else | |
| 7274 | #define _ALS_OnPlayerText | |
| 7275 | #endif | |
| 7276 | #define OnPlayerText ac_OnPlayerText | |
| 7277 | #if defined ac_OnPlayerText | |
| 7278 | forward ac_OnPlayerText(playerid, text[]); | |
| 7279 | #endif | |
| 7280 | ||
| 7281 | public OnPlayerEnterCheckpoint(playerid) | |
| 7282 | {
| |
| 7283 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7284 | #if AC_USE_NPC | |
| 7285 | if(!IsPlayerNPC(playerid)) | |
| 7286 | {
| |
| 7287 | #endif | |
| 7288 | new ac_gtc = GetTickCount(); | |
| 7289 | if(ACInfo[playerid][acACAllow][49]) | |
| 7290 | {
| |
| 7291 | if(ac_gtc - ACInfo[playerid][acCall][17] < ac_Mtfc[17][0]) ac_FloodDetect(playerid, 17); | |
| 7292 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7293 | else ACInfo[playerid][acFloodCount][17] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7294 | } | |
| 7295 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][17] = ac_gtc; | |
| 7296 | #if AC_USE_NPC | |
| 7297 | } | |
| 7298 | #endif | |
| 7299 | #if defined ac_OnPlayerEnterCheckpoint | |
| 7300 | return ac_OnPlayerEnterCheckpoint(playerid); | |
| 7301 | #else | |
| 7302 | return 1; | |
| 7303 | #endif | |
| 7304 | } | |
| 7305 | ||
| 7306 | #if defined _ALS_OnPlayerEnterCheckpoint | |
| 7307 | #undef OnPlayerEnterCheckpoint | |
| 7308 | #else | |
| 7309 | #define _ALS_OnPlayerEnterCheckpoint | |
| 7310 | #endif | |
| 7311 | #define OnPlayerEnterCheckpoint ac_OnPlayerEnterCheckpoint | |
| 7312 | #if defined ac_OnPlayerEnterCheckpoint | |
| 7313 | forward ac_OnPlayerEnterCheckpoint(playerid); | |
| 7314 | #endif | |
| 7315 | ||
| 7316 | public OnPlayerLeaveCheckpoint(playerid) | |
| 7317 | {
| |
| 7318 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7319 | #if AC_USE_NPC | |
| 7320 | if(!IsPlayerNPC(playerid)) | |
| 7321 | {
| |
| 7322 | #endif | |
| 7323 | new ac_gtc = GetTickCount(); | |
| 7324 | if(ACInfo[playerid][acACAllow][49]) | |
| 7325 | {
| |
| 7326 | if(ac_gtc - ACInfo[playerid][acCall][18] < ac_Mtfc[18][0]) ac_FloodDetect(playerid, 18); | |
| 7327 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7328 | else ACInfo[playerid][acFloodCount][18] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7329 | } | |
| 7330 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][18] = ac_gtc; | |
| 7331 | #if AC_USE_NPC | |
| 7332 | } | |
| 7333 | #endif | |
| 7334 | #if defined ac_OnPlayerLeaveCheckpoint | |
| 7335 | return ac_OnPlayerLeaveCheckpoint(playerid); | |
| 7336 | #else | |
| 7337 | return 1; | |
| 7338 | #endif | |
| 7339 | } | |
| 7340 | ||
| 7341 | #if defined _ALS_OnPlayerLeaveCheckpoint | |
| 7342 | #undef OnPlayerLeaveCheckpoint | |
| 7343 | #else | |
| 7344 | #define _ALS_OnPlayerLeaveCheckpoint | |
| 7345 | #endif | |
| 7346 | #define OnPlayerLeaveCheckpoint ac_OnPlayerLeaveCheckpoint | |
| 7347 | #if defined ac_OnPlayerLeaveCheckpoint | |
| 7348 | forward ac_OnPlayerLeaveCheckpoint(playerid); | |
| 7349 | #endif | |
| 7350 | ||
| 7351 | public OnPlayerRequestSpawn(playerid) | |
| 7352 | {
| |
| 7353 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7354 | new ac_gtc; | |
| 7355 | #if AC_USE_NPC | |
| 7356 | if(!IsPlayerNPC(playerid)) | |
| 7357 | {
| |
| 7358 | #endif | |
| 7359 | ac_gtc = GetTickCount(); | |
| 7360 | if(ACInfo[playerid][acACAllow][49]) | |
| 7361 | {
| |
| 7362 | if(ac_gtc - ACInfo[playerid][acCall][19] < ac_Mtfc[19][0]) ac_FloodDetect(playerid, 19); | |
| 7363 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7364 | else ACInfo[playerid][acFloodCount][19] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7365 | } | |
| 7366 | if(!ACInfo[playerid][acClassRes]) | |
| 7367 | {
| |
| 7368 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][19] = ac_gtc; | |
| 7369 | return 0; | |
| 7370 | } | |
| 7371 | #if AC_USE_NPC | |
| 7372 | } | |
| 7373 | #endif | |
| 7374 | #if defined ac_OnPlayerRequestSpawn | |
| 7375 | new ac_i = ac_OnPlayerRequestSpawn(playerid); | |
| 7376 | if(ac_i) | |
| 7377 | {
| |
| 7378 | #endif | |
| 7379 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][19] = ac_gtc; | |
| 7380 | ACInfo[playerid][acSpawnTick] = ACInfo[playerid][acNOPCount][9] = 0; | |
| 7381 | ACInfo[playerid][acSpawnRes] = 1; | |
| 7382 | ACInfo[playerid][acSet][6] = 3; | |
| 7383 | #if defined ac_OnPlayerRequestSpawn | |
| 7384 | } | |
| 7385 | return ac_i; | |
| 7386 | #else | |
| 7387 | return 1; | |
| 7388 | #endif | |
| 7389 | } | |
| 7390 | ||
| 7391 | #if defined _ALS_OnPlayerRequestSpawn | |
| 7392 | #undef OnPlayerRequestSpawn | |
| 7393 | #else | |
| 7394 | #define _ALS_OnPlayerRequestSpawn | |
| 7395 | #endif | |
| 7396 | #define OnPlayerRequestSpawn ac_OnPlayerRequestSpawn | |
| 7397 | #if defined ac_OnPlayerRequestSpawn | |
| 7398 | forward ac_OnPlayerRequestSpawn(playerid); | |
| 7399 | #endif | |
| 7400 | ||
| 7401 | public OnPlayerExitedMenu(playerid) | |
| 7402 | {
| |
| 7403 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7404 | new ac_gtc = GetTickCount(); | |
| 7405 | if(ACInfo[playerid][acACAllow][49]) | |
| 7406 | {
| |
| 7407 | if(ac_gtc - ACInfo[playerid][acCall][20] < ac_Mtfc[20][0]) ac_FloodDetect(playerid, 20); | |
| 7408 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7409 | else ACInfo[playerid][acFloodCount][20] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7410 | } | |
| 7411 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][20] = ac_gtc; | |
| 7412 | #if defined ac_OnPlayerExitedMenu | |
| 7413 | return ac_OnPlayerExitedMenu(playerid); | |
| 7414 | #else | |
| 7415 | return 1; | |
| 7416 | #endif | |
| 7417 | } | |
| 7418 | ||
| 7419 | #if defined _ALS_OnPlayerExitedMenu | |
| 7420 | #undef OnPlayerExitedMenu | |
| 7421 | #else | |
| 7422 | #define _ALS_OnPlayerExitedMenu | |
| 7423 | #endif | |
| 7424 | #define OnPlayerExitedMenu ac_OnPlayerExitedMenu | |
| 7425 | #if defined ac_OnPlayerExitedMenu | |
| 7426 | forward ac_OnPlayerExitedMenu(playerid); | |
| 7427 | #endif | |
| 7428 | ||
| 7429 | public OnPlayerEnterRaceCheckpoint(playerid) | |
| 7430 | {
| |
| 7431 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7432 | #if AC_USE_NPC | |
| 7433 | if(!IsPlayerNPC(playerid)) | |
| 7434 | {
| |
| 7435 | #endif | |
| 7436 | new ac_gtc = GetTickCount(); | |
| 7437 | if(ACInfo[playerid][acACAllow][49]) | |
| 7438 | {
| |
| 7439 | if(ac_gtc - ACInfo[playerid][acCall][21] < ac_Mtfc[21][0]) ac_FloodDetect(playerid, 21); | |
| 7440 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7441 | else ACInfo[playerid][acFloodCount][21] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7442 | } | |
| 7443 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][21] = ac_gtc; | |
| 7444 | #if AC_USE_NPC | |
| 7445 | } | |
| 7446 | #endif | |
| 7447 | #if defined ac_OnPlayerEnterRaceCheckpoint | |
| 7448 | return ac_OnPlayerEnterRaceCheckpoint(playerid); | |
| 7449 | #else | |
| 7450 | return 1; | |
| 7451 | #endif | |
| 7452 | } | |
| 7453 | ||
| 7454 | #if defined _ALS_OnPlayerEnterRaceCheckpoin\ | |
| 7455 | || defined _ALS_OnPlayerEnterRaceCP | |
| 7456 | #undef OnPlayerEnterRaceCheckpoint | |
| 7457 | #else | |
| 7458 | #define _ALS_OnPlayerEnterRaceCheckpoin | |
| 7459 | #define _ALS_OnPlayerEnterRaceCP | |
| 7460 | #endif | |
| 7461 | #define OnPlayerEnterRaceCheckpoint ac_OnPlayerEnterRaceCheckpoint | |
| 7462 | #if defined ac_OnPlayerEnterRaceCheckpoint | |
| 7463 | forward ac_OnPlayerEnterRaceCheckpoint(playerid); | |
| 7464 | #endif | |
| 7465 | ||
| 7466 | public OnPlayerLeaveRaceCheckpoint(playerid) | |
| 7467 | {
| |
| 7468 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7469 | #if AC_USE_NPC | |
| 7470 | if(!IsPlayerNPC(playerid)) | |
| 7471 | {
| |
| 7472 | #endif | |
| 7473 | new ac_gtc = GetTickCount(); | |
| 7474 | if(ACInfo[playerid][acACAllow][49]) | |
| 7475 | {
| |
| 7476 | if(ac_gtc - ACInfo[playerid][acCall][22] < ac_Mtfc[22][0]) ac_FloodDetect(playerid, 22); | |
| 7477 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7478 | else ACInfo[playerid][acFloodCount][22] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7479 | } | |
| 7480 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][22] = ac_gtc; | |
| 7481 | #if AC_USE_NPC | |
| 7482 | } | |
| 7483 | #endif | |
| 7484 | #if defined ac_OnPlayerLeaveRaceCheckpoint | |
| 7485 | return ac_OnPlayerLeaveRaceCheckpoint(playerid); | |
| 7486 | #else | |
| 7487 | return 1; | |
| 7488 | #endif | |
| 7489 | } | |
| 7490 | ||
| 7491 | #if defined _ALS_OnPlayerLeaveRaceCheckpoin\ | |
| 7492 | || defined _ALS_OnPlayerLeaveRaceCP | |
| 7493 | #undef OnPlayerLeaveRaceCheckpoint | |
| 7494 | #else | |
| 7495 | #define _ALS_OnPlayerLeaveRaceCheckpoin | |
| 7496 | #define _ALS_OnPlayerLeaveRaceCP | |
| 7497 | #endif | |
| 7498 | #define OnPlayerLeaveRaceCheckpoint ac_OnPlayerLeaveRaceCheckpoint | |
| 7499 | #if defined ac_OnPlayerLeaveRaceCheckpoint | |
| 7500 | forward ac_OnPlayerLeaveRaceCheckpoint(playerid); | |
| 7501 | #endif | |
| 7502 | ||
| 7503 | #if defined OnPlayerClickPlayerTextDraw | |
| 7504 | public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) | |
| 7505 | {
| |
| 7506 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 7507 | new ac_gtc = GetTickCount(); | |
| 7508 | if(ACInfo[playerid][acACAllow][49]) | |
| 7509 | {
| |
| 7510 | if(ac_gtc - ACInfo[playerid][acCall][23] < ac_Mtfc[23][0]) | |
| 7511 | {
| |
| 7512 | ac_FloodDetect(playerid, 23); | |
| 7513 | return 1; | |
| 7514 | } | |
| 7515 | if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7516 | else ACInfo[playerid][acFloodCount][23] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7517 | } | |
| 7518 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][23] = ac_gtc; | |
| 7519 | #if defined ac_OnPlayerClickPlayerTextDraw | |
| 7520 | return ac_OnPlayerClickPlayerTextDraw(playerid, playertextid); | |
| 7521 | #else | |
| 7522 | return 0; | |
| 7523 | #endif | |
| 7524 | } | |
| 7525 | ||
| 7526 | #if defined _ALS_OnPlayerClickPlayerTextDra\ | |
| 7527 | || defined _ALS_OnPlayerClickPlayerTD | |
| 7528 | #undef OnPlayerClickPlayerTextDraw | |
| 7529 | #else | |
| 7530 | #define _ALS_OnPlayerClickPlayerTextDra | |
| 7531 | #define _ALS_OnPlayerClickPlayerTD | |
| 7532 | #endif | |
| 7533 | #define OnPlayerClickPlayerTextDraw ac_OnPlayerClickPlayerTextDraw | |
| 7534 | #if defined ac_OnPlayerClickPlayerTextDraw | |
| 7535 | forward ac_OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid); | |
| 7536 | #endif | |
| 7537 | #endif | |
| 7538 | ||
| 7539 | public OnVehicleDamageStatusUpdate(vehicleid, playerid) | |
| 7540 | {
| |
| 7541 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 7542 | new ac_gtc = GetTickCount(), ac_panels, ac_doors, ac_tires, ac_tmp; | |
| 7543 | GetVehicleDamageStatus(vehicleid, ac_panels, ac_doors, ac_tmp, ac_tires); | |
| 7544 | if(ACInfo[playerid][acACAllow][49] && | |
| 7545 | (ACVehInfo[vehicleid][acPanels] != ac_panels || ACVehInfo[vehicleid][acDoors] != ac_doors || | |
| 7546 | ACVehInfo[vehicleid][acTires] != ac_tires)) | |
| 7547 | {
| |
| 7548 | if(ac_gtc - ACInfo[playerid][acCall][24] < ac_Mtfc[24][0]) ac_FloodDetect(playerid, 24); | |
| 7549 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7550 | else | |
| 7551 | {
| |
| 7552 | if(ACInfo[playerid][acFloodCount][24] > 0) ACInfo[playerid][acFloodCount][24]--; | |
| 7553 | ACInfo[playerid][acFloodCount][27] = 0; | |
| 7554 | } | |
| 7555 | } | |
| 7556 | ACVehInfo[vehicleid][acTires] = ac_tires; | |
| 7557 | ACVehInfo[vehicleid][acDoors] = ac_doors; | |
| 7558 | ACVehInfo[vehicleid][acPanels] = ac_panels; | |
| 7559 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][24] = ac_gtc; | |
| 7560 | #if defined ac_OnVehicleDamageStatusUpdate | |
| 7561 | return ac_OnVehicleDamageStatusUpdate(vehicleid, playerid); | |
| 7562 | #else | |
| 7563 | return 0; | |
| 7564 | #endif | |
| 7565 | } | |
| 7566 | ||
| 7567 | #if defined _ALS_OnVehicleDamageStatusUpdat\ | |
| 7568 | || defined _ALS_OnVehicleDamageStatusUpd | |
| 7569 | #undef OnVehicleDamageStatusUpdate | |
| 7570 | #else | |
| 7571 | #define _ALS_OnVehicleDamageStatusUpdat | |
| 7572 | #define _ALS_OnVehicleDamageStatusUpd | |
| 7573 | #endif | |
| 7574 | #define OnVehicleDamageStatusUpdate ac_OnVehicleDamageStatusUpdate | |
| 7575 | #if defined ac_OnVehicleDamageStatusUpdate | |
| 7576 | forward ac_OnVehicleDamageStatusUpdate(vehicleid, playerid); | |
| 7577 | #endif | |
| 7578 | ||
| 7579 | #if defined OnVehicleSirenStateChange | |
| 7580 | public OnVehicleSirenStateChange(playerid, vehicleid, newstate) | |
| 7581 | {
| |
| 7582 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 7583 | #if AC_USE_NPC | |
| 7584 | if(!IsPlayerNPC(playerid)) | |
| 7585 | {
| |
| 7586 | #endif | |
| 7587 | new ac_gtc = GetTickCount(); | |
| 7588 | if(ACInfo[playerid][acACAllow][49]) | |
| 7589 | {
| |
| 7590 | if(ac_gtc - ACInfo[playerid][acCall][25] < ac_Mtfc[25][0]) ac_FloodDetect(playerid, 25); | |
| 7591 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7592 | else ACInfo[playerid][acFloodCount][25] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7593 | } | |
| 7594 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][25] = ac_gtc; | |
| 7595 | #if AC_USE_NPC | |
| 7596 | } | |
| 7597 | #endif | |
| 7598 | #undef AC_USE_NPC | |
| 7599 | #if defined ac_OnVehicleSirenStateChange | |
| 7600 | return ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate); | |
| 7601 | #else | |
| 7602 | return 0; | |
| 7603 | #endif | |
| 7604 | } | |
| 7605 | ||
| 7606 | #if defined _ALS_OnVehicleSirenStateChange | |
| 7607 | #undef OnVehicleSirenStateChange | |
| 7608 | #else | |
| 7609 | #define _ALS_OnVehicleSirenStateChange | |
| 7610 | #endif | |
| 7611 | #define OnVehicleSirenStateChange ac_OnVehicleSirenStateChange | |
| 7612 | #if defined ac_OnVehicleSirenStateChange | |
| 7613 | forward ac_OnVehicleSirenStateChange(playerid, vehicleid, newstate); | |
| 7614 | #endif | |
| 7615 | #endif | |
| 7616 | ||
| 7617 | #if defined OnPlayerSelectDynamicObject | |
| 7618 | #if defined STREAMER_ENABLE_TAGS | |
| 7619 | public OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z) | |
| 7620 | #else | |
| 7621 | public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z) | |
| 7622 | #endif | |
| 7623 | {
| |
| 7624 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7625 | new ac_gtc = GetTickCount(); | |
| 7626 | if(ACInfo[playerid][acACAllow][49]) | |
| 7627 | {
| |
| 7628 | if(ac_gtc - ACInfo[playerid][acCall][26] < ac_Mtfc[26][0]) ac_FloodDetect(playerid, 26); | |
| 7629 | else if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7630 | else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7631 | } | |
| 7632 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_gtc; | |
| 7633 | #if defined ac_OnPlayerSelectDynamicObject | |
| 7634 | return ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, x, y, z); | |
| 7635 | #else | |
| 7636 | return 1; | |
| 7637 | #endif | |
| 7638 | } | |
| 7639 | ||
| 7640 | #if defined _ALS_OnPlayerSelectDynamicObjec\ | |
| 7641 | || defined _ALS_OnPlayerSelectDynObject || defined _ALS_OnPlayerSelectDynamicObj | |
| 7642 | #undef OnPlayerSelectDynamicObject | |
| 7643 | #else | |
| 7644 | #define _ALS_OnPlayerSelectDynamicObjec | |
| 7645 | #define _ALS_OnPlayerSelectDynObject | |
| 7646 | #define _ALS_OnPlayerSelectDynamicObj | |
| 7647 | #endif | |
| 7648 | #define OnPlayerSelectDynamicObject ac_OnPlayerSelectDynamicObject | |
| 7649 | #if defined ac_OnPlayerSelectDynamicObject | |
| 7650 | #if defined STREAMER_ENABLE_TAGS | |
| 7651 | forward ac_OnPlayerSelectDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, modelid, Float:x, Float:y, Float:z); | |
| 7652 | #else | |
| 7653 | forward ac_OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z); | |
| 7654 | #endif | |
| 7655 | #endif | |
| 7656 | #endif | |
| 7657 | ||
| 7658 | #if defined OnPlayerSelectObject | |
| 7659 | public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ) | |
| 7660 | {
| |
| 7661 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 7662 | new ac_gtc = GetTickCount(); | |
| 7663 | if(ACInfo[playerid][acACAllow][49]) | |
| 7664 | {
| |
| 7665 | if(ac_gtc - ACInfo[playerid][acCall][26] < ac_Mtfc[26][0]) | |
| 7666 | {
| |
| 7667 | ac_FloodDetect(playerid, 26); | |
| 7668 | return 1; | |
| 7669 | } | |
| 7670 | if(ac_gtc - ACInfo[playerid][acCall][27] < ac_Mtfc[27][0]) ac_FloodDetect(playerid, 27); | |
| 7671 | else ACInfo[playerid][acFloodCount][26] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 7672 | } | |
| 7673 | ACInfo[playerid][acCall][27] = ACInfo[playerid][acCall][26] = ac_gtc; | |
| 7674 | #if defined ac_OnPlayerSelectObject | |
| 7675 | return ac_OnPlayerSelectObject(playerid, type, objectid, modelid, fX, fY, fZ); | |
| 7676 | #else | |
| 7677 | return 0; | |
| 7678 | #endif | |
| 7679 | } | |
| 7680 | ||
| 7681 | #if defined _ALS_OnPlayerSelectObject | |
| 7682 | #undef OnPlayerSelectObject | |
| 7683 | #else | |
| 7684 | #define _ALS_OnPlayerSelectObject | |
| 7685 | #endif | |
| 7686 | #define OnPlayerSelectObject ac_OnPlayerSelectObject | |
| 7687 | #if defined ac_OnPlayerSelectObject | |
| 7688 | forward ac_OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ); | |
| 7689 | #endif | |
| 7690 | #endif | |
| 7691 | ||
| 7692 | #if defined OnTrailerUpdate | |
| 7693 | public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z) | |
| 7694 | #elseif defined GetServerTickRate | |
| 7695 | public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z) | |
| 7696 | #else | |
| 7697 | public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat) | |
| 7698 | #endif | |
| 7699 | {
| |
| 7700 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7701 | #if defined OnTrailerUpdate | |
| 7702 | if(ACInfo[playerid][acACAllow][31] && | |
| 7703 | (new_x != new_x || new_y != new_y || new_z != new_z || vel_x != vel_x || vel_y != vel_y || vel_z != vel_z || | |
| 7704 | floatabs(new_x) >= 25000.0 || floatabs(new_y) >= 25000.0 || floatabs(new_z) >= 25000.0 || | |
| 7705 | floatabs(vel_x) >= 100.0 || floatabs(vel_y) >= 100.0 || floatabs(vel_z) >= 100.0 || | |
| 7706 | floatabs(vel_x) - floatabs(ACVehInfo[vehicleid][acVelX]) >= 3.0 || | |
| 7707 | floatabs(vel_y) - floatabs(ACVehInfo[vehicleid][acVelY]) >= 3.0 || | |
| 7708 | floatabs(vel_z) - floatabs(ACVehInfo[vehicleid][acVelZ]) >= 3.0)) | |
| 7709 | {
| |
| 7710 | #if defined DEBUG | |
| 7711 | printf("[Nex-AC debug] Pos x, y, z: %f, %f, %f, vel x, y, z: %f, %f, %f", new_x, new_y, new_z, vel_x, vel_y, vel_z);
| |
| 7712 | #endif | |
| 7713 | return ac_KickWithCode(playerid, "", 0, 31, 2); | |
| 7714 | } | |
| 7715 | new ac_vsp = ac_GetSpeed(vel_x, vel_y, vel_z); | |
| 7716 | #elseif defined GetServerTickRate | |
| 7717 | if(ACInfo[playerid][acACAllow][31] && | |
| 7718 | (new_x != new_x || new_y != new_y || new_z != new_z || | |
| 7719 | floatabs(new_x) >= 25000.0 || floatabs(new_y) >= 25000.0 || floatabs(new_z) >= 25000.0)) | |
| 7720 | {
| |
| 7721 | #if defined DEBUG | |
| 7722 | printf("[Nex-AC debug] Pos x, y, z: %f, %f, %f", new_x, new_y, new_z);
| |
| 7723 | #endif | |
| 7724 | return ac_KickWithCode(playerid, "", 0, 31, 2); | |
| 7725 | } | |
| 7726 | #endif | |
| 7727 | new ac_gtc = GetTickCount(), ac_gpp = GetPlayerPing(playerid), Float:ac_x, Float:ac_y, Float:ac_z, Float:ac_dist; | |
| 7728 | #if defined GetServerTickRate | |
| 7729 | GetVehiclePos(vehicleid, ac_x, ac_y, ac_z); | |
| 7730 | if(ACInfo[playerid][acACAllow][5]) | |
| 7731 | {
| |
| 7732 | ac_dist = GetPlayerDistanceFromPoint(playerid, new_x, new_y, new_z); | |
| 7733 | if(ac_dist >= 120.0) | |
| 7734 | {
| |
| 7735 | #if defined DEBUG | |
| 7736 | printf("[Nex-AC debug] Dist: %f, veh: %d, seat: %d, playerid: %d", ac_dist, vehicleid, passenger_seat, playerid);
| |
| 7737 | #endif | |
| 7738 | #if defined OnCheatDetected | |
| 7739 | ac_KickWithCode(playerid, "", 0, 5, 4); | |
| 7740 | #endif | |
| 7741 | GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]); | |
| 7742 | #if defined SetVehicleFakeZAngleForPlayer | |
| 7743 | SetVehicleFakeZAngleForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acZAngle]); | |
| 7744 | #else | |
| 7745 | SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]); | |
| 7746 | #endif | |
| 7747 | #if defined SetVehicleFakePosForPlayer | |
| 7748 | SetVehicleFakePosForPlayer(playerid, vehicleid, ac_x, ac_y, ac_z); | |
| 7749 | #else | |
| 7750 | SetVehiclePos(vehicleid, ac_x, ac_y, ac_z); | |
| 7751 | #endif | |
| 7752 | return 0; | |
| 7753 | } | |
| 7754 | } | |
| 7755 | ac_dist = GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z); | |
| 7756 | if(passenger_seat > 0) | |
| 7757 | {
| |
| 7758 | new Float:ac_zDiff = new_z - ac_z; | |
| 7759 | #if defined OnTrailerUpdate | |
| 7760 | if(ACInfo[playerid][acACAllow][31] && | |
| 7761 | ((vel_z > ACVehInfo[vehicleid][acVelZ] || ac_zDiff >= -0.8) && | |
| 7762 | (floatabs(vel_x) - floatabs(ACVehInfo[vehicleid][acVelX]) >= 1.0 || | |
| 7763 | floatabs(vel_y) - floatabs(ACVehInfo[vehicleid][acVelY]) >= 1.0 || | |
| 7764 | floatabs(vel_x) >= floatabs(ACVehInfo[vehicleid][acVelX]) && floatabs(ACVehInfo[vehicleid][acVelX]) >= 0.3 || | |
| 7765 | floatabs(vel_y) >= floatabs(ACVehInfo[vehicleid][acVelY]) && floatabs(ACVehInfo[vehicleid][acVelY]) >= 0.3) || | |
| 7766 | ac_zDiff >= -5.0 && (floatabs(new_x - ac_x) >= 8.0 || floatabs(new_y - ac_y) >= 8.0))) | |
| 7767 | {
| |
| 7768 | if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS) | |
| 7769 | {
| |
| 7770 | #if defined DEBUG | |
| 7771 | printf("[Nex-AC debug] Vel x, y, z: %f, %f, %f, old vel x, y: %f, %f, pos diff x, y, z: %f, %f, %f, veh: %d",
| |
| 7772 | vel_x, vel_y, vel_z, ACVehInfo[vehicleid][acVelX], ACVehInfo[vehicleid][acVelY], new_x - ac_x, new_y - ac_y, ac_zDiff, vehicleid); | |
| 7773 | #endif | |
| 7774 | #if defined OnCheatDetected | |
| 7775 | ac_KickWithCode(playerid, "", 0, 31, 1); | |
| 7776 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7777 | ACInfo[playerid][acCheatCount][4] = 0; | |
| 7778 | #else | |
| 7779 | return ac_KickWithCode(playerid, "", 0, 31, 1); | |
| 7780 | #endif | |
| 7781 | } | |
| 7782 | #if defined OnCheatWarning | |
| 7783 | else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]); | |
| 7784 | #endif | |
| 7785 | } | |
| 7786 | else if(ACInfo[playerid][acACAllow][8] && | |
| 7787 | (vel_z >= 0.1 && vel_z > ACVehInfo[vehicleid][acVelZ] && | |
| 7788 | floatabs(ac_x - new_x) < ac_zDiff / 2.0 && floatabs(ac_y - new_y) < ac_zDiff / 2.0 || | |
| 7789 | vel_z >= 0.0 && ac_zDiff <= -1.0 || vel_z <= 0.0 && ac_zDiff >= 1.0)) | |
| 7790 | {
| |
| 7791 | if(++ACInfo[playerid][acCheatCount][3] > AC_MAX_FLYHACK_VEH_WARNINGS) | |
| 7792 | {
| |
| 7793 | #if defined DEBUG | |
| 7794 | printf("[Nex-AC debug] Vel z: %f, old vel z: %f, pos diff x, y, z: %f, %f, %f, veh: %d",
| |
| 7795 | - | else if(ACInfo[playerid][acACAllow][1] && ac_dist >= 2.0 && ac_vsp < 63) |
| 7795 | + | |
| 7796 | #endif | |
| 7797 | #if defined OnCheatDetected | |
| 7798 | ac_KickWithCode(playerid, "", 0, 8, 2); | |
| 7799 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7800 | ACInfo[playerid][acCheatCount][3] = 0; | |
| 7801 | #else | |
| 7802 | return ac_KickWithCode(playerid, "", 0, 8, 2); | |
| 7803 | #endif | |
| 7804 | } | |
| 7805 | #if defined OnCheatWarning | |
| 7806 | else OnCheatWarning(playerid, "", 0, 8, 2, ACInfo[playerid][acCheatCount][3]); | |
| 7807 | #endif | |
| 7808 | } | |
| 7809 | else if(ACInfo[playerid][acACAllow][1] && ac_dist >= 3.0 && ac_vsp < 63) | |
| 7810 | {
| |
| 7811 | if(++ACInfo[playerid][acCheatCount][2] > AC_MAX_AIR_VEH_WARNINGS) | |
| 7812 | {
| |
| 7813 | #undef AC_MAX_AIR_VEH_WARNINGS | |
| 7814 | #if defined DEBUG | |
| 7815 | printf("[Nex-AC debug] Speed: %d, dist: %f, old pos diff: %f, veh: %d, seat: %d",
| |
| 7816 | ac_vsp, ac_dist, ACVehInfo[vehicleid][acPosDiff], vehicleid, passenger_seat); | |
| 7817 | #endif | |
| 7818 | #if defined OnCheatDetected | |
| 7819 | ac_KickWithCode(playerid, "", 0, 1, 2); | |
| 7820 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7821 | ACInfo[playerid][acCheatCount][2] = 0; | |
| 7822 | #else | |
| 7823 | return ac_KickWithCode(playerid, "", 0, 1, 2); | |
| 7824 | #endif | |
| 7825 | } | |
| 7826 | #if defined OnCheatWarning | |
| 7827 | else OnCheatWarning(playerid, "", 0, 1, 2, ACInfo[playerid][acCheatCount][2]); | |
| 7828 | #endif | |
| 7829 | } | |
| 7830 | #else | |
| 7831 | if(ACInfo[playerid][acACAllow][31] && | |
| 7832 | ac_zDiff >= -5.0 && (floatabs(new_x - ac_x) >= 8.0 || floatabs(new_y - ac_y) >= 8.0)) | |
| 7833 | {
| |
| 7834 | if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS) | |
| 7835 | {
| |
| 7836 | #if defined DEBUG | |
| 7837 | printf("[Nex-AC debug] Pos diff x, y, z: %f, %f, %f, veh: %d",
| |
| 7838 | new_x - ac_x, new_y - ac_y, ac_zDiff, vehicleid); | |
| 7839 | #endif | |
| 7840 | #if defined OnCheatDetected | |
| 7841 | ac_KickWithCode(playerid, "", 0, 31, 1); | |
| 7842 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7843 | ACInfo[playerid][acCheatCount][4] = 0; | |
| 7844 | #else | |
| 7845 | return ac_KickWithCode(playerid, "", 0, 31, 1); | |
| 7846 | #endif | |
| 7847 | } | |
| 7848 | #if defined OnCheatWarning | |
| 7849 | else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]); | |
| 7850 | #endif | |
| 7851 | } | |
| 7852 | #endif | |
| 7853 | } | |
| 7854 | if(ACInfo[playerid][acACAllow][5] && | |
| 7855 | (ac_dist >= 25.0 || ac_dist >= 15.0 && ac_gtc - ACInfo[playerid][acGtc][15] > ac_gpp) && | |
| 7856 | ac_dist - ACVehInfo[vehicleid][acPosDiff] > (ac_dist / 3.0) * 1.6 && | |
| 7857 | (ac_z >= -45.0 || VectorSize(new_x - ac_x, new_y - ac_y, 0.0) >= 180.0)) | |
| 7858 | {
| |
| 7859 | #if defined DEBUG | |
| 7860 | printf("[Nex-AC debug] Dist: %f, old pos diff: %f, old pos z: %f, veh: %d, seat: %d, playerid: %d",
| |
| 7861 | ac_dist, ACVehInfo[vehicleid][acPosDiff], ac_z, vehicleid, passenger_seat, playerid); | |
| 7862 | #endif | |
| 7863 | #if defined OnCheatDetected | |
| 7864 | ac_KickWithCode(playerid, "", 0, 5, 1); | |
| 7865 | #endif | |
| 7866 | GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]); | |
| 7867 | #if defined SetVehicleFakeZAngleForPlayer | |
| 7868 | SetVehicleFakeZAngleForPlayer(playerid, vehicleid, ACVehInfo[vehicleid][acZAngle]); | |
| 7869 | #else | |
| 7870 | SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]); | |
| 7871 | #endif | |
| 7872 | #if defined SetVehicleFakePosForPlayer | |
| 7873 | SetVehicleFakePosForPlayer(playerid, vehicleid, ac_x, ac_y, ac_z); | |
| 7874 | #else | |
| 7875 | SetVehiclePos(vehicleid, ac_x, ac_y, ac_z); | |
| 7876 | #endif | |
| 7877 | return 0; | |
| 7878 | } | |
| 7879 | #else | |
| 7880 | GetVehiclePos(vehicleid, ac_x, ac_y, ac_z); | |
| 7881 | if(ACInfo[playerid][acACAllow][5]) | |
| 7882 | {
| |
| 7883 | ac_dist = GetPlayerDistanceFromPoint(playerid, ac_x, ac_y, ac_z); | |
| 7884 | if(ac_dist >= 120.0) | |
| 7885 | {
| |
| 7886 | #if defined DEBUG | |
| 7887 | printf("[Nex-AC debug] Dist: %f, veh: %d, seat: %d, playerid: %d", ac_dist, vehicleid, passenger_seat, playerid);
| |
| 7888 | #endif | |
| 7889 | #if defined OnCheatDetected | |
| 7890 | ac_KickWithCode(playerid, "", 0, 5, 4); | |
| 7891 | #endif | |
| 7892 | SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]); | |
| 7893 | SetVehiclePos(vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]); | |
| 7894 | return 0; | |
| 7895 | } | |
| 7896 | } | |
| 7897 | ac_dist = GetVehicleDistanceFromPoint(vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]); | |
| 7898 | if(passenger_seat > 0) | |
| 7899 | {
| |
| 7900 | new Float:ac_zDiff = ac_z - ACVehInfo[vehicleid][acPosZ]; | |
| 7901 | if(ACInfo[playerid][acACAllow][31] && ac_zDiff >= -5.0 && | |
| 7902 | (floatabs(ac_x - ACVehInfo[vehicleid][acPosX]) >= 8.0 || floatabs(ac_y - ACVehInfo[vehicleid][acPosY]) >= 8.0)) | |
| 7903 | {
| |
| 7904 | if(++ACInfo[playerid][acCheatCount][4] > AC_MAX_CARSHOT_WARNINGS) | |
| 7905 | {
| |
| 7906 | #if defined DEBUG | |
| 7907 | printf("[Nex-AC debug] Pos diff x, y, z: %f, %f, %f, veh: %d",
| |
| 7908 | ac_x - ACVehInfo[vehicleid][acPosX], ac_y - ACVehInfo[vehicleid][acPosY], ac_zDiff, vehicleid); | |
| 7909 | #endif | |
| 7910 | #if defined OnCheatDetected | |
| 7911 | ac_KickWithCode(playerid, "", 0, 31, 1); | |
| 7912 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 7913 | ACInfo[playerid][acCheatCount][4] = 0; | |
| 7914 | #else | |
| 7915 | return ac_KickWithCode(playerid, "", 0, 31, 1); | |
| 7916 | #endif | |
| 7917 | } | |
| 7918 | #if defined OnCheatWarning | |
| 7919 | else OnCheatWarning(playerid, "", 0, 31, 1, ACInfo[playerid][acCheatCount][4]); | |
| 7920 | #endif | |
| 7921 | } | |
| 7922 | } | |
| 7923 | #if defined VectorSize | |
| 7924 | if(ACInfo[playerid][acACAllow][5] && | |
| 7925 | (ac_dist >= 25.0 || ac_dist >= 15.0 && ac_gtc - ACInfo[playerid][acGtc][15] > ac_gpp) && | |
| 7926 | ac_dist - ACVehInfo[vehicleid][acPosDiff] > (ac_dist / 3.0) * 1.6 && | |
| 7927 | (ACVehInfo[vehicleid][acPosZ] >= -45.0 || VectorSize(ac_x - ACVehInfo[vehicleid][acPosX], ac_y - ACVehInfo[vehicleid][acPosY], 0.0) >= 180.0)) | |
| 7928 | #else | |
| 7929 | if(ACInfo[playerid][acACAllow][5] && | |
| 7930 | (ac_dist >= 25.0 || ac_dist >= 15.0 && ac_gtc - ACInfo[playerid][acGtc][15] > ac_gpp) && | |
| 7931 | ac_dist - ACVehInfo[vehicleid][acPosDiff] > (ac_dist / 3.0) * 1.6 && | |
| 7932 | (ACVehInfo[vehicleid][acPosZ] >= -45.0 || floatsqroot(floatpower(ac_x - ACVehInfo[vehicleid][acPosX], 2.0) + floatpower(ac_y - ACVehInfo[vehicleid][acPosY], 2.0)) >= 180.0)) | |
| 7933 | #endif | |
| 7934 | {
| |
| 7935 | #if defined DEBUG | |
| 7936 | printf("[Nex-AC debug] Dist: %f, old pos diff: %f, old pos z: %f, veh: %d, seat: %d, playerid: %d",
| |
| 7937 | ac_dist, ACVehInfo[vehicleid][acPosDiff], ACVehInfo[vehicleid][acPosZ], vehicleid, passenger_seat, playerid); | |
| 7938 | #endif | |
| 7939 | #if defined OnCheatDetected | |
| 7940 | ac_KickWithCode(playerid, "", 0, 5, 1); | |
| 7941 | #endif | |
| 7942 | SetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]); | |
| 7943 | SetVehiclePos(vehicleid, ACVehInfo[vehicleid][acPosX], ACVehInfo[vehicleid][acPosY], ACVehInfo[vehicleid][acPosZ]); | |
| 7944 | return 0; | |
| 7945 | } | |
| 7946 | #endif | |
| 7947 | #undef AC_MAX_FLYHACK_VEH_WARNINGS | |
| 7948 | #undef AC_MAX_CARSHOT_WARNINGS | |
| 7949 | #if defined ac_OnUnoccupiedVehicleUpdate | |
| 7950 | #if defined OnTrailerUpdate | |
| 7951 | new ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z, vel_x, vel_y, vel_z); | |
| 7952 | #elseif defined GetServerTickRate | |
| 7953 | new ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, new_x, new_y, new_z); | |
| 7954 | #else | |
| 7955 | new ac_a = ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat); | |
| 7956 | #endif | |
| 7957 | #endif | |
| 7958 | #if defined OnTrailerUpdate | |
| 7959 | #if defined ac_OnUnoccupiedVehicleUpdate | |
| 7960 | if(ac_a) | |
| 7961 | {
| |
| 7962 | #endif | |
| 7963 | ACVehInfo[vehicleid][acPosDiff] = ac_dist; | |
| 7964 | ACVehInfo[vehicleid][acSpeedDiff] = ac_vsp - ACVehInfo[vehicleid][acSpeed]; | |
| 7965 | ACVehInfo[vehicleid][acSpeed] = ac_vsp; | |
| 7966 | ACVehInfo[vehicleid][acPosX] = new_x; | |
| 7967 | ACVehInfo[vehicleid][acPosY] = new_y; | |
| 7968 | ACVehInfo[vehicleid][acPosZ] = new_z; | |
| 7969 | ACVehInfo[vehicleid][acVelX] = vel_x; | |
| 7970 | ACVehInfo[vehicleid][acVelY] = vel_y; | |
| 7971 | ACVehInfo[vehicleid][acVelZ] = vel_z; | |
| 7972 | #if defined ac_OnUnoccupiedVehicleUpdate | |
| 7973 | } | |
| 7974 | #endif | |
| 7975 | #elseif defined GetServerTickRate | |
| 7976 | #if defined ac_OnUnoccupiedVehicleUpdate | |
| 7977 | if(ac_a) | |
| 7978 | {
| |
| 7979 | #endif | |
| 7980 | ACVehInfo[vehicleid][acPosDiff] = ac_dist; | |
| 7981 | ACVehInfo[vehicleid][acPosX] = new_x; | |
| 7982 | ACVehInfo[vehicleid][acPosY] = new_y; | |
| 7983 | ACVehInfo[vehicleid][acPosZ] = new_z; | |
| 7984 | #if defined ac_OnUnoccupiedVehicleUpdate | |
| 7985 | } | |
| 7986 | #endif | |
| 7987 | #else | |
| 7988 | GetVehicleZAngle(vehicleid, ACVehInfo[vehicleid][acZAngle]); | |
| 7989 | ACVehInfo[vehicleid][acPosDiff] = ac_dist; | |
| 7990 | ACVehInfo[vehicleid][acPosX] = ac_x; | |
| 7991 | ACVehInfo[vehicleid][acPosY] = ac_y; | |
| 7992 | ACVehInfo[vehicleid][acPosZ] = ac_z; | |
| 7993 | #endif | |
| 7994 | #if defined ac_OnUnoccupiedVehicleUpdate | |
| 7995 | return ac_a; | |
| 7996 | #else | |
| 7997 | return 1; | |
| 7998 | #endif | |
| 7999 | } | |
| 8000 | ||
| 8001 | #if defined _ALS_OnUnoccupiedVehicleUpdate | |
| 8002 | #undef OnUnoccupiedVehicleUpdate | |
| 8003 | #else | |
| 8004 | #define _ALS_OnUnoccupiedVehicleUpdate | |
| 8005 | #endif | |
| 8006 | #define OnUnoccupiedVehicleUpdate ac_OnUnoccupiedVehicleUpdate | |
| 8007 | - | #if defined ac_OnTrailerUpdate |
| 8007 | + | |
| 8008 | #if defined OnTrailerUpdate | |
| 8009 | 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); | |
| 8010 | #elseif defined GetServerTickRate | |
| 8011 | forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z); | |
| 8012 | #else | |
| 8013 | forward ac_OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat); | |
| 8014 | #endif | |
| 8015 | #endif | |
| 8016 | ||
| 8017 | #if defined OnTrailerUpdate | |
| 8018 | public OnTrailerUpdate(playerid, vehicleid) | |
| 8019 | {
| |
| 8020 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 8021 | #if defined PAWNRAKNET_INC_ | |
| 8022 | #if defined ac_OnTrailerUpdate | |
| 8023 | new ac_a = ac_OnTrailerUpdate(playerid, vehicleid); | |
| 8024 | if(ac_a) | |
| 8025 | {
| |
| 8026 | #endif | |
| 8027 | if(ACVehInfo[vehicleid][acTrSpeed] != -1) | |
| 8028 | {
| |
| 8029 | ACVehInfo[vehicleid][acSpeedDiff] = ACVehInfo[vehicleid][acTrSpeedDiff]; | |
| 8030 | ACVehInfo[vehicleid][acVelX] = ACVehInfo[vehicleid][acTrVelX]; | |
| 8031 | ACVehInfo[vehicleid][acVelY] = ACVehInfo[vehicleid][acTrVelY]; | |
| 8032 | ACVehInfo[vehicleid][acVelZ] = ACVehInfo[vehicleid][acTrVelZ]; | |
| 8033 | ACVehInfo[vehicleid][acSpeed] = ACVehInfo[vehicleid][acTrSpeed]; | |
| 8034 | ACVehInfo[vehicleid][acTrSpeed] = -1; | |
| 8035 | } | |
| 8036 | #if defined ac_OnTrailerUpdate | |
| 8037 | } | |
| 8038 | return ac_a; | |
| 8039 | #else | |
| 8040 | return 1; | |
| 8041 | #endif | |
| 8042 | #elseif defined ac_OnTrailerUpdate | |
| 8043 | return ac_OnTrailerUpdate(playerid, vehicleid); | |
| 8044 | #else | |
| 8045 | return 1; | |
| 8046 | #endif | |
| 8047 | } | |
| 8048 | ||
| 8049 | #if defined _ALS_OnTrailerUpdate | |
| 8050 | #undef OnTrailerUpdate | |
| 8051 | #else | |
| 8052 | #define _ALS_OnTrailerUpdate | |
| 8053 | #endif | |
| 8054 | #define OnTrailerUpdate ac_OnTrailerUpdate | |
| 8055 | #if defined ac_OnTrailerUpdate | |
| 8056 | forward ac_OnTrailerUpdate(playerid, vehicleid); | |
| 8057 | #endif | |
| 8058 | #endif | |
| 8059 | ||
| 8060 | #if defined OnPlayerEditAttachedObject | |
| 8061 | 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) | |
| 8062 | {
| |
| 8063 | if(ACInfo[playerid][acKicked] > 0) return 1; | |
| 8064 | if(ACInfo[playerid][acACAllow][46] && 384 <= modelid <= 393) | |
| 8065 | {
| |
| 8066 | #if defined DEBUG | |
| 8067 | printf("[Nex-AC debug] Object modelid: %d", modelid);
| |
| 8068 | #endif | |
| 8069 | ac_KickWithCode(playerid, "", 0, 46); | |
| 8070 | return 1; | |
| 8071 | } | |
| 8072 | #if defined ac_OnPlayerEditAttachedObject | |
| 8073 | return ac_OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ); | |
| 8074 | #else | |
| 8075 | return 0; | |
| 8076 | #endif | |
| 8077 | } | |
| 8078 | ||
| 8079 | #if defined _ALS_OnPlayerEditAttachedObject | |
| 8080 | #undef OnPlayerEditAttachedObject | |
| 8081 | #else | |
| 8082 | #define _ALS_OnPlayerEditAttachedObject | |
| 8083 | #endif | |
| 8084 | #define OnPlayerEditAttachedObject ac_OnPlayerEditAttachedObject | |
| 8085 | #if defined ac_OnPlayerEditAttachedObject | |
| 8086 | 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); | |
| 8087 | #endif | |
| 8088 | #endif | |
| 8089 | ||
| 8090 | #if defined OnPlayerEnterDynamicArea | |
| 8091 | #if defined STREAMER_ENABLE_TAGS | |
| 8092 | public OnPlayerEnterDynamicArea(playerid, STREAMER_TAG_AREA:areaid) | |
| 8093 | #else | |
| 8094 | public OnPlayerEnterDynamicArea(playerid, areaid) | |
| 8095 | #endif | |
| 8096 | {
| |
| 8097 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 8098 | #if defined ac_OnPlayerEnterDynamicArea | |
| 8099 | return ac_OnPlayerEnterDynamicArea(playerid, areaid); | |
| 8100 | #else | |
| 8101 | return 1; | |
| 8102 | #endif | |
| 8103 | } | |
| 8104 | ||
| 8105 | #if defined _ALS_OnPlayerEnterDynamicArea | |
| 8106 | #undef OnPlayerEnterDynamicArea | |
| 8107 | #else | |
| 8108 | #define _ALS_OnPlayerEnterDynamicArea | |
| 8109 | #endif | |
| 8110 | #define OnPlayerEnterDynamicArea ac_OnPlayerEnterDynamicArea | |
| 8111 | #if defined ac_OnPlayerEnterDynamicArea | |
| 8112 | #if defined STREAMER_ENABLE_TAGS | |
| 8113 | forward ac_OnPlayerEnterDynamicArea(playerid, STREAMER_TAG_AREA:areaid); | |
| 8114 | #else | |
| 8115 | forward ac_OnPlayerEnterDynamicArea(playerid, areaid); | |
| 8116 | #endif | |
| 8117 | #endif | |
| 8118 | #endif | |
| 8119 | ||
| 8120 | #if defined OnPlayerLeaveDynamicArea | |
| 8121 | #if defined STREAMER_ENABLE_TAGS | |
| 8122 | public OnPlayerLeaveDynamicArea(playerid, STREAMER_TAG_AREA:areaid) | |
| 8123 | #else | |
| 8124 | public OnPlayerLeaveDynamicArea(playerid, areaid) | |
| 8125 | #endif | |
| 8126 | {
| |
| 8127 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 8128 | #if defined ac_OnPlayerLeaveDynamicArea | |
| 8129 | return ac_OnPlayerLeaveDynamicArea(playerid, areaid); | |
| 8130 | #else | |
| 8131 | return 1; | |
| 8132 | #endif | |
| 8133 | } | |
| 8134 | ||
| 8135 | #if defined _ALS_OnPlayerLeaveDynamicArea | |
| 8136 | #undef OnPlayerLeaveDynamicArea | |
| 8137 | #else | |
| 8138 | #define _ALS_OnPlayerLeaveDynamicArea | |
| 8139 | #endif | |
| 8140 | #define OnPlayerLeaveDynamicArea ac_OnPlayerLeaveDynamicArea | |
| 8141 | #if defined ac_OnPlayerLeaveDynamicArea | |
| 8142 | #if defined STREAMER_ENABLE_TAGS | |
| 8143 | forward ac_OnPlayerLeaveDynamicArea(playerid, STREAMER_TAG_AREA:areaid); | |
| 8144 | #else | |
| 8145 | forward ac_OnPlayerLeaveDynamicArea(playerid, areaid); | |
| 8146 | #endif | |
| 8147 | #endif | |
| 8148 | #endif | |
| 8149 | ||
| 8150 | #if defined PAWNRAKNET_INC_ | |
| 8151 | public OnIncomingPacket(playerid, packetid, BitStream:bs) | |
| 8152 | {
| |
| 8153 | if(ACInfo[playerid][acKicked] > 0 && ACInfo[playerid][acOnline]) return 0; | |
| 8154 | switch(packetid) | |
| 8155 | {
| |
| 8156 | case 200: | |
| 8157 | {
| |
| 8158 | new ac_cData[PR_InCarSync]; | |
| 8159 | BS_IgnoreBits(bs, 8); | |
| 8160 | BS_ReadInCarSync(bs, ac_cData); | |
| 8161 | if(ACInfo[playerid][acACAllow][44] && !(1 <= ac_cData[PR_vehicleId] < MAX_VEHICLES)) | |
| 8162 | {
| |
| 8163 | #if defined DEBUG | |
| 8164 | printf("[Nex-AC debug] Veh: %d", ac_cData[PR_vehicleId]);
| |
| 8165 | #endif | |
| 8166 | #if defined OnCheatDetected | |
| 8167 | ac_KickWithCode(playerid, "", 0, 44, 7); | |
| 8168 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 8169 | #else | |
| 8170 | return ac_KickWithCode(playerid, "", 0, 44, 7); | |
| 8171 | #endif | |
| 8172 | } | |
| 8173 | if(ac_cData[PR_trainSpeed] != ac_cData[PR_trainSpeed]) | |
| 8174 | {
| |
| 8175 | ac_cData[PR_trainSpeed] = 0.0; | |
| 8176 | BS_SetWriteOffset(bs, 8); | |
| 8177 | BS_WriteInCarSync(bs, ac_cData); | |
| 8178 | } | |
| 8179 | BS_ResetReadPointer(bs); | |
| 8180 | } | |
| 8181 | case 203: | |
| 8182 | {
| |
| 8183 | new ac_aData[PR_AimSync]; | |
| 8184 | BS_IgnoreBits(bs, 8); | |
| 8185 | BS_ReadAimSync(bs, ac_aData); | |
| 8186 | if(ACInfo[playerid][acLastWeapon] == WEAPON_BOMB && ac_aData[PR_camMode] != 4) return 0; | |
| 8187 | if(ac_aData[PR_aimZ] != ac_aData[PR_aimZ]) | |
| 8188 | {
| |
| 8189 | ac_aData[PR_aimZ] = 0.0; | |
| 8190 | BS_SetWriteOffset(bs, 8); | |
| 8191 | BS_WriteAimSync(bs, ac_aData); | |
| 8192 | } | |
| 8193 | BS_ResetReadPointer(bs); | |
| 8194 | } | |
| 8195 | case 207: | |
| 8196 | {
| |
| 8197 | new ac_fData[PR_OnFootSync]; | |
| 8198 | BS_IgnoreBits(bs, 8); | |
| 8199 | BS_ReadOnFootSync(bs, ac_fData); | |
| 8200 | if(ac_fData[PR_surfingOffsets][0] != ac_fData[PR_surfingOffsets][0] || | |
| 8201 | ac_fData[PR_surfingOffsets][1] != ac_fData[PR_surfingOffsets][1] || | |
| 8202 | ac_fData[PR_surfingOffsets][2] != ac_fData[PR_surfingOffsets][2]) | |
| 8203 | {
| |
| 8204 | ac_fData[PR_surfingOffsets][0] = | |
| 8205 | ac_fData[PR_surfingOffsets][1] = | |
| 8206 | ac_fData[PR_surfingOffsets][2] = 0.0; | |
| 8207 | ac_fData[PR_surfingVehicleId] = 0; | |
| 8208 | BS_SetWriteOffset(bs, 8); | |
| 8209 | BS_WriteOnFootSync(bs, ac_fData); | |
| 8210 | } | |
| 8211 | else if(ac_fData[PR_surfingVehicleId] != 0 && | |
| 8212 | ac_fData[PR_surfingOffsets][0] == 0.0 && ac_fData[PR_surfingOffsets][1] == 0.0 && | |
| 8213 | - | ac_uData[PR_roll][2] == ac_uData[PR_direction][2]) return 0; |
| 8213 | + | |
| 8214 | {
| |
| 8215 | ac_fData[PR_surfingVehicleId] = 0; | |
| 8216 | BS_SetWriteOffset(bs, 8); | |
| 8217 | BS_WriteOnFootSync(bs, ac_fData); | |
| 8218 | } | |
| 8219 | BS_ResetReadPointer(bs); | |
| 8220 | } | |
| 8221 | case 209: | |
| 8222 | {
| |
| 8223 | new ac_uData[PR_UnoccupiedSync]; | |
| 8224 | BS_IgnoreBits(bs, 8); | |
| 8225 | BS_ReadUnoccupiedSync(bs, ac_uData); | |
| 8226 | if(ac_uData[PR_seatId] > 0 && | |
| 8227 | (ac_uData[PR_seatId] != ACInfo[playerid][acSeat] || ac_uData[PR_vehicleId] != ACInfo[playerid][acVeh]) || | |
| 8228 | ac_uData[PR_roll][0] != ac_uData[PR_roll][0] || | |
| 8229 | ac_uData[PR_roll][1] != ac_uData[PR_roll][1] || | |
| 8230 | ac_uData[PR_roll][2] != ac_uData[PR_roll][2] || | |
| 8231 | ac_uData[PR_direction][0] != ac_uData[PR_direction][0] || | |
| 8232 | ac_uData[PR_direction][1] != ac_uData[PR_direction][1] || | |
| 8233 | ac_uData[PR_direction][2] != ac_uData[PR_direction][2] || | |
| 8234 | ac_uData[PR_angularVelocity][0] != ac_uData[PR_angularVelocity][0] || | |
| 8235 | ac_uData[PR_angularVelocity][1] != ac_uData[PR_angularVelocity][1] || | |
| 8236 | ac_uData[PR_angularVelocity][2] != ac_uData[PR_angularVelocity][2] || | |
| 8237 | ac_uData[PR_vehicleHealth] != ac_uData[PR_vehicleHealth] || | |
| 8238 | floatabs(ac_uData[PR_roll][0]) >= 1.0 || | |
| 8239 | floatabs(ac_uData[PR_roll][1]) >= 1.0 || | |
| 8240 | floatabs(ac_uData[PR_roll][2]) >= 1.0 || | |
| 8241 | floatabs(ac_uData[PR_direction][0]) >= 1.0 || | |
| 8242 | floatabs(ac_uData[PR_direction][1]) >= 1.0 || | |
| 8243 | floatabs(ac_uData[PR_direction][2]) >= 1.0 || | |
| 8244 | floatabs(ac_uData[PR_angularVelocity][0]) >= 1.0 || | |
| 8245 | floatabs(ac_uData[PR_angularVelocity][1]) >= 1.0 || | |
| 8246 | floatabs(ac_uData[PR_angularVelocity][2]) >= 1.0 || | |
| 8247 | ac_uData[PR_roll][0] == ac_uData[PR_direction][0] && | |
| 8248 | ac_uData[PR_roll][1] == ac_uData[PR_direction][1] && | |
| 8249 | ac_uData[PR_roll][2] == ac_uData[PR_direction][2] || | |
| 8250 | ac_uData[PR_roll][0] == ac_uData[PR_roll][1] && | |
| 8251 | ac_uData[PR_roll][1] == ac_uData[PR_roll][2] || | |
| 8252 | ac_uData[PR_direction][0] == ac_uData[PR_direction][1] && | |
| 8253 | ac_uData[PR_direction][1] == ac_uData[PR_direction][2]) return 0; | |
| 8254 | BS_ResetReadPointer(bs); | |
| 8255 | } | |
| 8256 | case 210: | |
| 8257 | {
| |
| 8258 | new ac_tData[PR_TrailerSync], trailerid; | |
| 8259 | BS_IgnoreBits(bs, 8); | |
| 8260 | BS_ReadTrailerSync(bs, ac_tData); | |
| 8261 | trailerid = ac_tData[PR_trailerId]; | |
| 8262 | - | ACVehInfo[trailerid][acSpeedDiff] = ac_vsp - ACVehInfo[trailerid][acSpeed]; |
| 8262 | + | |
| 8263 | - | ACVehInfo[trailerid][acVelX] = ac_tData[PR_velocity][0]; |
| 8263 | + | |
| 8264 | - | ACVehInfo[trailerid][acVelY] = ac_tData[PR_velocity][1]; |
| 8264 | + | |
| 8265 | - | ACVehInfo[trailerid][acVelZ] = ac_tData[PR_velocity][2]; |
| 8265 | + | |
| 8266 | - | ACVehInfo[trailerid][acSpeed] = ac_vsp; |
| 8266 | + | |
| 8267 | {
| |
| 8268 | #if defined DEBUG | |
| 8269 | printf("[Nex-AC debug] Pos x, y, z: %f, %f, %f, vel x, y, z: %f, %f, %f",
| |
| 8270 | ac_tData[PR_position][0], ac_tData[PR_position][1], ac_tData[PR_position][2], ac_tData[PR_velocity][0], ac_tData[PR_velocity][1], ac_tData[PR_velocity][2]); | |
| 8271 | #endif | |
| 8272 | return ac_KickWithCode(playerid, "", 0, 31, 3); | |
| 8273 | } | |
| 8274 | if(ACInfo[playerid][acACAllow][5]) | |
| 8275 | {
| |
| 8276 | new Float:ac_dist = GetVehicleDistanceFromPoint(trailerid, ac_tData[PR_position][0], ac_tData[PR_position][1], ac_tData[PR_position][2]); | |
| 8277 | if(ac_dist >= 80.0) | |
| 8278 | {
| |
| 8279 | new Float:ac_x, Float:ac_y, Float:ac_z; | |
| 8280 | GetVehiclePos(trailerid, ac_x, ac_y, ac_z); | |
| 8281 | #if defined DEBUG | |
| 8282 | printf("[Nex-AC debug] Dist: %f, old pos z: %f, veh: %d, playerid: %d", ac_dist, ac_z, trailerid, playerid);
| |
| 8283 | #endif | |
| 8284 | #if defined OnCheatDetected | |
| 8285 | ac_KickWithCode(playerid, "", 0, 5, 2); | |
| 8286 | #endif | |
| 8287 | GetVehicleZAngle(trailerid, ACVehInfo[trailerid][acZAngle]); | |
| 8288 | #if defined SetVehicleFakeZAngleForPlayer | |
| 8289 | SetVehicleFakeZAngleForPlayer(playerid, trailerid, ACVehInfo[trailerid][acZAngle]); | |
| 8290 | #else | |
| 8291 | SetVehicleZAngle(trailerid, ACVehInfo[trailerid][acZAngle]); | |
| 8292 | #endif | |
| 8293 | #if defined SetVehicleFakePosForPlayer | |
| 8294 | SetVehicleFakePosForPlayer(playerid, trailerid, ac_x, ac_y, ac_z); | |
| 8295 | #else | |
| 8296 | SetVehiclePos(trailerid, ac_x, ac_y, ac_z); | |
| 8297 | #endif | |
| 8298 | return 0; | |
| 8299 | } | |
| 8300 | } | |
| 8301 | new ac_vsp = ac_GetSpeed(ac_tData[PR_velocity][0], ac_tData[PR_velocity][1], ac_tData[PR_velocity][2]); | |
| 8302 | ACVehInfo[trailerid][acTrSpeedDiff] = ac_vsp - ACVehInfo[trailerid][acSpeed]; | |
| 8303 | ACVehInfo[trailerid][acTrVelX] = ac_tData[PR_velocity][0]; | |
| 8304 | ACVehInfo[trailerid][acTrVelY] = ac_tData[PR_velocity][1]; | |
| 8305 | ACVehInfo[trailerid][acTrVelZ] = ac_tData[PR_velocity][2]; | |
| 8306 | ACVehInfo[trailerid][acTrSpeed] = ac_vsp; | |
| 8307 | BS_ResetReadPointer(bs); | |
| 8308 | } | |
| 8309 | case 211: | |
| 8310 | {
| |
| 8311 | if(ACInfo[playerid][acACAllow][44]) | |
| 8312 | {
| |
| 8313 | new ac_pData[PR_PassengerSync]; | |
| 8314 | BS_IgnoreBits(bs, 8); | |
| 8315 | - | #if defined IsPlayerSpawned |
| 8315 | + | |
| 8316 | if(ac_pData[PR_seatId] < 1 || !(1 <= ac_pData[PR_vehicleId] < MAX_VEHICLES)) | |
| 8317 | {
| |
| 8318 | #if defined DEBUG | |
| 8319 | printf("[Nex-AC debug] AC seat: %d, seat: %d, veh: %d",
| |
| 8320 | ACInfo[playerid][acSeat], ac_pData[PR_seatId], ac_pData[PR_vehicleId]); | |
| 8321 | #endif | |
| 8322 | #if defined OnCheatDetected | |
| 8323 | ac_KickWithCode(playerid, "", 0, 44, 6); | |
| 8324 | if(ACInfo[playerid][acKicked] > 0) return 0; | |
| 8325 | #else | |
| 8326 | return ac_KickWithCode(playerid, "", 0, 44, 6); | |
| 8327 | #endif | |
| 8328 | } | |
| 8329 | BS_ResetReadPointer(bs); | |
| 8330 | } | |
| 8331 | } | |
| 8332 | } | |
| 8333 | #if defined ac_OnIncomingPacket | |
| 8334 | return ac_OnIncomingPacket(playerid, packetid, bs); | |
| 8335 | #else | |
| 8336 | return 1; | |
| 8337 | #endif | |
| 8338 | } | |
| 8339 | ||
| 8340 | #if defined _ALS_OnIncomingPacket | |
| 8341 | #undef OnIncomingPacket | |
| 8342 | #else | |
| 8343 | #define _ALS_OnIncomingPacket | |
| 8344 | #endif | |
| 8345 | #define OnIncomingPacket ac_OnIncomingPacket | |
| 8346 | #if defined ac_OnIncomingPacket | |
| 8347 | forward ac_OnIncomingPacket(playerid, packetid, BitStream:bs); | |
| 8348 | #endif | |
| 8349 | ||
| 8350 | public OnIncomingRPC(playerid, rpcid, BitStream:bs) | |
| 8351 | {
| |
| 8352 | if(ACInfo[playerid][acKicked] > 0 && ACInfo[playerid][acOnline]) return 0; | |
| 8353 | if(rpcid == 128 && !ACInfo[playerid][acForceClass]) | |
| 8354 | {
| |
| 8355 | #if defined WC_IsPlayerSpawned | |
| 8356 | if(WC_IsPlayerSpawned(playerid)) return 0; | |
| 8357 | #elseif defined IsPlayerSpawned | |
| 8358 | if(IsPlayerSpawned(playerid)) return 0; | |
| 8359 | #else | |
| 8360 | new ac_i = GetPlayerState(playerid); | |
| 8361 | if(PLAYER_STATE_ONFOOT <= ac_i < PLAYER_STATE_WASTED || ac_i == PLAYER_STATE_SPAWNED) return 0; | |
| 8362 | #endif | |
| 8363 | } | |
| 8364 | #if defined ac_OnIncomingRPC | |
| 8365 | return ac_OnIncomingRPC(playerid, rpcid, bs); | |
| 8366 | #else | |
| 8367 | return 1; | |
| 8368 | #endif | |
| 8369 | } | |
| 8370 | ||
| 8371 | #if defined _ALS_OnIncomingRPC | |
| 8372 | #undef OnIncomingRPC | |
| 8373 | #else | |
| 8374 | #define _ALS_OnIncomingRPC | |
| 8375 | #endif | |
| 8376 | #define OnIncomingRPC ac_OnIncomingRPC | |
| 8377 | #if defined ac_OnIncomingRPC | |
| 8378 | forward ac_OnIncomingRPC(playerid, rpcid, BitStream:bs); | |
| 8379 | #endif | |
| 8380 | #endif | |
| 8381 | ||
| 8382 | #if defined PAWNRAKNET_INC_ || defined SendRPC | |
| 8383 | static SetVehicleFakePosForPlayer(playerid, vehicleid, Float:x, Float:y, Float:z) | |
| 8384 | {
| |
| 8385 | if(!IsPlayerConnected(playerid) || GetVehicleModel(vehicleid) <= 0) return 0; | |
| 8386 | #if defined PAWNRAKNET_INC_ | |
| 8387 | new BitStream:bs = BS_New(); | |
| 8388 | BS_WriteValue(bs, PR_UINT16, vehicleid, PR_FLOAT, x, PR_FLOAT, y, PR_FLOAT, z); | |
| 8389 | #if defined PR_SendRPC | |
| 8390 | PR_SendRPC(bs, playerid, 159); | |
| 8391 | #else | |
| 8392 | BS_RPC(bs, playerid, 159); | |
| 8393 | #endif | |
| 8394 | BS_Delete(bs); | |
| 8395 | #else | |
| 8396 | SendRPC(playerid, 159, BS_UNSIGNEDSHORT, vehicleid, BS_FLOAT, x, BS_FLOAT, y, BS_FLOAT, z); | |
| 8397 | #endif | |
| 8398 | return 1; | |
| 8399 | } | |
| 8400 | ||
| 8401 | static SetVehicleFakeZAngleForPlayer(playerid, vehicleid, Float:z_angle) | |
| 8402 | {
| |
| 8403 | if(!IsPlayerConnected(playerid) || GetVehicleModel(vehicleid) <= 0) return 0; | |
| 8404 | #if defined PAWNRAKNET_INC_ | |
| 8405 | new BitStream:bs = BS_New(); | |
| 8406 | BS_WriteValue(bs, PR_UINT16, vehicleid, PR_FLOAT, z_angle); | |
| 8407 | #if defined PR_SendRPC | |
| 8408 | PR_SendRPC(bs, playerid, 160); | |
| 8409 | #else | |
| 8410 | BS_RPC(bs, playerid, 160); | |
| 8411 | #endif | |
| 8412 | BS_Delete(bs); | |
| 8413 | #else | |
| 8414 | SendRPC(playerid, 160, BS_UNSIGNEDSHORT, vehicleid, BS_FLOAT, z_angle); | |
| 8415 | #endif | |
| 8416 | return 1; | |
| 8417 | } | |
| 8418 | #endif | |
| 8419 | ||
| 8420 | ac_fpublic ac_Timer(playerid) | |
| 8421 | {
| |
| 8422 | if(!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked] > 0) return 0; | |
| 8423 | new ac_gpp; | |
| 8424 | - | new ac_t, ac_s; |
| 8424 | + | |
| 8425 | if(ACInfo[playerid][acACAllow][51] && (ac_gpp = NetStats_MessagesRecvPerSecond(playerid)) > AC_MAX_MSGS_REC_DIFF) | |
| 8426 | - | ac_s = GetPlayerSyncWeapon(playerid); |
| 8426 | + | |
| 8427 | #if defined DEBUG | |
| 8428 | - | ac_s = GetPlayerWeapon(playerid); |
| 8428 | + | |
| 8429 | #endif | |
| 8430 | ac_KickWithCode(playerid, "", 0, 51); | |
| 8431 | } | |
| 8432 | #endif | |
| 8433 | #undef AC_MAX_MSGS_REC_DIFF | |
| 8434 | ac_gpp = GetPlayerPing(playerid); | |
| 8435 | if(ACInfo[playerid][acACAllow][38]) | |
| 8436 | {
| |
| 8437 | if(ac_gpp > AC_MAX_PING) | |
| 8438 | {
| |
| 8439 | if(++ACInfo[playerid][acCheatCount][0] > AC_MAX_PING_WARNINGS) | |
| 8440 | {
| |
| 8441 | #if defined DEBUG | |
| 8442 | printf("[Nex-AC debug] Max ping: %d, ping: %d", AC_MAX_PING, ac_gpp);
| |
| 8443 | #endif | |
| 8444 | #undef AC_MAX_PING | |
| 8445 | #undef AC_MAX_PING_WARNINGS | |
| 8446 | ac_KickWithCode(playerid, "", 0, 38); | |
| 8447 | #if defined OnCheatDetected | |
| 8448 | ACInfo[playerid][acCheatCount][0] = 0; | |
| 8449 | - | if(ac_w == 39) ac_cw = true; |
| 8449 | + | |
| 8450 | } | |
| 8451 | #if defined OnCheatWarning | |
| 8452 | else OnCheatWarning(playerid, "", 0, 38, 0, ACInfo[playerid][acCheatCount][0]); | |
| 8453 | #endif | |
| 8454 | } | |
| 8455 | else ACInfo[playerid][acCheatCount][0] = 0; | |
| 8456 | } | |
| 8457 | new ac_gtc = GetTickCount(); | |
| 8458 | #if defined IsPlayerDying | |
| 8459 | if(!IsPlayerDying(playerid)) | |
| 8460 | #else | |
| 8461 | if(!ACInfo[playerid][acDead]) | |
| 8462 | #endif | |
| 8463 | {
| |
| 8464 | if(ac_gtc - ACInfo[playerid][acUpdateTick] < 1500) | |
| 8465 | {
| |
| 8466 | new ac_t, ac_s = ACInfo[playerid][acLastWeapon]; | |
| 8467 | if(ac_s != -1 && ac_gtc - ACInfo[playerid][acGtc][6] > ac_gpp) | |
| 8468 | {
| |
| 8469 | #if AC_USE_AMMUNATIONS | |
| 8470 | new ac_m; | |
| 8471 | #endif | |
| 8472 | #if AC_USE_PICKUP_WEAPONS\ | |
| 8473 | && defined Streamer_GetDistanceToItem\ | |
| 8474 | && defined Streamer_GetIntData | |
| 8475 | new Float:ac_pick_dist; | |
| 8476 | if(ACInfo[playerid][acLastPickup] > MAX_PICKUPS) | |
| 8477 | {
| |
| 8478 | Streamer_GetDistanceToItem(ACInfo[playerid][acPosX], ACInfo[playerid][acPosY], ACInfo[playerid][acPosZ], STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, ac_pick_dist); | |
| 8479 | ac_t = Streamer_GetIntData(STREAMER_TYPE_PICKUP, ACInfo[playerid][acLastPickup] - MAX_PICKUPS, E_STREAMER_EXTRA_ID) - 100; | |
| 8480 | } | |
| 8481 | #endif | |
| 8482 | ac_s = ac_wSlot[ac_s]; | |
| 8483 | for(new ac_i, ac_w, ac_a, bool:ac_cw; ac_i <= 12; ++ac_i) | |
| 8484 | {
| |
| 8485 | GetPlayerWeaponData(playerid, ac_i, ac_w, ac_a); | |
| 8486 | if(ac_w == WEAPON_SATCHEL) ac_cw = true; | |
| 8487 | if(ac_s != ac_i) | |
| 8488 | {
| |
| 8489 | if(ACInfo[playerid][acSetWeapon][ac_i] > 0) | |
| 8490 | {
| |
| 8491 | if(ACInfo[playerid][acSetWeapon][ac_i] == ac_w) | |
| 8492 | {
| |
| 8493 | ACInfo[playerid][acSetWeapon][ac_i] = -1; | |
| 8494 | ACInfo[playerid][acWeapon][ac_i] = ac_w; | |
| 8495 | } | |
| 8496 | else if(ac_gtc - ACInfo[playerid][acGtcSetWeapon][ac_i] > ac_gpp) | |
| 8497 | {
| |
| 8498 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][0]) | |
| 8499 | {
| |
| 8500 | if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_TIMER_WARNINGS) | |
| 8501 | {
| |
| 8502 | #if defined DEBUG | |
| 8503 | printf(DEBUG_CODE_5, playerid, "GivePlayerWeapon"); | |
| 8504 | printf("[Nex-AC debug] AC weapon: %d, weaponid: %d", ACInfo[playerid][acSetWeapon][ac_i], ac_w);
| |
| 8505 | #endif | |
| 8506 | ac_KickWithCode(playerid, "", 0, 52, 13); | |
| 8507 | #if defined OnCheatDetected | |
| 8508 | ACInfo[playerid][acSetWeapon][ac_i] = -1; | |
| 8509 | - | if(ac_w == 0 || ac_w == 40 && ac_cw || |
| 8509 | + | |
| 8510 | - | ac_w == 46 && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute] > 0) |
| 8510 | + | |
| 8511 | #if defined OnNOPWarning | |
| 8512 | else OnNOPWarning(playerid, 13, ACInfo[playerid][acNOPCount][0]); | |
| 8513 | #endif | |
| 8514 | - | ACInfo[playerid][acParachute] = 0; |
| 8514 | + | |
| 8515 | else if(++ACInfo[playerid][acNOPCount][0] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSetWeapon][ac_i] = -1; | |
| 8516 | } | |
| 8517 | } | |
| 8518 | else | |
| 8519 | {
| |
| 8520 | if(ACInfo[playerid][acWeapon][ac_i] != ac_w) | |
| 8521 | {
| |
| 8522 | #if AC_USE_PICKUP_WEAPONS | |
| 8523 | #if defined Streamer_GetDistanceToItem\ | |
| 8524 | && defined Streamer_GetIntData | |
| 8525 | if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && | |
| 8526 | ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w && | |
| 8527 | ac_a <= (3 <= ac_i <= 5 ? (ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) && | |
| 8528 | IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX], | |
| 8529 | ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ]) || | |
| 8530 | ACInfo[playerid][acLastPickup] > MAX_PICKUPS && ac_t == ac_w && | |
| 8531 | ac_a <= (3 <= ac_i <= 5 ? (ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) && ac_pick_dist <= 15.0) | |
| 8532 | #else | |
| 8533 | if(0 <= ACInfo[playerid][acLastPickup] < MAX_PICKUPS && | |
| 8534 | ACPickInfo[ACInfo[playerid][acLastPickup]][acWeapon] == ac_w && | |
| 8535 | ac_a <= (3 <= ac_i <= 5 ? (ACInfo[playerid][acAmmo][ac_i] + ac_pAmmo[ac_w]) : ac_pAmmo[ac_w]) && | |
| 8536 | IsPlayerInRangeOfPoint(playerid, 15.0, ACPickInfo[ACInfo[playerid][acLastPickup]][acPosX], | |
| 8537 | ACPickInfo[ACInfo[playerid][acLastPickup]][acPosY], ACPickInfo[ACInfo[playerid][acLastPickup]][acPosZ])) | |
| 8538 | #endif | |
| 8539 | {
| |
| 8540 | ACInfo[playerid][acWeapon][ac_i] = ac_w; | |
| 8541 | ACInfo[playerid][acAmmo][ac_i] = ac_a; | |
| 8542 | } | |
| 8543 | else | |
| 8544 | {
| |
| 8545 | #endif | |
| 8546 | if(ac_w == 0 || ac_w == WEAPON_BOMB && ac_cw || | |
| 8547 | ac_w == WEAPON_PARACHUTE && ACInfo[playerid][acVeh] > 0 && ACInfo[playerid][acParachute] > 0) | |
| 8548 | {
| |
| 8549 | if(ac_w == WEAPON_PARACHUTE) ACInfo[playerid][acParachute] = 0; | |
| 8550 | ACInfo[playerid][acWeapon][ac_i] = ac_w; | |
| 8551 | ACInfo[playerid][acAmmo][ac_i] = ac_a; | |
| 8552 | } | |
| 8553 | else if(ACInfo[playerid][acACAllow][15] && !(16 <= ac_w <= 43 && ac_a == 0)) | |
| 8554 | {
| |
| 8555 | #if defined DEBUG | |
| 8556 | printf("[Nex-AC debug] AC weaponid: %d, AC ammo: %d, weaponid: %d, ammo: %d",
| |
| 8557 | ACInfo[playerid][acWeapon][ac_i], ACInfo[playerid][acAmmo][ac_i], ac_w, ac_a); | |
| 8558 | #endif | |
| 8559 | ac_KickWithCode(playerid, "", 0, 15, 2); | |
| 8560 | #if defined OnCheatDetected | |
| 8561 | if(ACInfo[playerid][acKicked] < 1) | |
| 8562 | {
| |
| 8563 | ACInfo[playerid][acWeapon][ac_i] = ac_w; | |
| 8564 | ACInfo[playerid][acAmmo][ac_i] = ac_a; | |
| 8565 | } | |
| 8566 | #endif | |
| 8567 | } | |
| 8568 | #if AC_USE_PICKUP_WEAPONS | |
| 8569 | } | |
| 8570 | #endif | |
| 8571 | - | else if(ACInfo[playerid][acACAllow][16] && ac_w != 40 && |
| 8571 | + | |
| 8572 | } | |
| 8573 | if(ACInfo[playerid][acGiveAmmo][ac_i] != -65535) | |
| 8574 | {
| |
| 8575 | if(ACInfo[playerid][acGiveAmmo][ac_i] == ac_a || | |
| 8576 | ACInfo[playerid][acGiveAmmo][ac_i] > ac_a && !(ac_a < 0 <= ACInfo[playerid][acGiveAmmo][ac_i]) && | |
| 8577 | ac_gtc - ACInfo[playerid][acGtcGiveAmmo][ac_i] > ac_gpp) | |
| 8578 | {
| |
| 8579 | ACInfo[playerid][acGiveAmmo][ac_i] = -65535; | |
| 8580 | ACInfo[playerid][acAmmo][ac_i] = ac_a; | |
| 8581 | } | |
| 8582 | else if(ac_gtc - ACInfo[playerid][acGtcGiveAmmo][ac_i] > ac_gpp) | |
| 8583 | {
| |
| 8584 | if(ACInfo[playerid][acACAllow][52] && ACInfo[playerid][acNOPAllow][1]) | |
| 8585 | {
| |
| 8586 | if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_TIMER_WARNINGS) | |
| 8587 | {
| |
| 8588 | #if defined DEBUG | |
| 8589 | printf(DEBUG_CODE_5, playerid, "SetPlayerAmmo"); | |
| 8590 | printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
| |
| 8591 | ACInfo[playerid][acGiveAmmo][ac_i], ac_a, ac_w); | |
| 8592 | #endif | |
| 8593 | ac_KickWithCode(playerid, "", 0, 52, 14); | |
| 8594 | #if defined OnCheatDetected | |
| 8595 | ACInfo[playerid][acGiveAmmo][ac_i] = -65535; | |
| 8596 | #endif | |
| 8597 | } | |
| 8598 | #if defined OnNOPWarning | |
| 8599 | else OnNOPWarning(playerid, 14, ACInfo[playerid][acNOPCount][1]); | |
| 8600 | #endif | |
| 8601 | } | |
| 8602 | else if(++ACInfo[playerid][acNOPCount][1] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acGiveAmmo][ac_i] = -65535; | |
| 8603 | } | |
| 8604 | } | |
| 8605 | else if(16 <= ac_w <= 43) | |
| 8606 | {
| |
| 8607 | if(ac_a == 0) ACInfo[playerid][acAmmo][ac_i] = 0; | |
| 8608 | else if(ACInfo[playerid][acACAllow][16] && ac_w != WEAPON_BOMB && | |
| 8609 | (ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i]) && | |
| 8610 | (!ac_LagCompMode || !ac_IsBulletWeapon(ac_w) || ac_gtc - ACInfo[playerid][acShotTick] > 3850)) | |
| 8611 | {
| |
| 8612 | #if defined DEBUG | |
| 8613 | printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
| |
| 8614 | ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w); | |
| 8615 | #endif | |
| 8616 | ac_KickWithCode(playerid, "", 0, 16, 2); | |
| 8617 | #if defined OnCheatDetected | |
| 8618 | if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acAmmo][ac_i] = ac_a; | |
| 8619 | #endif | |
| 8620 | } | |
| 8621 | } | |
| 8622 | } | |
| 8623 | } | |
| 8624 | else if(ac_IsBulletWeapon(ac_w)) | |
| 8625 | {
| |
| 8626 | if(ac_a > ACInfo[playerid][acAmmo][ac_i] || ac_a < 0 <= ACInfo[playerid][acAmmo][ac_i]) | |
| 8627 | {
| |
| 8628 | if(ACInfo[playerid][acGiveAmmo][ac_i] == -65535) | |
| 8629 | {
| |
| 8630 | #if AC_USE_AMMUNATIONS | |
| 8631 | if(ac_w <= 32 && ac_InAmmuNation(playerid, ACInfo[playerid][acInt]) && | |
| 8632 | (ac_m = ac_a - ACInfo[playerid][acAmmo][ac_i]) % ac_AmmuNationInfo[ac_w - 22][1] == 0) | |
| 8633 | {
| |
| 8634 | if(ACInfo[playerid][acSet][10] != -1) ACInfo[playerid][acSet][10] += ac_AmmuNationInfo[ac_w - 22][0] * (ac_m / ac_AmmuNationInfo[ac_w - 22][1]); | |
| 8635 | else ACInfo[playerid][acSet][10] = ac_AmmuNationInfo[ac_w - 22][0] * (ac_m / ac_AmmuNationInfo[ac_w - 22][1]); | |
| 8636 | ACInfo[playerid][acAmmo][ac_i] += ac_m; | |
| 8637 | ACInfo[playerid][acGtc][16] = ac_gtc + 2850; | |
| 8638 | ACInfo[playerid][acCheatCount][20] = 0; | |
| 8639 | } | |
| 8640 | else | |
| 8641 | {
| |
| 8642 | #endif | |
| 8643 | if(ACInfo[playerid][acACAllow][16] && (!ac_LagCompMode || ac_gtc - ACInfo[playerid][acShotTick] > 3850)) | |
| 8644 | {
| |
| 8645 | #if defined DEBUG | |
| 8646 | printf("[Nex-AC debug] AC ammo: %d, ammo: %d, weaponid: %d",
| |
| 8647 | ACInfo[playerid][acAmmo][ac_i], ac_a, ac_w); | |
| 8648 | #endif | |
| 8649 | ac_KickWithCode(playerid, "", 0, 16, 3); | |
| 8650 | #if defined OnCheatDetected | |
| 8651 | if(ACInfo[playerid][acKicked] < 1) ACInfo[playerid][acAmmo][ac_i] = ac_a; | |
| 8652 | #endif | |
| 8653 | } | |
| 8654 | #if AC_USE_AMMUNATIONS | |
| 8655 | } | |
| 8656 | #endif | |
| 8657 | } | |
| 8658 | } | |
| 8659 | else if(ACInfo[playerid][acAmmo][ac_i] != 0) ACInfo[playerid][acAmmo][ac_i] = ac_a; | |
| 8660 | } | |
| 8661 | } | |
| 8662 | } | |
| 8663 | if((ac_s = GetPlayerState(playerid)) == PLAYER_STATE_DRIVER) | |
| 8664 | {
| |
| 8665 | ac_t = ACInfo[playerid][acVeh]; | |
| 8666 | if(ACInfo[playerid][acACAllow][35] && GetPlayerCameraMode(playerid) == 55) ac_KickWithCode(playerid, "", 0, 35); | |
| 8667 | if(ACInfo[playerid][acACAllow][3] && ACInfo[playerid][acSet][8] == -1) | |
| 8668 | {
| |
| 8669 | new Float:ac_time, Float:ac_maxdist = 140.0, | |
| 8670 | Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY], ACInfo[playerid][acPosZ]), | |
| 8671 | Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], ACInfo[playerid][acPosZ]); | |
| 8672 | if((ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1000.0) > 1.0) ac_maxdist *= ac_time; | |
| 8673 | if(ac_dist >= ac_maxdist && (ACInfo[playerid][acSet][7] == -1 || ac_dist_set >= ac_maxdist)) | |
| 8674 | {
| |
| 8675 | #if defined DEBUG | |
| 8676 | printf("[Nex-AC debug] Dist: %f, dist set: %f, acSet[7]: %d, speed: %d, veh: %d",
| |
| 8677 | ac_dist, ac_dist_set, ACInfo[playerid][acSet][7], ACVehInfo[ac_t][acSpeed], ac_t); | |
| 8678 | #endif | |
| 8679 | ac_KickWithCode(playerid, "", 0, 3, 3); | |
| 8680 | } | |
| 8681 | } | |
| 8682 | ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX]; | |
| 8683 | ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY]; | |
| 8684 | ac_s = ac_GetSpeed(ACVehInfo[ac_t][acVelX], ACVehInfo[ac_t][acVelY]); | |
| 8685 | if(ACInfo[playerid][acACAllow][10] && ac_gtc - ACInfo[playerid][acGtc][8] > ac_gpp) | |
| 8686 | {
| |
| 8687 | new ac_model = GetVehicleModel(ac_t), ac_maxdiff = 80, | |
| 8688 | Float:ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1100.0; | |
| 8689 | if(ac_s - ACVehInfo[ac_t][acLastSpeed] >= (ac_time > 1.0 ? floatround(ac_maxdiff * ac_time) : ac_maxdiff) && | |
| 8690 | (!ac_IsValidVehicleModel(ac_model) || ac_model != 449 && !ac_IsATrainLoco(ac_model) && !ac_IsAnAirplane(ac_model))) | |
| 8691 | {
| |
| 8692 | ACInfo[playerid][acCheatCount][18] += (1 * AC_SPEEDHACK_VEH_RESET_DELAY); | |
| 8693 | if(ACInfo[playerid][acCheatCount][18] > AC_MAX_SPEEDHACK_VEH_WARNINGS) | |
| 8694 | {
| |
| 8695 | #undef AC_MAX_SPEEDHACK_VEH_WARNINGS | |
| 8696 | #if defined DEBUG | |
| 8697 | printf("[Nex-AC debug] Speed: %d, last speed: %d, veh model: %d, veh: %d",
| |
| 8698 | ac_s, ACVehInfo[ac_t][acLastSpeed], ac_model, ac_t); | |
| 8699 | #endif | |
| 8700 | ac_KickWithCode(playerid, "", 0, 10, 4); | |
| 8701 | #if defined OnCheatDetected | |
| 8702 | ACInfo[playerid][acCheatCount][18] = 0; | |
| 8703 | #endif | |
| 8704 | } | |
| 8705 | #if defined OnCheatWarning | |
| 8706 | else OnCheatWarning(playerid, "", 0, 10, 4, floatround(ACInfo[playerid][acCheatCount][18] / AC_SPEEDHACK_VEH_RESET_DELAY)); | |
| 8707 | #endif | |
| 8708 | #undef AC_SPEEDHACK_VEH_RESET_DELAY | |
| 8709 | } | |
| 8710 | } | |
| 8711 | ACVehInfo[ac_t][acLastSpeed] = ac_s; | |
| 8712 | } | |
| 8713 | else if(ac_s == PLAYER_STATE_ONFOOT) | |
| 8714 | {
| |
| 8715 | if(ACInfo[playerid][acACAllow][2] && ACInfo[playerid][acSet][8] == -1 && | |
| 8716 | !IsVehicleStreamedIn(GetPlayerSurfingVehicleID(playerid), playerid) && | |
| 8717 | GetPlayerSurfingObjectID(playerid) == INVALID_OBJECT_ID) | |
| 8718 | {
| |
| 8719 | new Float:ac_time, Float:ac_maxdist = 80.0, | |
| 8720 | Float:ac_dist = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY], ACInfo[playerid][acPosZ]), | |
| 8721 | Float:ac_dist_set = GetPlayerDistanceFromPoint(playerid, ACInfo[playerid][acSetPosX], ACInfo[playerid][acSetPosY], ACInfo[playerid][acPosZ]); | |
| 8722 | if((ac_time = (ac_gtc - ACInfo[playerid][acTimerTick]) / 1000.0) > 1.0) ac_maxdist *= ac_time; | |
| 8723 | if(ac_dist >= ac_maxdist && (ACInfo[playerid][acSet][7] == -1 || ac_dist_set >= ac_maxdist)) | |
| 8724 | {
| |
| 8725 | #if defined DEBUG | |
| 8726 | printf("[Nex-AC debug] Dist: %f, dist set: %f, acSet[7]: %d, speed: %d, old pos x, y: %f, %f",
| |
| 8727 | ac_dist, ac_dist_set, ACInfo[playerid][acSet][7], ACInfo[playerid][acSpeed], ACInfo[playerid][acLastPosX], ACInfo[playerid][acLastPosY]); | |
| 8728 | #endif | |
| 8729 | ac_KickWithCode(playerid, "", 0, 2, 6); | |
| 8730 | } | |
| 8731 | } | |
| 8732 | ACInfo[playerid][acLastPosX] = ACInfo[playerid][acPosX]; | |
| 8733 | ACInfo[playerid][acLastPosY] = ACInfo[playerid][acPosY]; | |
| 8734 | } | |
| 8735 | ac_t = orig_GetPlayerMoney(playerid); | |
| 8736 | #if AC_USE_AMMUNATIONS | |
| 8737 | if(ACInfo[playerid][acSet][10] != -1) | |
| 8738 | {
| |
| 8739 | if(ac_t < ACInfo[playerid][acMoney] && | |
| 8740 | ACInfo[playerid][acMoney] - ac_t >= ACInfo[playerid][acSet][10]) ACInfo[playerid][acSet][10] = -1; | |
| 8741 | else if(ac_gtc - ACInfo[playerid][acGtc][16] > ac_gpp) | |
| 8742 | {
| |
| 8743 | if(ACInfo[playerid][acACAllow][15]) | |
| 8744 | {
| |
| 8745 | if(++ACInfo[playerid][acCheatCount][20] > AC_MAX_NOP_TIMER_WARNINGS) | |
| 8746 | {
| |
| 8747 | #if defined DEBUG | |
| 8748 | printf("[Nex-AC debug] Money: %d, old money: %d, price: %d",
| |
| 8749 | ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][10]); | |
| 8750 | #endif | |
| 8751 | ac_KickWithCode(playerid, "", 0, 15, 4); | |
| 8752 | #if defined OnCheatDetected | |
| 8753 | ACInfo[playerid][acSet][10] = -1; | |
| 8754 | #endif | |
| 8755 | } | |
| 8756 | #if defined OnCheatWarning | |
| 8757 | else OnCheatWarning(playerid, "", 0, 15, 4, ACInfo[playerid][acCheatCount][20]); | |
| 8758 | #endif | |
| 8759 | } | |
| 8760 | else if(++ACInfo[playerid][acCheatCount][20] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSet][10] = -1; | |
| 8761 | } | |
| 8762 | } | |
| 8763 | #endif | |
| 8764 | #if AC_USE_TUNING_GARAGES | |
| 8765 | if(ACInfo[playerid][acSet][11] != -1) | |
| 8766 | {
| |
| 8767 | if(ac_t < ACInfo[playerid][acMoney] && | |
| 8768 | ACInfo[playerid][acMoney] - ac_t >= ACInfo[playerid][acSet][11]) ACInfo[playerid][acSet][11] = -1; | |
| 8769 | else if(ac_gtc - ACInfo[playerid][acGtc][17] > ac_gpp) | |
| 8770 | {
| |
| 8771 | if(ACInfo[playerid][acACAllow][23]) | |
| 8772 | {
| |
| 8773 | if(++ACInfo[playerid][acCheatCount][21] > AC_MAX_NOP_TIMER_WARNINGS) | |
| 8774 | {
| |
| 8775 | #if defined DEBUG | |
| 8776 | printf("[Nex-AC debug] Money: %d, old money: %d, component price: %d",
| |
| 8777 | ac_t, ACInfo[playerid][acMoney], ACInfo[playerid][acSet][11]); | |
| 8778 | #endif | |
| 8779 | ac_KickWithCode(playerid, "", 0, 23, 6); | |
| 8780 | #if defined OnCheatDetected | |
| 8781 | ACInfo[playerid][acSet][11] = -1; | |
| 8782 | #endif | |
| 8783 | } | |
| 8784 | #if defined OnCheatWarning | |
| 8785 | else OnCheatWarning(playerid, "", 0, 23, 6, ACInfo[playerid][acCheatCount][21]); | |
| 8786 | #endif | |
| 8787 | } | |
| 8788 | else if(++ACInfo[playerid][acCheatCount][21] > AC_MAX_NOP_TIMER_WARNINGS) ACInfo[playerid][acSet][11] = -1; | |
| 8789 | } | |
| 8790 | } | |
| 8791 | #endif | |
| 8792 | #undef AC_USE_TUNING_GARAGES | |
| 8793 | #undef AC_MAX_NOP_TIMER_WARNINGS | |
| 8794 | if(ACInfo[playerid][acNOPCount][11] > 0) ACInfo[playerid][acNOPCount][11]--; | |
| 8795 | else | |
| 8796 | {
| |
| 8797 | if(ACInfo[playerid][acACAllow][14] && ac_t > ACInfo[playerid][acMoney] && | |
| 8798 | (!ACInfo[playerid][acStuntBonus] || ACInfo[playerid][acVeh] == 0 && ac_gtc - ACInfo[playerid][acGtc][15] > ac_gpp)) | |
| 8799 | {
| |
| 8800 | #if AC_USE_CASINOS | |
| 8801 | if(!ac_InCasino(playerid, ACInfo[playerid][acInt])) | |
| 8802 | {
| |
| 8803 | #endif | |
| 8804 | #if defined DEBUG | |
| 8805 | printf("[Nex-AC debug] AC money: %d, money: %d, stunt bonus: %d, veh: %d, playerid: %d",
| |
| 8806 | ACInfo[playerid][acMoney], ac_t, ACInfo[playerid][acStuntBonus], ACInfo[playerid][acVeh], playerid); | |
| 8807 | #endif | |
| 8808 | #if defined OnCheatDetected | |
| 8809 | ac_KickWithCode(playerid, "", 0, 14); | |
| 8810 | #endif | |
| 8811 | ac_t = ACInfo[playerid][acMoney]; | |
| 8812 | ResetPlayerMoney(playerid); | |
| 8813 | GivePlayerMoney(playerid, ac_t); | |
| 8814 | #if AC_USE_CASINOS | |
| 8815 | } | |
| 8816 | #endif | |
| 8817 | } | |
| 8818 | ACInfo[playerid][acMoney] = ac_t; | |
| 8819 | } | |
| 8820 | } | |
| 8821 | else | |
| 8822 | {
| |
| 8823 | if(ACInfo[playerid][acSet][9] != -1) ACInfo[playerid][acGtc][7] += (ac_gtc - ACInfo[playerid][acTimerTick]); | |
| 8824 | if(ac_gtc - ACInfo[playerid][acGtc][9] <= ac_gpp) ACInfo[playerid][acGtc][9] += (ac_gtc - ACInfo[playerid][acTimerTick]); | |
| 8825 | if(ac_gtc - ACInfo[playerid][acGtc][8] <= ac_gpp) ACInfo[playerid][acGtc][8] += (ac_gtc - ACInfo[playerid][acTimerTick]); | |
| 8826 | if(ac_gtc - ACInfo[playerid][acGtc][6] <= ac_gpp) ACInfo[playerid][acGtc][6] += (ac_gtc - ACInfo[playerid][acTimerTick]); | |
| 8827 | } | |
| 8828 | if(ACInfo[playerid][acCheatCount][14] > 0) ACInfo[playerid][acCheatCount][14]--; | |
| 8829 | if(ACInfo[playerid][acCheatCount][18] > 0) ACInfo[playerid][acCheatCount][18]--; | |
| 8830 | ACInfo[playerid][acCheatCount][1] = ACInfo[playerid][acCheatCount][2] = | |
| 8831 | ACInfo[playerid][acCheatCount][3] = ACInfo[playerid][acCheatCount][4] = | |
| 8832 | ACInfo[playerid][acCheatCount][19] = 0; | |
| 8833 | } | |
| 8834 | if(ACInfo[playerid][acKicked] < 1) | |
| 8835 | {
| |
| 8836 | ACInfo[playerid][acTimerTick] = ac_gtc; | |
| 8837 | ACInfo[playerid][acTimerID] = SetTimerEx("ac_Timer", 1000, false, "i", playerid);
| |
| 8838 | } | |
| 8839 | return 1; | |
| 8840 | } | |
| 8841 | ||
| 8842 | #if !defined OnCheatDetected | |
| 8843 | //Don't make changes in this public | |
| 8844 | //To customize punishments, declare 'OnCheatDetected' in your script | |
| 8845 | ac_fpublic ac_OnCheatDetected(playerid, ip_address[], type, code) | |
| 8846 | {
| |
| 8847 | if(type) | |
| 8848 | {
| |
| 8849 | #if defined BlockIpAddress | |
| 8850 | BlockIpAddress(ip_address, 0); | |
| 8851 | #else | |
| 8852 | static ac_strtmp[32]; | |
| 8853 | format(ac_strtmp, sizeof ac_strtmp, "banip %s", ip_address); | |
| 8854 | SendRconCommand(ac_strtmp); | |
| 8855 | #endif | |
| 8856 | } | |
| 8857 | else | |
| 8858 | {
| |
| 8859 | switch(code) | |
| 8860 | {
| |
| 8861 | case 40: SendClientMessage(playerid, AC_DEFAULT_COLOR, MAX_CONNECTS_MSG); | |
| 8862 | case 41: SendClientMessage(playerid, AC_DEFAULT_COLOR, UNKNOWN_CLIENT_MSG); | |
| 8863 | default: | |
| 8864 | {
| |
| 8865 | static ac_strtmp[sizeof KICK_MSG]; | |
| 8866 | format(ac_strtmp, sizeof ac_strtmp, KICK_MSG, code); | |
| 8867 | SendClientMessage(playerid, AC_DEFAULT_COLOR, ac_strtmp); | |
| 8868 | #undef AC_DEFAULT_COLOR | |
| 8869 | } | |
| 8870 | } | |
| 8871 | AntiCheatKickWithDesync(playerid, code); | |
| 8872 | } | |
| 8873 | return 1; | |
| 8874 | } | |
| 8875 | #endif | |
| 8876 | ||
| 8877 | ac_fpublic ac_KickTimer(playerid) return Kick(playerid); | |
| 8878 | ||
| 8879 | #undef ac_fpublic | |
| 8880 | ||
| 8881 | stock AntiCheatGetHealth(playerid, &Float:health) | |
| 8882 | {
| |
| 8883 | if(!IsPlayerConnected(playerid)) return 0; | |
| 8884 | health = ACInfo[playerid][acHealth]; | |
| 8885 | return 1; | |
| 8886 | } | |
| 8887 | ||
| 8888 | stock AntiCheatGetArmour(playerid, &Float:armour) | |
| 8889 | {
| |
| 8890 | if(!IsPlayerConnected(playerid)) return 0; | |
| 8891 | armour = ACInfo[playerid][acArmour]; | |
| 8892 | return 1; | |
| 8893 | } | |
| 8894 | ||
| 8895 | stock AntiCheatGetWeaponData(playerid, slot, &weapons, &ammo) | |
| 8896 | {
| |
| 8897 | if(!IsPlayerConnected(playerid)) return 0; | |
| 8898 | if(!(0 <= slot <= 12)) return -1; | |
| 8899 | weapons = ACInfo[playerid][acWeapon][slot]; | |
| 8900 | ammo = ACInfo[playerid][acAmmo][slot]; | |
| 8901 | return 1; | |
| 8902 | } | |
| 8903 | ||
| 8904 | stock AntiCheatGetPos(playerid, &Float:x, &Float:y, &Float:z) | |
| 8905 | {
| |
| 8906 | if(!IsPlayerConnected(playerid)) return 0; | |
| 8907 | x = ACInfo[playerid][acPosX]; | |
| 8908 | y = ACInfo[playerid][acPosY]; | |
| 8909 | z = ACInfo[playerid][acPosZ]; | |
| 8910 | return 1; | |
| 8911 | } | |
| 8912 | ||
| 8913 | stock AntiCheatGetSpawnPos(playerid, &Float:x, &Float:y, &Float:z) | |
| 8914 | {
| |
| 8915 | if(!IsPlayerConnected(playerid)) return 0; | |
| 8916 | x = ACInfo[playerid][acSpawnPosX]; | |
| 8917 | y = ACInfo[playerid][acSpawnPosY]; | |
| 8918 | z = ACInfo[playerid][acSpawnPosZ]; | |
| 8919 | return 1; | |
| 8920 | } | |
| 8921 | ||
| 8922 | stock AntiCheatGetSpawnWeapon(playerid, &weapon1, &weapon1_ammo, &weapon2, &weapon2_ammo, &weapon3, &weapon3_ammo) | |
| 8923 | {
| |
| 8924 | if(!IsPlayerConnected(playerid)) return 0; | |
| 8925 | weapon1 = ACInfo[playerid][acSpawnWeapon1]; | |
| 8926 | weapon1_ammo = ACInfo[playerid][acSpawnAmmo1]; | |
| 8927 | weapon2 = ACInfo[playerid][acSpawnWeapon2]; | |
| 8928 | weapon2_ammo = ACInfo[playerid][acSpawnAmmo2]; | |
| 8929 | weapon3 = ACInfo[playerid][acSpawnWeapon3]; | |
| 8930 | weapon3_ammo = ACInfo[playerid][acSpawnAmmo3]; | |
| 8931 | return 1; | |
| 8932 | } | |
| 8933 | ||
| 8934 | stock AntiCheatGetVehicleHealth(vehicleid, &Float:health) | |
| 8935 | {
| |
| 8936 | if(GetVehicleModel(vehicleid) <= 0) return 0; | |
| 8937 | health = ACVehInfo[vehicleid][acHealth]; | |
| 8938 | return 1; | |
| 8939 | } | |
| 8940 | ||
| 8941 | stock AntiCheatGetVehiclePos(vehicleid, &Float:x, &Float:y, &Float:z) | |
| 8942 | {
| |
| 8943 | if(GetVehicleModel(vehicleid) <= 0) return 0; | |
| 8944 | x = ACVehInfo[vehicleid][acPosX]; | |
| 8945 | y = ACVehInfo[vehicleid][acPosY]; | |
| 8946 | z = ACVehInfo[vehicleid][acPosZ]; | |
| 8947 | return 1; | |
| 8948 | } | |
| 8949 | ||
| 8950 | stock AntiCheatGetVehicleVelocity(vehicleid, &Float:x, &Float:y, &Float:z) | |
| 8951 | {
| |
| 8952 | if(GetVehicleModel(vehicleid) <= 0) return 0; | |
| 8953 | x = ACVehInfo[vehicleid][acVelX]; | |
| 8954 | y = ACVehInfo[vehicleid][acVelY]; | |
| 8955 | z = ACVehInfo[vehicleid][acVelZ]; | |
| 8956 | return 1; | |
| 8957 | } | |
| 8958 | ||
| 8959 | stock AntiCheatGetVehicleZAngle(vehicleid, &Float:z_angle) | |
| 8960 | {
| |
| 8961 | if(GetVehicleModel(vehicleid) <= 0) return 0; | |
| 8962 | z_angle = ACVehInfo[vehicleid][acZAngle]; | |
| 8963 | return 1; | |
| 8964 | } | |
| 8965 | ||
| 8966 | stock AntiCheatGetVehicleSpawnPos(vehicleid, &Float:x, &Float:y, &Float:z) | |
| 8967 | {
| |
| 8968 | if(GetVehicleModel(vehicleid) <= 0) return 0; | |
| 8969 | x = ACVehInfo[vehicleid][acSpawnPosX]; | |
| 8970 | y = ACVehInfo[vehicleid][acSpawnPosY]; | |
| 8971 | z = ACVehInfo[vehicleid][acSpawnPosZ]; | |
| 8972 | return 1; | |
| 8973 | } | |
| 8974 | ||
| 8975 | stock AntiCheatGetVehicleSpawnZAngle(vehicleid, &Float:z_angle) | |
| 8976 | {
| |
| 8977 | if(GetVehicleModel(vehicleid) <= 0) return 0; | |
| 8978 | z_angle = ACVehInfo[vehicleid][acSpawnZAngle]; | |
| 8979 | return 1; | |
| 8980 | } | |
| 8981 | ||
| 8982 | stock AntiCheatGetPickupPos(pickupid, &Float:x, &Float:y, &Float:z) | |
| 8983 | {
| |
| 8984 | if(!(0 <= pickupid < MAX_PICKUPS) || ACPickInfo[pickupid][acType] <= 0) return 0; | |
| 8985 | x = ACPickInfo[pickupid][acPosX]; | |
| 8986 | y = ACPickInfo[pickupid][acPosY]; | |
| 8987 | z = ACPickInfo[pickupid][acPosZ]; | |
| 8988 | return 1; | |
| 8989 | } | |
| 8990 | ||
| 8991 | static ac_IsValidVehicleModel(modelid) return (400 <= modelid <= 611); | |
| 8992 | ||
| 8993 | static ac_IsAnAirplane(modelid) return (ac_vType[modelid - 400] == 1); | |
| 8994 | ||
| 8995 | static ac_IsAnAircraftEx(modelid) return (ac_IsValidVehicleModel(modelid) && 1 <= ac_vType[modelid - 400] <= 2); | |
| 8996 | ||
| 8997 | static ac_IsABoatEx(modelid) return (ac_IsValidVehicleModel(modelid) && ac_vType[modelid - 400] == 3); | |
| 8998 | ||
| 8999 | static ac_IsABmx(modelid) return (ac_vType[modelid - 400] == 4); | |
| 9000 | ||
| 9001 | static ac_IsABmxEx(modelid) return (ac_IsValidVehicleModel(modelid) && ac_vType[modelid - 400] == 4); | |
| 9002 | ||
| 9003 | static ac_IsABikeEx(modelid) return (ac_IsValidVehicleModel(modelid) && 4 <= ac_vType[modelid - 400] <= 5); | |
| 9004 | ||
| 9005 | static ac_IsABusEx(modelid) return (ac_IsValidVehicleModel(modelid) && ac_vType[modelid - 400] == 6); | |
| 9006 | ||
| 9007 | static ac_IsATrainLoco(modelid) return (ac_vType[modelid - 400] == 8); | |
| 9008 | ||
| 9009 | static ac_IsATrainCarriageEx(modelid) return (ac_IsValidVehicleModel(modelid) && ac_vType[modelid - 400] == 9); | |
| 9010 | ||
| 9011 | static ac_IsATrainPartEx(modelid) return (ac_IsValidVehicleModel(modelid) && 7 <= ac_vType[modelid - 400] <= 9); | |
| 9012 | ||
| 9013 | static ac_IsValidDamageReason(weaponid) return (0 <= weaponid <= 18 || 22 <= weaponid <= 46 || 49 <= weaponid <= 54); | |
| 9014 | ||
| 9015 | static ac_IsValidWeapon(weaponid) return (0 <= weaponid <= 18 || 22 <= weaponid <= 46); | |
| 9016 | ||
| 9017 | static ac_IsBulletWeapon(weaponid) return (weaponid == 38 || 22 <= weaponid <= 34); | |
| 9018 | ||
| 9019 | #if defined VectorSize | |
| 9020 | static ac_GetSpeed(Float:ac_x, Float:ac_y, Float:ac_z = 0.0) return floatround(VectorSize(ac_x, ac_y, ac_z) * 179.28625); | |
| 9021 | #else | |
| 9022 | static ac_GetSpeed(Float:ac_x, Float:ac_y, Float:ac_z = 0.0) return floatround(floatsqroot(floatpower(ac_x, 2.0) + floatpower(ac_y, 2.0) + floatpower(ac_z, 2.0)) * 179.28625); | |
| 9023 | #endif | |
| 9024 | ||
| 9025 | static ac_IsVehicleSeatOccupied(vehicleid, seat) | |
| 9026 | {
| |
| 9027 | #if defined foreach | |
| 9028 | foreach(new ac_i : Player) | |
| 9029 | {
| |
| 9030 | if(ACInfo[ac_i][acVeh] == vehicleid && ACInfo[ac_i][acSeat] == seat) return 1; | |
| 9031 | } | |
| 9032 | #else | |
| 9033 | #if defined GetPlayerPoolSize | |
| 9034 | for(new ac_i = GetPlayerPoolSize(); ac_i >= 0; --ac_i) | |
| 9035 | #else | |
| 9036 | for(new ac_i = MAX_PLAYERS - 1; ac_i >= 0; --ac_i) | |
| 9037 | #endif | |
| 9038 | {
| |
| 9039 | if(IsPlayerInVehicle(ac_i, vehicleid) && ACInfo[ac_i][acSeat] == seat) return 1; | |
| 9040 | } | |
| 9041 | #endif | |
| 9042 | return 0; | |
| 9043 | } | |
| 9044 | ||
| 9045 | #if AC_USE_RESTAURANTS | |
| 9046 | static ac_InRestaurant(playerid, interiorid) | |
| 9047 | {
| |
| 9048 | switch(interiorid) | |
| 9049 | {
| |
| 9050 | case 5: | |
| 9051 | {
| |
| 9052 | if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[0][0], ac_Restaurants[0][1], ac_Restaurants[0][2])) return 1; | |
| 9053 | } | |
| 9054 | case 9: | |
| 9055 | {
| |
| 9056 | if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[1][0], ac_Restaurants[1][1], ac_Restaurants[1][2])) return 1; | |
| 9057 | } | |
| 9058 | case 10: | |
| 9059 | {
| |
| 9060 | if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_Restaurants[2][0], ac_Restaurants[2][1], ac_Restaurants[2][2])) return 1; | |
| 9061 | } | |
| 9062 | } | |
| 9063 | return 0; | |
| 9064 | } | |
| 9065 | #endif | |
| 9066 | #undef AC_USE_RESTAURANTS | |
| 9067 | ||
| 9068 | #if AC_USE_AMMUNATIONS | |
| 9069 | static ac_InAmmuNation(playerid, interiorid) | |
| 9070 | {
| |
| 9071 | switch(interiorid) | |
| 9072 | {
| |
| 9073 | case 1: | |
| 9074 | {
| |
| 9075 | if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[0][0], ac_AmmuNations[0][1], ac_AmmuNations[0][2])) return 1; | |
| 9076 | } | |
| 9077 | case 4: | |
| 9078 | {
| |
| 9079 | if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[1][0], ac_AmmuNations[1][1], ac_AmmuNations[1][2])) return 1; | |
| 9080 | } | |
| 9081 | case 6: | |
| 9082 | {
| |
| 9083 | if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[2][0], ac_AmmuNations[2][1], ac_AmmuNations[2][2]) || | |
| 9084 | IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[3][0], ac_AmmuNations[3][1], ac_AmmuNations[3][2])) return 1; | |
| 9085 | } | |
| 9086 | case 7: | |
| 9087 | {
| |
| 9088 | if(IsPlayerInRangeOfPoint(playerid, 3.0, ac_AmmuNations[4][0], ac_AmmuNations[4][1], ac_AmmuNations[4][2])) return 1; | |
| 9089 | } | |
| 9090 | } | |
| 9091 | return 0; | |
| 9092 | } | |
| 9093 | #endif | |
| 9094 | #undef AC_USE_AMMUNATIONS | |
| 9095 | ||
| 9096 | #if AC_USE_PAYNSPRAY | |
| 9097 | static ac_InPayNSpray(playerid, interiorid) | |
| 9098 | {
| |
| 9099 | if(interiorid == 0) | |
| 9100 | {
| |
| 9101 | for(new ac_i = sizeof(ac_PayNSpray) - 1; ac_i >= 0; --ac_i) | |
| 9102 | {
| |
| 9103 | if(IsPlayerInRangeOfPoint(playerid, 7.5, ac_PayNSpray[ac_i][0], ac_PayNSpray[ac_i][1], ac_PayNSpray[ac_i][2])) return 1; | |
| 9104 | } | |
| 9105 | } | |
| 9106 | return 0; | |
| 9107 | } | |
| 9108 | #endif | |
| 9109 | #undef AC_USE_PAYNSPRAY | |
| 9110 | ||
| 9111 | #if AC_USE_VENDING_MACHINES | |
| 9112 | static ac_NearVendingMachine(playerid, interiorid) | |
| 9113 | {
| |
| 9114 | switch(interiorid) | |
| 9115 | {
| |
| 9116 | case 0: | |
| 9117 | {
| |
| 9118 | for(new ac_i = 44; ac_i >= 0; --ac_i) | |
| 9119 | {
| |
| 9120 | if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1; | |
| 9121 | } | |
| 9122 | } | |
| 9123 | case 1: | |
| 9124 | {
| |
| 9125 | for(new ac_i = 51; ac_i >= 45; --ac_i) | |
| 9126 | {
| |
| 9127 | if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1; | |
| 9128 | } | |
| 9129 | } | |
| 9130 | case 2: | |
| 9131 | {
| |
| 9132 | if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[52][0], ac_vMachines[52][1], ac_vMachines[52][2])) return 1; | |
| 9133 | } | |
| 9134 | case 3: | |
| 9135 | {
| |
| 9136 | for(new ac_i = 58; ac_i >= 53; --ac_i) | |
| 9137 | {
| |
| 9138 | if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1; | |
| 9139 | } | |
| 9140 | } | |
| 9141 | case 6: | |
| 9142 | {
| |
| 9143 | if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[59][0], ac_vMachines[59][1], ac_vMachines[59][2]) || | |
| 9144 | IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[60][0], ac_vMachines[60][1], ac_vMachines[60][2])) return 1; | |
| 9145 | } | |
| 9146 | case 7: | |
| 9147 | {
| |
| 9148 | if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[61][0], ac_vMachines[61][1], ac_vMachines[61][2])) return 1; | |
| 9149 | } | |
| 9150 | case 15: | |
| 9151 | {
| |
| 9152 | if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[62][0], ac_vMachines[62][1], ac_vMachines[62][2])) return 1; | |
| 9153 | } | |
| 9154 | case 16: | |
| 9155 | {
| |
| 9156 | if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[63][0], ac_vMachines[63][1], ac_vMachines[63][2]) || | |
| 9157 | IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[64][0], ac_vMachines[64][1], ac_vMachines[64][2]) || | |
| 9158 | IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[65][0], ac_vMachines[65][1], ac_vMachines[65][2])) return 1; | |
| 9159 | } | |
| 9160 | case 17: | |
| 9161 | {
| |
| 9162 | for(new ac_i = 72; ac_i >= 66; --ac_i) | |
| 9163 | {
| |
| 9164 | if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[ac_i][0], ac_vMachines[ac_i][1], ac_vMachines[ac_i][2])) return 1; | |
| 9165 | } | |
| 9166 | } | |
| 9167 | case 18: | |
| 9168 | {
| |
| 9169 | if(IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[73][0], ac_vMachines[73][1], ac_vMachines[73][2]) || | |
| 9170 | IsPlayerInRangeOfPoint(playerid, 1.5, ac_vMachines[74][0], ac_vMachines[74][1], ac_vMachines[74][2])) return 1; | |
| 9171 | } | |
| 9172 | } | |
| 9173 | return 0; | |
| 9174 | } | |
| 9175 | #endif | |
| 9176 | #undef AC_USE_VENDING_MACHINES | |
| 9177 | ||
| 9178 | #if AC_USE_CASINOS | |
| 9179 | static ac_InCasino(playerid, interiorid) | |
| 9180 | {
| |
| 9181 | switch(interiorid) | |
| 9182 | {
| |
| 9183 | case 1: | |
| 9184 | {
| |
| 9185 | for(new ac_i = 41; ac_i >= 0; --ac_i) | |
| 9186 | {
| |
| 9187 | if(IsPlayerInRangeOfPoint(playerid, ac_Casinos[ac_i][3], ac_Casinos[ac_i][0], ac_Casinos[ac_i][1], ac_Casinos[ac_i][2])) return 1; | |
| 9188 | } | |
| 9189 | } | |
| 9190 | case 10: | |
| 9191 | {
| |
| 9192 | for(new ac_i = 61; ac_i >= 42; --ac_i) | |
| 9193 | {
| |
| 9194 | if(IsPlayerInRangeOfPoint(playerid, ac_Casinos[ac_i][3], ac_Casinos[ac_i][0], ac_Casinos[ac_i][1], ac_Casinos[ac_i][2])) return 1; | |
| 9195 | } | |
| 9196 | } | |
| 9197 | case 12: | |
| 9198 | {
| |
| 9199 | for(new ac_i = 70; ac_i >= 62; --ac_i) | |
| 9200 | {
| |
| 9201 | if(IsPlayerInRangeOfPoint(playerid, ac_Casinos[ac_i][3], ac_Casinos[ac_i][0], ac_Casinos[ac_i][1], ac_Casinos[ac_i][2])) return 1; | |
| 9202 | } | |
| 9203 | } | |
| 9204 | } | |
| 9205 | return 0; | |
| 9206 | } | |
| 9207 | #endif | |
| 9208 | #undef AC_USE_CASINOS | |
| 9209 | ||
| 9210 | static ac_IsCompatible(modelid, componentid) | |
| 9211 | {
| |
| 9212 | if(ac_IsValidVehicleModel(modelid)) | |
| 9213 | {
| |
| 9214 | switch(componentid) | |
| 9215 | {
| |
| 9216 | case 1000..1191: | |
| 9217 | {
| |
| 9218 | componentid -= 1000; | |
| 9219 | if(ac_vMods[(modelid - 400) * 6 + (componentid >>> 5)] & 1 << (componentid & 0b00011111)) return 1; | |
| 9220 | } | |
| 9221 | case 1192, 1193: | |
| 9222 | {
| |
| 9223 | if(modelid == 576) return 1; | |
| 9224 | } | |
| 9225 | } | |
| 9226 | } | |
| 9227 | return 0; | |
| 9228 | } | |
| 9229 | ||
| 9230 | static ac_GetMaxPassengers(modelid) | |
| 9231 | {
| |
| 9232 | if(ac_IsValidVehicleModel(modelid)) | |
| 9233 | {
| |
| 9234 | modelid -= 400; | |
| 9235 | return ((ac_MaxPassengers[modelid >>> 3] >>> ((modelid & 7) << 2)) & 0xF); | |
| 9236 | } | |
| 9237 | return 0xF; | |
| 9238 | } | |
| 9239 | ||
| 9240 | static ac_IpToInt(const ip[]) | |
| 9241 | {
| |
| 9242 | #if defined sscanf | |
| 9243 | new ac_b0, ac_b1, ac_b2, ac_b3; | |
| 9244 | sscanf(ip, "p<.>iiii", ac_b3, ac_b2, ac_b1, ac_b0); | |
| 9245 | return (ac_b0 | ac_b1 << 8 | ac_b2 << 16 | ac_b3 << 24); | |
| 9246 | #else | |
| 9247 | new ac_bytes[1], ac_pos; | |
| 9248 | ac_bytes{0} = strval(ip[ac_pos]);
| |
| 9249 | while(ac_pos < 15 && ip[ac_pos++] != '.'){}
| |
| 9250 | ac_bytes{1} = strval(ip[ac_pos]);
| |
| 9251 | while(ac_pos < 15 && ip[ac_pos++] != '.'){}
| |
| 9252 | ac_bytes{2} = strval(ip[ac_pos]);
| |
| 9253 | while(ac_pos < 15 && ip[ac_pos++] != '.'){}
| |
| 9254 | ac_bytes{3} = strval(ip[ac_pos]);
| |
| 9255 | return ac_bytes[0]; | |
| 9256 | #endif | |
| 9257 | } | |
| 9258 | ||
| 9259 | static ac_FloodDetect(playerid, publicid) | |
| 9260 | {
| |
| 9261 | if(ACInfo[playerid][acKicked] < 1) | |
| 9262 | {
| |
| 9263 | if(++ACInfo[playerid][acFloodCount][publicid] > ac_Mtfc[publicid][1]) | |
| 9264 | {
| |
| 9265 | #if defined DEBUG | |
| 9266 | printf(DEBUG_CODE_1, playerid, ac_Mtfc[publicid][1], publicid); | |
| 9267 | #if !defined mysql_included | |
| 9268 | #undef DEBUG | |
| 9269 | #endif | |
| 9270 | #endif | |
| 9271 | #if defined OnCheatDetected | |
| 9272 | ac_KickWithCode(playerid, "", 0, 49, publicid); | |
| 9273 | ACInfo[playerid][acFloodCount][publicid] = ACInfo[playerid][acFloodCount][27] = 0; | |
| 9274 | #else | |
| 9275 | return ac_KickWithCode(playerid, "", 0, 49, publicid); | |
| 9276 | #endif | |
| 9277 | } | |
| 9278 | #if defined OnFloodWarning | |
| 9279 | else OnFloodWarning(playerid, publicid, ACInfo[playerid][acFloodCount][publicid]); | |
| 9280 | #endif | |
| 9281 | } | |
| 9282 | return 0; | |
| 9283 | } | |
| 9284 | ||
| 9285 | static ac_KickWithCode(playerid, ip_address[], type, code, code2 = 0) | |
| 9286 | {
| |
| 9287 | if(type == 0 && (!IsPlayerConnected(playerid) || ACInfo[playerid][acKicked] > 0)) return 0; | |
| 9288 | #if AC_USE_STATISTICS | |
| 9289 | ac_sInfo[5]++; | |
| 9290 | switch(code) | |
| 9291 | {
| |
| 9292 | case 0..35, 37, 39, 51: ac_sInfo[0]++; | |
| 9293 | case 36, 38, 40, 41, 50: ac_sInfo[4]++; | |
| 9294 | case 42: ac_sInfo[1]++; | |
| 9295 | case 47..49: ac_sInfo[3]++; | |
| 9296 | case 43..46: ac_sInfo[2]++; | |
| 9297 | } | |
| 9298 | #endif | |
| 9299 | #undef AC_USE_STATISTICS | |
| 9300 | #if defined NO_SUSPICION_LOGS | |
| 9301 | #pragma unused code2 | |
| 9302 | #else | |
| 9303 | new ac_strtmp[6]; | |
| 9304 | if(code2) format(ac_strtmp, sizeof ac_strtmp, " (%d)", code2); | |
| 9305 | if(type) printf(SUSPICION_2, ip_address, code, ac_strtmp); | |
| 9306 | else printf(SUSPICION_1, playerid, code, ac_strtmp); | |
| 9307 | #endif | |
| 9308 | #if defined OnCheatDetected | |
| 9309 | OnCheatDetected(playerid, ip_address, type, code); | |
| 9310 | #else | |
| 9311 | ac_OnCheatDetected(playerid, ip_address, type, code); | |
| 9312 | #endif | |
| 9313 | return 0; | |
| 9314 | } | |
| 9315 | ||
| 9316 | #if AC_USE_CONFIG_FILES | |
| 9317 | static ac_LoadCfg() | |
| 9318 | {
| |
| 9319 | static ac_strtmp[10]; | |
| 9320 | new ac_i, ac_string[415], File:ac_cfgFile; | |
| 9321 | if(fexist(AC_CONFIG_FILE)) | |
| 9322 | {
| |
| 9323 | if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_read))) | |
| 9324 | {
| |
| 9325 | #if defined sscanf | |
| 9326 | new ac_j; | |
| 9327 | #endif | |
| 9328 | while(fread(ac_cfgFile, ac_string) > 0) | |
| 9329 | {
| |
| 9330 | #if defined sscanf | |
| 9331 | sscanf(ac_string, "i'//'i", ac_j, ac_i); | |
| 9332 | ac_ACAllow[ac_i] = (ac_j != 0); | |
| 9333 | #else | |
| 9334 | if((ac_i = strfind(ac_string, "//")) != -1) | |
| 9335 | {
| |
| 9336 | strmid(ac_strtmp, ac_string, ac_i + 2, strlen(ac_string)); | |
| 9337 | if(0 <= (ac_i = strval(ac_strtmp)) < sizeof ac_ACAllow) ac_ACAllow[ac_i] = (strval(ac_string) != 0); | |
| 9338 | } | |
| 9339 | #endif | |
| 9340 | } | |
| 9341 | fclose(ac_cfgFile); | |
| 9342 | } | |
| 9343 | else return 0; | |
| 9344 | } | |
| 9345 | else if((ac_cfgFile = fopen(AC_CONFIG_FILE, io_write))) | |
| 9346 | {
| |
| 9347 | #undef AC_CONFIG_FILE | |
| 9348 | for(; ac_i < sizeof ac_ACAllow; ++ac_i) | |
| 9349 | {
| |
| 9350 | format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_ACAllow[ac_i], ac_i); | |
| 9351 | strcat(ac_string, ac_strtmp); | |
| 9352 | } | |
| 9353 | fwrite(ac_cfgFile, ac_string); | |
| 9354 | fclose(ac_cfgFile); | |
| 9355 | } | |
| 9356 | else return 0; | |
| 9357 | return 1; | |
| 9358 | } | |
| 9359 | ||
| 9360 | static ac_LoadNOPCfg() | |
| 9361 | {
| |
| 9362 | static ac_strtmp[10]; | |
| 9363 | new ac_i, ac_string[87], File:ac_cfgFile; | |
| 9364 | if(fexist(AC_NOP_CONFIG_FILE)) | |
| 9365 | {
| |
| 9366 | if((ac_cfgFile = fopen(AC_NOP_CONFIG_FILE, io_read))) | |
| 9367 | {
| |
| 9368 | #if defined sscanf | |
| 9369 | new ac_j; | |
| 9370 | #endif | |
| 9371 | while(fread(ac_cfgFile, ac_string) > 0) | |
| 9372 | {
| |
| 9373 | #if defined sscanf | |
| 9374 | sscanf(ac_string, "i'//'i", ac_j, ac_i); | |
| 9375 | ac_NOPAllow[ac_i] = (ac_j != 0); | |
| 9376 | #else | |
| 9377 | if((ac_i = strfind(ac_string, "//")) != -1) | |
| 9378 | {
| |
| 9379 | strmid(ac_strtmp, ac_string, ac_i + 2, strlen(ac_string)); | |
| 9380 | if(0 <= (ac_i = strval(ac_strtmp)) < sizeof ac_NOPAllow) ac_NOPAllow[ac_i] = (strval(ac_string) != 0); | |
| 9381 | } | |
| 9382 | #endif | |
| 9383 | } | |
| 9384 | fclose(ac_cfgFile); | |
| 9385 | } | |
| 9386 | else return 0; | |
| 9387 | } | |
| 9388 | else if((ac_cfgFile = fopen(AC_NOP_CONFIG_FILE, io_write))) | |
| 9389 | {
| |
| 9390 | #undef AC_NOP_CONFIG_FILE | |
| 9391 | for(; ac_i < sizeof ac_NOPAllow; ++ac_i) | |
| 9392 | {
| |
| 9393 | format(ac_strtmp, sizeof ac_strtmp, "%d //%d\r\n", ac_NOPAllow[ac_i], ac_i); | |
| 9394 | strcat(ac_string, ac_strtmp); | |
| 9395 | } | |
| 9396 | fwrite(ac_cfgFile, ac_string); | |
| 9397 | fclose(ac_cfgFile); | |
| 9398 | } | |
| 9399 | else return 0; | |
| 9400 | return 1; | |
| 9401 | } | |
| 9402 | #endif | |
| 9403 | #undef AC_USE_CONFIG_FILES | |
| 9404 | ||
| 9405 | #endif |