a3_vemf_reloaded/exile_vemf_reloaded/functions/fn_checkSide.sqf

53 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-04-10 15:25:24 +00:00
/*
Author: IT07
Description: checks the side of given unit and returns it
Params:
_this: STRING - unit classname
Returns: SIDE - unit's side
*/
2016-04-13 20:28:31 +00:00
private ["_return"];
2016-04-10 15:25:24 +00:00
if (_this isEqualType "") then
{
2016-04-17 14:35:35 +00:00
private ["_faction"];
_faction = getText (configFile >> "CfgVehicles" >> _this >> "faction");
if not(_faction isEqualTo "") then
2016-04-10 15:25:24 +00:00
{
2016-04-16 11:11:18 +00:00
scopeName "isNull";
if (_faction isEqualTo "BLU_G_F") then
2016-04-10 15:25:24 +00:00
{
2016-04-16 11:11:18 +00:00
_return = WEST;
breakOut "isNull";
};
if (_faction isEqualTo "CIV_F") then
{
_return = civilian;
breakOut "isNull";
};
if (_faction isEqualTo "IND_F") then
{
_return = independent;
breakOut "isNull";
};
if (_faction isEqualTo "IND_G_F") then
{
_return = resistance;
breakOut "isNull";
};
2016-04-17 14:35:35 +00:00
if (_faction isEqualTo "OPF_G_F") then
2016-04-16 11:11:18 +00:00
{
_return = EAST;
2016-04-10 15:25:24 +00:00
};
2016-04-17 14:35:35 +00:00
} else
{
["fn_checkSide", 0, format["Failed to find faction of %1", _this]] spawn VEMFr_fnc_log;
};
if not isNil"_return" then
{
_return
2016-04-10 15:25:24 +00:00
};
};