Jump to content

Recommended Posts

Hi everyone Arma's gamers. Could you help me please with "removeAction" command. I have tired finding the way out for this script .
Here is the code : 

Init.sqf

mhq = "C_Offroad_01_F" createVehicle  getMarkerPos "mk1";
deploy = [[mhq,["Deploy MHQ",{execVM "mhq.sqf"} ]],"addAction",true] call BIS_fnc_MP;

mhq.sqf

marker1 = createMarker ["respawn_guerrila1", position mhq];
marker1 setMarkerType "Empty";
marker1 SetMarkerPos GetPos mhq;

mhq removeAction deploy; // won't working !
mhq removeAllActions; // won't working also !
undeploy = [[mhq,["UnDeploy MHQ",{execVM "undeploymhq.sqf"} ]],"addAction",true] call BIS_fnc_MP; 

mhq removeAction deploy , mhq removeAllActions and i not sure , is this commands are compatible in MP and working for clients too.

 Thank you .

Share this post


Link to post
Share on other sites

I doesn't work because mhq is not the name of the vehicle. It's the name of "C_Offroad_01_F" createVehicle getMarkerPos "mk1";

 

Set the vehicle name when it spawn. Not tested :

mhq = "C_Offroad_01_F" createVehicle getMarkerPos "mk1";
deploy = [[mhq,["Deploy MHQ",{execVM "mhq.sqf"} ]],"addAction",true] call BIS_fnc_MP;
mhq SetVehicleVarName vehicle_name; // set the name
marker1 = createMarker ["respawn_guerrila1", position mhq];
marker1 setMarkerType "Empty";
marker1 SetMarkerPos GetPos mhq;

vehicle_name removeAction deploy;
undeploy = [[mhq,["UnDeploy MHQ",{execVM "undeploymhq.sqf"} ]],"addAction",true] call BIS_fnc_MP; 

Share this post


Link to post
Share on other sites

I doesn't work because mhq is not the name of the vehicle. It's the name of "C_Offroad_01_F" createVehicle getMarkerPos "mk1";

 

That's wrong.

You might wanna read this.

 

The addAction ID is passed to the code field as (_this select 2).

For removing the action upon activation, simply use this line:

deploy = [[mhq,["Deploy MHQ",{(_this select 0) removeAction (_this select 2);execVM "mhq.sqf"} ]],"addAction",true] call BIS_fnc_MP

Cheers

Share this post


Link to post
Share on other sites

 

I doesn't work because mhq is not the name of the vehicle. It's the name of "C_Offroad_01_F" createVehicle getMarkerPos "mk1";

 

Set the vehicle name when it spawn. Not tested :

mhq = "C_Offroad_01_F" createVehicle getMarkerPos "mk1";
deploy = [[mhq,["Deploy MHQ",{execVM "mhq.sqf"} ]],"addAction",true] call BIS_fnc_MP;
mhq SetVehicleVarName vehicle_name; // set the name
marker1 = createMarker ["respawn_guerrila1", position mhq];
marker1 setMarkerType "Empty";
marker1 SetMarkerPos GetPos mhq;

vehicle_name removeAction deploy;
undeploy = [[mhq,["UnDeploy MHQ",{execVM "undeploymhq.sqf"} ]],"addAction",true] call BIS_fnc_MP; 

Unfortunately  :unsure: 

I'v try the following code :

marker1 = createMarker ["respawn_guerrila1", position mhq];
marker1 setMarkerType "Empty";
marker1 SetMarkerPos GetPos mhq;
mhq SetVehicleVarName "mbase";
mbase removeAction deploy; 
undeploy = [[mhq,["UnDeploy MHQ",{execVM "unmhq.sqf"} ]],"addAction",true] call BIS_fnc_MP;

Share this post


Link to post
Share on other sites

That's wrong.

You might wanna read this.

 

The addAction ID is passed to the code field as (_this select 2).

For removing the action upon activation, simply use this line:

deploy = [[mhq,["Deploy MHQ",{(_this select 0) removeAction (_this select 2);execVM "mhq.sqf"} ]],"addAction",true] call BIS_fnc_MP

Cheers

Thank you alot , it works perfect . You saving  me from sleepable night :D

I am used a following code ;

 

Init.sqf

mhq = "C_Offroad_01_F" createVehicle  getMarkerPos "mk1";
deploy = [[mhq,["Deploy MHQ",{(_this select 0) removeAction (_this select 2);execVM "mhq.sqf"} ]],"addAction",true] call BIS_fnc_MP;

Its removed the Action an fired " mhq.sqf "


  • Like 1

Share this post


Link to post
Share on other sites

My bad, sorry !

No problem , Thank you any way , You at least tried to help :)

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

×