Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Anti-_SetVehicleParamsEx .. & por Zume_
- #if defined _ANSVPEX_included
- #endinput
- #endif
- #define _ANSVPEX_included
- #include <a_samp>
- enum VehicleEnum
- {
- NOP_ENGINE,
- NOP_LIGHTS,
- NOP_ALARM,
- NOP_DOORS,
- NOP_BONNET,
- NOP_BOOT,
- NOP_OBJECTIVE,
- };
- new VehicleData[MAX_VEHICLES][VehicleEnum];
- #if !defined IsValidVehicle
- native IsValidVehicle(vehicleid);
- #endif
- stock _SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective)
- {
- VehicleData[vehicleid][NOP_ENGINE] = engine;
- VehicleData[vehicleid][NOP_LIGHTS] = lights;
- VehicleData[vehicleid][NOP_ALARM] = alarm;
- VehicleData[vehicleid][NOP_DOORS] = doors;
- VehicleData[vehicleid][NOP_BONNET] = bonnet;
- VehicleData[vehicleid][NOP_BOOT] = boot;
- VehicleData[vehicleid][NOP_OBJECTIVE] = objective;
- SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
- }
- forward _VehTimeHackParams(); public _VehTimeHackParams()
- {
- new
- params[7], vehicle;
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i) || !IsPlayerInAnyVehicle(i) || GetPlayerVehicleSeat(i) == 0)
- continue;
- vehicle = GetPlayerVehicleID(i);
- if(IsValidVehicle(vehicle))
- {
- GetVehicleParamsEx(vehicle, params[0], params[1], params[2],params[3],params[4],params[5],params[6]);
- if(VehicleData[vehicle][NOP_ENGINE] != params[0] || VehicleData[vehicle][NOP_LIGHTS] != params[1] || VehicleData[vehicle][NOP_ALARM] != params[2] || VehicleData[vehicle][NOP_DOORS] != params[3] || VehicleData[vehicle][NOP_BONNET] != params[4] || VehicleData[vehicle][NOP_BOOT] != params[5] || VehicleData[vehicle][NOP_OBJECTIVE] != params[6])
- {
- SetVehicleParamsEx(vehicle, VehicleData[vehicle][NOP_ENGINE], VehicleData[vehicle][NOP_LIGHTS], VehicleData[vehicle][NOP_ALARM], VehicleData[vehicle][NOP_DOORS], VehicleData[vehicle][NOP_BONNET], VehicleData[vehicle][NOP_BOOT], VehicleData[vehicle][NOP_OBJECTIVE]);
- CallLocalFunction("HackVehicleParams", "d");
- }
- }
- }
- }
- public OnGameModeInit()
- {
- SetTimer("_VehTimeHackParams", 1000, true);
- #if defined ant_Hook_OnGameModeInit
- return ant_Hook_OnGameModeInit();
- #else
- return 1;
- #endif
- }
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit ant_Hook_OnGameModeInit
- #if defined ant_Hook_OnGameModeInit
- forward ant_Hook_OnGameModeInit();
- #endif
- #define SetVehicleParamsEx _SetVehicleParamsEx
- forward HackVehicleParams(playerid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement