onClientVehicleWeaponHit | Multi Theft Auto: Wiki Skip to content

onClientVehicleWeaponHit

Client-side
Server-side
Shared

This event is called when a vehicle weapon hits an element or the world.

This event is only triggered for elements that are streamed in

Parameters

int weaponType, element hitElement, float hitX, float hitY, float hitZ, int model, int materialID
  • weaponType: The type of vehicle weapon. (See the list below)
  • hitElement: The vehicle, ped or player that was hit by the weapon sometimes false.
  • hitX: The X world co-ordinate of where the hit occured.
  • hitY: The Y world co-ordinate of where the hit occured.
  • hitZ: The Z world co-ordinate of where the hit occured.
  • model: The model ID of the element that was hit.
  • materialID: The material ID of the element that was hit.

Source

element: The source of this event is the vehicle that fired the weapon.

Code Examples

client
addEventHandler("onClientVehicleWeaponHit", root,
function(weaponType, hitElement, hitX, hitY, hitZ, model, materialID)
outputChatBox(tostring(weaponType).." "..tostring(hitElement).." "..tostring(hitX).." "..tostring(hitY).." "..tostring(hitZ).." "..tostring(model).." "..tostring(materialID))
end
)

See Also

Vehicle Functions