Scripting/Client/Events/onObjectShot
(0.6) A bullet of the local player hit a building, a map object or an object: the game's own map, the server's IPL maps and CreateObject objects (not vehicles and peds). model is the model id, x, y, z the position of the whole object (not the hit point) and rx, ry, rz its rotation in degrees, in the same order as CreateObject / object.Rotation use, so the values can be pasted into a script. One shot gives one call (a shotgun blast too); sniper bullets count. A function with fewer parameters gets fewer arguments: function onObjectShot(model) works. PC, Android and PS3.
Syntax
onObjectShot(model, x, y, z, rx, ry, rz)Arguments
- int model –
modelis the model id,x, y, zthe position of the whole object (not the hit point) andrx, ry, rzits rotation in degrees, in the same order asCreateObject/object.Rotationuse, so the values can be pasted into a script. - float x
- float y
- float z
- float rx
- float ry
- float rz
Example
function onObjectShot( model, x, y, z, rx, ry, rz )
{
Message( "onObjectShot fired" );
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
- onScriptLoad
- onScriptUnload
- onClientSpawn
- onClientRender
- onClientCommand
- onClientMouseMove
- onClientMouseClick
- onClientMouseWheel
- onClientKeyStateChange
- onGameWindowResize
Section: Client events
Categories: Client events | Client events