SHOW:
|
|
- or go back to the newest paste.
| 1 | /*------------------------------------------------------------------------------ | |
| 2 | ######## ## ###### ### ###### | |
| 3 | ## ## ## ## ## ## ## ## | |
| 4 | ## ## ## ## ## ## | |
| 5 | ###### ## ## ## ## ## | |
| 6 | ## ## ## ######### ## | |
| 7 | ## ## ## ## ## ## ## ## | |
| 8 | ######## ######## ###### ####### ## ## ###### | |
| 9 | ||
| 10 | ||
| 11 | ######## ## ## | |
| 12 | ## ## ## ## | |
| 13 | ## ## #### | |
| 14 | ######## ## | |
| 15 | ## ## ## | |
| 16 | ## ## ## | |
| 17 | ######## ## | |
| 18 | ||
| 19 | ||
| 20 | ######## ## ####### ###### ######## ######## ####### | |
| 21 | ## ## ## ## ## ## ## ## ## ## ## | |
| 22 | ## ## ## ## ## ## ## ## ## ## | |
| 23 | ###### ## ## ## ## ## ######## ## ## | |
| 24 | ## ## ## ## ## ## ## ## ## ## | |
| 25 | ## ## ## ## ## ## ## ## ## ## ## | |
| 26 | ######## ######## ####### ###### ## ## ## ####### | |
| 27 | ||
| 28 | Anti-Cheat(ELC_AC) | |
| 29 | ||
| 30 | PROTECTIONS : | |
| 31 | Anti-Weapon HACK | |
| 32 | Anti-Ammo HACK | |
| 33 | Anti-Ammo Block HACK | |
| 34 | Anti-Money HACK | |
| 35 | Anti-Speed HACK | |
| 36 | Anti-Teleport & Anti-Airbreak | |
| 37 | Anti-Health HACK | |
| 38 | Anti-Armour HACK | |
| 39 | Anti-VEHICLE TELEPORT HACK | |
| 40 | Anti-Crasher | |
| 41 | ||
| 42 | BUG : | |
| 43 | Nothing | |
| 44 | ||
| 45 | VERSION : | |
| 46 | - | V4.3 |
| 46 | + | V4.3.1 |
| 47 | ||
| 48 | COMPATIBLE : | |
| 49 | SA-MP 0.3x | |
| 50 | ||
| 51 | CREDITS : | |
| 52 | ELOCTRO (SCRIPT) | |
| 53 | SIM (GetTickCount for linux) | |
| 54 | Donya(Anti-Crasher) | |
| 55 | Mineralo(OnPlayerCheat Update) | |
| 56 | ||
| 57 | ELC_AC THE BEST PROTECTION | |
| 58 | ! | |
| 59 | ||
| 60 | \**/ | |
| 61 | /*/- Anti-Cheat By Eloctro ----------------------------------------------------- | |
| 62 | ||
| 63 | ELC PRODUCTION(FRANCE) | |
| 64 | ||
| 65 | http://eloctro.blogspot.com/ | |
| 66 | */ | |
| 67 | #include <a_samp> | |
| 68 | /*----------------------------------------------------------------------------*/ | |
| 69 | //Anti-Cheat Statut defaut : | |
| 70 | #define ANTI_WEAPON_&_AMMO_HACK 1 | |
| 71 | #define ANTI_AMMO_BLOCK_HACK 1 | |
| 72 | #define ANTI_MONEY_HACK 1 | |
| 73 | #define ANTI_SPEED_HACK 1 | |
| 74 | #define ANTI_TELEPORT/AIBREAK_HACK 1 | |
| 75 | #define ANTI_HEALTH_HACK 0//Not fix | |
| 76 | #define ANTI_ARMOUR_HACK 0//Not fix | |
| 77 | #define ANTI_VEHICLE-TELEPORT_HACK 1//1->Normal Protection,2->Hight Proection | |
| 78 | //Configuration : | |
| 79 | #define MAX_SPEED_VEHICLE 380.0 // SPEED VEHICLE MAX(380=default) | |
| 80 | #define MAX_VEHICLE_DISTANCE_PER_SECOND 180 // DISTANCE PARCOUR MAX VEHICLE PER SECOND(180=default) | |
| 81 | #define MAX_PED_DISTANCE_PER_SECOND 100 // DISTANCE PARCOUR MAX AT PED PER SECOND(100=default) | |
| 82 | #define SPRINT_SPEED 30.0 // (30=DEFAULT/BETA) | |
| 83 | #define TIRE_RATE 2000 // (2000=default) | |
| 84 | #define TIMER_CHEAT_RATE 3500 | |
| 85 | #define TIME_GRANULITY 50 // Granulity GetTickCount | |
| 86 | #define DELAY_LOAD_AFTER_SPAWN 5000 | |
| 87 | #define MAX_DELAY_SEND_STATS 2000 | |
| 88 | #define MAX_DELAY_WAIT_AFTER_SPAWN 3000 | |
| 89 | #define MAX_VEHICLE_DISTANCE_UCM 10.0 | |
| 90 | //STATUS MODE : | |
| 91 | //#define NO_TICK_COUNT //uncomment If GetTickCount() bug(linux?) | |
| 92 | #define INCLUDE_BASE_MODE //uncomment to pass in mod include | |
| 93 | #define MODE_DELAY_SEND_STATS //uncomment if the sending of stats is a bit slow(RECOMMANDED) | |
| 94 | #define DISABLE_MONEY_DEATHLOSE //uncomment if you disable the lose of 100$ after death | |
| 95 | //Calcul(DON'T TOUCH)---------------------------------------------------------- | |
| 96 | #define XMAX_VEHICLE_DISTANCE_PER_SECOND MAX_VEHICLE_DISTANCE_PER_SECOND*(TIMER_CHEAT_RATE/1000) | |
| 97 | #define XMAX_PED_DISTANCE_PER_SECOND MAX_PED_DISTANCE_PER_SECOND*(TIMER_CHEAT_RATE/1000) | |
| 98 | #define SaveTime(%0,%1) %0=%1+MAX_DELAY_SEND_STATS | |
| 99 | #define IsPassTime(%0,%1,%2) (%1<%2&&CheatPlayerInfo[%0][elc_LastUpdate]!=0&&CheatPlayerInfo[%0][elc_LastUpdate]<%2)//Time Action ,Time Now | |
| 100 | #define IsPlayerCheatPos(%0) (((GetPlayerSurfingVehicleID(%0)!=INVALID_VEHICLE_ID || IsPlayerInAnyVehicle(%0)) && !IsPlayerInRangeOfPoint(%0,XMAX_VEHICLE_DISTANCE_PER_SECOND,CheatPlayerInfo[%0][elc_posx],CheatPlayerInfo[%0][elc_posy],CheatPlayerInfo[%0][elc_posz]))||!IsPlayerInRangeOfPoint(%0,XMAX_PED_DISTANCE_PER_SECOND,CheatPlayerInfo[%0][elc_posx],CheatPlayerInfo[%0][elc_posy],CheatPlayerInfo[%0][elc_posz])) | |
| 101 | ||
| 102 | #define IsPlayerCheatAllowTelPos(%0) (((GetPlayerSurfingVehicleID(%0)!=INVALID_VEHICLE_ID || IsPlayerInAnyVehicle(%0)) && !IsPlayerInRangeOfPoint(%0,XMAX_VEHICLE_DISTANCE_PER_SECOND,CheatPlayerInfo[%0][elc_AllowTelX],CheatPlayerInfo[%0][elc_AllowTelY],CheatPlayerInfo[%0][elc_AllowTelZ]))|| \ | |
| 103 | !IsPlayerInRangeOfPoint(%0,XMAX_PED_DISTANCE_PER_SECOND,CheatPlayerInfo[%0][elc_AllowTelX],CheatPlayerInfo[%0][elc_AllowTelY],CheatPlayerInfo[%0][elc_AllowTelZ])) | |
| 104 | ||
| 105 | #define IsPlayerUpdatePos(%0) !IsPlayerInRangeOfPoint(%0,0.5,CheatPlayerInfo[%0][elc_posx],CheatPlayerInfo[%0][elc_posy],CheatPlayerInfo[%0][elc_posz]) | |
| 106 | ||
| 107 | #define ELC_AC_IsCreatedVehicle(%0) (GetVehicleModel(%0)!=0) | |
| 108 | /*----------------------------------------------------------------------------*/ | |
| 109 | enum aELCp | |
| 110 | {
| |
| 111 | elc_money, | |
| 112 | elc_ammo[13], | |
| 113 | elc_weapon[13], | |
| 114 | elc_tickfire, | |
| 115 | elc_ammoFire, | |
| 116 | elc_weaponFire, | |
| 117 | Float:elc_health, | |
| 118 | Float:elc_armour, | |
| 119 | elc_timer, | |
| 120 | Float:elc_posx, | |
| 121 | Float:elc_posy, | |
| 122 | Float:elc_posz, | |
| 123 | elc_interior, | |
| 124 | elc_virtualworld, | |
| 125 | Float:elc_AllowTelX, | |
| 126 | Float:elc_AllowTelY, | |
| 127 | Float:elc_AllowTelZ, | |
| 128 | elc_AntiTeleportHack, | |
| 129 | elc_AntiWeaponHack, | |
| 130 | elc_AntiAmmoBlockHack, | |
| 131 | elc_AntiMoneyHack, | |
| 132 | elc_AntiSpeedHack, | |
| 133 | elc_AntiHealthHack, | |
| 134 | elc_AntiArmourHack, | |
| 135 | elc_AntiVehicleTelportHack, | |
| 136 | #if defined MODE_DELAY_SEND_STATS | |
| 137 | elc_GiveWeaponTime, | |
| 138 | elc_GiveMoneyTime, | |
| 139 | elc_GiveHealthTime, | |
| 140 | elc_GiveArmourTime, | |
| 141 | #endif | |
| 142 | elc_SetPositionTime, | |
| 143 | elc_PlayerEnterTime, | |
| 144 | elc_PlayerEnterVeh, | |
| 145 | elc_PossibleVehicleHack, | |
| 146 | elc_LastUpdate, | |
| 147 | elc_TimeSpawn | |
| 148 | }; | |
| 149 | ||
| 150 | new CheatPlayerInfo[MAX_PLAYERS][aELCp]; | |
| 151 | enum aELCv | |
| 152 | {
| |
| 153 | Float:elc_vHealth, | |
| 154 | Float:elc_vX, | |
| 155 | Float:elc_vY, | |
| 156 | Float:elc_vZ, | |
| 157 | Float:elc_vAngle, | |
| 158 | elc_vSetPositionTime, | |
| 159 | elc_vPossiblePlayerHack, | |
| 160 | elc_vPossibleHackTime, | |
| 161 | elc_vStatut | |
| 162 | }; | |
| 163 | new CheatVehicleInfo[MAX_VEHICLES][aELCv]; | |
| 164 | #if defined NO_TICK_COUNT | |
| 165 | enum aELCs | |
| 166 | {
| |
| 167 | elc_TickCount, | |
| 168 | elc_TimerTick | |
| 169 | }; | |
| 170 | - | /*stock SENDPOS(playerid) |
| 170 | + | |
| 171 | #endif | |
| 172 | - | new Float:Px[3],Ps[128]; |
| 172 | + | |
| 173 | - | GetPlayerPos(playerid,Px[0],Px[1],Px[2]); |
| 173 | + | |
| 174 | - | format(Ps, 128,"ACUTEL : %f,%f,%f | AVANT : %f,%f,%f",Px[0],Px[1],Px[2],CheatPlayerInfo[playerid][elc_posx],CheatPlayerInfo[playerid][elc_posy],CheatPlayerInfo[playerid][elc_posz]); |
| 174 | + | |
| 175 | - | SendClientMessageToAll(0xBD0000FF,Ps); |
| 175 | + | |
| 176 | - | }*/ |
| 176 | + | |
| 177 | if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid), elc_SpeedX, elc_SpeedY, elc_SpeedZ); | |
| 178 | else GetPlayerVelocity(playerid, elc_SpeedX, elc_SpeedY, elc_SpeedZ); | |
| 179 | elc_Speed = floatsqroot(floatadd(floatpower(elc_SpeedX, 2.0), floatpower(elc_SpeedY, 2.0))); | |
| 180 | return floatmul(elc_Speed, 200.0); | |
| 181 | } | |
| 182 | #if defined NO_TICK_COUNT | |
| 183 | #define GetTickCount() (CheatServerInfo[TickCount]) | |
| 184 | forward TimeUpdate(); | |
| 185 | public TimeUpdate() | |
| 186 | {
| |
| 187 | CheatServerInfo[elc_TickCount] +=TIME_GRANULITY; | |
| 188 | return 1; | |
| 189 | } | |
| 190 | #endif | |
| 191 | forward OnPlayerCheckCheat(playerid); | |
| 192 | forward OnPlayerCheat(playerid, cheatid, source[]); | |
| 193 | forward ELC_AC_EnablePlayerCheatID(playerid,cheatid,enable); | |
| 194 | forward OnPlayerCheckFaceWall(playerid,Float:wall_x,Float:wall_y,Float:wall_z,Float:nwall_x,Float:nwall_y,Float:wall_he); | |
| 195 | forward RemovePlayerWeapon(playerid, weaponid); | |
| 196 | /*----------------------------------------------------------------------------*/ | |
| 197 | forward ELC_AC_GivePlayerMoney(playerid, money); | |
| 198 | public ELC_AC_GivePlayerMoney(playerid, money) | |
| 199 | {
| |
| 200 | if(CheatPlayerInfo[playerid][elc_AntiMoneyHack]==1)CheatPlayerInfo[playerid][elc_AntiMoneyHack]=2; | |
| 201 | CheatPlayerInfo[playerid][elc_money] += money; | |
| 202 | GivePlayerMoney(playerid, money); | |
| 203 | #if defined MODE_DELAY_SEND_STATS | |
| 204 | SaveTime(CheatPlayerInfo[playerid][elc_GiveMoneyTime],GetTickCount()); | |
| 205 | #endif | |
| 206 | if(CheatPlayerInfo[playerid][elc_AntiMoneyHack]==2)CheatPlayerInfo[playerid][elc_AntiMoneyHack]=1; | |
| 207 | return 1; | |
| 208 | } | |
| 209 | stock initial_GivePlayerMoney(playerid, money) | |
| 210 | {
| |
| 211 | return GivePlayerMoney(playerid, money); | |
| 212 | } | |
| 213 | #if defined INCLUDE_BASE_MODE | |
| 214 | //ALS_SYSTEME -------------------- | |
| 215 | #if defined _ALS_GivePlayerMoney | |
| 216 | #undef GivePlayerMoney | |
| 217 | #else | |
| 218 | #define _ALS_GivePlayerMoney | |
| 219 | #endif | |
| 220 | #define GivePlayerMoney ELC_AC_GivePlayerMoney | |
| 221 | #endif | |
| 222 | //ALS_OFF_SYSTEME ---------------- | |
| 223 | /*----------------------------------------------------------------------------*/ | |
| 224 | forward ELC_AC_ResetPlayerMoney(playerid); | |
| 225 | public ELC_AC_ResetPlayerMoney(playerid) | |
| 226 | {
| |
| 227 | if(CheatPlayerInfo[playerid][elc_AntiMoneyHack]==1)CheatPlayerInfo[playerid][elc_AntiMoneyHack]=2; | |
| 228 | ResetPlayerMoney(playerid); | |
| 229 | CheatPlayerInfo[playerid][elc_money] = 0; | |
| 230 | #if defined MODE_DELAY_SEND_STATS | |
| 231 | SaveTime(CheatPlayerInfo[playerid][elc_GiveMoneyTime],GetTickCount()); | |
| 232 | #endif | |
| 233 | if(CheatPlayerInfo[playerid][elc_AntiMoneyHack]==2)CheatPlayerInfo[playerid][elc_AntiMoneyHack]=1; | |
| 234 | return 1; | |
| 235 | } | |
| 236 | stock initial_ResetPlayerMoney(playerid) | |
| 237 | {
| |
| 238 | return ResetPlayerMoney(playerid); | |
| 239 | } | |
| 240 | #if defined INCLUDE_BASE_MODE | |
| 241 | //ALS_SYSTEME -------------------- | |
| 242 | #if defined _ALS_ResetPlayerMoney | |
| 243 | #undef ResetPlayerMoney | |
| 244 | #else | |
| 245 | #define _ALS_ResetPlayerMoney | |
| 246 | #endif | |
| 247 | #define ResetPlayerMoney ELC_AC_ResetPlayerMoney | |
| 248 | #endif | |
| 249 | //ALS_OFF_SYSTEME ---------------- | |
| 250 | /*----------------------------------------------------------------------------*/ | |
| 251 | forward ELC_AC_GetPlayerMoney(playerid); | |
| 252 | public ELC_AC_GetPlayerMoney(playerid) | |
| 253 | {
| |
| 254 | new elc_gpm=GetPlayerMoney(playerid); | |
| 255 | if(GetPlayerMoney(playerid)<CheatPlayerInfo[playerid][elc_money]) return elc_gpm; | |
| 256 | return CheatPlayerInfo[playerid][elc_money]; | |
| 257 | } | |
| 258 | stock initial_GetPlayerMoney(playerid) | |
| 259 | {
| |
| 260 | return GetPlayerMoney(playerid); | |
| 261 | } | |
| 262 | #if defined INCLUDE_BASE_MODE | |
| 263 | //ALS_SYSTEME -------------------- | |
| 264 | #if defined _ALS_GetPlayerMoney | |
| 265 | #undef GetPlayerMoney | |
| 266 | #else | |
| 267 | #define _ALS_GetPlayerMoney | |
| 268 | #endif | |
| 269 | #define GetPlayerMoney ELC_AC_GetPlayerMoney | |
| 270 | #endif | |
| 271 | //ALS_OFF_SYSTEME ---------------- | |
| 272 | /*----------------------------------------------------------------------------*/ | |
| 273 | forward ELC_AC_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz); | |
| 274 | public ELC_AC_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz) | |
| 275 | {
| |
| 276 | if(CheatPlayerInfo[playerid][elc_AntiTeleportHack]==1)CheatPlayerInfo[playerid][elc_AntiTeleportHack]=2; | |
| 277 | CheatPlayerInfo[playerid][elc_PlayerEnterTime]=0; | |
| 278 | CheatPlayerInfo[playerid][elc_AllowTelX]=ix; CheatPlayerInfo[playerid][elc_AllowTelY]=iy; CheatPlayerInfo[playerid][elc_AllowTelZ]=iz; | |
| 279 | SetPlayerPos(playerid, ix, iy, iz); | |
| 280 | if(CheatPlayerInfo[playerid][elc_AntiTeleportHack]==2)CheatPlayerInfo[playerid][elc_AntiTeleportHack]=1; | |
| 281 | return 1; | |
| 282 | } | |
| 283 | stock initial_SetPlayerPos(playerid, Float:ix, Float:iy, Float:iz) | |
| 284 | {
| |
| 285 | return SetPlayerPos(playerid, ix, iy, iz); | |
| 286 | } | |
| 287 | #if defined INCLUDE_BASE_MODE | |
| 288 | //ALS_SYSTEME -------------------- | |
| 289 | #if defined _ALS_SetPlayerPos | |
| 290 | #undef SetPlayerPos | |
| 291 | #else | |
| 292 | #define _ALS_SetPlayerPos | |
| 293 | #endif | |
| 294 | #define SetPlayerPos ELC_AC_SetPlayerPos | |
| 295 | //ALS_OFF_SYSTEME ---------------- | |
| 296 | #endif | |
| 297 | /*----------------------------------------------------------------------------*/ | |
| 298 | forward ELC_AC_PutPlayerInVehicle(playerid,vehicleid, seatid); | |
| 299 | public ELC_AC_PutPlayerInVehicle(playerid,vehicleid, seatid) | |
| 300 | {
| |
| 301 | if(CheatPlayerInfo[playerid][elc_AntiTeleportHack]==1)CheatPlayerInfo[playerid][elc_AntiTeleportHack]=2; | |
| 302 | CheatPlayerInfo[playerid][elc_PlayerEnterTime]=0; | |
| 303 | CheatPlayerInfo[playerid][elc_PlayerEnterVeh]=vehicleid; | |
| 304 | GetVehiclePos(vehicleid,CheatPlayerInfo[playerid][elc_AllowTelX],CheatPlayerInfo[playerid][elc_AllowTelY],CheatPlayerInfo[playerid][elc_AllowTelZ]); | |
| 305 | GetPlayerPos(playerid,CheatPlayerInfo[playerid][elc_posx],CheatPlayerInfo[playerid][elc_posy],CheatPlayerInfo[playerid][elc_posz]); | |
| 306 | SaveTime(CheatPlayerInfo[playerid][elc_SetPositionTime],GetTickCount()); | |
| 307 | PutPlayerInVehicle(playerid,vehicleid, seatid); | |
| 308 | if(CheatPlayerInfo[playerid][elc_AntiTeleportHack]==2)CheatPlayerInfo[playerid][elc_AntiTeleportHack]=1; | |
| 309 | return 1; | |
| 310 | } | |
| 311 | stock initial_PutPlayerInVehicle(playerid,vehicleid, seatid) | |
| 312 | {
| |
| 313 | return PutPlayerInVehicle(playerid,vehicleid, seatid); | |
| 314 | } | |
| 315 | #if defined INCLUDE_BASE_MODE | |
| 316 | //ALS_SYSTEME -------------------- | |
| 317 | #if defined _ALS_PutPlayerInVehicle | |
| 318 | #undef PutPlayerInVehicle | |
| 319 | #else | |
| 320 | #define _ALS_PutPlayerInVehicle | |
| 321 | #endif | |
| 322 | #define PutPlayerInVehicle ELC_AC_PutPlayerInVehicle | |
| 323 | //ALS_OFF_SYSTEME ---------------- | |
| 324 | #endif | |
| 325 | /*----------------------------------------------------------------------------*/ | |
| 326 | forward ELC_AC_RemovePlayerFromVehicle(playerid); | |
| 327 | public ELC_AC_RemovePlayerFromVehicle(playerid) | |
| 328 | {
| |
| 329 | CheatPlayerInfo[playerid][elc_PlayerEnterTime]=0; | |
| 330 | RemovePlayerFromVehicle(playerid); | |
| 331 | return 1; | |
| 332 | } | |
| 333 | stock initial_RemovePlayerFromVehicle(playerid) | |
| 334 | {
| |
| 335 | return RemovePlayerFromVehicle(playerid); | |
| 336 | } | |
| 337 | #if defined INCLUDE_BASE_MODE | |
| 338 | //ALS_SYSTEME -------------------- | |
| 339 | #if defined _ALS_RemovePlayerFromVehicle | |
| 340 | #undef RemovePlayerFromVehicle | |
| 341 | #else | |
| 342 | #define _ALS_RemovePlayerFromVehicle | |
| 343 | #endif | |
| 344 | #define RemovePlayerFromVehicle ELC_AC_RemovePlayerFromVehicle | |
| 345 | //ALS_OFF_SYSTEME ---------------- | |
| 346 | #endif | |
| 347 | /*----------------------------------------------------------------------------*/ | |
| 348 | forward ELC_AC_TogglePlayerSpectating(playerid, toggle); | |
| 349 | public ELC_AC_TogglePlayerSpectating(playerid, toggle) | |
| 350 | {
| |
| 351 | if(toggle==1) | |
| 352 | {
| |
| 353 | if(CheatPlayerInfo[playerid][elc_AntiSpeedHack]==1) CheatPlayerInfo[playerid][elc_AntiSpeedHack]=3; | |
| 354 | if(CheatPlayerInfo[playerid][elc_AntiTeleportHack]==1) CheatPlayerInfo[playerid][elc_AntiTeleportHack]=3; | |
| 355 | } | |
| 356 | else | |
| 357 | {
| |
| 358 | if(CheatPlayerInfo[playerid][elc_AntiSpeedHack]==3) CheatPlayerInfo[playerid][elc_AntiSpeedHack]=1; | |
| 359 | if(CheatPlayerInfo[playerid][elc_AntiTeleportHack]==3)CheatPlayerInfo[playerid][elc_AntiTeleportHack]=1; | |
| 360 | GetPlayerPos(playerid,CheatPlayerInfo[playerid][elc_posx],CheatPlayerInfo[playerid][elc_posy],CheatPlayerInfo[playerid][elc_posz]); | |
| 361 | SaveTime(CheatPlayerInfo[playerid][elc_SetPositionTime],GetTickCount()); | |
| 362 | } | |
| 363 | return TogglePlayerSpectating(playerid, toggle); | |
| 364 | } | |
| 365 | stock initial_TogglePlayerSpectating(playerid, toggle) | |
| 366 | {
| |
| 367 | return TogglePlayerSpectating(playerid, toggle); | |
| 368 | } | |
| 369 | #if defined INCLUDE_BASE_MODE | |
| 370 | //ALS_SYSTEME -------------------- | |
| 371 | #if defined _ALS_TogglePlayerSpectating | |
| 372 | #undef TogglePlayerSpectating | |
| 373 | #else | |
| 374 | #define _ALS_TogglePlayerSpectating | |
| 375 | #endif | |
| 376 | #define TogglePlayerSpectating ELC_AC_TogglePlayerSpectating | |
| 377 | //ALS_OFF_SYSTEME ---------------- | |
| 378 | #endif | |
| 379 | //Weapon------------------------------------------------------------------------ | |
| 380 | /*#define elc_IsNotWeaponNoAmmo(%0) (%0!=0 && %0!=1 && %0!=10) | |
| 381 | #define elc_IsNotWeaponVise(%0,%1) (%0>1 && %0!=10 && %0!=6 && %0!=9 && %0!=11 && %0!=12 && %1!=35 && %1!=36 %1!=43)*/ | |
| 382 | stock elc_IsNotWeaponNoAmmo(WeaponID) | |
| 383 | {
| |
| 384 | new elc_slot=elc_GetWeaponSlot(WeaponID); | |
| 385 | if(elc_slot!=0 && elc_slot!=1 && elc_slot!=10)return 1; | |
| 386 | return 0; | |
| 387 | } | |
| 388 | stock elc_IsNotWeaponVise(WeaponID) | |
| 389 | {
| |
| 390 | new elc_slot=elc_GetWeaponSlot(WeaponID); | |
| 391 | if(elc_slot>1 && elc_slot!=10 && elc_slot!=6 && elc_slot!=9 && elc_slot!=11 && elc_slot!=12 && elc_slot!=35 && elc_slot!=36 && elc_slot!=43) return 1; | |
| 392 | return 0; | |
| 393 | } | |
| 394 | stock elc_IsGiveVehicleWeapon(WeaponID) | |
| 395 | {
| |
| 396 | if(WeaponID==25 || WeaponID==46 || WeaponID==2) return 1; | |
| 397 | return 0; | |
| 398 | } | |
| 399 | #define IsValidWeapon(%0) (%0>=1 && %0<=18 || %0>=21 && %0<=46) | |
| 400 | stock elc_GetWeaponSlot(weaponid) | |
| 401 | {
| |
| 402 | new elc_slot=-1; | |
| 403 | switch(weaponid) | |
| 404 | {
| |
| 405 | case 0,1: elc_slot = 0; | |
| 406 | case 2 .. 9: elc_slot = 1; | |
| 407 | case 10 .. 15: elc_slot = 10; | |
| 408 | case 16 .. 18, 39: elc_slot = 8; | |
| 409 | case 22 .. 24: elc_slot =2; | |
| 410 | case 25 .. 27: elc_slot = 3; | |
| 411 | case 28, 29, 32: elc_slot = 4; | |
| 412 | case 30, 31: elc_slot = 5; | |
| 413 | case 33, 34: elc_slot = 6; | |
| 414 | case 35 .. 38: elc_slot = 7; | |
| 415 | case 40: elc_slot = 12; | |
| 416 | case 41 .. 43: elc_slot = 9; | |
| 417 | case 44 .. 46: elc_slot = 11; | |
| 418 | } | |
| 419 | return elc_slot; | |
| 420 | } | |
| 421 | /*----------------------------------------------------------------------------*/ | |
| 422 | forward ELC_AC_GivePlayerWeapon(playerid,Weapon,ammo); | |
| 423 | public ELC_AC_GivePlayerWeapon(playerid,Weapon,ammo) | |
| 424 | {
| |
| 425 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==1)CheatPlayerInfo[playerid][elc_AntiWeaponHack]=2; | |
| 426 | new slot=elc_GetWeaponSlot(Weapon); | |
| 427 | if(IsValidWeapon(Weapon) && slot!=-1) | |
| 428 | {
| |
| 429 | CheatPlayerInfo[playerid][elc_weapon][slot] = Weapon; | |
| 430 | CheatPlayerInfo[playerid][elc_ammo][slot] += ammo; | |
| 431 | GivePlayerWeapon(playerid,Weapon,ammo); | |
| 432 | #if defined MODE_DELAY_SEND_STATS | |
| 433 | SaveTime(CheatPlayerInfo[playerid][elc_GiveWeaponTime],GetTickCount()); | |
| 434 | #endif | |
| 435 | } | |
| 436 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==2)CheatPlayerInfo[playerid][elc_AntiWeaponHack]=1; | |
| 437 | return 1; | |
| 438 | } | |
| 439 | stock initial_GivePlayerWeapon(playerid,Weapon,ammo) | |
| 440 | {
| |
| 441 | return GivePlayerWeapon(playerid,Weapon,ammo); | |
| 442 | } | |
| 443 | #if defined INCLUDE_BASE_MODE | |
| 444 | //ALS_SYSTEME -------------------- | |
| 445 | #if defined _ALS_GivePlayerWeapon | |
| 446 | #undef GivePlayerWeapon | |
| 447 | #else | |
| 448 | #define _ALS_GivePlayerWeapon | |
| 449 | #endif | |
| 450 | #define GivePlayerWeapon ELC_AC_GivePlayerWeapon | |
| 451 | //ALS_OFF_SYSTEME ---------------- | |
| 452 | #endif | |
| 453 | /*----------------------------------------------------------------------------*/ | |
| 454 | forward ELC_AC_SetPlayerAmmo(playerid,weapon,ammo); | |
| 455 | public ELC_AC_SetPlayerAmmo(playerid,weapon,ammo) | |
| 456 | {
| |
| 457 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==1)CheatPlayerInfo[playerid][elc_AntiWeaponHack]=2; | |
| 458 | new slot=elc_GetWeaponSlot(weapon); | |
| 459 | if(weapon>0 && 47>weapon && slot!=-1) | |
| 460 | {
| |
| 461 | CheatPlayerInfo[playerid][elc_ammo][slot]=ammo; | |
| 462 | SetPlayerAmmo(playerid,weapon,ammo); | |
| 463 | #if defined MODE_DELAY_SEND_STATS | |
| 464 | SaveTime(CheatPlayerInfo[playerid][elc_GiveWeaponTime],GetTickCount()); | |
| 465 | #endif | |
| 466 | } | |
| 467 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==2)CheatPlayerInfo[playerid][elc_AntiWeaponHack]=1; | |
| 468 | return 1; | |
| 469 | } | |
| 470 | stock initial_SetPlayerAmmo(playerid,weapon,ammo) | |
| 471 | {
| |
| 472 | return SetPlayerAmmo(playerid,weapon,ammo); | |
| 473 | } | |
| 474 | #if defined INCLUDE_BASE_MODE | |
| 475 | //ALS_SYSTEME -------------------- | |
| 476 | #if defined _ALS_SetPlayerAmmo | |
| 477 | #undef SetPlayerAmmo | |
| 478 | #else | |
| 479 | #define _ALS_SetPlayerAmmo | |
| 480 | #endif | |
| 481 | #define SetPlayerAmmo ELC_AC_SetPlayerAmmo | |
| 482 | //ALS_OFF_SYSTEME ---------------- | |
| 483 | #endif | |
| 484 | /*----------------------------------------------------------------------------*/ | |
| 485 | forward ELC_AC_ResetPlayerWeapons(playerid); | |
| 486 | public ELC_AC_ResetPlayerWeapons(playerid) | |
| 487 | {
| |
| 488 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==1)CheatPlayerInfo[playerid][elc_AntiWeaponHack]=2; | |
| 489 | for(new i = 0; i <13; i++) | |
| 490 | {
| |
| 491 | CheatPlayerInfo[playerid][elc_weapon][i]=0; | |
| 492 | CheatPlayerInfo[playerid][elc_ammo][i]=0; | |
| 493 | } | |
| 494 | ResetPlayerWeapons(playerid); | |
| 495 | #if defined MODE_DELAY_SEND_STATS | |
| 496 | SaveTime(CheatPlayerInfo[playerid][elc_GiveWeaponTime],GetTickCount()); | |
| 497 | #endif | |
| 498 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==2)CheatPlayerInfo[playerid][elc_AntiWeaponHack]=1; | |
| 499 | return 1; | |
| 500 | } | |
| 501 | stock initial_ResetPlayerWeapons(playerid) | |
| 502 | {
| |
| 503 | return ResetPlayerWeapons(playerid); | |
| 504 | } | |
| 505 | #if defined INCLUDE_BASE_MODE | |
| 506 | //ALS_SYSTEME -------------------- | |
| 507 | #if defined _ALS_ResetPlayerWeapons | |
| 508 | #undef ResetPlayerWeapons | |
| 509 | #else | |
| 510 | #define _ALS_ResetPlayerWeapons | |
| 511 | #endif | |
| 512 | #define ResetPlayerWeapons ELC_AC_ResetPlayerWeapons | |
| 513 | //ALS_OFF_SYSTEME ---------------- | |
| 514 | #endif | |
| 515 | /*----------------------------------------------------------------------------*/ | |
| 516 | forward ELC_AC_SetPlayerHealth(playerid,Float:health); | |
| 517 | public ELC_AC_SetPlayerHealth(playerid,Float:health) | |
| 518 | {
| |
| 519 | if(CheatPlayerInfo[playerid][elc_AntiHealthHack]==1)CheatPlayerInfo[playerid][elc_AntiHealthHack]=2; | |
| 520 | CheatPlayerInfo[playerid][elc_health]=health; | |
| 521 | SetPlayerHealth(playerid,health); | |
| 522 | #if defined MODE_DELAY_SEND_STATS | |
| 523 | SaveTime(CheatPlayerInfo[playerid][elc_GiveHealthTime],GetTickCount()); | |
| 524 | #endif | |
| 525 | if(CheatPlayerInfo[playerid][elc_AntiHealthHack]==2)CheatPlayerInfo[playerid][elc_AntiHealthHack]=1; | |
| 526 | return 1; | |
| 527 | } | |
| 528 | stock initial_SetPlayerHealth(playerid,Float:health) | |
| 529 | {
| |
| 530 | return SetPlayerHealth(playerid,health); | |
| 531 | } | |
| 532 | #if defined INCLUDE_BASE_MODE | |
| 533 | //ALS_SYSTEME -------------------- | |
| 534 | #if defined _ALS_SetPlayerHealth | |
| 535 | #undef SetPlayerHealth | |
| 536 | #else | |
| 537 | #define _ALS_SetPlayerHealth | |
| 538 | #endif | |
| 539 | #define SetPlayerHealth ELC_AC_SetPlayerHealth | |
| 540 | //ALS_OFF_SYSTEME ---------------- | |
| 541 | #endif | |
| 542 | /*----------------------------------------------------------------------------*/ | |
| 543 | forward ELC_AC_SetPlayerArmour(playerid,Float:armour); | |
| 544 | public ELC_AC_SetPlayerArmour(playerid,Float:armour) | |
| 545 | {
| |
| 546 | if(CheatPlayerInfo[playerid][elc_AntiArmourHack]==1)CheatPlayerInfo[playerid][elc_AntiArmourHack]=2; | |
| 547 | CheatPlayerInfo[playerid][elc_armour]=armour; | |
| 548 | SetPlayerArmour(playerid,armour); | |
| 549 | #if defined MODE_DELAY_SEND_STATS | |
| 550 | SaveTime(CheatPlayerInfo[playerid][elc_GiveArmourTime],GetTickCount()); | |
| 551 | #endif | |
| 552 | if(CheatPlayerInfo[playerid][elc_AntiArmourHack]==2)CheatPlayerInfo[playerid][elc_AntiArmourHack]=1; | |
| 553 | return 1; | |
| 554 | } | |
| 555 | stock initial_SetPlayerArmour(playerid,Float:armour) | |
| 556 | {
| |
| 557 | return SetPlayerArmour(playerid,armour); | |
| 558 | } | |
| 559 | #if defined INCLUDE_BASE_MODE | |
| 560 | //ALS_SYSTEME -------------------- | |
| 561 | #if defined _ALS_SetPlayerArmour | |
| 562 | #undef SetPlayerArmour | |
| 563 | #else | |
| 564 | #define _ALS_SetPlayerArmour | |
| 565 | #endif | |
| 566 | #define SetPlayerArmour ELC_AC_SetPlayerArmour | |
| 567 | //ALS_OFF_SYSTEME ---------------- | |
| 568 | #endif | |
| 569 | /*----------------------------------------------------------------------------*/ | |
| 570 | forward ELC_AC_SetVehiclePos(vehicleid,Float:x,Float:y,Float:z); | |
| 571 | public ELC_AC_SetVehiclePos(vehicleid,Float:x,Float:y,Float:z) | |
| 572 | {
| |
| 573 | CheatVehicleInfo[vehicleid][elc_vX]=x; | |
| 574 | CheatVehicleInfo[vehicleid][elc_vY]=y; | |
| 575 | CheatVehicleInfo[vehicleid][elc_vZ]=z; | |
| 576 | SetVehiclePos(vehicleid,x,y,z); | |
| 577 | CheatVehicleInfo[vehicleid][elc_vStatut]=0; | |
| 578 | return 1; | |
| 579 | } | |
| 580 | stock initial_SetVehiclePos(vehicleid,Float:x,Float:y,Float:z) | |
| 581 | {
| |
| 582 | return SetVehiclePos(vehicleid,x,y,z); | |
| 583 | } | |
| 584 | #if defined INCLUDE_BASE_MODE | |
| 585 | //ALS_SYSTEME -------------------- | |
| 586 | #if defined _ALS_SetVehiclePos | |
| 587 | #undef SetVehiclePos | |
| 588 | #else | |
| 589 | #define _ALS_SetVehiclePos | |
| 590 | #endif | |
| 591 | #define SetVehiclePos ELC_AC_SetVehiclePos | |
| 592 | //ALS_OFF_SYSTEME ---------------- | |
| 593 | #endif | |
| 594 | //Core-------------------------------------------------------------------------- | |
| 595 | public OnPlayerCheckCheat(playerid) | |
| 596 | {
| |
| 597 | new elc_IsTime=GetTickCount(); | |
| 598 | #if defined MODE_DELAY_SEND_STATS | |
| 599 | if(CheatPlayerInfo[playerid][elc_AntiMoneyHack]==1 && IsPassTime(playerid,CheatPlayerInfo[playerid][elc_GiveMoneyTime],elc_IsTime)) | |
| 600 | #else | |
| 601 | if(CheatPlayerInfo[playerid][elc_AntiMoneyHack]==1) | |
| 602 | #endif | |
| 603 | {
| |
| 604 | new elc_getmoney=initial_GetPlayerMoney(playerid); | |
| 605 | if(elc_getmoney>CheatPlayerInfo[playerid][elc_money]) | |
| 606 | {
| |
| 607 | new elc_str[60]; | |
| 608 | format(elc_str,sizeof(elc_str),"%d", elc_getmoney-CheatPlayerInfo[playerid][elc_money]); | |
| 609 | initial_ResetPlayerMoney(playerid); | |
| 610 | initial_GivePlayerMoney(playerid, CheatPlayerInfo[playerid][elc_money]); | |
| 611 | ELC_SendCheatWarning(playerid,1,elc_str); | |
| 612 | } | |
| 613 | #if defined DISABLE_MONEY_DEATHLOSE | |
| 614 | else if(((elc_getmoney+100)<=CheatPlayerInfo[playerid][elc_money])&&((GetTickCount()-CheatPlayerInfo[playerid][elc_TimeSpawn])<(TIMER_CHEAT_RATE+MAX_DELAY_SEND_STATS+5000))) | |
| 615 | {
| |
| 616 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,1,elc_str);
|
| 616 | + | |
| 617 | initial_GivePlayerMoney(playerid, elc_getmoney+100); | |
| 618 | } | |
| 619 | #endif | |
| 620 | } | |
| 621 | if(CheatPlayerInfo[playerid][elc_AntiTeleportHack]==1 && IsPlayerUpdatePos(playerid)) | |
| 622 | {
| |
| 623 | #if defined MODE_DELAY_SEND_STATS | |
| 624 | if(CheatPlayerInfo[playerid][elc_SetPositionTime]!=0) | |
| 625 | {
| |
| 626 | if(IsPassTime(playerid,CheatPlayerInfo[playerid][elc_SetPositionTime],elc_IsTime)) | |
| 627 | {
| |
| 628 | CheatPlayerInfo[playerid][elc_SetPositionTime]=0; | |
| 629 | GetPlayerPos(playerid,CheatPlayerInfo[playerid][elc_posx],CheatPlayerInfo[playerid][elc_posy],CheatPlayerInfo[playerid][elc_posz]); | |
| 630 | CheatPlayerInfo[playerid][elc_interior]=GetPlayerInterior(playerid); | |
| 631 | CheatPlayerInfo[playerid][elc_virtualworld]=GetPlayerVirtualWorld(playerid); | |
| 632 | } | |
| 633 | } | |
| 634 | else if(IsPlayerCheatPos(playerid)) | |
| 635 | #else | |
| 636 | if(IsPlayerCheatPos(playerid)) | |
| 637 | #endif | |
| 638 | {
| |
| 639 | if(!IsPlayerCheatAllowTelPos(playerid)) | |
| 640 | {
| |
| 641 | GetPlayerPos(playerid,CheatPlayerInfo[playerid][elc_posx],CheatPlayerInfo[playerid][elc_posy],CheatPlayerInfo[playerid][elc_posz]); | |
| 642 | CheatPlayerInfo[playerid][elc_interior]=GetPlayerInterior(playerid); | |
| 643 | CheatPlayerInfo[playerid][elc_virtualworld]=GetPlayerVirtualWorld(playerid); | |
| 644 | CheatPlayerInfo[playerid][elc_AllowTelX]=0; | |
| 645 | CheatPlayerInfo[playerid][elc_AllowTelY]=0; | |
| 646 | CheatPlayerInfo[playerid][elc_AllowTelZ]=0; | |
| 647 | } | |
| 648 | else | |
| 649 | {
| |
| 650 | ELC_SendCheatWarning(playerid,6); | |
| 651 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,6," ");
|
| 651 | + | SetPlayerPos(playerid,CheatPlayerInfo[playerid][elc_posx],CheatPlayerInfo[playerid][elc_posy],CheatPlayerInfo[playerid][elc_posz]); |
| 652 | SetPlayerInterior(playerid,CheatPlayerInfo[playerid][elc_interior]); | |
| 653 | SetPlayerVirtualWorld(playerid,CheatPlayerInfo[playerid][elc_virtualworld]); | |
| 654 | } | |
| 655 | - | else GetPlayerPos(playerid,CheatPlayerInfo[playerid][elc_posx],CheatPlayerInfo[playerid][elc_posy],CheatPlayerInfo[playerid][elc_posz]); |
| 655 | + | |
| 656 | else | |
| 657 | {
| |
| 658 | GetPlayerPos(playerid,CheatPlayerInfo[playerid][elc_posx],CheatPlayerInfo[playerid][elc_posy],CheatPlayerInfo[playerid][elc_posz]); | |
| 659 | CheatPlayerInfo[playerid][elc_interior]=GetPlayerInterior(playerid); | |
| 660 | CheatPlayerInfo[playerid][elc_virtualworld]=GetPlayerVirtualWorld(playerid); | |
| 661 | } | |
| 662 | } | |
| 663 | #if defined MODE_DELAY_SEND_STATS | |
| 664 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==1 && IsPassTime(playerid,CheatPlayerInfo[playerid][elc_GiveWeaponTime],elc_IsTime)) | |
| 665 | #else | |
| 666 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==1&&GetPlayerSpecialAction(playerid)!=SPECIAL_ACTION_ENTER_VEHICLE&&GetPlayerSpecialAction(playerid)!=SPECIAL_ACTION_EXIT_VEHICLE) | |
| 667 | #endif | |
| 668 | {
| |
| 669 | //ANTI BLOCK MUNITIONS | |
| 670 | if(CheatPlayerInfo[playerid][elc_tickfire]!=0 && CheatPlayerInfo[playerid][elc_AntiAmmoBlockHack]==1) | |
| 671 | {
| |
| 672 | if((elc_IsTime-CheatPlayerInfo[playerid][elc_tickfire]) >= TIRE_RATE) | |
| 673 | {
| |
| 674 | if(CheatPlayerInfo[playerid][elc_weaponFire]==GetPlayerWeapon(playerid)) | |
| 675 | {
| |
| 676 | if(CheatPlayerInfo[playerid][elc_ammoFire]==GetPlayerAmmo(playerid)) ELC_AC_StartCheckPlayerFaceWall(playerid); | |
| 677 | CheatPlayerInfo[playerid][elc_tickfire]=0; | |
| 678 | CheatPlayerInfo[playerid][elc_ammoFire]=0; | |
| 679 | CheatPlayerInfo[playerid][elc_weaponFire]=0; | |
| 680 | ||
| 681 | } | |
| 682 | else | |
| 683 | {
| |
| 684 | ||
| 685 | new elc_keys,elc_ud,elc_lr; | |
| 686 | GetPlayerKeys(playerid,elc_keys,elc_ud,elc_lr); | |
| 687 | if(elc_keys==4 && elc_IsNotWeaponVise(GetPlayerWeapon(playerid))) | |
| 688 | {
| |
| 689 | CheatPlayerInfo[playerid][elc_tickfire]=elc_IsTime; | |
| 690 | CheatPlayerInfo[playerid][elc_ammoFire]=GetPlayerAmmo(playerid); | |
| 691 | CheatPlayerInfo[playerid][elc_weaponFire]=GetPlayerWeapon(playerid); | |
| 692 | } | |
| 693 | else if(elc_keys==132 && elc_IsNotWeaponNoAmmo(GetPlayerWeapon(playerid)) && (elc_GetPlayerSpeedXY(playerid) < 1)) | |
| 694 | {
| |
| 695 | CheatPlayerInfo[playerid][elc_tickfire]=elc_IsTime; | |
| 696 | CheatPlayerInfo[playerid][elc_ammoFire]=GetPlayerAmmo(playerid); | |
| 697 | CheatPlayerInfo[playerid][elc_weaponFire]=GetPlayerWeapon(playerid); | |
| 698 | } | |
| 699 | else | |
| 700 | {
| |
| 701 | CheatPlayerInfo[playerid][elc_tickfire]=0; | |
| 702 | CheatPlayerInfo[playerid][elc_ammoFire]=0; | |
| 703 | CheatPlayerInfo[playerid][elc_weaponFire]=0; | |
| 704 | } | |
| 705 | } | |
| 706 | } | |
| 707 | } | |
| 708 | new elc_WA_VAR[2]; | |
| 709 | new elc_NeedRemove; | |
| 710 | /*new actweap=GetPlayerWeapon(playerid); | |
| 711 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,2,elc_str);
|
| 711 | + | |
| 712 | {
| |
| 713 | if(!elc_IsGiveVehicleWeapon(actweap)) | |
| 714 | {
| |
| 715 | new elc_str[32]; | |
| 716 | GetWeaponName(elc_WA_VAR[0][i],str,32); | |
| 717 | ELC_SendCheatWarning(playerid,2,elc_str); | |
| 718 | } | |
| 719 | elc_NeedRemove=1; | |
| 720 | }*/ | |
| 721 | for(new i = 0; i <13; i++) | |
| 722 | {
| |
| 723 | elc_WA_VAR[0]=0; elc_WA_VAR[1]=0; | |
| 724 | GetPlayerWeaponData(playerid,i,elc_WA_VAR[0],elc_WA_VAR[1]); | |
| 725 | if(CheatPlayerInfo[playerid][elc_weapon][i]!=elc_WA_VAR[0] && elc_WA_VAR[0]!=0 && elc_WA_VAR[1]!=0)// && elc_WA_VAR[0][i]!=actweap | |
| 726 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,2,elc_str);
|
| 726 | + | |
| 727 | //CHEAT WEAPON | |
| 728 | if(!elc_IsGiveVehicleWeapon(elc_WA_VAR[0])&&elc_NeedRemove==0) | |
| 729 | {
| |
| 730 | new elc_str[32]; | |
| 731 | GetWeaponName(elc_WA_VAR[i],elc_str,sizeof(elc_str)); | |
| 732 | ELC_SendCheatWarning(playerid,2,elc_str); | |
| 733 | } | |
| 734 | elc_NeedRemove=1; | |
| 735 | //SetPlayerAmmo(playerid, elc_WA_VAR[0], 0); | |
| 736 | } | |
| 737 | else if(((CheatPlayerInfo[playerid][elc_ammo][i]-elc_WA_VAR[1]) < 0) && elc_IsNotWeaponNoAmmo(elc_WA_VAR[0]) && elc_WA_VAR[0]!=0) | |
| 738 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,3,elc_str);
|
| 738 | + | |
| 739 | //CHEAT AMMO | |
| 740 | if(elc_NeedRemove<=1) | |
| 741 | {
| |
| 742 | new elc_str[60]; | |
| 743 | format(elc_str,sizeof(elc_str),"%d",elc_WA_VAR[1]-CheatPlayerInfo[playerid][elc_ammo][i]); | |
| 744 | ELC_SendCheatWarning(playerid,3,elc_str); | |
| 745 | } | |
| 746 | elc_NeedRemove=2; | |
| 747 | //SetPlayerAmmo(playerid, elc_WA_VAR[0], 0); | |
| 748 | } | |
| 749 | else if(CheatPlayerInfo[playerid][elc_weapon][i]!=0 && elc_WA_VAR[0]==0 && elc_WA_VAR[1]==0) | |
| 750 | {
| |
| 751 | CheatPlayerInfo[playerid][elc_weapon][i]=0; | |
| 752 | CheatPlayerInfo[playerid][elc_ammo][i]=0; | |
| 753 | } | |
| 754 | else if(elc_WA_VAR[1]!=0) CheatPlayerInfo[playerid][elc_ammo][i]=elc_WA_VAR[1]; | |
| 755 | ||
| 756 | } | |
| 757 | if(elc_NeedRemove>=1) | |
| 758 | {
| |
| 759 | new WepUse=GetPlayerWeapon(playerid); | |
| 760 | initial_ResetPlayerWeapons(playerid); | |
| 761 | for(new i = 0; i <13; i++)if(CheatPlayerInfo[playerid][elc_weapon][i] != 0)initial_GivePlayerWeapon(playerid, CheatPlayerInfo[playerid][elc_weapon][i], CheatPlayerInfo[playerid][elc_ammo][i]); | |
| 762 | SetPlayerArmedWeapon(playerid,WepUse); | |
| 763 | } | |
| 764 | } | |
| 765 | #if defined MODE_DELAY_SEND_STATS | |
| 766 | if(CheatPlayerInfo[playerid][elc_AntiHealthHack]==1 && IsPassTime(playerid,CheatPlayerInfo[playerid][elc_GiveHealthTime],elc_IsTime) && IsPassTime(playerid,CheatPlayerInfo[playerid][elc_GiveMoneyTime],elc_IsTime)) | |
| 767 | #else | |
| 768 | if(CheatPlayerInfo[playerid][elc_AntiHealthHack]==1) | |
| 769 | #endif | |
| 770 | {
| |
| 771 | new Float:velc_health; | |
| 772 | GetPlayerHealth(playerid,velc_health); | |
| 773 | if(velc_health!=CheatPlayerInfo[playerid][elc_health]) | |
| 774 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,7," ");
|
| 774 | + | |
| 775 | if(velc_health<=100 && velc_health>0 && CheatPlayerInfo[playerid][elc_health]==0) CheatPlayerInfo[playerid][elc_health]=velc_health; | |
| 776 | else if(velc_health>CheatPlayerInfo[playerid][elc_health]) | |
| 777 | {
| |
| 778 | //Cheat Health | |
| 779 | initial_SetPlayerHealth(playerid,CheatPlayerInfo[playerid][elc_health]); | |
| 780 | ELC_SendCheatWarning(playerid,7); | |
| 781 | } | |
| 782 | else if(velc_health<CheatPlayerInfo[playerid][elc_health] && velc_health!=0)CheatPlayerInfo[playerid][elc_health]=velc_health; | |
| 783 | } | |
| 784 | } | |
| 785 | #if defined MODE_DELAY_SEND_STATS | |
| 786 | if(CheatPlayerInfo[playerid][elc_AntiArmourHack]==1 && IsPassTime(playerid,CheatPlayerInfo[playerid][elc_GiveArmourTime],elc_IsTime) && IsPassTime(playerid,CheatPlayerInfo[playerid][elc_GiveMoneyTime],elc_IsTime)) | |
| 787 | #else | |
| 788 | if(CheatPlayerInfo[playerid][elc_AntiArmourHack]==1) | |
| 789 | #endif | |
| 790 | {
| |
| 791 | new Float:velc_armour; | |
| 792 | GetPlayerArmour(playerid,velc_armour); | |
| 793 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,8," ");
|
| 793 | + | |
| 794 | {
| |
| 795 | if(velc_armour>CheatPlayerInfo[playerid][elc_armour]) | |
| 796 | {
| |
| 797 | //Cheat Armour | |
| 798 | initial_SetPlayerArmour(playerid,CheatPlayerInfo[playerid][elc_armour]); | |
| 799 | ELC_SendCheatWarning(playerid,8); | |
| 800 | } | |
| 801 | else if(velc_armour<CheatPlayerInfo[playerid][elc_armour])CheatPlayerInfo[playerid][elc_armour]=velc_armour; | |
| 802 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,9," ");
|
| 802 | + | |
| 803 | } | |
| 804 | if(CheatPlayerInfo[playerid][elc_AntiVehicleTelportHack]==2 && CheatPlayerInfo[playerid][elc_PossibleVehicleHack]!=0 && IsPassTime(playerid,CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PossibleVehicleHack]][elc_vPossibleHackTime],elc_IsTime)) | |
| 805 | {
| |
| 806 | if(ELC_AC_IsCreatedVehicle(CheatPlayerInfo[playerid][elc_PossibleVehicleHack])) | |
| 807 | {
| |
| 808 | ELC_SendCheatWarning(playerid,9); | |
| 809 | SetVehiclePos(CheatPlayerInfo[playerid][elc_PossibleVehicleHack], CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PossibleVehicleHack]][elc_vX], CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PossibleVehicleHack]][elc_vY], CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PossibleVehicleHack]][elc_vZ]); | |
| 810 | SetVehicleZAngle(CheatPlayerInfo[playerid][elc_PossibleVehicleHack],CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PossibleVehicleHack]][elc_vAngle]); | |
| 811 | CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PossibleVehicleHack]][elc_vPossiblePlayerHack]=0; | |
| 812 | CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PossibleVehicleHack]][elc_vPossibleHackTime]=0; | |
| 813 | } | |
| 814 | CheatPlayerInfo[playerid][elc_PossibleVehicleHack]=0; | |
| 815 | } | |
| 816 | else if(GetPlayerVehicleSeat(playerid)==0) | |
| 817 | {
| |
| 818 | new vehicleid=GetPlayerVehicleID(playerid); | |
| 819 | if(vehicleid!=0) | |
| 820 | {
| |
| 821 | GetVehiclePos(vehicleid, CheatVehicleInfo[vehicleid][elc_vX], CheatVehicleInfo[vehicleid][elc_vY], CheatVehicleInfo[vehicleid][elc_vZ]); | |
| 822 | GetVehicleZAngle(vehicleid,CheatVehicleInfo[vehicleid][elc_vAngle]); | |
| 823 | } | |
| 824 | } | |
| 825 | return 1; | |
| 826 | } | |
| 827 | /*----------------------------------------------------------------------------*/ | |
| 828 | stock ELC_AC_StartCheckPlayerFaceWall(playerid) | |
| 829 | {
| |
| 830 | if(IsPlayerConnected(playerid)) | |
| 831 | {
| |
| 832 | if(CheatPlayerInfo[playerid][elc_AntiAmmoBlockHack]==1)CheatPlayerInfo[playerid][elc_AntiAmmoBlockHack]=2; | |
| 833 | new Float:x,Float:y,Float:z,Float:a,Float:lx,Float:ly,Float:lhealth; | |
| 834 | GetPlayerPos(playerid, x, y ,z); | |
| 835 | GetPlayerFacingAngle(playerid, a); | |
| 836 | GetPlayerHealth(playerid,lhealth); | |
| 837 | lx = (0.5 * floatsin(-a, degrees)); | |
| 838 | ly = (0.5 * floatcos(-a, degrees)); | |
| 839 | SetPlayerVelocity(playerid,lx,ly,0.0); | |
| 840 | SetTimerEx("OnPlayerCheckFaceWall",500,0,"iffffff",playerid,x+lx,y+ly,z,x,y,lhealth);
| |
| 841 | } | |
| 842 | return 1; | |
| 843 | } | |
| 844 | /*----------------------------------------------------------------------------*/ | |
| 845 | public OnPlayerCheckFaceWall(playerid,Float:wall_x,Float:wall_y,Float:wall_z,Float:nwall_x,Float:nwall_y,Float:wall_he) | |
| 846 | {
| |
| 847 | if(IsPlayerConnected(playerid)) | |
| 848 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,4," ");
|
| 848 | + | |
| 849 | new Float:elc_x,Float:elc_y,Float:elc_z; | |
| 850 | GetPlayerPos(playerid, elc_x, elc_y ,elc_z); | |
| 851 | if(IsPlayerInRangeOfPoint(playerid,0.25,wall_x,wall_y,elc_z)) | |
| 852 | {
| |
| 853 | //Cheat Block Ammo | |
| 854 | ELC_SendCheatWarning(playerid,4); | |
| 855 | initial_ResetPlayerWeapons(playerid); | |
| 856 | } | |
| 857 | SetPlayerHealth(playerid,wall_he); | |
| 858 | initial_SetPlayerPos(playerid, nwall_x,nwall_y,wall_z); | |
| 859 | if(CheatPlayerInfo[playerid][elc_AntiAmmoBlockHack]==2)CheatPlayerInfo[playerid][elc_AntiAmmoBlockHack]=1; | |
| 860 | } | |
| 861 | return 1; | |
| 862 | } | |
| 863 | ||
| 864 | /*----------------------------------------------------------------------------*/ | |
| 865 | public OnPlayerUpdate(playerid) | |
| 866 | {
| |
| 867 | new elc_tick=GetTickCount(); | |
| 868 | if(CheatPlayerInfo[playerid][elc_LastUpdate]+1000<elc_tick) | |
| 869 | {
| |
| 870 | - | if(elc_GetPlayerSpeedXY(playerid) > MAX_SPEED_VEHICLE)CallRemoteFunction("OnPlayerCheat", "dds", playerid,5," ");
|
| 870 | + | |
| 871 | } | |
| 872 | CheatPlayerInfo[playerid][elc_LastUpdate]=elc_tick; | |
| 873 | if(CheatPlayerInfo[playerid][elc_AntiSpeedHack]==1) | |
| 874 | {
| |
| 875 | //if((GetPlayerSurfingVehicleID(playerid)!=INVALID_VEHICLE_ID || GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (elc_GetPlayerSpeedXY(playerid) > MAX_SPEED_VEHICLE)) | |
| 876 | if(elc_GetPlayerSpeedXY(playerid) > MAX_SPEED_VEHICLE)ELC_SendCheatWarning(playerid,5); | |
| 877 | } | |
| 878 | #if defined INCLUDE_BASE_MODE | |
| 879 | return CallLocalFunction("ELC_AC_OnPlayerUpdate", "i",playerid);
| |
| 880 | #else | |
| 881 | return 1; | |
| 882 | #endif | |
| 883 | } | |
| 884 | /*----------------------------------------------------------------------------*/ | |
| 885 | #if defined INCLUDE_BASE_MODE | |
| 886 | //ALS_SYSTEME -------------------- | |
| 887 | #if defined _ALS_OnPlayerUpdate | |
| 888 | #undef OnPlayerUpdate | |
| 889 | #else | |
| 890 | #define _ALS_OnPlayerUpdate | |
| 891 | #endif | |
| 892 | #define OnPlayerUpdate ELC_AC_OnPlayerUpdate | |
| 893 | forward ELC_AC_OnPlayerUpdate(playerid); | |
| 894 | #endif | |
| 895 | //ALS_OFF_SYSTEME ---------------- | |
| 896 | /*----------------------------------------------------------------------------*/ | |
| 897 | #if defined INCLUDE_BASE_MODE | |
| 898 | public OnGameModeInit() | |
| 899 | #else | |
| 900 | public OnFilterScriptInit() | |
| 901 | #endif | |
| 902 | {
| |
| 903 | #if defined NO_TICK_COUNT | |
| 904 | CheatServerInfo[elc_TimerTick]=SetTimer("TimeUpdate", TIME_GRANULITY, true);
| |
| 905 | #endif | |
| 906 | #if defined INCLUDE_BASE_MODE | |
| 907 | return CallLocalFunction("ELC_AC_OnGameModeInit", " ");
| |
| 908 | #else | |
| 909 | return 1; | |
| 910 | #endif | |
| 911 | } | |
| 912 | /*----------------------------------------------------------------------------*/ | |
| 913 | #if defined INCLUDE_BASE_MODE | |
| 914 | //ALS_SYSTEME -------------------- | |
| 915 | #if defined _ALS_OnGameModeInit | |
| 916 | #undef OnGameModeInit | |
| 917 | #else | |
| 918 | #define _ALS_OnGameModeInit | |
| 919 | #endif | |
| 920 | #define OnGameModeInit ELC_AC_OnGameModeInit | |
| 921 | forward ELC_AC_OnGameModeInit(); | |
| 922 | #endif | |
| 923 | //ALS_OFF_SYSTEME ---------------- | |
| 924 | /*----------------------------------------------------------------------------*/ | |
| 925 | #if defined INCLUDE_BASE_MODE | |
| 926 | public OnGameModeExit() | |
| 927 | #else | |
| 928 | public OnFilterScriptExit() | |
| 929 | #endif | |
| 930 | {
| |
| 931 | #if defined NO_TICK_COUNT | |
| 932 | KillTimer(CheatServerInfo[elc_TimerTick]); | |
| 933 | #endif | |
| 934 | #if defined INCLUDE_BASE_MODE | |
| 935 | return CallLocalFunction("ELC_AC_OnGameModeExit", " ");
| |
| 936 | #else | |
| 937 | return 1; | |
| 938 | #endif | |
| 939 | } | |
| 940 | /*----------------------------------------------------------------------------*/ | |
| 941 | #if defined INCLUDE_BASE_MODE | |
| 942 | //ALS_SYSTEME -------------------- | |
| 943 | #if defined _ALS_OnGameModeExit | |
| 944 | #undef OnGameModeExit | |
| 945 | #else | |
| 946 | #define _ALS_OnGameModeExit | |
| 947 | #endif | |
| 948 | #define OnGameModeExit ELC_AC_OnGameModeExit | |
| 949 | forward ELC_AC_OnGameModeExit(); | |
| 950 | #endif | |
| 951 | //ALS_OFF_SYSTEME ---------------- | |
| 952 | /*----------------------------------------------------------------------------*/ | |
| 953 | public OnPlayerConnect(playerid) | |
| 954 | {
| |
| 955 | for(new i = 0; i <_:aELCp; i++)CheatPlayerInfo[playerid][aELCp:i]=0; | |
| 956 | if (!IsPlayerNPC(playerid)) | |
| 957 | {
| |
| 958 | CheatPlayerInfo[playerid][elc_armour]=100; | |
| 959 | CheatPlayerInfo[playerid][elc_health]=100; | |
| 960 | CheatPlayerInfo[playerid][elc_timer]=SetTimerEx("OnPlayerCheckCheat", TIMER_CHEAT_RATE, 1, "i", playerid);
| |
| 961 | CheatPlayerInfo[playerid][elc_AntiWeaponHack]=ANTI_WEAPON_&_AMMO_HACK; | |
| 962 | CheatPlayerInfo[playerid][elc_AntiAmmoBlockHack]=ANTI_AMMO_BLOCK_HACK; | |
| 963 | CheatPlayerInfo[playerid][elc_AntiMoneyHack]=ANTI_MONEY_HACK; | |
| 964 | CheatPlayerInfo[playerid][elc_AntiSpeedHack]=0; | |
| 965 | CheatPlayerInfo[playerid][elc_AntiArmourHack]=ANTI_ARMOUR_HACK; | |
| 966 | CheatPlayerInfo[playerid][elc_AntiHealthHack]=ANTI_HEALTH_HACK; | |
| 967 | CheatPlayerInfo[playerid][elc_AntiVehicleTelportHack]=ANTI_VEHICLE-TELEPORT_HACK; | |
| 968 | #if defined MODE_DELAY_SEND_STATS | |
| 969 | CheatPlayerInfo[playerid][elc_GiveWeaponTime]=1; | |
| 970 | CheatPlayerInfo[playerid][elc_GiveMoneyTime]=1; | |
| 971 | CheatPlayerInfo[playerid][elc_GiveHealthTime]=1; | |
| 972 | CheatPlayerInfo[playerid][elc_GiveArmourTime]=1; | |
| 973 | #endif | |
| 974 | CheatPlayerInfo[playerid][elc_PlayerEnterTime]=0; | |
| 975 | SendClientMessage(playerid,0xBD0000FF,"[ANTI-CHEAT]Ce serveur est protégé par ELC_AC(By Eloctro)"); | |
| 976 | } | |
| 977 | #if defined INCLUDE_BASE_MODE | |
| 978 | return CallLocalFunction("ELC_AC_OnPlayerConnect", "d", playerid);
| |
| 979 | #else | |
| 980 | return 1; | |
| 981 | #endif | |
| 982 | } | |
| 983 | /*----------------------------------------------------------------------------*/ | |
| 984 | #if defined INCLUDE_BASE_MODE | |
| 985 | //ALS_SYSTEME -------------------- | |
| 986 | #if defined _ALS_OnPlayerConnect | |
| 987 | #undef OnPlayerConnect | |
| 988 | #else | |
| 989 | #define _ALS_OnPlayerConnect | |
| 990 | #endif | |
| 991 | #define OnPlayerConnect ELC_AC_OnPlayerConnect | |
| 992 | forward ELC_AC_OnPlayerConnect(playerid); | |
| 993 | #endif | |
| 994 | //ALS_OFF_SYSTEME ---------------- | |
| 995 | /*----------------------------------------------------------------------------*/ | |
| 996 | public OnPlayerSpawn(playerid) | |
| 997 | {
| |
| 998 | if (!IsPlayerNPC(playerid)) | |
| 999 | {
| |
| 1000 | GetPlayerPos(playerid,CheatPlayerInfo[playerid][elc_posx],CheatPlayerInfo[playerid][elc_posy],CheatPlayerInfo[playerid][elc_posz]); | |
| 1001 | SaveTime(CheatPlayerInfo[playerid][elc_SetPositionTime],GetTickCount()+MAX_DELAY_WAIT_AFTER_SPAWN); | |
| 1002 | CheatPlayerInfo[playerid][elc_TimeSpawn]=GetTickCount(); | |
| 1003 | if(CheatPlayerInfo[playerid][elc_AntiSpeedHack]!=2) | |
| 1004 | {
| |
| 1005 | CheatPlayerInfo[playerid][elc_AntiTeleportHack]=ANTI_TELEPORT/AIBREAK_HACK; | |
| 1006 | CheatPlayerInfo[playerid][elc_AntiSpeedHack]=ANTI_SPEED_HACK; | |
| 1007 | } | |
| 1008 | CheatPlayerInfo[playerid][elc_health]=100; | |
| 1009 | CheatPlayerInfo[playerid][elc_armour]=100; | |
| 1010 | } | |
| 1011 | #if defined INCLUDE_BASE_MODE | |
| 1012 | return CallLocalFunction("ELC_AC_OnPlayerSpawn", "d", playerid);
| |
| 1013 | #else | |
| 1014 | return 1; | |
| 1015 | #endif | |
| 1016 | } | |
| 1017 | /*----------------------------------------------------------------------------*/ | |
| 1018 | #if defined INCLUDE_BASE_MODE | |
| 1019 | //ALS_SYSTEME -------------------- | |
| 1020 | #if defined _ALS_OnPlayerSpawn | |
| 1021 | #undef OnPlayerSpawn | |
| 1022 | #else | |
| 1023 | #define _ALS_OnPlayerSpawn | |
| 1024 | #endif | |
| 1025 | #define OnPlayerSpawn ELC_AC_OnPlayerSpawn | |
| 1026 | forward ELC_AC_OnPlayerSpawn(playerid); | |
| 1027 | #endif | |
| 1028 | //ALS_OFF_SYSTEME ---------------- | |
| 1029 | /*----------------------------------------------------------------------------*/ | |
| 1030 | public OnPlayerDeath(playerid, killerid, reason) | |
| 1031 | {
| |
| 1032 | if (!IsPlayerNPC(playerid)) | |
| 1033 | {
| |
| 1034 | CheatPlayerInfo[playerid][elc_PlayerEnterTime]=0; | |
| 1035 | CheatPlayerInfo[playerid][elc_AntiTeleportHack]=0; | |
| 1036 | CheatPlayerInfo[playerid][elc_AntiSpeedHack]=0; | |
| 1037 | } | |
| 1038 | #if defined INCLUDE_BASE_MODE | |
| 1039 | return CallLocalFunction("ELC_AC_OnPlayerDeath", "ddd", playerid, killerid, reason);
| |
| 1040 | #else | |
| 1041 | return 1; | |
| 1042 | #endif | |
| 1043 | } | |
| 1044 | /*----------------------------------------------------------------------------*/ | |
| 1045 | #if defined INCLUDE_BASE_MODE | |
| 1046 | //ALS_SYSTEME -------------------- | |
| 1047 | #if defined _ALS_OnPlayerDeath | |
| 1048 | #undef OnPlayerDeath | |
| 1049 | #else | |
| 1050 | #define _ALS_OnPlayerDeath | |
| 1051 | #endif | |
| 1052 | #define OnPlayerDeath ELC_AC_OnPlayerDeath | |
| 1053 | forward ELC_AC_OnPlayerDeath(playerid, killerid, reason); | |
| 1054 | #endif | |
| 1055 | //ALS_OFF_SYSTEME ---------------- | |
| 1056 | /*----------------------------------------------------------------------------*/ | |
| 1057 | public OnPlayerDisconnect(playerid, reason) | |
| 1058 | {
| |
| 1059 | if (!IsPlayerNPC(playerid))KillTimer(CheatPlayerInfo[playerid][elc_timer]); | |
| 1060 | //for(new i = 0; i <_:aELCp; i++)CheatPlayerInfo[playerid][aELCp:i]=0; | |
| 1061 | #if defined INCLUDE_BASE_MODE | |
| 1062 | return CallLocalFunction("ELC_AC_OnPlayerDisconnect", "dd", playerid, reason);
| |
| 1063 | #else | |
| 1064 | return 1; | |
| 1065 | #endif | |
| 1066 | } | |
| 1067 | /*----------------------------------------------------------------------------*/ | |
| 1068 | #if defined INCLUDE_BASE_MODE | |
| 1069 | //ALS_SYSTEME -------------------- | |
| 1070 | #if defined _ALS_OnPlayerDisconnect | |
| 1071 | #undef OnPlayerDisconnect | |
| 1072 | #else | |
| 1073 | #define _ALS_OnPlayerDisconnect | |
| 1074 | #endif | |
| 1075 | #define OnPlayerDisconnect ELC_AC_OnPlayerDisconnect | |
| 1076 | forward ELC_AC_OnPlayerDisconnect(playerid, reason); | |
| 1077 | #endif | |
| 1078 | //ALS_OFF_SYSTEME ---------------- | |
| 1079 | /*----------------------------------------------------------------------------*/ | |
| 1080 | public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) | |
| 1081 | {
| |
| 1082 | if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)) | |
| 1083 | {
| |
| 1084 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==1 && CheatPlayerInfo[playerid][elc_AntiAmmoBlockHack]==1) | |
| 1085 | {
| |
| 1086 | if(newkeys==4) | |
| 1087 | {
| |
| 1088 | new Float:XPOS[3]; GetPlayerPos(playerid,XPOS[0],XPOS[1],XPOS[2]); | |
| 1089 | if(CheatPlayerInfo[playerid][elc_tickfire]==0 && elc_IsNotWeaponVise(GetPlayerWeapon(playerid)) && CheatPlayerInfo[playerid][elc_posz]==XPOS[2]) | |
| 1090 | {
| |
| 1091 | CheatPlayerInfo[playerid][elc_tickfire]=GetTickCount(); | |
| 1092 | CheatPlayerInfo[playerid][elc_ammoFire]=GetPlayerAmmo(playerid); | |
| 1093 | CheatPlayerInfo[playerid][elc_weaponFire]=GetPlayerWeapon(playerid); | |
| 1094 | } | |
| 1095 | } | |
| 1096 | else if(newkeys==132) | |
| 1097 | {
| |
| 1098 | if(CheatPlayerInfo[playerid][elc_tickfire]==0 && elc_IsNotWeaponNoAmmo(GetPlayerWeapon(playerid)) && (elc_GetPlayerSpeedXY(playerid) < 1)) | |
| 1099 | {
| |
| 1100 | CheatPlayerInfo[playerid][elc_tickfire]=GetTickCount(); | |
| 1101 | CheatPlayerInfo[playerid][elc_ammoFire]=GetPlayerAmmo(playerid); | |
| 1102 | CheatPlayerInfo[playerid][elc_weaponFire]=GetPlayerWeapon(playerid); | |
| 1103 | } | |
| 1104 | } | |
| 1105 | else if(oldkeys==4&&newkeys!=132 || oldkeys==132&&newkeys!=4) | |
| 1106 | {
| |
| 1107 | if(CheatPlayerInfo[playerid][elc_tickfire]!=0) | |
| 1108 | {
| |
| 1109 | if((GetTickCount()-CheatPlayerInfo[playerid][elc_tickfire]) >= TIRE_RATE) | |
| 1110 | {
| |
| 1111 | new Float:elc_XPOS[3]; | |
| 1112 | GetPlayerPos(playerid,elc_XPOS[0],elc_XPOS[1],elc_XPOS[2]); | |
| 1113 | if(CheatPlayerInfo[playerid][elc_posz]==elc_XPOS[2] && CheatPlayerInfo[playerid][elc_weaponFire]==GetPlayerWeapon(playerid)&& CheatPlayerInfo[playerid][elc_ammoFire]==GetPlayerAmmo(playerid)) ELC_AC_StartCheckPlayerFaceWall(playerid); | |
| 1114 | } | |
| 1115 | CheatPlayerInfo[playerid][elc_tickfire]=0; | |
| 1116 | CheatPlayerInfo[playerid][elc_ammoFire]=0; | |
| 1117 | CheatPlayerInfo[playerid][elc_weaponFire]=0; | |
| 1118 | } | |
| 1119 | } | |
| 1120 | } | |
| 1121 | } | |
| 1122 | #if defined INCLUDE_BASE_MODE | |
| 1123 | return CallLocalFunction("ELC_AC_OnPlayerKeyStateChange", "ddd",playerid, newkeys, oldkeys);
| |
| 1124 | #else | |
| 1125 | return 1; | |
| 1126 | #endif | |
| 1127 | } | |
| 1128 | /*----------------------------------------------------------------------------*/ | |
| 1129 | #if defined INCLUDE_BASE_MODE | |
| 1130 | //ALS_SYSTEME -------------------- | |
| 1131 | #if defined _ALS_OnPlayerKeyStateChange | |
| 1132 | #undef OnPlayerKeyStateChange | |
| 1133 | #else | |
| 1134 | #define _ALS_OnPlayerKeyStateChange | |
| 1135 | #endif | |
| 1136 | #define OnPlayerKeyStateChange ELC_AC_OnPlayerKeyStateChange | |
| 1137 | forward ELC_AC_OnPlayerKeyStateChange(playerid, newkeys, oldkeys); | |
| 1138 | #endif | |
| 1139 | //ALS_OFF_SYSTEME ---------------- | |
| 1140 | /*----------------------------------------------------------------------------*/ | |
| 1141 | public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) | |
| 1142 | {
| |
| 1143 | CheatPlayerInfo[playerid][elc_PlayerEnterVeh]=vehicleid; | |
| 1144 | #if defined INCLUDE_BASE_MODE | |
| 1145 | return CallLocalFunction("ELC_AC_OnPlayerEnterVehicle", "ddd",playerid, vehicleid, ispassenger);
| |
| 1146 | #else | |
| 1147 | return 1; | |
| 1148 | #endif | |
| 1149 | } | |
| 1150 | /*----------------------------------------------------------------------------*/ | |
| 1151 | #if defined INCLUDE_BASE_MODE | |
| 1152 | //ALS_SYSTEME -------------------- | |
| 1153 | #if defined _ALS_OnPlayerEnterVehicle | |
| 1154 | #undef OnPlayerEnterVehicle | |
| 1155 | #else | |
| 1156 | #define _ALS_OnPlayerEnterVehicle | |
| 1157 | #endif | |
| 1158 | #define OnPlayerEnterVehicle ELC_AC_OnPlayerEnterVehicle | |
| 1159 | forward ELC_AC_OnPlayerEnterVehicle(playerid, vehicleid, ispassenger); | |
| 1160 | #endif | |
| 1161 | //ALS_OFF_SYSTEME ---------------- | |
| 1162 | /*----------------------------------------------------------------------------*/ | |
| 1163 | public OnPlayerStateChange(playerid, newstate, oldstate) | |
| 1164 | {
| |
| 1165 | if(newstate == PLAYER_STATE_DRIVER) | |
| 1166 | {
| |
| 1167 | if(CheatPlayerInfo[playerid][elc_AntiVehicleTelportHack]>=1&&CheatPlayerInfo[playerid][elc_PlayerEnterVeh]!=GetPlayerVehicleID(playerid)) | |
| 1168 | {
| |
| 1169 | CheatPlayerInfo[playerid][elc_PlayerEnterTime] = GetTickCount(); | |
| 1170 | new elc_vehicleid=GetPlayerVehicleID(playerid); | |
| 1171 | if(elc_vehicleid!=0) | |
| 1172 | {
| |
| 1173 | CheatPlayerInfo[playerid][elc_PlayerEnterVeh]=elc_vehicleid; | |
| 1174 | CheatVehicleInfo[elc_vehicleid][elc_vStatut]=1; | |
| 1175 | } | |
| 1176 | } | |
| 1177 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,9," ");
|
| 1177 | + | |
| 1178 | else if(oldstate == PLAYER_STATE_DRIVER) | |
| 1179 | {//220 def
| |
| 1180 | if(CheatPlayerInfo[playerid][elc_PlayerEnterTime]!=0&&(GetTickCount()-CheatPlayerInfo[playerid][elc_PlayerEnterTime]) < 220)//player entered and exited vehicle faster than 220 ms. | |
| 1181 | {
| |
| 1182 | //if(CheatPlayerInfo[playerid][elc_PlayerEnterVeh]!=0)SetVehiclePos(CheatPlayerInfo[playerid][elc_PlayerEnterVeh], CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PlayerEnterVeh]][elc_vX], CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PlayerEnterVeh]][elc_vY], CheatVehicleInfo[CheatPlayerInfo[playerid][elc_PlayerEnterVeh]][elc_vZ]); | |
| 1183 | ELC_SendCheatWarning(playerid,9); | |
| 1184 | } | |
| 1185 | CheatPlayerInfo[playerid][elc_PlayerEnterTime]=0; | |
| 1186 | } | |
| 1187 | #if defined INCLUDE_BASE_MODE | |
| 1188 | return CallLocalFunction("ELC_AC_OnPlayerStateChange", "ddd",playerid, newstate, oldstate);
| |
| 1189 | #else | |
| 1190 | return 1; | |
| 1191 | #endif | |
| 1192 | } | |
| 1193 | /*----------------------------------------------------------------------------*/ | |
| 1194 | #if defined INCLUDE_BASE_MODE | |
| 1195 | //ALS_SYSTEME -------------------- | |
| 1196 | #if defined _ALS_OnPlayerStateChange | |
| 1197 | #undef OnPlayerStateChange | |
| 1198 | #else | |
| 1199 | #define _ALS_OnPlayerStateChange | |
| 1200 | #endif | |
| 1201 | #define OnPlayerStateChange ELC_AC_OnPlayerStateChange | |
| 1202 | forward ELC_AC_OnPlayerStateChange(playerid, newstate, oldstate); | |
| 1203 | #endif | |
| 1204 | //ALS_OFF_SYSTEME ---------------- | |
| 1205 | /*----------------------------------------------------------------------------*/ | |
| 1206 | public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat) | |
| 1207 | {
| |
| 1208 | if (CheatPlayerInfo[playerid][elc_AntiVehicleTelportHack]==2&&ELC_AC_IsCreatedVehicle(vehicleid)) | |
| 1209 | {
| |
| 1210 | new Float:elc_oldposx, Float:elc_oldposy, Float:elc_oldposz; | |
| 1211 | new Float:elc_tempposx, Float:elc_tempposy, Float:elc_tempposz; | |
| 1212 | GetVehiclePos(vehicleid, elc_oldposx, elc_oldposy, elc_oldposz); | |
| 1213 | elc_tempposx = (elc_oldposx -CheatVehicleInfo[vehicleid][elc_vX]); | |
| 1214 | elc_tempposy = (elc_oldposy -CheatVehicleInfo[vehicleid][elc_vY]); | |
| 1215 | elc_tempposz = (elc_oldposz -CheatVehicleInfo[vehicleid][elc_vZ]); | |
| 1216 | if(CheatVehicleInfo[vehicleid][elc_vStatut]==1||CheatVehicleInfo[vehicleid][elc_vX]==0 || ((elc_tempposx < MAX_VEHICLE_DISTANCE_UCM) && (elc_tempposx > -MAX_VEHICLE_DISTANCE_UCM)) && ((elc_tempposy < MAX_VEHICLE_DISTANCE_UCM) && (elc_tempposy > -MAX_VEHICLE_DISTANCE_UCM)) && ((elc_tempposz < MAX_VEHICLE_DISTANCE_UCM) && (elc_tempposz > -MAX_VEHICLE_DISTANCE_UCM))) | |
| 1217 | {
| |
| 1218 | /*if(CheatVehicleInfo[vehicleid][elc_vStatut]==1) | |
| 1219 | {
| |
| 1220 | new Float:vvelo[3]; | |
| 1221 | GetVehicleVelocity(vehicleid,vvelo[0],vvelo[1],vvelo[2]); | |
| 1222 | if(vvelo[0]!=0||vvelo[1]!=0||vvelo[2]!=0)return 1; | |
| 1223 | }*/ | |
| 1224 | if(CheatVehicleInfo[vehicleid][elc_vStatut]==1)CheatVehicleInfo[vehicleid][elc_vStatut]=0; | |
| 1225 | CheatVehicleInfo[vehicleid][elc_vX]=elc_oldposx; | |
| 1226 | CheatVehicleInfo[vehicleid][elc_vY]=elc_oldposy; | |
| 1227 | CheatVehicleInfo[vehicleid][elc_vZ]=elc_oldposz; | |
| 1228 | GetVehicleZAngle(vehicleid,CheatVehicleInfo[vehicleid][elc_vAngle]); | |
| 1229 | } | |
| 1230 | else if(playerid!=INVALID_PLAYER_ID)// && IsPlayerInRangeOfPoint(playerid,MAX_VEHICLE_DISTANCE_UCM,oldposx,oldposy,oldposz) | |
| 1231 | {
| |
| 1232 | if(CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]==0) | |
| 1233 | {
| |
| 1234 | CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]=playerid+1; | |
| 1235 | SaveTime(CheatVehicleInfo[vehicleid][elc_vPossibleHackTime],GetTickCount()); | |
| 1236 | CheatPlayerInfo[playerid][elc_PossibleVehicleHack]=vehicleid; | |
| 1237 | } | |
| 1238 | else if(CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]!=playerid+1) | |
| 1239 | {
| |
| 1240 | CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]=0; | |
| 1241 | CheatVehicleInfo[vehicleid][elc_vPossibleHackTime]=0; | |
| 1242 | if(IsPlayerConnected(CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]-1))CheatPlayerInfo[CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]-1][elc_PossibleVehicleHack]=0; | |
| 1243 | SetVehiclePos(vehicleid, CheatVehicleInfo[vehicleid][elc_vX], CheatVehicleInfo[vehicleid][elc_vY], CheatVehicleInfo[vehicleid][elc_vZ]); | |
| 1244 | SetVehicleZAngle(vehicleid,CheatVehicleInfo[vehicleid][elc_vAngle]); | |
| 1245 | } | |
| 1246 | } | |
| 1247 | } | |
| 1248 | #if defined INCLUDE_BASE_MODE | |
| 1249 | return CallLocalFunction("ELC_AC_OnUnoccupiedVehicle", "ddd",vehicleid, playerid, passenger_seat);
| |
| 1250 | #else | |
| 1251 | return 1; | |
| 1252 | #endif | |
| 1253 | } | |
| 1254 | ||
| 1255 | /*----------------------------------------------------------------------------*/ | |
| 1256 | #if defined INCLUDE_BASE_MODE | |
| 1257 | //ALS_SYSTEME -------------------- | |
| 1258 | #if defined _ALS_OnUnoccupiedVehicleUpdate | |
| 1259 | #undef OnUnoccupiedVehicleUpdate | |
| 1260 | #else | |
| 1261 | #define _ALS_OnUnoccupiedVehicleUpdate | |
| 1262 | #endif | |
| 1263 | #define OnUnoccupiedVehicleUpdate ELC_AC_OnUnoccupiedVehicle | |
| 1264 | forward ELC_AC_OnUnoccupiedVehicle(vehicleid, playerid, passenger_seat); | |
| 1265 | #endif | |
| 1266 | //ALS_OFF_SYSTEME ---------------- | |
| 1267 | /*----------------------------------------------------------------------------*/ | |
| 1268 | public OnVehicleSpawn(vehicleid) | |
| 1269 | {
| |
| 1270 | GetVehiclePos(vehicleid, CheatVehicleInfo[vehicleid][elc_vX], CheatVehicleInfo[vehicleid][elc_vY], CheatVehicleInfo[vehicleid][elc_vZ]); | |
| 1271 | #if defined INCLUDE_BASE_MODE | |
| 1272 | return CallLocalFunction("ELC_AC_OnVehicleSpawn", "d",vehicleid);
| |
| 1273 | #else | |
| 1274 | return 1; | |
| 1275 | #endif | |
| 1276 | } | |
| 1277 | /*----------------------------------------------------------------------------*/ | |
| 1278 | #if defined INCLUDE_BASE_MODE | |
| 1279 | //ALS_SYSTEME -------------------- | |
| 1280 | #if defined _ALS_OnVehicleSpawn | |
| 1281 | #undef OnVehicleSpawn | |
| 1282 | #else | |
| 1283 | #define _ALS_OnVehicleSpawn | |
| 1284 | #endif | |
| 1285 | #define OnVehicleSpawn ELC_AC_OnVehicleSpawn | |
| 1286 | forward ELC_AC_OnVehicleSpawn(vehicleid); | |
| 1287 | #endif | |
| 1288 | //ALS_OFF_SYSTEME ---------------- | |
| 1289 | /*----------------------------------------------------------------------------*/ | |
| 1290 | public OnVehicleDeath(vehicleid) | |
| 1291 | {
| |
| 1292 | CheatVehicleInfo[vehicleid][elc_vX]=0; | |
| 1293 | #if defined INCLUDE_BASE_MODE | |
| 1294 | return CallLocalFunction("ELC_AC_OnVehicleDeath", "d",vehicleid);
| |
| 1295 | #else | |
| 1296 | return 1; | |
| 1297 | #endif | |
| 1298 | } | |
| 1299 | /*----------------------------------------------------------------------------*/ | |
| 1300 | #if defined INCLUDE_BASE_MODE | |
| 1301 | //ALS_SYSTEME -------------------- | |
| 1302 | #if defined _ALS_OnVehicleDeath | |
| 1303 | #undef OnVehicleDeath | |
| 1304 | #else | |
| 1305 | #define _ALS_OnVehicleDeath | |
| 1306 | #endif | |
| 1307 | #define OnVehicleDeath ELC_AC_OnVehicleDeath | |
| 1308 | forward ELC_AC_OnVehicleDeath(vehicleid); | |
| 1309 | #endif | |
| 1310 | //ALS_OFF_SYSTEME ---------------- | |
| 1311 | /*----------------------------------------------------------------------------*/ | |
| 1312 | public ELC_AC_EnablePlayerCheatID(playerid,cheatid,enable) | |
| 1313 | {
| |
| 1314 | if(cheatid==1)//Money | |
| 1315 | {
| |
| 1316 | if(enable==1) | |
| 1317 | {
| |
| 1318 | CheatPlayerInfo[playerid][elc_AntiMoneyHack]=1; | |
| 1319 | } | |
| 1320 | else CheatPlayerInfo[playerid][elc_AntiMoneyHack]=0; | |
| 1321 | } | |
| 1322 | else if(cheatid==2)//Weapon | |
| 1323 | {
| |
| 1324 | if(enable==1) | |
| 1325 | {
| |
| 1326 | for(new i = 0; i <13; i++) | |
| 1327 | {
| |
| 1328 | GetPlayerWeaponData(playerid,i,CheatPlayerInfo[playerid][elc_weapon][i],CheatPlayerInfo[playerid][elc_ammo][i]); | |
| 1329 | } | |
| 1330 | CheatPlayerInfo[playerid][elc_AntiWeaponHack]=1; | |
| 1331 | } | |
| 1332 | else CheatPlayerInfo[playerid][elc_AntiWeaponHack]=0; | |
| 1333 | } | |
| 1334 | else if(cheatid==3)//AirBreak/SpeedHack | |
| 1335 | {
| |
| 1336 | if(enable==1) CheatPlayerInfo[playerid][elc_AntiSpeedHack]=1; | |
| 1337 | else CheatPlayerInfo[playerid][elc_AntiSpeedHack]=0; | |
| 1338 | } | |
| 1339 | else if(cheatid==4)//Anti-Teleport | |
| 1340 | {
| |
| 1341 | if(enable==1) | |
| 1342 | {
| |
| 1343 | GetPlayerPos(playerid,CheatPlayerInfo[playerid][elc_posx],CheatPlayerInfo[playerid][elc_posy],CheatPlayerInfo[playerid][elc_posz]); | |
| 1344 | CheatPlayerInfo[playerid][elc_AntiTeleportHack]=1; | |
| 1345 | } | |
| 1346 | else CheatPlayerInfo[playerid][elc_AntiTeleportHack]=0; | |
| 1347 | } | |
| 1348 | else if(cheatid==5)//Anti-Ammo_Block | |
| 1349 | {
| |
| 1350 | if(enable==1) | |
| 1351 | {
| |
| 1352 | CheatPlayerInfo[playerid][elc_tickfire]=0; | |
| 1353 | CheatPlayerInfo[playerid][elc_ammoFire]=0; | |
| 1354 | CheatPlayerInfo[playerid][elc_weaponFire]=0; | |
| 1355 | CheatPlayerInfo[playerid][elc_AntiAmmoBlockHack]=1; | |
| 1356 | } | |
| 1357 | else CheatPlayerInfo[playerid][elc_AntiAmmoBlockHack]=0; | |
| 1358 | } | |
| 1359 | else if(cheatid==6)//Anti_HEALTH_HACK | |
| 1360 | {
| |
| 1361 | if(enable==1) | |
| 1362 | {
| |
| 1363 | CheatPlayerInfo[playerid][elc_AntiHealthHack]=1; | |
| 1364 | } | |
| 1365 | else CheatPlayerInfo[playerid][elc_AntiHealthHack]=0; | |
| 1366 | } | |
| 1367 | else if(cheatid==7)//Anti_ARMOUR_HACK | |
| 1368 | {
| |
| 1369 | if(enable==1) | |
| 1370 | {
| |
| 1371 | CheatPlayerInfo[playerid][elc_AntiArmourHack]=1; | |
| 1372 | } | |
| 1373 | else CheatPlayerInfo[playerid][elc_AntiArmourHack]=0; | |
| 1374 | } | |
| 1375 | return 1; | |
| 1376 | } | |
| 1377 | /*----------------------------------------------------------------------------*/ | |
| 1378 | #define EnablePlayerCheatID ELC_AC_EnablePlayerCheatID | |
| 1379 | /*----------------------------------------------------------------------------*/ | |
| 1380 | #if defined INCLUDE_BASE_MODE | |
| 1381 | #else | |
| 1382 | public OnPlayerCheat(playerid, cheatid, source[]) | |
| 1383 | {
| |
| 1384 | new elc_str[120],elc_reason[60],elc_name[MAX_PLAYER_NAME]; | |
| 1385 | GetPlayerName(playerid, elc_name, sizeof(elc_name)); | |
| 1386 | format(elc_str,sizeof(elc_str),"( ! ) %s has been cheated for: ",elc_name); | |
| 1387 | switch(cheatid) | |
| 1388 | {
| |
| 1389 | case 1: format(elc_reason,sizeof(elc_reason),"Money Cheat ( %s $ )",source); | |
| 1390 | case 2: format(elc_reason,sizeof(elc_reason),"Weapon Cheat ( %s )",source); | |
| 1391 | case 3: format(elc_reason,sizeof(elc_reason),"Ammo Cheat ( %s Bullets )",source); | |
| 1392 | case 4: format(elc_reason,sizeof(elc_reason),"Ammo Block Cheat"); | |
| 1393 | case 5: format(elc_reason,sizeof(elc_reason),"Speed Cheat"); | |
| 1394 | case 6: format(elc_reason,sizeof(elc_reason),"Airbreak/Teleport Cheat"); | |
| 1395 | case 7: format(elc_reason,sizeof(elc_reason),"Health Cheat"); | |
| 1396 | case 8: format(elc_reason,sizeof(elc_reason),"Armour Cheat"); | |
| 1397 | case 9: format(elc_reason,sizeof(elc_reason),"Vehicle Spawn Cheat"); | |
| 1398 | case 10: format(elc_reason,sizeof(elc_reason),"Vehicle Crasher"); | |
| 1399 | } | |
| 1400 | strcat(elc_str,elc_reason); | |
| 1401 | SendClientMessageToAll(0xBD0000FF,elc_str); | |
| 1402 | return 1; | |
| 1403 | } | |
| 1404 | #endif | |
| 1405 | /*----------------------------------------------------------------------------*/ | |
| 1406 | public RemovePlayerWeapon(playerid, weaponid) | |
| 1407 | {
| |
| 1408 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==1)CheatPlayerInfo[playerid][elc_AntiWeaponHack]=2; | |
| 1409 | new WeaponsID[13]; | |
| 1410 | new AmmoID[13]; | |
| 1411 | new WepUse=GetPlayerWeapon(playerid); | |
| 1412 | new slotremove=elc_GetWeaponSlot(weaponid); | |
| 1413 | for(new slot = 0; slot <13; slot++) | |
| 1414 | {
| |
| 1415 | if(slotremove!=slot)GetPlayerWeaponData(playerid, slot, WeaponsID[slot], AmmoID[slot]); | |
| 1416 | } | |
| 1417 | initial_ResetPlayerWeapons(playerid); | |
| 1418 | for(new slot = 0; slot <13; slot++)if(WeaponsID[slot]!=0 && AmmoID[slot] != 0)initial_GivePlayerWeapon(playerid, WeaponsID[slot], AmmoID[slot]); | |
| 1419 | SetPlayerArmedWeapon(playerid,WepUse); | |
| 1420 | if(CheatPlayerInfo[playerid][elc_AntiWeaponHack]==2)CheatPlayerInfo[playerid][elc_AntiWeaponHack]=1; | |
| 1421 | return 1; | |
| 1422 | } | |
| 1423 | /*----------------------------------------------------------------------------*/ | |
| 1424 | public OnVehicleMod(playerid, vehicleid, componentid) | |
| 1425 | {
| |
| 1426 | switch(componentid) | |
| 1427 | - | CallRemoteFunction("OnPlayerCheat", "dds", playerid,10," ");
|
| 1427 | + | |
| 1428 | case 1008..1010: if(ELC_IsPlayerInInvalidNosVehicle(playerid)) RemoveVehicleComponent(vehicleid, componentid); | |
| 1429 | } | |
| 1430 | if(!ELC_IsComponentidCompatible(GetVehicleModel(vehicleid), componentid)) | |
| 1431 | {
| |
| 1432 | RemoveVehicleComponent(vehicleid, componentid); | |
| 1433 | ELC_SendCheatWarning(playerid,10); | |
| 1434 | } | |
| 1435 | #if defined INCLUDE_BASE_MODE | |
| 1436 | return CallLocalFunction("ELC_AC_OnVehicleMod", "ddd",playerid, vehicleid, componentid);
| |
| 1437 | #else | |
| 1438 | return 1; | |
| 1439 | #endif | |
| 1440 | } | |
| 1441 | /*----------------------------------------------------------------------------*/ | |
| 1442 | #if defined INCLUDE_BASE_MODE | |
| 1443 | //ALS_SYSTEME -------------------- | |
| 1444 | #if defined _ALS_OnVehicleMod | |
| 1445 | #undef OnVehicleMod | |
| 1446 | #else | |
| 1447 | #define _ALS_OnVehicleMod | |
| 1448 | #endif | |
| 1449 | #define OnVehicleMod ELC_AC_OnVehicleMod | |
| 1450 | forward ELC_AC_OnVehicleMod(playerid, vehicleid, componentid); | |
| 1451 | #endif | |
| 1452 | //ALS_OFF_SYSTEME ---------------- | |
| 1453 | /*----------------------------------------------------------------------------*/ | |
| 1454 | stock ELC_IsPlayerInInvalidNosVehicle(playerid) | |
| 1455 | {
| |
| 1456 | new elc_vehicleid = GetPlayerVehicleID(playerid); | |
| 1457 | #define MAX_INVALID_NOS_VEHICLES 52 | |
| 1458 | new ELC_InvalidNosVehicles[MAX_INVALID_NOS_VEHICLES] = | |
| 1459 | {
| |
| 1460 | 581,523,462,521,463,522,461,448,468,586,417,425,469,487,512,520,563,593, | |
| 1461 | 509,481,510,472,473,493,520,595,484,430,453,432,476,497,513,533,577, | |
| 1462 | 452,446,447,454,590,569,537,538,570,449,519,460,488,511,519,548,592 | |
| 1463 | }; | |
| 1464 | if(IsPlayerInAnyVehicle(playerid)) | |
| 1465 | {
| |
| 1466 | for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++) | |
| 1467 | {
| |
| 1468 | if(GetVehicleModel(elc_vehicleid) == ELC_InvalidNosVehicles[i]) return true; | |
| 1469 | } | |
| 1470 | } | |
| 1471 | return false; | |
| 1472 | } | |
| 1473 | /*----------------------------------------------------------------------------*/ | |
| 1474 | stock ELC_IsComponentidCompatible(modelid, componentid) | |
| 1475 | {
| |
| 1476 | if(componentid == 1025 || componentid == 1073 || componentid == 1074 || componentid == 1075 || componentid == 1076 || | |
| 1477 | componentid == 1077 || componentid == 1078 || componentid == 1079 || componentid == 1080 || componentid == 1081 || | |
| 1478 | componentid == 1082 || componentid == 1083 || componentid == 1084 || componentid == 1085 || componentid == 1096 || | |
| 1479 | componentid == 1097 || componentid == 1098 || componentid == 1087 || componentid == 1086) | |
| 1480 | return true; | |
| 1481 | ||
| 1482 | switch (modelid) | |
| 1483 | {
| |
| 1484 | case 400: return (componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1018 || componentid == 1013 || componentid == 1024 || componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1485 | case 401: return (componentid == 1005 || componentid == 1004 || componentid == 1142 || componentid == 1143 || componentid == 1144 || componentid == 114 || componentid == 1020 || componentid == 1019 || componentid == 1013 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1001 || componentid == 1003 || componentid == 1017 || componentid == 1007); | |
| 1486 | case 402: return (componentid == 1009 || componentid == 1009 || componentid == 1010); | |
| 1487 | case 404: return (componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1013 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1002 || componentid == 1016 || componentid == 1000 || componentid == 1017 || componentid == 1007); | |
| 1488 | case 405: return (componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1001 || componentid == 1014 || componentid == 1023 || componentid == 1000); | |
| 1489 | case 409: return (componentid == 1009); | |
| 1490 | case 410: return (componentid == 1019 || componentid == 1021 || componentid == 1020 || componentid == 1013 || componentid == 1024 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1001 || componentid == 1023 || componentid == 1003 || componentid == 1017 || componentid == 1007); | |
| 1491 | case 411: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1492 | case 412: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1493 | case 415: return (componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1001 || componentid == 1023 || componentid == 1003 || componentid == 1017 || componentid == 1007); | |
| 1494 | case 418: return (componentid == 1020 || componentid == 1021 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1002 || componentid == 1016); | |
| 1495 | case 419: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1496 | case 420: return (componentid == 1005 || componentid == 1004 || componentid == 1021 || componentid == 1019 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1001 || componentid == 1003); | |
| 1497 | case 421: return (componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1014 || componentid == 1023 || componentid == 1016 || componentid == 1000); | |
| 1498 | case 422: return (componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1013 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1017 || componentid == 1007); | |
| 1499 | case 426: return (componentid == 1005 || componentid == 1004 || componentid == 1021 || componentid == 1019 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1001 || componentid == 1003); | |
| 1500 | case 429: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1501 | case 436: return (componentid == 1020 || componentid == 1021 || componentid == 1022 || componentid == 1019 || componentid == 1013 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1001 || componentid == 1003 || componentid == 1017 || componentid == 1007); | |
| 1502 | case 438: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1503 | case 439: return (componentid == 1003 || componentid == 1023 || componentid == 1001 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1017 || componentid == 1007 || componentid == 1142 || componentid == 1143 || componentid == 1144 || componentid == 1145 || componentid == 1013); | |
| 1504 | case 442: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1505 | case 445: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1506 | case 451: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1507 | case 458: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1508 | case 466: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1509 | case 467: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1510 | case 474: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1511 | case 475: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1512 | case 477: return (componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1017 || componentid == 1007); | |
| 1513 | case 478: return (componentid == 1005 || componentid == 1004 || componentid == 1012 || componentid == 1020 || componentid == 1021 || componentid == 1022 || componentid == 1013 || componentid == 1024 || componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1514 | case 479: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1515 | case 480: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1516 | case 489: return (componentid == 1005 || componentid == 1004 || componentid == 1020 || componentid == 1019 || componentid == 1018 || componentid == 1013 || componentid == 1024 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1002 || componentid == 1016 || componentid == 1000); | |
| 1517 | case 491: return (componentid == 1142 || componentid == 1143 || componentid == 1144 || componentid == 1145 || componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1014 || componentid == 1023 || componentid == 1003 || componentid == 1017 || componentid == 1007); | |
| 1518 | case 492: return (componentid == 1005 || componentid == 1004 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1016 || componentid == 1000); | |
| 1519 | case 496: return (componentid == 1006 || componentid == 1017 || componentid == 1007 || componentid == 1011 || componentid == 1019 || componentid == 1023 || componentid == 1001 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1003 || componentid == 1002 || componentid == 1142 || componentid == 1143 || componentid == 1020); | |
| 1520 | case 500: return (componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1013 || componentid == 1024 || componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1521 | case 506: return (componentid == 1009); | |
| 1522 | case 507: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1523 | case 516: return (componentid == 1004 || componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1002 || componentid == 1015 || componentid == 1016 || componentid == 1000 || componentid == 1017 || componentid == 1007); | |
| 1524 | case 517: return (componentid == 1142 || componentid == 1143 || componentid == 1144 || componentid == 1145 || componentid == 1020 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1002 || componentid == 1023 || componentid == 1016 || componentid == 1003 || componentid == 1017 || componentid == 1007); | |
| 1525 | case 518: return (componentid == 1005 || componentid == 1142 || componentid == 1143 || componentid == 1144 || componentid == 1145 || componentid == 1020 || componentid == 1018 || componentid == 1013 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1001 || componentid == 1023 || componentid == 1003 || componentid == 1017 || componentid == 1007); | |
| 1526 | case 526: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1527 | case 527: return (componentid == 1021 || componentid == 1020 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1001 || componentid == 1014 || componentid == 1015 || componentid == 1017 || componentid == 1007); | |
| 1528 | case 529: return (componentid == 1012 || componentid == 1011 || componentid == 1020 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1001 || componentid == 1023 || componentid == 1003 || componentid == 1017 || componentid == 1007); | |
| 1529 | case 533: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1530 | case 534: return (componentid == 1126 || componentid == 1127 || componentid == 1179 || componentid == 1185 || componentid == 1100 || componentid == 1123 || componentid == 1125 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1180 || componentid == 1178 || componentid == 1101 || componentid == 1122 || componentid == 1124 || componentid == 1106); | |
| 1531 | case 535: return (componentid == 1109 || componentid == 1110 || componentid == 1113 || componentid == 1114 || componentid == 1115 || componentid == 1116 || componentid == 1117 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1120 || componentid == 1118 || componentid == 1121 || componentid == 1119); | |
| 1532 | case 536: return (componentid == 1104 || componentid == 1105 || componentid == 1182 || componentid == 1181 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1184 || componentid == 1183 || componentid == 1128 || componentid == 1103 || componentid == 1107 || componentid == 1108); | |
| 1533 | case 540: return (componentid == 1004 || componentid == 1142 || componentid == 1143 || componentid == 1144 || componentid == 1145 || componentid == 1020 || componentid == 1019 || componentid == 1018 || componentid == 1024 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1001 || componentid == 1023 || componentid == 1017 || componentid == 1007); | |
| 1534 | case 541: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1535 | case 542: return (componentid == 1144 || componentid == 1145 || componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1014 || componentid == 1015); | |
| 1536 | case 545: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1537 | case 546: return (componentid == 1004 || componentid == 1142 || componentid == 1143 || componentid == 1144 || componentid == 1145 || componentid == 1019 || componentid == 1018 || componentid == 1024 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1002 || componentid == 1001 || componentid == 1023 || componentid == 1017 || componentid == 1007); | |
| 1538 | case 547: return (componentid == 1142 || componentid == 1143 || componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1016 || componentid == 1003 || componentid == 1000); | |
| 1539 | case 549: return (componentid == 1012 || componentid == 1011 || componentid == 1142 || componentid == 1143 || componentid == 1144 || componentid == 1145 || componentid == 1020 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1001 || componentid == 1023 || componentid == 1003 || componentid == 1017 || componentid == 1007); | |
| 1540 | case 550: return (componentid == 1005 || componentid == 1004 || componentid == 1142 || componentid == 1143 || componentid == 1144 || componentid == 1145 || componentid == 1020 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1001 || componentid == 1023 || componentid == 1003); | |
| 1541 | case 551: return (componentid == 1005 || componentid == 1020 || componentid == 1021 || componentid == 1019 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1002 || componentid == 1023 || componentid == 1016 || componentid == 1003); | |
| 1542 | case 555: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1543 | case 558: return (componentid == 1092 || componentid == 1089 || componentid == 1166 || componentid == 1165 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1168 || componentid == 1167 || componentid == 1088 || componentid == 1091 || componentid == 1164 || componentid == 1163 || componentid == 1094 || componentid == 1090 || componentid == 1095 || componentid == 1093); | |
| 1544 | case 559: return (componentid == 1065 || componentid == 1066 || componentid == 1160 || componentid == 1173 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1159 || componentid == 1161 || componentid == 1162 || componentid == 1158 || componentid == 1067 || componentid == 1068 || componentid == 1071 || componentid == 1069 || componentid == 1072 || componentid == 1070 || componentid == 1009); | |
| 1545 | case 560: return (componentid == 1028 || componentid == 1029 || componentid == 1169 || componentid == 1170 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1141 || componentid == 1140 || componentid == 1032 || componentid == 1033 || componentid == 1138 || componentid == 1139 || componentid == 1027 || componentid == 1026 || componentid == 1030 || componentid == 1031); | |
| 1546 | case 561: return (componentid == 1064 || componentid == 1059 || componentid == 1155 || componentid == 1157 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1154 || componentid == 1156 || componentid == 1055 || componentid == 1061 || componentid == 1058 || componentid == 1060 || componentid == 1062 || componentid == 1056 || componentid == 1063 || componentid == 1057); | |
| 1547 | case 562: return (componentid == 1034 || componentid == 1037 || componentid == 1171 || componentid == 1172 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1149 || componentid == 1148 || componentid == 1038 || componentid == 1035 || componentid == 1147 || componentid == 1146 || componentid == 1040 || componentid == 1036 || componentid == 1041 || componentid == 1039); | |
| 1548 | case 565: return (componentid == 1046 || componentid == 1045 || componentid == 1153 || componentid == 1152 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1150 || componentid == 1151 || componentid == 1054 || componentid == 1053 || componentid == 1049 || componentid == 1050 || componentid == 1051 || componentid == 1047 || componentid == 1052 || componentid == 1048); | |
| 1549 | case 566: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1550 | case 567: return (componentid == 1129 || componentid == 1132 || componentid == 1189 || componentid == 1188 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1187 || componentid == 1186 || componentid == 1130 || componentid == 1131 || componentid == 1102 || componentid == 1133); | |
| 1551 | case 575: return (componentid == 1044 || componentid == 1043 || componentid == 1174 || componentid == 1175 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1176 || componentid == 1177 || componentid == 1099 || componentid == 1042); | |
| 1552 | case 576: return (componentid == 1136 || componentid == 1135 || componentid == 1191 || componentid == 1190 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1192 || componentid == 1193 || componentid == 1137 || componentid == 1134); | |
| 1553 | case 579: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1554 | case 580: return (componentid == 1020 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1001 || componentid == 1023 || componentid == 1017 || componentid == 1007); | |
| 1555 | case 585: return (componentid == 1142 || componentid == 1143 || componentid == 1144 || componentid == 1145 || componentid == 1020 || componentid == 1019 || componentid == 1018 || componentid == 1013 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1001 || componentid == 1023 || componentid == 1003 || componentid == 1017 || componentid == 1007); | |
| 1556 | case 587: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1557 | case 589: return (componentid == 1005 || componentid == 1004 || componentid == 1144 || componentid == 1145 || componentid == 1020 || componentid == 1018 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1024 || componentid == 1013 || componentid == 1006 || componentid == 1016 || componentid == 1000 || componentid == 1017 || componentid == 1007); | |
| 1558 | case 600: return (componentid == 1005 || componentid == 1004 || componentid == 1020 || componentid == 1022 || componentid == 1018 || componentid == 1013 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1017 || componentid == 1007); | |
| 1559 | case 602: return (componentid == 1008 || componentid == 1009 || componentid == 1010); | |
| 1560 | case 603: return (componentid == 1144 || componentid == 1145 || componentid == 1142 || componentid == 1143 || componentid == 1020 || componentid == 1019 || componentid == 1018 || componentid == 1024 || componentid == 1008 || componentid == 1009 || componentid == 1010 || componentid == 1006 || componentid == 1001 || componentid == 1023 || componentid == 1017 || componentid == 1007); | |
| 1561 | } | |
| 1562 | return false; | |
| 1563 | } | |
| 1564 | /*----------------------------------------------------------------------------*/ | |
| 1565 | stock ELC_SendCheatWarning(playerid,elc_type,xelc_str[]=" ") | |
| 1566 | {
| |
| 1567 | new elc_str[60]; | |
| 1568 | if(!strlen(xelc_str))format(elc_str,sizeof(elc_str)," "); | |
| 1569 | else format(elc_str,sizeof(elc_str),"%s",xelc_str); | |
| 1570 | CallRemoteFunction("OnPlayerCheat", "dds", playerid,elc_type,elc_str);
| |
| 1571 | } |