Jump to content
Sign in to follow this  
1para{god-father}

addaction and JIP

Recommended Posts

OK been trying to get this to work for ages but having no luck with JIP does anyone have a working addaction for JIP on a dedi

I have tried all sorts of things but have no luck so far

This is what I have, which works but not for JIP it is a side mission so comes up during the mission.

init.sqf

fnc_unitinit= {_this addaction ['Capture', 'scripts\capture.sqf', [],1,false,true,'',''];}; 

SideRescue.sqf

if(not isServer) exitWith{};
sleep 5;
_location = AO_locations call BIS_fnc_selectRandom;
_pos = (position _location);
_locationName = (text _location);
AO_locations = AO_locations - [_location];
_grp = createGroup WEST;
_TAG_pilot = _grp createUnit ["B_Helipilot_F", _pos, [], 0, "FORM"];
_TAG_pilot setCaptive true;
_TAG_pilot allowDamage false;
_TAG_pilot setHit ["hands",1];
_TAG_pilot setHit ["head_hit",0.4];
_TAG_pilot setHit ["body",0.5];
_TAG_pilot playMoveNow "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
_TAG_pilot disableAI "MOVE";
_TAG_pilot disableAI "ANIM";
removeAllWeapons _TAG_pilot;
[_TAG_pilot, "fnc_unitinit", true, true] spawn BIS_fnc_MP;   //  works but not for JIP 
........
...



Can anyone please help thanks !

Share this post


Link to post
Share on other sites

try something like - (not tested)

[[[_TAG_pilot],"fnc_unitinit"],"BIS-Fnc_spawn",true,true] spawn BIS_fnc_MP;

i think its a matter of the function (name) not being sent to the client when he joins. Not that the client doesnt know about the fnc_unitinit (as this is loaded up in your init.sqf).

Share this post


Link to post
Share on other sites

I use:

_VehAction = _Veh addAction ["Unload","[[_this,'Logistics\Detach.sqf'],'BIS_fnc_execVM',true,true] spawn BIS_fnc_MP",[_Veh,_tar]];

in a script to add my actions to a vehicle for everyone, and make it work in JIP too.

To add the action to a vehicle so that anyone can use it. You just need to use the BIS_fnc_execVM to run a script that creates that on every client.

Share this post


Link to post
Share on other sites

Hmmm works fine in MP , but does not even give me the option on our Dedi ?

_grp = createGroup WEST;
_TAG_pilot = _grp createUnit ["B_Helipilot_F", _pos, [], 0, "FORM"];
_TAG_pilot setCaptive true;
_TAG_pilot allowDamage false;
_TAG_pilot setHit ["hands",1];
_TAG_pilot setHit ["head_hit",0.4];
_TAG_pilot setHit ["body",0.5];
//_TAG_pilot playMoveNow "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
_TAG_pilot disableAI "MOVE";
_TAG_pilot disableAI "ANIM";
removeAllWeapons _TAG_pilot;
_pilotAction = _TAG_pilot addAction ["Rescue Pilot","[[_this,'scripts\capture.sqf'],'BIS_fnc_execVM',true,true] spawn BIS_fnc_MP",[_TAG_pilot]];

Share this post


Link to post
Share on other sites

It worked fine on a dedi for me and my clan when using it as part of a logistics script I wrote.

The reason I think it works in MP but not on a dedi is because you are adding the action to the pilot, but not everyone will have the reference (otherwise you will end up with lots of pilots). So you might want to create the pilot via a script, and then in his init call a script that then adds the script for everyone, instead of having the action added in with the spawning. (use the bis_fnc_mp to call that script) That should get around the reference not being passed.

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  

×