Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: In my MP mission , how to spawn with same weapons as before i died ?

  1. #1

    In my MP mission , how to spawn with same weapons as before i died ?

    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

  2. #2
    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.

  3. #3
    Private First Class Edoardo's Avatar
    Join Date
    Apr 13 2012
    Posts
    15
    Author of the Thread
    Works , thank you Zeewolf

  4. #4
    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?

  5. #5
    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.
    Code:
    ["w1",0] exec "weapons_respawn.sqs"
    ["w2",0] exec "weapons_respawn.sqs"
    ["w3",0] exec "weapons_respawn.sqs"
    the 2nd number after w1 there is 0 <--(zero) either choose 0 or 1
    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

  6. #6
    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

  7. #7
    Quote Originally Posted by Günter Severloh View Post
    Same script is here:

    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
    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.

    Quote Originally Posted by kierandobbin54 View Post
    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
    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.

  8. #8
    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.

  9. #9
    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.

  10. #10
    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.

Page 1 of 2 12 LastLast

Similar Threads

  1. Spawn weapons to be picked up
    By Koni in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 9
    Last Post: Aug 5 2011, 09:11
  2. Mission Makers: How Do You Spawn Your AI?
    By The Hebrew Hammer in forum ARMA 2 & OA - QUESTIONS & ANSWERS
    Replies: 3
    Last Post: May 23 2011, 03:52
  3. In Need of help:Triggering weapons to spawn on the ground
    By Requiem007 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 1
    Last Post: Nov 23 2010, 08:56
  4. have a script spawn a mission
    By joske in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 0
    Last Post: Nov 12 2009, 18:37
  5. AI spawn in Saboteur mission
    By JohnnyBoy in forum ARMA - OFFICIAL MISSIONS
    Replies: 2
    Last Post: Feb 14 2007, 09:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •