Advertisement
ZumeZero

[INCLUDE] Anti-NOP_SetPlayerVehicleParamsEx

Dec 20th, 2014
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.49 KB | None | 0 0
  1. // Anti-_SetVehicleParamsEx .. & por Zume_
  2.  
  3. #if defined _ANSVPEX_included
  4. #endinput
  5. #endif
  6. #define _ANSVPEX_included
  7.  
  8. #include <a_samp>
  9.  
  10. enum VehicleEnum
  11. {
  12.     NOP_ENGINE,
  13.     NOP_LIGHTS,
  14.     NOP_ALARM,
  15.     NOP_DOORS,
  16.     NOP_BONNET,
  17.     NOP_BOOT,
  18.     NOP_OBJECTIVE,
  19. };
  20. new VehicleData[MAX_VEHICLES][VehicleEnum];
  21.  
  22. #if !defined IsValidVehicle
  23. native IsValidVehicle(vehicleid);
  24. #endif
  25.  
  26. stock _SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective)
  27. {
  28.     VehicleData[vehicleid][NOP_ENGINE] = engine;
  29.     VehicleData[vehicleid][NOP_LIGHTS] = lights;
  30.     VehicleData[vehicleid][NOP_ALARM] = alarm;
  31.     VehicleData[vehicleid][NOP_DOORS] = doors;
  32.     VehicleData[vehicleid][NOP_BONNET] = bonnet;
  33.     VehicleData[vehicleid][NOP_BOOT] = boot;
  34.     VehicleData[vehicleid][NOP_OBJECTIVE] = objective;
  35.     SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
  36. }
  37.  
  38. forward _VehTimeHackParams(); public _VehTimeHackParams()
  39. {
  40.     new
  41.     params[7], vehicle;
  42.  
  43.     for(new i; i < MAX_PLAYERS; i++)
  44.     {
  45.        
  46.         if(!IsPlayerConnected(i) || !IsPlayerInAnyVehicle(i) || GetPlayerVehicleSeat(i) == 0)
  47.         continue;
  48.  
  49.         vehicle = GetPlayerVehicleID(i);
  50.         if(IsValidVehicle(vehicle))
  51.         {
  52.            
  53.             GetVehicleParamsEx(vehicle, params[0], params[1], params[2],params[3],params[4],params[5],params[6]);
  54.  
  55.             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])
  56.             {
  57.                
  58.  
  59.                 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]);
  60.                 CallLocalFunction("HackVehicleParams", "d");
  61.             }
  62.         }
  63.     }
  64. }
  65.  
  66. public OnGameModeInit()
  67. {
  68.     SetTimer("_VehTimeHackParams", 1000, true);
  69.  
  70.     #if defined ant_Hook_OnGameModeInit
  71.     return ant_Hook_OnGameModeInit();
  72.     #else
  73.     return 1;
  74.     #endif
  75. }
  76.  
  77. #if defined _ALS_OnGameModeInit
  78. #undef OnGameModeInit
  79. #else
  80. #define _ALS_OnGameModeInit
  81. #endif
  82.  
  83. #define OnGameModeInit          ant_Hook_OnGameModeInit
  84.  
  85. #if defined ant_Hook_OnGameModeInit
  86. forward ant_Hook_OnGameModeInit();
  87. #endif
  88.  
  89. #define SetVehicleParamsEx _SetVehicleParamsEx
  90.  
  91. forward HackVehicleParams(playerid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement