Jump to content

Vehicle Damage Problem?


Recommended Posts

Hi i noticed something different, When i create a vehicle via script the damage event doesn't work, but when i create by admin panel it does

Black vehicle is created serverside, are vehicles in admin panel created client side? idk man here:

also the damage function on vehicle works properly, but its just with the vehicles created from script serverside as u can see on the video.

damage event is onClientVehicleDamage btw. also you can see the outputChatBox debug there, when i shot the vehicle created by admin panel the "boom" message only popped up once, even with the RPG, but when i shot the vehicle created by a server-side script, the boom shows up twice on the explosion thus triggering the damage event twice as well. why?

They shouldn't be any different right? I mean, they're the same vehicle model and all so what's the thing that's messing with it? I only have 1 vehicle damaging script as well. and if there would have to be something messing with it, why is it not triggering twice on the vehicle made by the panel?

 

Damage Part on the onClientVehicleDamage

if weapon ~= 37 and warMachines[model] then 
	if attacker and attacker == localPlayer then 
		outputChatBox("boom!")
		triggerServerEvent ("damageWarMachine", source, source, attacker, weapon, bodypart )
		cancelEvent()
    end 
end 

creation of the vehicle server:

APC1 = createVehicle( 601, 447.017578125, 725.5615234375, 6.7242736816406, 0, 0, 246.6 )
setVehicleColor(APC1, 45, 45, 45, 45, 45, 45)

 

Edited by Bean666
Link to post

Since the vehicle was exploded by you, the same event is triggered again, that is, because the white vehicle did not explode, 1 time because the black vehicle exploded 2

I'm not sure you can use this to solve this problem

if(getElementHealth(source) > 0) then
    outputChatBox("boom")
end

 

Edited by Burak5312
Link to post
5 minutes ago, Burak5312 said:

Since the vehicle was exploded by you, the same event is triggered again, that is, because the white vehicle did not explode, 1 time because the black vehicle exploded 2

hahah i have the same vehicle damage property, why were they not gaining the same damage they are the same model. and no it doesn't trigger on vehicle explosion, the first SWAT tank only got 1 trigger on the rocket explosion, the second one got 2 triggers on the rocket explosion itself. anyways i think this is a bug, suddenly i restarted server and everything's fine now, thanks!

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...