mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
27 lines
503 B
Plaintext
27 lines
503 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Vdauphin
|
|
* Get surface of an item.
|
|
*
|
|
* Arguments:
|
|
* 0: Object <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Surface in m² <NUMBER>
|
|
*
|
|
* Example:
|
|
* [player] call ace_cargo_fnc_getSurfaceItem
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_object"];
|
|
|
|
private _bbr = 0 boundingBoxReal _object;
|
|
private _p1 = _bbr select 0;
|
|
private _p2 = _bbr select 1;
|
|
private _width = abs ((_p2 select 0) - (_p1 select 0));
|
|
private _length = abs ((_p2 select 1) - (_p1 select 1));
|
|
|
|
_width * _length
|