Home   Help Search Login Register  

Author Topic: Ammo Crate help  (Read 597 times)

0 Members and 1 Guest are viewing this topic.

DarkCell

  • Guest
Ammo Crate help
« on: 30 Jul 2003, 19:30:45 »
I downloaded a Ammo crate script where you can add weapons into a ammo crate
I typed this into Condition field:

this, ["HK", "LAWL", "KOZB"], 5, 9] exec "ammocrate.sqs"

and i putted the ammocrate.sqs into my mission folder and addon folder
But there is no ammo crate  now :(

Can someone help me plz?
What did I do wrong?

m21man

  • Guest
Re:Ammo Crate help
« Reply #1 on: 30 Jul 2003, 19:40:30 »
For starters, you don't need the script in your addons folder.
Don't put the exec line in the condition box, put it in the init box.
« Last Edit: 30 Jul 2003, 19:41:53 by m21man »

DarkCell

  • Guest
Re:Ammo Crate help
« Reply #2 on: 30 Jul 2003, 19:44:49 »
THNX I shall try it :)

DarkCell

  • Guest
Re:Ammo Crate help
« Reply #3 on: 30 Jul 2003, 19:47:39 »
Where can I find INIT BOX??

Lol I am NooB  :-X

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Ammo Crate help
« Reply #4 on: 30 Jul 2003, 22:43:26 »
Every object has an init line .... short for initialization.      You know when you double click on the map to insert the ammo crate a screen appears?    Well the init line is at the bottom of the upper section.

ammocrate.sqs should go in the mission folder along with the mission.sqm, briefing.html, etc..

The syntax of the line of code you quoted is wrong - the brackets don't add up.    Check it again.

If you haven't read it already I recommend you read snYpir's Friendly Introduction to Code Snippets in the Editors Depot.
Plenty of reviewed ArmA missions for you to play

Offline KJAM

  • Contributing Member
  • **
  • Why Me, Whats it For?
    • Nightstalker mod
Re:Ammo Crate help
« Reply #5 on: 31 Jul 2003, 06:39:28 »
here is an example of the script you should use (ignore the lines that have ; at the start, just showing you how to add the weapons and ammo)

copy the script below all this explaination into a text file and save as (without the quotes) "ammocrate" (it doesnt really matter what you call it as long as you remember what you caled it)

then add a ammo crate (doesnt matter which one) and then in the initialisation box type

[this] Exec "ammocrate.sqs"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


SCRIPT
(copy below this line, add to a txt file and save as ammocrate.sqs or as whatever)
; Get the crate parameter given
_crate = _this Select 0

; Remove the stock items from the crate
ClearMagazineCargo _crate
ClearWeaponCargo _crate

; Add the items to the crate
_crate AddWeaponCargo ["HK", 5]
_crate AddMagazineCargo ["HK", 25]
_crate AddWeaponCargo ["LAWLauncher", 5]
_crate AddMagazineCargo ["LAWLauncher", 25]
_crate AddWeaponCargo ["Binocular", 5]

Exit
« Last Edit: 31 Jul 2003, 06:47:09 by KJAM »