Jump to content
Sign in to follow this  
kakagoegie

detect if player is incargo

Recommended Posts

I want to get some kind of condition to fire a trigger. The trigger should be activated when player "play" is incargo of car "lin"

"play" has got into car "lin" before. So I also need something to fire the trigger if he goes incargo for the second time or so.

Share this post


Link to post
Share on other sites

Looks like you'll need the event handler getin, if it's about the cargo position. There's a good tutorial about them at ofpec.

Share this post


Link to post
Share on other sites

Might be (untested);

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(play in (crew lin))

But that detects any position. If you want just the cargo position its a little more complicated.

You using scripts or just editor stuff ?

Share this post


Link to post
Share on other sites

hmm i did one like this once.

cond :(playa in (crew lin))

use the code above to activate a trigger repeated.

in the trigger activation [playa] exec "ishein.sqs"

where ishein.sqs = :

?!(playa == driver lin):goto "hesin"

exit

#hesin

hint "workin"

this will eliminate your action from working if playa is driver. you can also add gunner pos if vheicle has one.

dont know exactly what ya want, any pos or only in cargo but there ya go.

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(play in (crew lin)) works good enough for me.

Only I have this situation now. "play" gets in "lin", than he gets out and he gets in again. How can a trigger be fired for the second time he gets in?

Share this post


Link to post
Share on other sites

make the trigger "repeadetly", then the script will be called every time the "play" gets in "lin"

Share this post


Link to post
Share on other sites

hi,

try this....

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_positions = ["driver lin","gunner lin","commander lin"]

#Start

~1

@((!(typeof vehicle play == typeof play)) && (vehicle play == lin))

_i = 0;_result = 3

While {_i < count _positions} do {if(call (_positions select _i) == play) then {_result = _i;_i = _i + 1}

~0.1

goto format["Crew_%1",_result]

#Crew_0

hint "play as driver"

goto "CheckGetOut"

#Crew_1

hint "play as gunner"

goto "CheckGetOut"

#Crew_2

hint "play as commander"

goto "CheckGetOut"

#Crew_3

hint "play as cargo"

#CheckGetOut

~1

@(typeof vehicle play == typeof play)

goto "Start"

bye

silola

Share this post


Link to post
Share on other sites
make the trigger "repeadetly", then the script will be called every time the "play" gets in "lin"

No, that's not what I mean. An other trigger has to be activated now.

ps. If somebody know the playmove command which makes a soldier use his gun to hit someone in the back, plz tell me.

Share this post


Link to post
Share on other sites

you need a counter on the trigger, so you know that when he gets in for the 2nd time, you can activate your "thing".

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  

×