Results 1 to 6 of 6

Thread: delete Weaponholder in mission

  1. #1
    Lance Corporal
    Join Date
    Oct 3 2005
    Location
    Wewelsfleth, Germany
    Posts
    54
    Hi there,

    I made 4 weaponholders on tables to choose four weapons.
    When the player chooses a weapon I would like to delete the other weaponholders. With deleteVehicle Table I can take the tables away but then the weapons suspend in the air.
    How can I exit or delete a started script in a running mission?

    Every *** ***is *** . Thank you!

    Regards limmy3
    The only necessary for triumph of evil is for good men to do nothing.

  2. #2
    Uh... have you tried deleting the weaponholders?

    Script ends when it reaches end of file or the exit command.

  3. #3
    To stop a script during a mission :

    - give a boolean value (true/false) to a variable (like endscript = false) in the init.sqs of the mission or the init line of a unit for example.

    - write somewhere in the script :

    ? endscript : exit

    - then change the value of the variable from false to true when you wanna stop the script (in a trigger or whatever, endscript = true).

    For the first question, just give names to the weaponholders and deletevehicle them, having checked if the player has a given weapon (player hasweapon "m16") or (player hasweapon "spoon") or etc.. in the condition line of a trigger for example.

  4. #4
    Lance Corporal
    Join Date
    Oct 3 2005
    Location
    Wewelsfleth, Germany
    Posts
    54
    Author of the Thread
    Hello,

    Quote Originally Posted by [b
    Quote[/b] ]Uh... have you tried deleting the weaponholders?
    That is what I was asking! ***

    Yours ProfTournesol is looking good I'm working on that.
    Quote Originally Posted by [b
    Quote[/b] ]For the first question, just give names to the weaponholders and deletevehicle them, having checked if the player has a given weapon (player hasweapon "m16") or (player hasweapon "spoon") or etc.. in the condition line of a trigger for example.
    The weaponholders are four seperat scripts. "table_M21_weapon.sqs", "table_M16_weapon.sqs", table_M4_weapon.sqs", table_HK_weapon.sqs",

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; and call the script by using this exec &#34;table_HK_weapon.sqs&#34; in the init line of the table.

    _table = _this

    Weapon = &#34;weaponholder&#34; createVehicle getpos _table
    Weapon addMagazineCargo &#91;&#34;HK&#34;,5&#93;
    Weapon addWeaponCargo *** ***&#91;&#34;HK&#34;,1&#93;
    Weapon Setpos &#91;Getpos _table Select 0, Getpos _table Select 1, &#40;getpos _table select 2&#41; + 1&#93;

    ? endscript &#58; exit
    exit[/QUOTE]
    I made a trigger with: (player hasweapon "m16") or (player hasweapon "M21") ... ; West not present
    Is this what you meant? ***
    Thank you
    Regards limmy3

  5. #5
    Quote Originally Posted by (limmy3 @ Sep. 07 2006,18:13)
    Quote Originally Posted by [b
    Quote[/b] ]Uh... have you tried deleting the weaponholders?
    That is what I was asking&#33;
    Oh yeah, of course you were, sorry.

    Try scripts like this:
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    _table = _this

    _wh = &#34;weaponholder&#34; createVehicle getpos _table
    _wh addMagazineCargo &#91;&#34;HK&#34;,5&#93;
    _wh addWeaponCargo &#91;&#34;HK&#34;,1&#93;
    _wh Setpos &#91;Getpos _table Select 0, Getpos _table Select 1, &#40;getpos _table select 2&#41; + 1&#93;

    @endwhscripts
    deletevehicle _wh
    exit[/QUOTE]
    And a trigger like:

    condition: player hasweapon "name" OR player hasweapon "name2"
    onActivation: endwhscripts = true

  6. #6
    Lance Corporal
    Join Date
    Oct 3 2005
    Location
    Wewelsfleth, Germany
    Posts
    54
    Author of the Thread
    Hello Metal Heart,

    this is excellent and works fine thank you very much&#33; ***

    Regards limmy3

Posting Permissions

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