Jump to content
Sign in to follow this  
nullsystems

Add/Remove weapons in MP not working

Recommended Posts

Once again, it works in SP.

Im sick of locality entirely, it ruins my life lol.

Any idea why nothing happens in MP ?

Trigger:

Cond: alive A1

onAct: [A1] exec "weapons.sqs"

weapons.sqs

------------

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

? not local server : exit;

_play = _this select 0

removeallweapons _play

_play addmagazine "15Rnd_9x19_M9"

_play addmagazine "15Rnd_9x19_M9"

_play addmagazine "15Rnd_9x19_M9"

_play addmagazine "15Rnd_9x19_M9"

_play addmagazine "15Rnd_9x19_M9"

_play addmagazine "15Rnd_9x19_M9"

_play addmagazine "15Rnd_9x19_M9"

_play addmagazine "15Rnd_9x19_M9"

_play addWeapon "M9"

exit

Share this post


Link to post
Share on other sites

Is A1 a player unit?

If so, you have your locality all backwards. You are basically exiting the script unless it is NOT the player

Furthermore, with the IsServer command, I think we can all go beyond the server "logic" workaround.

edited for typo

Share this post


Link to post
Share on other sites

You must filter out the the rest or the players at the start of the script somehow before you addmagazines/weapons or anything.

The only trick I can think of offhand is the one Doolittle mentioned in earlier post.

The client who starts the activate should be the first to fire the script since its happening on their machine first and there will be network lag. So the first machine to fire the script SHOULD be the correct client.

RemovWeaps = 0 (init on all Machines)

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

;AddWeaps.sqs

? RemovWeaps != 0: exit

? RemovWeaps == 0: RemovWeaps = 1

PublicVariable "RemovWeaps"

Add the weapons as is. Then wait a time and set the RemovWeaps value back to 0 and Publicvariable it to finish so its ready for next time.

So the first machine to run the script should be the only machine to run the script. once it gets in it closes the door for the rest. All the late machines should get the 1 value and exit and the filtering is done.

This is not the cleanest best way to do things IMO but it is a method that has worked in the past and it is clever. Just might have unpredictable results. I havent tried it yet myself. Let me know how it works out.

Share this post


Link to post
Share on other sites
The only trick I can think of offhand is the one Doolittle mentioned in earlier post.

That was for the radio thing, actually..

Share this post


Link to post
Share on other sites
Hmm, I removed the first line ? not, etc.

Worked fine lol

what you should have had was:

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

? not (A1 = player) : exit

Share this post


Link to post
Share on other sites

Ah, thanks wink_o.gif

But I dont have seperate scripts for each A1,a2,a3, etc. Just one script...and different triggers. So it'll be ok. smile_o.gif Thanks agian guys

Share this post


Link to post
Share on other sites

I am trying to remove the weapons and ammo from the civillian trucks (Urals).

removeAllWeapons man1

works fine on players, but not on vehicles. sad_o.gif

Tried

removeAllWeapons car5

Any help apperciated.

Share this post


Link to post
Share on other sites
I am trying to remove the weapons and ammo from the civillian trucks (Urals).

removeAllWeapons man1

works fine on players, but not on vehicles. sad_o.gif

Tried

removeAllWeapons car5

Any help apperciated.

Try clearWeaponCargo and clearMagazineCargo

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  

×