objectParent: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Killzone Kid (talk | contribs) (example) |
||
Line 25: | Line 25: | ||
_weaponHolder = [[objectParent]] _backpackContainer; | _weaponHolder = [[objectParent]] _backpackContainer; | ||
_weaponHolder [[setPos]] ([[player]] [[modelToWorld]] [0,5,0]);</code>|= EXAMPLE2 | _weaponHolder [[setPos]] ([[player]] [[modelToWorld]] [0,5,0]);</code>|= EXAMPLE2 | ||
|x2= SQF (see Notes)<code>if ( [[vehicle]] [[player]] != player ) [[then]] {[[hint]] "Player is in a vehicle"};</code> |= Example 2 | |||
|x3= | |x3= Detect if player is in commander turret of a vehicle:<code>_isVehicleCommander = [[player]] [[isEqualTo]] [[commander]] [[objectParent]] [[player]];</code>|= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Revision as of 11:26, 15 May 2016
Description
- Description:
- Returns parent of an object if the object is proxy, otherwise objNull. In case of backpack, the parent is a weaponholder or a cargo space of a vehicle or the unit carrying it. Unit in a vehicle will return the vehicle as parent.
- Groups:
- Uncategorised
Syntax
Examples
- Example 1:
_weaponholder = objectParent _mybackpack;
- Example 2:
- SQF (see Notes)
if ( vehicle player != player ) then {hint "Player is in a vehicle"};
- Example 3:
- Detect if player is in commander turret of a vehicle:
_isVehicleCommander = player isEqualTo commander objectParent player;
Additional Information
- See also:
- backpackContainerunitBackpackbackpackbackpackCargogetBackpackCargobackpackItemsaddBackpackaddBackpackCargoaddBackpackCargoGlobalremoveBackpackclearBackpackCargoclearBackpackCargoGlobalclearAllItemsFromBackpackloadBackpackbackpackSpaceForcanAddItemToBackpackaddItemToBackpackremoveItemFromBackpackeveryBackpackvehicle
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