06.06.2014, 14:01
New cheat do respawn cars, but OnVehicleDeath and OnUnoccupiedVehicleUpdate is not called. How to fix it?
sorry for my english
sorry for my english
If the vehicle respawns, then it would probably call OnVehicleSpawn, not OnVehicleDeath.
|
That's not a new cheat. I've faced those hackers since 2013, and possibly that cheating tool is older than that. Just what Emmet mentioned, OnVehicleDeath is only called when vehicle health is in exploding situation (burning engine) or already exploded and OnVehicleSpawn is called when the vehicle is re-spawned (it doesn't calls if the vehicle spawns). You can script it quite easily.
|
That's not a new cheat. I've faced those hackers since 2013, and possibly that cheating tool is older than that. Just what Emmet mentioned, OnVehicleDeath is only called when vehicle health is in exploding situation (burning engine) or already exploded and OnVehicleSpawn is called when the vehicle is re-spawned (it doesn't calls if the vehicle spawns). You can script it quite easily.
|
native IsValidVehicle(vehicleid);// it's better to write this in the a_samp library
enum E_VehInfosFields
{
bool:IsRespawning,
//The idea is to integrate this "system" to your current vehicles info' array :)
}
new gVehInfos[MAX_VEHICLES][E_VehInfosFields],
stock SetVehicleToRespawn_EX(vehID)
{
if(!IsValidVehicle(vehID))
return 1;
gVehInfos[vehID][IsRespawning] = true;
SetVehicleToRespawn(vehID);
return 0;
}
public OnVehicleSpawn(vehicleid)
{
if(!gVehInfos[vehID][IsRespawning])
{
print("[Anti-Cheat] Vehicle respawn cheat detected");
//Alert the admins that there is someone cheating - Do it how you want :)
}
else
gVehInfos[vehID][IsRespawning] = false;
return 1;
}
#define SetVehicleToRespawn(%1) SetVehicleToRespawn_EX(%1)