Jump to content
Sign in to follow this  
chacne

how to call a script ?

Recommended Posts

I am sorry but i have searched and googled this but no answer I find seems to work

I am trying to call a script which see's 2 A-10's come to my location to 'support' me

but in the trigger I dont know what to put to 'call' the script ?

I have tried afew different things which I have seen through the forums but it doesnt seem to work, unless my script is wrong ?

please can someone advise., I would be very grateful

here is my script (which is taken from somewhere else in the forums it is not my own)

_BluforHQ = createCenter west;
_GroupCAS = CreateGroup West;

_veh1 = createVehicle ["A10_US_EP1", [(getpos player) select 0,(getpos player) select 1, 350], [], 3000, "FLY"];
_Pilot1 = _GroupCAS createUnit ["US_Pilot_Light_EP1", [0,0,1], [], 0, "CAN_COLLIDE"];
_pilot1 moveInDriver _veh1;
_veh1 FlyInHeight 350;

_veh2 = createVehicle ["A10_US_EP1", [(getpos _veh1) select 0,(getpos _veh1) select 1, 360], [], 50, "FLY"];
_Pilot2 = _GroupCAS createUnit ["US_Pilot_Light_EP1", [0,0,1], [], 0, "CAN_COLLIDE"];
_pilot2 moveInDriver _veh2;

{_x setSkill 1; _x setrank "CAPTAIN"} foreach units _GroupCAS;

_wp1 = _GroupCAS addwaypoint [position player, 0];
_wp1 setwaypointtype "SAD";
_wp1 setWaypointCompletionRadius 100;
_wp1 setWaypointSpeed "FULL";
_wp1 setWaypointBehaviour "COMBAT";

lastly does player mean who ever i control the planes will fly to or do i need a unit named player (which I have tried aswell by the way) ?

my main problem is I dont know how to call the script, I want it to be in a radio alpha kinda thing

the script is called airstrike.sqf

Edited by Chacne
to add script name

Share this post


Link to post
Share on other sites

Hi,

You can call that .sqf script by putting this in the Trigger Activation:

nul = [] execVM "scriptName.sqf";

For .sqs scripts use:

[] exec "scriptName.sqs";

_neo_

Share this post


Link to post
Share on other sites

ok thanks for great responces guys,

so i use

nul = [] execVM "airstrike.sqf";

in the on activation field then ?

adn the player is that the 'player' or the unit named player ?

Share this post


Link to post
Share on other sites

"Player" is a special variable that returns whatever unit is currently being controlled by, well, the player. In MP, it is different on every client.

Share this post


Link to post
Share on other sites

'player' is reserved for the actual 'player'.

To call it from radio there is a drop down within the trigger. Don't recall its identifier, but you'll find it if you have a look. Then just put

nub = execVM "pornhax.sqf";

in the on act. as you have

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×