PHP Code:
//assignActions.sqf
_object = _this select 0;
_marker = _this select 1;
_availableVehicles = switch (getPlayerUID player) do
{
case "111222": //Player with UID 111222
{
["HMMWV_MK19", "M1A2_TUSK_MG", "TowingTractor", "GAZ_Vodnik_HMG"]
};
case "222333": //Player with UID 222333
{
["HMMWV_MK19", "TowingTractor", "GAZ_Vodnik_HMG"]
};
default //Everyone else
{
["TowingTractor"]
};
};
{
_object addAction [format ["Spawn %1", getText(configFile >> "CfgVehicles" >> _x >> "displayName")], //Fetch the vehicle name from the config
"spawner.sqf",
[_marker, _x]];
} forEach _availableVehicles;
Then add this to the buildings init field:
PHP Code:
0 = [this, "MARKERNAME"] execVM "assignActions.sqf"