Explode vehicle immediately
#1

Hi, is there a way to explode vehicle immediately or after some miliseconds? I tried with SetVehicleHealth, multiple epxlosions but it always blows after 5-7 seconds.
Reply
#2

It's not possible.
Reply
#3

It is possible, try doing something like this.

pawn Код:
new Float:g_vPosition[ 3 ];

GetVehiclePos(vehicleid, g_vPosition[0], g_vPosition[1], g_vPosition[2]);
CreateExplosion(g_vPosition[0], g_vPosition[1], g_vPosition[2], 0, 5);
if(IsPlayerInVehicle(playerid, vehicleid)) SetPlayerHealth(playerid, 0);
SetVehicleHealth(vehicleid, -1);
Reply
#4

You could run a loop and kill all the players inside the vehicle, and create an explosion at the position of the vehicle. But there is no way to make the vehicle explode immediately as far as i know.
Reply
#5

It seems that SetPlayerHealth with CreateExplosion in vehicle kinda bugs player (dies twice or sometimes doesn't respawn at all). Anyway, thanks for helping guys, I appreciate your efforts.
Reply
#6

If you kill them in the car, that bugs.

You should use SetPlayerPos and remove them with that function out of the car and kill them then.

Its a stupid and annoying bug...
Reply
#7

You don't need to set a players health to 0 to kill them. All that does is achieve death on the client, so register their death server side and respawn them. There is no need to set vehicle health either it's totalled or not let the server decide that. Make sure you register when a player is either alive or dead with a variable IsDead[MAX_PLAYERS];. It's so easy to do this stuff you are completely thinking about it all wrong rely on the server not the client.
Reply
#8

Quote:
Originally Posted by Pottus
Посмотреть сообщение
You don't need to set a players health to 0 to kill them. All that does is achieve death on the client, so register their death server side and respawn them. There is no need to set vehicle health either it's totalled or not let the server decide that. Make sure you register when a player is either alive or dead with a variable IsDead[MAX_PLAYERS];. It's so easy to do this stuff you are completely thinking about it all wrong rely on the server not the client.
Do not compromise yourself. It's not me thinking about it wrong. It's you not understand what I want to achieve. I asked the question about vehicle's explosion and you post $hitty answer about what?

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
If you kill them in the car, that bugs.

You should use SetPlayerPos and remove them with that function out of the car and kill them then.

Its a stupid and annoying bug...
I replaced SetPlayerPos with RemoveVehicle, then turn on spectate mode and it's looking good, thanks for the tip.
Reply
#9

Man are you ever stupid. Read what I wrote, sure you found a way you like but that isn't always the case sometimes you need to change your thinking. In any case.

Rely on the server not the client.

Not my fault you are a goof.
Reply
#10

Try use this


Quote:

new Float, Float:y, Float:z;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleHealth(vehicleid, health)
if(health == 0)
{
CreateExplosion(x, y, z, 2, 10.0);
}

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)