Results 1 to 3 of 3

Thread: Respawn with Weapons

Hybrid View

  1. #1
    Private First Class
    Join Date
    Oct 8 2005
    Location
    Berlin, Germany
    Posts
    25
    Hi,

    i have a question. I want to make a mission 4 ofp. When i got killed and then got respawned.. i always get the m16 or ak74... how can i give a soldier another weapon after he will be respanwed.

  2. #2
    Try this "Kit.sqs"

    Quote Originally Posted by [b
    Quote[/b] ];Universal Weapons Respawn Script v1.02 (December 4, 2002)
    ;Required Version: 1.85
    ;by toadlife and Hamdinger
    ;toadlife@toadlife.net
    ;intialize like this: ["unitname",0] exec "thisscript.sqs"
    ; Or this: ["unitname",1] exec "thisscript.sqs"
    ;
    ; * "unitname" = The name of the player the script runs on (must be enclosed by quotes&#33
    ; * 0/1 = method of repleneshing weapons
    ; **if method is 0, the player gets the same weapons he stated out with every time
    ; **if method is 1, the player gets the same weapons he had when he died

    requiredVersion "1.85"
    _name = _this select 0
    _method = _this select 1

    _unit = call format["%1",_name]
    ?(_method == 0):_guns = weapons _unit;_mags = magazines _unit;_guncount = count weapons _unit;_magcount = count magazines _unit

    #checklocal
    _unit = call format["%1",_name]
    ?local _unit:goto "respawnloop"
    ~(1 + (random 3))
    goto "checklocal"

    #respawnloop
    @!alive _unit
    ?(_method == 1):_guns = weapons _unit;_mags = magazines _unit;_guncount = count weapons _unit;_magcount = count magazines _unit
    @alive call format["%1",_name]
    _unit = call format["%1",_name]
    _unit removemagazines (magazines _unit select 0)
    _unit removeweapon (weapons _unit select 0)
    _c = 0
    while "_c <= (_magcount - 1)" do {_unit addmagazine (_mags select _c); _c = _c + 1}
    _c = 0
    while "_c <= (_guncount - 1)" do {_unit addweapon (_guns select _c); _c = _c + 1}
    @weapons _unit select 0 == (_guns select 0)
    _unit selectweapon primaryweapon _unit
    goto "respawnloop"

  3. #3

Posting Permissions

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