Jump to content
Sign in to follow this  
jubbie

Shoot and scoot

Recommended Posts

Hi all

I'm making a mission that lets one player emplace and then remove a static weapon using two addactions. I have the scripts working fine except when I deploy a second time, I get extra addactions that shouldn't be there.

I have the following scripts:

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

"gunup.sqs"

gun setpos [(getpos player select 0),(getpos player select 1)+2];

player removeaction 0;

player addaction ["Stow weapon", "gundown.sqs"]

and

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

"gundown.sqs"

gun setpos getmarker pos "hide";

player removeaction 0;

player addaction ["Deploy gun", "gunup.sqs"]

Any idea why the addactions keep coming back even though I call for them to be removed before the opposite addaction is supposed to kick in?

Thanks for any help

Share this post


Link to post
Share on other sites

The action index number (0) increases everytime.

Use global variables to update the action index number:

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

actionstop = player addaction ["Stow weapon", "gundown.sqs"]

player removeaction actionstop

actiondeploy = player addaction ["Deploy gun", "gunup.sqs"]

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  

×