OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: TH on 01 Jul 2004, 23:30:02

Title: Respawn without weapons
Post by: TH on 01 Jul 2004, 23:30:02
is there a simple way to do this from within the editor? i tried the weapons respawn scripts from the depot but the only 1 that fits what i want has a corrupt zip file:/. I want all players to respawn without any weapons.
Title: Re:Respawn without weapons
Post by: ponq on 02 Jul 2004, 10:12:13
add this to the units init field:
this addEventHandler ["killed",{removeallweapons _this}]

I've heard eventhandlers aren't very good in MP, but I'd say give it a shot.
Title: Re:Respawn without weapons
Post by: Terox on 02 Jul 2004, 17:16:10
quicker to just add the eventhandler to the init.sqs, one line does it all for all players then

INIT.sqs

Player addEventHandler ["killed",{removeallweapons Player}]
Title: Re:Respawn without weapons
Post by: TH on 02 Jul 2004, 21:32:17
er, i get an error when the first guy dies, removeallweapons _this
Title: Re:Respawn without weapons
Post by: ponq on 02 Jul 2004, 22:44:04
tested it myself, in the units init field in the editor:
Code: [Select]
this addEventHandler ["killed",{removeallweapons s1}] Just name all the players. In the above case, the player name (in the editor) is s1.
The 2nd one s2 (and change the code accordingly).

_this and this didn't work for me (either got your error, or the weapons weren't removed).

gl.
Title: Re:Respawn without weapons
Post by: TH on 02 Jul 2004, 22:57:10
 8) works now thx ponq ;D