Home   Help Search Login Register  

Author Topic: Weapons and Vehicles disappear after respawn  (Read 2037 times)

0 Members and 2 Guests are viewing this topic.

JPSelter

  • Guest
Weapons and Vehicles disappear after respawn
« on: 31 Aug 2005, 14:39:34 »
This is really strange: I made a simple multiplayer mission. At the respawn site I have an empty truck (5t BWMod), an empty Mi-17 helicopter and 3 soldiers on my side. When I test the respawn and kill 2 soldiers they shoot me and I respawn after 10 seconds... so far so good... but then the Mi-17 has disappeared but the truck is still there. I also lost my G36 and got the standard rifle. What is wrong?

JPSelter

  • Guest
Re:Weapons and Vehicles disappear after respawn
« Reply #1 on: 31 Aug 2005, 14:57:08 »
LOL please donÂ't slap me! The chopper disappeared because it rolled down the hill into the sea behind my back... I was looking at my mates :D

So please forget about about the "disappearing" vehicles :D But I still lose my G36 after respawning. My default soldier type is BWMod Squad Leader.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Weapons and Vehicles disappear after respawn
« Reply #2 on: 31 Aug 2005, 15:36:01 »
I would guess that you respawn with the default weapon of the default BWmod squad leader, am I correct? When you respawn, you need to change the weapon manually if you want a different one than the default selection.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

JPSelter

  • Guest
Re:Weapons and Vehicles disappear after respawn
« Reply #3 on: 31 Aug 2005, 17:25:18 »
Hmmmm I start the mission as a default squad leader. I have a G36, hand granates and a binocular. When I kill myself and respawn I have only the standard M16, no hand granates and no binocular. IÂ'm able to pick up the "old" weapons but that doesnÂ't make sense. So why are my weapons gone after a respawn? A bug? Do I need to configure my weapons loadout somewhere else?

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Weapons and Vehicles disappear after respawn
« Reply #4 on: 31 Aug 2005, 18:22:32 »
using a killed eventhandler attached to all Playersl run the following code

INIT.sqs
Quote
tx_weapons = weapons player
tx_ammo = ammunition player
tx_prim = primaryweapon player
player addEventHandler ["killed", {_this exec "respawn.sqs"}]


Respawn.sqs
Quote
player removealleventhandlers "Killed"

@ alive player
removeallweapons player
player addEventHandler ["killed", {_this exec "respawn.sqs"}]

{player addMagazine _x} forEach tx_ammo
{player addWeapon _x} forEach tx_weapons
player selectWeapon tx_primary

this will reload the player with the weapons he started with ingame

if you want the weapons the unit died with, then that can also be done by:

a) remove all the lines except the addeventhandler "killed" in ther INIT.sqs

and add them to just before the "@ alive Player" line in the respawn.sqs
If this system is used then you can change the variable names from global to local

eg from
tx_weapons
to
_weapons

Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

JPSelter

  • Guest
Re:Weapons and Vehicles disappear after respawn
« Reply #5 on: 31 Aug 2005, 19:56:02 »
Phew... this goes deep into programming. I did create these two files and inserted the code into them. In the mission editor I gave my player the name "player". But when I start the mission I get the error "tx_ammunition |#|player" - unknown operator player". Is your above syntax correct? Are any ; or " missing?

JPSelter

  • Guest
Re:Weapons and Vehicles disappear after respawn
« Reply #6 on: 01 Sep 2005, 14:37:31 »
I tested a bit more and came to this: Everything in init.sqs and respawn.sqs is working except for line 2 in init.sqs

"tx_ammo = ammunition Player" --> unknown operator |#|Player

So why is tx_weapons working but not tx_ammo? Now I have my G36 and my binoculars back after respawn, but with no ammunition.

JPSelter

  • Guest
Re:Weapons and Vehicles disappear after respawn
« Reply #7 on: 01 Sep 2005, 15:15:13 »
OK, I found the error... itÂ's magazines not ammunitions. And tx_prim has to be tx_primary. Thanks though, itÂ's working now :)

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Weapons and Vehicles disappear after respawn
« Reply #8 on: 01 Sep 2005, 16:31:36 »
sorry about syntax errors m8, I wrote the code on the fly
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

JPSelter

  • Guest
Re:Weapons and Vehicles disappear after respawn
« Reply #9 on: 01 Sep 2005, 23:09:10 »
No problem :)