Home   Help Search Login Register  

Author Topic: Custom Crate Script dont work on server  (Read 1780 times)

0 Members and 1 Guest are viewing this topic.

Offline Assaultant

  • Members
  • *
Custom Crate Script dont work on server
« on: 29 Aug 2007, 22:44:18 »
Hello this is my first post so bear with me.
A friend and I have been trying to figure out why the custom crate script from ArmA Edit works in the editor but not when we upload them to our clan's server.  We are using the latest version of ArmA Edit.  If anyone can help it would be greatly appreciated.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Custom Crate Script dont work on server
« Reply #1 on: 29 Aug 2007, 22:55:45 »
Can you post an example of the script?
How is it executed?

More information is needed to help you out i'm afraid. Plus you could have posted this in MP as it is more of a suitable forum :)

Offline Assaultant

  • Members
  • *
Re: Custom Crate Script dont work on server
« Reply #2 on: 29 Aug 2007, 23:08:41 »
ok then ill post there

Offline Assaultant

  • Members
  • *
Custom Crate Script wont work on server
« Reply #3 on: 29 Aug 2007, 23:15:18 »
Hello I need help with getting the ArmA Edit Custom Crate script to work on my clan's server.  It works fine in the editor but when uploaded onto the server the crate holds only default weapons.  Here is the script.
; CODE: [this] exec "ACrate.sqs"
; ****************************************************************

; 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 ["M16A4", 10]
_crate addMagazineCargo ["100Rnd_762x51_M240", 400]
_crate addWeaponCargo ["M240", 6]
_crate addWeaponCargo ["M24", 2]
_crate addMagazineCargo ["30Rnd_556x45_Stanag", 400]
_crate addMagazineCargo ["5Rnd_762x51_M24", 400]
_crate addWeaponCargo ["M136", 6]
_crate addMagazineCargo ["M136", 400]
_crate addWeaponCargo ["JAVELIN", 2]
_crate addMagazineCargo ["JAVELIN", 400]
_crate addWeaponCargo ["M9", 18]
_crate addMagazineCargo ["15Rnd_9x19_M9", 400]
_crate addWeaponCargo ["M249", 18]
_crate addMagazineCargo ["200Rnd_556x45_M249", 400]
_crate addWeaponCargo ["M16A4_ACG", 18]
_crate addWeaponCargo ["M16A4_ACG_GL", 18]
_crate addWeaponCargo ["M4A1", 18]
_crate addWeaponCargo ["M4AIM", 18]
_crate addWeaponCargo ["M4GL", 18]
_crate addWeaponCargo ["M4", 18]
_crate addWeaponCargo ["M107", 2]
_crate addMagazineCargo ["10Rnd_127x99_m107", 40]
_crate addWeaponCargo ["Binocular", 18]
_crate addWeaponCargo ["NVGoggles", 18]
_crate addMagazineCargo ["SmokeShell", 40]
_crate addMagazineCargo ["SmokeShellRed", 40]
_crate addMagazineCargo ["SmokeShellGreen", 40]
_crate addMagazineCargo ["HandGrenadeTimed", 100]

Exit

And I type in [this] exec "ACrate.sqs" in the Init of the crate.
Any help would be appreciated and if you need more info let me know

Offline satexas69

  • Members
  • *
Re: Custom Crate Script dont work on server
« Reply #4 on: 30 Aug 2007, 01:48:44 »
There are tons of threads on this, and it sounds like you are putting your "crate script" outside of the actual mission directory itself.... maybe somewhere else in /arma.

Try this script, I put a lot of comments at the top of the script making it super-easy.

Once you get my crate working, edit this script to add/remove weapons and the ammo inside it to suite your specific mission needs.

Code: [Select]
; Instructions:
;
; 1. Inside of your mission directory, make a subdirectory called "reload" and put this
; script in it called "ammobox_1.sqs"
;
; 2. Make a crate in the game
;
; 3. Put this as it's NAME:  ammo_1
;
; 4. Put this in the item's INIT field:   [ammo_1] exec "reload\ammobox_1.sqs
;
; Increment the ammobox tag for each individual box after this first one to load others
; IE: [ammo_2]... [ammo_5]...

; NOTE - This is my USA GUNS crate


; Get the crate parameter given
_crate = _this Select 0

; REMOVE STOCK ITEMS FROM THE CRATE:

ClearMagazineCargo _crate
ClearWeaponCargo _crate


; ADD THE ITEMS TO THE CRATE:

; West Weapons

_crate addweaponcargo ["M9",100]
_crate addweaponcargo ["M9SD",100]
_crate addweaponcargo ["M16A2",100]
_crate addweaponcargo ["M16A2GL",100]
_crate addweaponcargo ["M4",100]
_crate addweaponcargo ["M4A1SD",100]
_crate addweaponcargo ["M4GL",100]
_crate addweaponcargo ["M4A1",100]
_crate addweaponcargo ["M4A1GL",100]
_crate addweaponcargo ["M4AIM",100]
_crate addweaponcargo ["M4SPR",100]
_crate addweaponcargo ["G36a",100]
_crate addweaponcargo ["g36c",100]
_crate addweaponcargo ["g36k",100]
_crate addweaponcargo ["m24",100]
_crate addweaponcargo ["mp5A5",100]
_crate addweaponcargo ["MP5SD",100]
_crate addweaponcargo ["M240",100]
_crate addweaponcargo ["M249",100]

_crate addweaponcargo ["M107",100]
_crate addmagazinecargo ["10Rnd_127x99_m107",100]

_crate addweaponcargo ["Laserdesignator",200]
_crate addweaponcargo ["Binocular",200]
_crate addweaponcargo ["NVGoggles",100]
_crate addmagazinecargo ["30Rnd_9x19_MP5",900]
_crate addmagazinecargo ["30Rnd_9x19_MP5SD",900]
_crate addmagazinecargo ["15Rnd_9x19_M9",900]
_crate addmagazinecargo ["15Rnd_9x19_M9SD",900]
_crate addmagazinecargo ["30Rnd_556x45_Stanag",900]
_crate addmagazinecargo ["30Rnd_556x45_G36",900]
_crate addmagazinecargo ["200Rnd_556x45_M249",900]
_crate addmagazinecargo ["5Rnd_762x51_M24",900]
_crate addmagazinecargo ["100Rnd_762x51_M240",900]
_crate addmagazinecargo ["1Rnd_HE_M203",900]
_crate addmagazinecargo ["Laserbatteries",900]


; East Weapons

_crate addweaponcargo ["PK",100]
_crate addmagazinecargo ["100Rnd_762x54_PK"]
_crate addweaponcargo ["SVD",100]
_crate addmagazinecargo ["10Rnd_762x54_SVD"]


Exit

Offline Assaultant

  • Members
  • *
Re: Custom Crate Script dont work on server
« Reply #5 on: 30 Aug 2007, 04:09:57 »
I do put it in the mission folder.  Profile, MP Missions, then the mission folder.  It works in the editor like I said.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Custom Crate Script dont work on server
« Reply #6 on: 30 Aug 2007, 16:06:25 »
Make sure you call the script from the init.sqs/sqf so that it runs on all machines. Unit initfields can be a bit flakey in MP. I never use them for adding/removing weapons/ammo.
« Last Edit: 30 Aug 2007, 16:09:50 by Mr.Peanut »
urp!

Offline MattiusRochelle

  • Members
  • *
Re: Custom Crate Script dont work on server
« Reply #7 on: 30 Aug 2007, 18:45:58 »
As a scripter my self i also came into problems with this. I tried many differnt ways and found the only way to seem to get the player in MP start with custom weapons was to add the weapons to his init. I tried all sorts of scripts that work in the editor but not on a server.  >:(

Belive me i tried sorting it out spending hours and hours for 5 days doing trial and error testing and the only way that worked was though the players init.