I am trying to call a generic base protection script from a sensor in mission.sqm but cannot get the params working.
Exerpt from mission.sqm:
// Sun base
class Item10
{
position[]={10625,30,9182};
a=50;
b=50;
activationBy="WEST";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="base_generic";
expCond="(vehicle player) in thislist;";
expActiv="base_generic = ['Sun',['123456789']] execVM ""markers\base_generic.sqf"";";
expDesactiv="terminate base_generic; titleText [""You left the base."", ""PLAIN DOWN"", 5];";
class Effects{};
};
It seems expActive is not calling base_generic.sqf
Target sqf:
//Base Protection by Sun (based on code by ZSquad)
//private["_c","_ownerName","_owners","_owner","_visitorUID"]; //is this required?
_c = count _this;
if(_c < 1) exitWith { cutText[format["Base_Generic Error: _this params count = %1,_c],5]; };
_ownerName = _this select 0;
_owners = _this select 1;
_owner = _owners select 0;
_visitorUID = getPlayerUID player;
//Default
_canEnter = false;
titleText [format["SCANNING RETINA: %1", _ownerName], "PLAIN", 5];
sleep 5;
if (_visitorUID in _owners) then { _canEnter = true; };
// friendly to owner?
if(_visitorUID != _owner) then
{
_friendlies = _visitorUID getVariable ["friendlyTo",[]];
if(_owner in _friendlies) then {
_canEnter = true;
};
};
//Is Admin?
if (_visitorUID in FastBuilding) then { _canEnter = true; };
sleep 5;
if (_canEnter) exitWith {
titleText [format ["Access Granted: %1", name player], "PLAIN", 10];
};
// Access denied to all others
titleText ["RESTRICTED AREA - NO ACCESS!", "PLAIN", 5];
sleep 5;
titleText ["YOU HAVE 15 SECONDS TO LEAVE!", "PLAIN", 5];
sleep 5;
titleText ["YOU HAVE 10 SECONDS TO LEAVE!", "PLAIN", 5];
sleep 5;
titleText ["YOU HAVE 5 SECONDS TO LEAVE!", "PLAIN", 5];
sleep 5;
titleText ["REST IN PEACE...", "PLAIN", 5];
sleep 2;
player setPos[16492,18312,0]; // PVP Island 1
Thx in advance for looking at this!
Any thoughts?
@nedfox: folders should be correct, it's all client-side relative to root (vilayercustomcode folder). I already have working player-specific files in there.
The point of my efforts here is to get a generic routine working so I don't have to make a specific .sqf for every new player base with UID's etc.
@KiloSwiss: I have looked at triggers for other purposes but I'm not that advanced.
I suspect -
1/ the params need to be double or triple quoted? or
2/ the mission.sqf was never intended to pass params in this way.
UPDATE: At last I found the error - double quotes in the right places did it. Thx for input guys.