Jump to content

Recommended Posts

I have a trigger that had this on activation:

 

{[_x] execVM "rearm.sqf"} foreach thislist;

 

// Written by Weasel [PXS] - andy@andymoore.ca

 

// This script rearms, refuels, and repairs vehicles.

// Vehicles must be less than height 2 (typically landed, if air vehicles) and must remain in the

// trigger area for 3 seconds. It then drains all fuel, repairs, rearms, and refuels.

//

// Setup a trigger area to activate this (F3 in map editor) with the following settings:

//

// Trigger REPEATEDLY, BLUFOR, PRESENT

// Name: Rearmlist

// Condition: this;

// Activation: {[_x] execVM "rearm.sqf"} foreach thislist;

// 

// Warning: If this trigger area overlaps another trigger area (such as ammo-transport Scripts), sometimes

// things don't work as planned. Keep this seperate if you can.

 

_unit = _this select 0;

 

// Don't start the script until the unit is below a height of 2, and make sure they hold that 

// height for at least 3 seconds.

WaitUntil{(getPos _unit select 2)<2}; 

sleep 3;

if((getPos _unit select 2)>2) exitWith{};

WaitUntil{speed _unit < 2};

sleep 3;

if(speed _unit > 5) exitWith{};

 

// Make sure unit is inside one of these lists (trigger areas)

if( not (_unit in list rearmlist1)) exitWith{};

 

 

 

_unit setFuel 0;

_unit VehicleChat "Repairing...";

sleep 2;

_unit setDammage 0;

_unit VehicleChat "Rearming...";

sleep 2;

_unit setVehicleAmmo 1;

_unit VehicleChat "Refueling...";

sleep 2;

_unit setFuel 1;

_unit VehicleChat "Finished.";

 

if(true) exitWith{};

 

It works in SP but not on my dedicated server. What can i do?

Share this post


Link to post
Share on other sites

those commands need to run on the machine where the vehicle is local.
I assume player is the driver so vehicle is local to client and not to server but triggers run at server

Share this post


Link to post
Share on other sites

those commands need to run on the machine where the vehicle is local.

I assume player is the driver so vehicle is local to client and not to server but triggers run at server

I should point out that it works on local mp.

Btw, the trigger activation line only has this:

{[_x] execVM "rearm.sqf"} foreach thislist;

Share this post


Link to post
Share on other sites

I should point out that it works on local mp.

Completely different story.

 

You should probably do some research on multiplayerscripting in arma. It'll come in handy.

 

 

 

Anyhow, here is a simple fix:

{ [[_x],"rearm.sqf"] remoteExec ["execVM",_x,false] } forEach thisList;

That makes sure the execvm happens only where the vehicle is local.

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

×