OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Knut Erik on 17 May 2003, 23:50:57

Title: WeaponHolder trouble
Post by: Knut Erik on 17 May 2003, 23:50:57
I've created this weapon script to make weapons appear on tables, however I have problems to get it to work:

Code: [Select]
_table = _this select 0
_weapon = _this select 1
_mag    = _this select 2


Weapon = "weaponholder" createVehicle getpos _table
Weapon addMagazineCargo ["_mag",4]
Weapon addWeaponCargo    ["_weapon",1]
Weapon Setpos [Getpos _table Select 0, Getpos _table Select 1, (getpos _table select 2) + 0.95]

I put this in the init field of the table:
[this,ak47,ak47] exec "Weapon.sqs"
I get an error message.
No entry bin.\cfgweapons _mag
Something like that. Can this be fixed?  :-\ :(
Title: Re:WeaponHolder trouble
Post by: Igor Drukov on 18 May 2003, 00:28:39
You should remove the inverted commas "" from the script and add them in tne init field :
[this,"ak47","ak47"] exec "Weapon.sqs"

and :
 
Weapon addWeaponCargo    [_weapon,1]

I did that, and it worked... almost : at first, I was able to grab the weapon (the big thing being that it does appear, now...), but now I no longer can  ???
As to the ammo, as I can't grab the ak47 anymore, I can't say whether it is loaded or not... :-\
Hope this helps anyway.

Title: Re:WeaponHolder trouble
Post by: Knut Erik on 18 May 2003, 20:38:51
Thanks a lot, Igor!  ;D :) :D

You'll have to wait a moment before the weapons can be picked up.
Probably a bug in Ofp, so there is nothing we can do about it.

*Topic solved and locked!*