Jump to content

[HELP] onClientPedHitByWaterCannon


Sendy

Recommended Posts

function outputPlayerHitByWater(thePed)
	--if (getElementType(thePed) ~= "player") then
	if (getElementType(thePed) == "ped") then
	--setElementHealth(thePed, getElementHealth(thePed) - 1)
	killPed ( thePed, attacker, 56, 9, false)
	end
end
addEventHandler("onClientPedHitByWaterCannon", getRootElement(), outputPlayerHitByWater)

Can anyone tell me why this not working? i have always warning Bad ussage killPed this client side function will only work with client created peds

Edited by Sendy
Link to comment
6 hours ago, Sendy said:

But how i Can detect if my ped is hit by water Can? 

local cPed = createPed(0, x, y, z)

function outputPlayerHitByWater(thePed)
	local attacker = getVehicleOccupant(source)
	if (thePed == cPed and getElementType(thePed) == "ped") then
		killPed ( thePed, attacker, 56, 9, false)
	end
end
addEventHandler("onClientPedHitByWaterCannon", getRootElement(), outputPlayerHitByWater)

 

Edited by NeverGiveup
Link to comment

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...