Jump to content
Sign in to follow this  
kocrachon

AddAction script help.

Recommended Posts

@Partyhead

addaction is local, so if you place this in top of your script, before you add the actions:

if ((getPlayerUID player) != "1234567") exitWith {};

only the player with the puid "1234567" will see the action, you can also use:

if (unit1 != player) exitWith {};

now only the player that controls the unit named unit1 in editor can see the action.

also here is link to addaction, wich you find more info on using special conditions, wich is very helpful with actions, all info is in there.

Share this post


Link to post
Share on other sites
@Partyhead

addaction is local, so if you place this in top of your script, before you add the actions:

if (unit1 != player) exitWith {};

now only the player that controls the unit named unit1 in editor can see the action.

@Demonized

Thanks mate i did this and it seems to work.

_vehicle = _this select 0;
_side = _this Select 1;

if (_side == EAST) then
{
[color="Red"]if (squadLeaderEast != player) exitWith {};[/color]
hqe = _vehicle addAction ["Head Quarters Menu", "module\menu_items\HQ_east_dialog.sqf"];
};

if (_side == WEST) then
{
[color="Red"]if (squadLeaderWest != player) exitWith {};[/color]
hqw = _vehicle addAction ["Head Quarters Menu", "module\menu_items\HQ_west_dialog.sqf"];
};

Do i also add this aswell like this ?

[color="Red"]if ((isServer) && !(local player)) exitwith {};[/color]

_vehicle = _this select 0;
_side = _this Select 1;

if (_side == EAST) then
{
if (squadLeaderEast != player) exitWith {};
hqe = _vehicle addAction ["Head Quarters Menu", "module\menu_items\HQ_east_dialog.sqf"];
};

if (_side == WEST) then
{
if (squadLeaderWest != player) exitWith {};
hqw = _vehicle addAction ["Head Quarters Menu", "module\menu_items\HQ_west_dialog.sqf"];
};

Share this post


Link to post
Share on other sites

no you dont need that, the player is unit check will exclude all else on its own, also you just can do it above the lines, instead of for each action, this would work just as fine.

_vehicle = _this select 0;
_side = _this Select 1;

if (squadLeaderEast != player) exitWith {};
if (_side == EAST) then {
hqe = _vehicle addAction ["Head Quarters Menu", "module\menu_items\HQ_east_dialog.sqf"];
};

if (_side == WEST) then {
hqw = _vehicle addAction ["Head Quarters Menu", "module\menu_items\HQ_west_dialog.sqf"];
};

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  

×