Jump to content
Sign in to follow this  
-FW- Shaanguy

addaction problem

Recommended Posts

i want to see, if a player get near "Land_Money_F", then they get a addaction, like in the wasteland.

Here is the script that i used:

PickupIDS = [];

PickupIDS = PickupIDS + [player addAction["<img image='icons\money.paa' width='32' height='32'/> Pickup Money", "client\actions\pickup_money.sqf", [], 1, false, false, "", 'player distance (nearestobjects [player, ["Land_Money_F"],  5] select 0) < 5']];

this works in Singleplayer, but when i go to multiplayer, when i go near a "Land_Money_F" i can see the addaction, and the problem is the other players cannot see the addaction. Only i can see?,

i want all the players to see that addaction, in every "Land_Money_F", like in Wasteland, anyway the script i used its also copied from wasteland, it does not work. :butbut:

Share this post


Link to post
Share on other sites

Sounds like something is preventing it from either loading or running on the Client machines.

I would suggest checking the mission's path from init to code and make sure there is no "if (isServer)" or "if (isDedicated)" preventing the Clients from running it or running the script.

Share this post


Link to post
Share on other sites
Sounds like something is preventing it from either loading or running on the Client machines.

I would suggest checking the mission's path from init to code and make sure there is no "if (isServer)" or "if (isDedicated)" preventing the Clients from running it or running the script.

i didn't use "if (isServer)" or "if (isDedicated)" in my mission, i only wrote this in my init.sqf

_____init.sqf_____

PickupIDS = [];

PickupIDS = PickupIDS + [player addAction["<img image='icons\money.paa' width='32' height='32'/> Pickup Money", "client\actions\pickup_money.sqf", [], 1, false, false, "", 'player distance (nearestobjects [player, ["Land_Money_F"],  5] select 0) < 5']];

:confused::confused::confused::confused::confused::confused::confused:

-----

I have made another mission for a test, i just only wrote that script, and start in on Multiplayer lan, to test. It does not work

Share this post


Link to post
Share on other sites

Maybe this(?)

PickupIDS = [];

PickupIDS = PickupIDS + [player addAction["<img image='icons\money.paa' width='32' height='32'/> Pickup Money", "client\actions\pickup_money.sqf", [], 1, false, false, "", 'player distance (nearestobjects [player, ["Land_Money_F"],  5] select 0) < 5']];

https://community.bistudio.com/wiki/addAction

In the 'title' it might be the XML syntax interpreting < >.

Edited by OpusFmSPol

Share this post


Link to post
Share on other sites

I wouldn't use player in the condition field, this could lead to unwanted results, use _target instead:

count (nearestobjects [_target, ["Land_Money_F"],  5]) != 0

Another (and more easy way) would be assigning the action to the objects itself ("Land_Money_F") and using _target and _this to perform your script.

That would be also the more effective way, because assigning an action to a player will check the condition on every frame, whereas assigning the action to a stationary object will check it only if there's a player in the vicinity.

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  

×