onClientPedHitByWaterCannon | Multi Theft Auto: Wiki Skip to content

onClientPedHitByWaterCannon

Client-side
Server-side
Shared

This event is fired when a ped is hit by a water cannon.

This event is only triggered for peds that are streamed in

Parameters

ped pedHit
  • pedHit: the ped which got shot by the water cannon

Source

element: The source of this event is the vehicle who shot the water cannon.

Canceling

If this event is canceled, the ped will not be knocked down

Code Examples

client

This example says who got hit by a water cannon.

function outputPlayerHitByWater(thePed)
if (getElementType(thePed) ~= "player") then
return false -- This event is for peds and players but this example only wants players
end
local hitPed = getPlayerName(thePed)
outputChatBox(hitPed.." got hit by a water cannon!", 255, 0, 0)
end
addEventHandler("onClientPedHitByWaterCannon", root, outputPlayerHitByWater)

See Also