Sendy Posted August 14, 2022 Share Posted August 14, 2022 (edited) 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 August 14, 2022 by Sendy Link to comment
Shady1 Posted August 14, 2022 Share Posted August 14, 2022 you didn't use attacker, so no attacker https://wiki.multitheftauto.com/wiki/OnClientPedWasted Link to comment
Sendy Posted August 14, 2022 Author Share Posted August 14, 2022 But how i Can detect if my ped is hit by water Can? Link to comment
roaddog Posted August 15, 2022 Share Posted August 15, 2022 (edited) 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 August 15, 2022 by NeverGiveup Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now