OnVehicleDeath
#1

Hello,
When a cheater attempts to make a respawn for vehicles (falsely call callback OnVehicleDeath), we can catch a cheater but can not prevent a respawn. I think that this is a global problem at the moment and we can not do anything about it.
I suggest adding for OnVehicleDeath the ability to prevent respawn if the value 0 is returned.

Code:
public OnVehicleDeath(vehicleid, killerid)
{
	new Float:health;
	GetVehicleHealth(vehicleid, health);
	if(health >= 250.0)
	{
		return 0; // we prevent respawn
	}
	return 1;
}
Video: https://www.youtube.com/watch?v=9QnbkqBbcQI

@Kalcor, please do not ignore this proposal, it is very important.
Reply
#2

Quote:
Originally Posted by Romz
View Post
Hello,
When a cheater attempts to make a respawn for vehicles (falsely call callback OnVehicleDeath), we can catch a cheater but can not prevent a respawn. I think that this is a global problem at the moment and we can not do anything about it.
I suggest adding for OnVehicleDeath the ability to prevent respawn if the value 0 is returned.

Code:
public OnVehicleDeath(vehicleid, killerid)
{
	new Float:health;
	GetVehicleHealth(vehicleid, health);
	if(health >= 250.0)
	{
		return 0; // we prevent respawn
	}
	return 1;
}
@Kalcor, please do not ignore this proposal, it is very important.
I'm just wondering, what is a vehicle's health value after it enters water? OnVehicleDeath is called when a vehicle enters water, but I'm not sure if the health value is less than 250.0?
Reply
#3

Quote:
Originally Posted by BeckzyBoi
View Post
I'm just wondering, what is a vehicle's health value after it enters water? OnVehicleDeath is called when a vehicle enters water, but I'm not sure if the health value is less than 250.0?
When transport falls into the water, health remains the same.
Reply
#4

Quote:
Originally Posted by Romz
View Post
When transport falls into the water, health remains the same.
Then in that case returning 0 in OnVehicleDeath if health is >= 250.0 won't really work, unless you don't want vehicles that fall in water to respawn.
Reply
#5

Using ColAndreas in this case will be more accurate.

Code:
public OnVehicleDeath(vehicleid, killerid)
{
	new Float:health, Float:depth, Float:vehicledepth;
	GetVehicleHealth(vehicleid, health);
	if(health >= 250.0 && !CA_IsVehicleInWater(vehicleid, depth, vehicledepth))
	{
		return 0; // we prevent respawn
	}
	return 1;
}
Code:
stock CA_IsVehicleInWater(vehicleid, &Float:depth, &Float:vehicledepth)
{
	new Float:x, Float:y, Float:z, Float:retx[10], Float:rety[10], Float:retz[10], Float:retdist[10], modelids[10];
	GetVehiclePos(vehicleid, x, y, z);
	new collisions = CA_RayCastMultiLine(x, y, z + 1000.0, x, y, z - 1000.0, retx, rety, retz, retdist, modelids, 10);
	if(collisions)
	{
		for(new i = 0; i < collisions; i++)
		{
			if(modelids[i] == WATER_OBJECT)
			{
				depth = INFINITY;

				for(new j = 0; j < collisions; j++)
				{
					if(retz[j] < depth)
					depth = retz[j];
				}

				depth = retz[i] - depth;
				if(depth < 0.001 && depth > -0.001)
				depth = 100.0;
				vehicledepth = retz[i] - z;

				if(vehicledepth < -2.0)
				return 0;

				return 1;
			}
		}
	}
	return 0;
}
Reply
#6

I wouldn't know how these hacks work, so I'm just curious - do the vehicles actually explode or just respawn? I've seen hackers IG exploding vehicles, but I'm not sure if that's the hack you're referring to?
Reply
#7

Quote:
Originally Posted by BeckzyBoi
View Post
I wouldn't know how these hacks work, so I'm just curious - do the vehicles actually explode or just respawn? I've seen hackers IG exploding vehicles, but I'm not sure if that's the hack you're referring to?
I can record more detailed videos of how hackers do this. Would you like me to make a video?
Reply
#8

Video:

PS: I do not use cheats myself, cheats help me in writing anticheat.
Reply
#9

https://github.com/urShadow/Pawn.Rak...tiVehicleSpawn

Returning 0 at OnVehicleDeathRequest will prevent them from re-spawning.
Reply
#10

Quote:
Originally Posted by Jelly23
View Post
https://github.com/urShadow/Pawn.Rak...tiVehicleSpawn

Returning 0 at OnVehicleDeathRequest will prevent them from re-spawning.
I do not want to use a plug-in with a memory hack for 1 opportunity. Moreover, there is no guarantee that this plug-in will work after every update of the server version.
Reply
#11

Did you debug just this callback or others?
Reply
#12

Quote:
Originally Posted by Locky_
Посмотреть сообщение
Did you debug just this callback or others?
I did not quite understand the essence of the question.
Reply
#13

Quote:
Originally Posted by Romz
Посмотреть сообщение
I did not quite understand the essence of the question.
From what I saw in the video, when using cheating, OnVehicleDeath is called.
Usually cheatings call other callbacks. Example: OnPlayerStateChange

So I asked if you consulted the output of other callbacks when cheating is used.
Reply
#14

Quote:
Originally Posted by Locky_
Посмотреть сообщение
From what I saw in the video, when using cheating, OnVehicleDeath is called.
Usually cheatings call other callbacks. Example: OnPlayerStateChange

So I asked if you consulted the output of other callbacks when cheating is used.
Only OnVehicleDeath is called. When I catch a cheater, I kick him from the server. But all the same the vehicles respawn in a few seconds and this can not be stopped.
Reply
#15

Similar problem with this https://sampforum.blast.hk/showthread.php?tid=611060
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)