Home   Help Search Login Register  

Author Topic: Going out of my head!!  (Read 1253 times)

0 Members and 1 Guest are viewing this topic.

B-2-0

  • Guest
Going out of my head!!
« on: 20 May 2003, 13:13:55 »
Ok, i have been up all night trawling the forums and trying to get this to work, i'm more stressed than Saddam Hussain's insurance company and i'm in need of a problem fix ASAP!!

*Realises the keys won't take much more of this punishment and takes a deep breath*

Sit rep: East ammo crate, West ammo crate........East ammo crate script, West ammo crate script........i place East crate with command [] exec "AmmoE.sqs" in init field, works fine........i delete that crate........i place West ammo crate with command [] exec "AmmoW.sqs" in init field, works fine........i replace the East ammo crate and init command and i only get the East crate with weapons in........West crate has M-16 mags and grenades.... >:(....HELP!!!

Here are the scripts:

;---------------------------------------------------------------------
;AmmoE.sqs

;Clear Ammo Crate
clearWeaponCargo this;
 clearMagazineCargo this;


;AK-103
this addweaponcargo ["kegak103", 100];
 this addmagazinecargo ["KEGak103Mag", 500];


;AK-107
this addweaponcargo ["kegak107", 100];
 this addmagazinecargo ["KEGak107Mag", 500];


;RPK-74
this addweaponcargo ["kegrpk74", 50];
 this addmagazinecargo ["KEGrpk74Mag", 300];

;------------------------------------------------------------------------

;------------------------------------------------------------------------
;AmmoW.sqs

;Clear Ammo Crate
clearWeaponCargo this;
 clearMagazineCargo this;



;M4 ACOG Des
this addweaponcargo ["BAS_M4desACOG", 100];
 this addmagazinecargo ["BAS_M4Mag", 500];


;M4 ACOG  Des Silenced
this addweaponcargo ["BAS_M4desACOGS", 100];
 this addmagazinecargo ["BAS_M4SMag", 500];


;M4 ACOG Des Masterkey
this addweaponcargo ["BAS_M4desMKACOG", 100];
 this addmagazinecargo ["BAS_M4Mag", 500];
 this addmagazinecargo ["BAS_MKshell", 500];

;-------------------------------------------------------------------------

Where am i going wrong ???

I thought maybe it was the ammount of weapons and mags but i get the same result with 1 gun and 5 mags in each box :-\

Just so you know....i intend to have 3 crates for each side so your solution must be workable with multiple crates on the same side running the same script!

I have also tried it without the clear ammo crate part to no avail........I have a feeling this is wrong too as i still get M-16 mags and nades :-\

Please, please, please help me!!!!

Please :)

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Going out of my head!!
« Reply #1 on: 20 May 2003, 14:14:56 »
Haven't looked in detail, but try to add :

_myammocrate=_this select 0

at the beginning of both scripts, and give a name to each of your ammo crates.

In the init field, type :

[_myname1] exec "AmmoW.sqs", etc.

Hope it'll work.

« Last Edit: 20 May 2003, 14:15:08 by Igor Drukov »

Offline Kotp

  • Members
  • *
  • I'm a llama!
Re:Going out of my head!!
« Reply #2 on: 20 May 2003, 14:31:03 »
I just created a quick test on Desert Island with a slight variance of your code and it worked fine.

AmmoCrateWest i named Ammo1

AmmoCrateEast i named Ammo2

-------------------------------------------------------------------------------------------

then in Ammo1 Init Field

"RemoveAllWeapons Ammo1" ; Ammo1 exec "AmmoWest.sqs"

-------------------------------------------------------------------------------------

"AmmoWest.sqs"
clearWeaponCargo this;
clearMagazineCargo this;

;M4 ACOG Des
this addweaponcargo ["BAS_M4desACOG", 100];
this addmagazinecargo ["BAS_M4Mag", 500];

;M4 ACOG Des Silenced
this addweaponcargo ["BAS_M4desACOGS", 100];
this addmagazinecargo ["BAS_M4SMag", 500];

;M4 ACOG Des Masterkey
this addweaponcargo ["BAS_M4desMKACOG", 100];
this addmagazinecargo ["BAS_M4Mag", 500];
this addmagazinecargo ["BAS_MKshell", 500];

-----------------------------------------------------------------------------------

then in Ammo2 Init Field

"RemoveAllweapons Ammo2" ; Ammo2 exec "AmmoEast.sqs"

------------------------------------------------------------------------------------

AmmoEast.sqs

clearWeaponCargo this;
clearMagazineCargo this;

;AK-103
this addweaponcargo ["kegak103", 100];
this addmagazinecargo ["KEGak103Mag", 500];

;AK-107
this addweaponcargo ["kegak107", 100];
this addmagazinecargo ["KEGak107Mag", 500];

;RPK-74
this addweaponcargo ["kegrpk74", 50];
this addmagazinecargo ["KEGrpk74Mag", 300];

-------------------------------------------------------------------------


Works fine i can take all the weapons from both crates and Mags.

B-2-0

  • Guest
Re:Going out of my head!!
« Reply #3 on: 20 May 2003, 14:33:21 »
No, i get --[_CrateW|#|] Error local variable in global space-- when i add that to the init field! :-[

[Edit] Oh, i'll try that out!
 :)Thanks!
« Last Edit: 20 May 2003, 14:34:29 by B-2-0 »

B-2-0

  • Guest
Re:Going out of my head!!
« Reply #4 on: 20 May 2003, 14:46:35 »
When i enter this into Ammo1 init field-

"RemoveAllWeapons Ammo1" ; Ammo1 exec "AmmoWest.sqs"


I get-

"RemoveAllWeapons Ammo1" |#|; Ammo1 exec "AmmoWest.sqs" type string, expected nothing

 ???

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Going out of my head!!
« Reply #5 on: 20 May 2003, 14:48:39 »
I may not have been clear :

Quote
[_myname1] exec "AmmoW.sqs"

What I meant was, just name your crate (e.g. cratewest1), and put the name in the [].

[cratewest1] exec "AmmoW.sqs"

If you've found a solution, don't forget to SOLVE the topic !

Offline Kotp

  • Members
  • *
  • I'm a llama!
Re:Going out of my head!!
« Reply #6 on: 20 May 2003, 14:53:14 »
Strange it worked fine for me. LOL well it did , Ive just checked it again and now all the Ammo and Weapons have jumped into 1 Crate !! :o

Must be a bug with the Addons.
« Last Edit: 20 May 2003, 15:08:52 by Kotp »

B-2-0

  • Guest
Re:Going out of my head!!
« Reply #7 on: 20 May 2003, 15:09:11 »
You sure the syntax is correct....i am new to scripting as u can probably tell!! :)

B-2-0

  • Guest
Re:Going out of my head!!
« Reply #8 on: 20 May 2003, 15:17:33 »
Nope, it's not an addon bug....i just tried it with the M4ACOG and the M4ACOGdes....still missing from 1 crate and the crates aren't clearing of M-16 and grenades either! :-\