Please , i need to know how to respawn with the same weapons i died ( i use Hunting rifle + CZ75 + Law launcher ) but when i respawn i have only an Ak47 with 30 rounds..
Thanks for any help![]()
Please , i need to know how to respawn with the same weapons i died ( i use Hunting rifle + CZ75 + Law launcher ) but when i respawn i have only an Ak47 with 30 rounds..
Thanks for any help![]()
Try this classic script
Put the weapon_respawn.xsqs script in your mission folder (I also suggest changing the extension back to .sqs while you're at it).
In your init.sqs script or the init line of the unit in the editor put: [Name of unit,1] exec "weapon_respawn.xsqs", where Name is what you've put in the unit's Name field in the editor. The second argument can be 0 or 1. 0 means the unit gets the weapons and magazines they had when the mission started, 1 means they get the weapons/magazines they had when they died.
E.g. ["W1",1] exec "weapon_respawn.xsqs". For the unit named W1.
I tried this script zeewolf and it doesn't work for me :S, ive looked at the information in the files but nothing, What i did is name my unit "w1" okay then on the init file ive got " ~0.01
["w1",1] exec "weapons_respawn.sqs" and nothing happens, have I left something out?
Same script is here:
http://www.armaholic.com/page.php?id...RESPAWN+SCRIPT
I use it myself all the time and works for me np.
Look below, for every person that is playing add this code, and just give each person a name,
for example I'll use W1 for the 1st guy, and then W2 for the 2nd and so forth.
Put the code in the init line of each solider that is going to play.
the 2nd number after w1 there is 0 <--(zero) either choose 0 or 1Code:["w1",0] exec "weapons_respawn.sqs" ["w2",0] exec "weapons_respawn.sqs" ["w3",0] exec "weapons_respawn.sqs"
if you choose 0 then when you die you will get the same weapon and ammo ect, you started with.
If you choose 1 then you will respawn with the weapons and ammo you had last.
For the script itself just place in your folder of the mission, obviously it will be an mp missions so it needs to be i this folder address:
C:\Documents and Settings\username\My Documents\ArmA 2\MPMissions
Any questions about importing missions into the editor, or files related to it, then refer to my tutorial in my sig.
Hosting Missions for Invasion-1944, Iron Front: Liberation 1944, & Hell in the Pacific
WarMod Series - Massive Addon & Mod Customizable Compilation Mods for Arma1, Arma2, & Arma2CO
WarMod | A2WarMod |A2WarModACE | COWarMod | COWarModACE | COWarModI44 |COSLX
-=///Unofficial Iron Front Fan Forums\\\=-
when I try and load the mission up it comes up saying "script weapons_respawn.sqs" can not be found? any idea why that is?
Thank you for helping me with this matter![]()
I'm amazed people are still using versions of this script for Arma 2, it's a good example of dynamic code generation but it isn't the most efficient or best written implementation.
The error means it can't find a script by that file name.
Is there a script with that file name in your mission's folder? Your mission folder would be in Operation Flashpoint\Users\profile name\MPMissions\mission name.island name (assuming you're using OFP not Arma:CWA).
Check the file name extension is correct, for some reason the version on OFPEC is using the extension .xsqs. When it really should be .sqs so either rename the file extension to .sqs or change the exec call to the .xsqs.
Yeah im using it for ofp, the file name is "weapons_respawn.xsqs" and in my units int ive put "["w1",0] exec "weapons_respawn.xsqs" and still comes up with that problem, ive tryed it without the xsqs and put sqs.
W1 is just the name of the unit or soldier, be sure to name the unit or soldier w1 too or it wont work.
the name can be anything not w1, I just use that as its small less to type in the editor.
Here's a demo mission with that script working. It's pretty barebones but it has a timer script and outros, as well as selectable loadouts in the briefing. Basically all the background stuff needed for an infantry mission. There's no vehicle respawning or game mode scripting included since that might be confusing if you're just trying to get infantry respawn with weapons working.
If you're still having issues zip up the mission folder and upload it somewhere we will take a look.
Last edited by *Zeewolf*; Jul 21 2012 at 10:10.