Jump to content
Sign in to follow this  
sneakysix

Search dead body script

Recommended Posts

Hi,

I used to have a mission where you can search a dead body and the addaction appears only when the soldier is dead and your are near the dead body, (appears Search body).

The problem im having is Ive pulled apart a few scripts and made something that once unit is dead the addaction appears but the distance shows up about 30m away where i want it to appear only when 1m away. How do I do this? I played with variables and cant seem to get it to work.

Has anyone got a script example to post, and i can paste it into a my own script. Be much appreciated, thank you.

Share this post


Link to post
Share on other sites

--> init.sqs <--

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

[] exec "check.sqs";

action_activated = false;

--> check.sqs <--

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#loop

_people = nearestObjects [player, ["Man"], 2]

_man = _people select 0

? (!alive _man) : goto "check"

? (count _people < 1) goto "none"

#check

? (action_added) : goto "loop"

_search_ac = _man addAction ["Search for Weapons", "search.sqs"];

action_added = true

#none

action_added = false;

player removeAction _search_ac

~1

goto "loop"

Im sorry if this does not work, I do not like .sqs and am unable to test this at the moment. I could do it in .sqf, but that does not work in OFP sad_o.gif

Share this post


Link to post
Share on other sites

thank you biggrin_o.gif

Sweet now the recon team can search dead infantry as part of their routines, ooh look enemy base at grid blah blah hehe,

thats great,thx for your helpp knowledge. notworthy.gif

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  

×