getShotParents: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{Command|= ____________________________________________________________________________________________ |arma3 |= Game |1.62|= Game Version |arg= |= Multiplayer Arguments |e...")
 
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
(24 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|=
{{RV|type=command
____________________________________________________________________________________________
 
|arma3 |= Game
|game1= arma3
|1.62|= Game Version
|version1= 1.62
|arg=  |= Multiplayer Arguments
 
|eff= |= Multiplayer Effects
|gr1= Weapons
____________________________________________________________________________________________
 
| Get the shot's parent and a unit which caused the shot to happen. |= Description
|descr= Returns shot information for the given projectile. If shot was fired by a soldier on foot or in FFV position in vehicle, the soldier is returned for the vehicle.
____________________________________________________________________________________________
 
| [[getShotParents]] projectile |= Syntax
|s1= [[getShotParents]] projectile
|p1= projectile: [[Object]] |= Parameter 1
 
|p2=  |= Parameter 2
|p1= projectile: [[Object]] - The actual projectile shot
|p3=  |= Parameter 3
 
|p3= |= Parameter 4
|r1= [[Array]] - [vehicle, instigator] - Where vehicle is the vehicle the shot was fired from, and the instigator is the person who pulled the trigger
|p3=  |= Parameter 5
|p3=  |= Parameter 6
| [[Array]] - [owner, instigator] |= Return Value
|x1= shotParents = [[getShotParents]] myProjectile; |= Example 1
| - |= See Also
}}


<dl class='command_description'>
|x1= <sqf>_shotParents = getShotParents myProjectile;</sqf>
<!-- BEGIN Note Section -->
<!-- For example:
<dd class='notedate'>Posted on Month Day, Year - Time (UTC)</dd>
<dt class='note'>'''[[User:User Name|User Name]]'''</dt>
<dd class='note'>This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[_this]] == anExample) [[then]] { hint: Leave it here for others to read; };</code></dd>
-->
<!-- END Note Section -->
</dl>


<h3 style='display:none'>Bottom Section</h3>
|x2= <sqf>batmobile addEventHandler ["Fired", {systemChat str getShotParents (_this select 6)}];</sqf>
<!-- Appropriate categories go here -->


[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
|seealso= [[setShotParents]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
}}

Revision as of 11:23, 13 May 2022

Hover & click on the images for description

Description

Description:
Returns shot information for the given projectile. If shot was fired by a soldier on foot or in FFV position in vehicle, the soldier is returned for the vehicle.
Groups:
Weapons

Syntax

Syntax:
getShotParents projectile
Parameters:
projectile: Object - The actual projectile shot
Return Value:
Array - [vehicle, instigator] - Where vehicle is the vehicle the shot was fired from, and the instigator is the person who pulled the trigger

Examples

Example 1:
_shotParents = getShotParents myProjectile;
Example 2:
batmobile addEventHandler ["Fired", {systemChat str getShotParents (_this select 6)}];

Additional Information

See also:
setShotParents

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note