Jump to content
Sign in to follow this  
Idomass

Double condition?

Recommended Posts

Hi! :greetings:

I have my WIP bomb game to Arma 3.

And in my money system i having troubles define who bought an weapon (in addaction).

I defined the guy that called the script as usual: _caller.

How can i check what is the name of the guy that bought (lets say t1 is hes name and hes money variable is tm1).

how can check if he have enough money (tm1 > 1999) and who is the guy that called the script? (maybe _Caller == t1).

And if he have no money how i can exit using exitwith {};

NOTICE : if (_caller == t1) then {if (tm1 < 1999) exitwith {};tm1 = (tm1 -2000);};<-------- i found this useless and not wotking

Buyar.sqf:

abs1 addaction ["TRG-20 (2000$)",{
_target = _this select 0;
_caller = _this select 1;
if (side _caller == blufor) exitwith {};
if (WHO IS THE GUY?) then {HE HAVE ENOUGH MONEY?};
removeallassigneditems _caller;
comment "Add items";
removeBackpack _caller;
_caller addbackpack "B_AssaultPack_Base";
_caller linkItem "ItemMap";
_caller linkItem "ItemCompass";
_caller linkItem "ItemWatch";
_caller linkItem "ItemRadio";
_caller addmagazine "30Rnd_556x45_Stanag_Tracer_Green";
_caller addmagazine "30Rnd_556x45_Stanag_Tracer_Green";
_caller addmagazine "30Rnd_556x45_Stanag_Tracer_Green";
_caller addweapon "arifle_TRG20_F";
}];

Share this post


Link to post
Share on other sites

You really don't need a check status if you are thinking what i'm thinking :) (When you die, you get a plain pistol with knife. If you have gear, you keep that but spawned back at your start pos...CSGO style)

If the person is dead, set his respawn to instant and do a "get marker pos" and "setDir" code within your file.

If the person is alive, just do a "getMarkerPos" and "setDir".

I am not on arma at the moment for the above, but its recommended that you would take a look at my mission as previously said. It will help and answer your question indefinently

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  

×