Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Mirek

Adding weapon to player in the trigger by the trigger

Recommended Posts

Hallo ,

I have an multiplayer training map with obstacle course with a target.

iam triing to get trigger that will add an weapon and magazine with 3 bullets, to player who steps in to the trigger on the start of the obstacle course, but not to the other players around.

First i tried to add

player addMagazine ["30Rnd_556x45_Stanag",3]; player addWeapon "ukf_L85A2"; hint "weapon added \nreload your weapon\nif weapon doesnt work press F few times"

But it added the weapon to everyone.

then i tried

if (isServer) then {player addMagazine ["30Rnd_556x45_Stanag",3]; player addWeapon "ukf_L85A2"; hint "weapon added \nreload your weapon\nif weapon doesnt work press F few times"};

But that adds the weapon to me (iam a host) but not to anyone else not even to the guy who stepped to the trigger.

So how do i tell the trigger that i want it to add the weapon only to the guy who activated the trigger?

Edited by Mirek
Clearing things out.

Share this post


Link to post
Share on other sites

Can't you just name the unit, add the units name in the code instead of player. Or is this online with human players and whoever triggers it first gets the weapon?

Share this post


Link to post
Share on other sites

It is online. it is training map and i want any player who enters the triger to get the weapon. but not the players who are not in the triger. There is no AI.

note:First post updated to prevent further misunderstanding.

Edited by Mirek

Share this post


Link to post
Share on other sites

No, but i will thank you.

Edit:

OK i figured it out in the end.

I put a trigger for BLUFOR PRESENT, then i put a baseball called ttt1 in the middle of the trigger area, and then i put folowing to the trigger init:

 {_x addMagazine ["30Rnd_556x45_Stanag",3] } forEach nearestObjects [ttt1, ["man"],2];   {_x addWeapon "ukf_L85A2" } forEach nearestObjects [ttt1, ["man"],2];     hint "weapon added \nreload your weapon\nif weapon doesnt work press F few times"

Thank you WIKI!!

Edited by Mirek
Conclusion

Share this post


Link to post
Share on other sites
Sign in to follow this  

×