Jump to content
Sign in to follow this  
[lol]clan killer bee

Add and removeweapons in the init.sqf

Recommended Posts

This is the deal.

I want a civi vehicle and stuff it up with weapons.

I want to controle the stuff from the ini.sqf

Civi truck is called truckyammo1

This is what I got but doesn't seem to work !

ClearWeaponcargo truckyammo1

truckyammo1 addweaponcargo ["Binocular", 10]

truckyammo1 addmagazinecargo ["SmokeShell", 5]

When I load up the game and run to the truck I can't get no ammo !?

I know i can do this

create a 'gun.sqf' just don't overload it.

// weapons
_this addWeaponCargo ["SMAW", 2];
_this addWeaponCargo ["Javelin", 3];
_this addWeaponCargo ["m16a4_acg", 10];
_this addWeaponCargo ["Javelin", 3];
_this addWeaponCargo ["AK_47_M", 3];

_this addWeaponCargo ["NVGoggles", 10];
_this addWeaponCargo ["Stinger", 3];


// ammo
_this addMagazineCargo ["30Rnd_762x39_AK47", 100];
_this addMagazineCargo ["30Rnd_556x45_G36", 100];
_this addMagazineCargo ["Javelin", 20];
_this addMagazineCargo ["SMAW_HEAA", 20];
_this addMagazineCargo ["Stinger", 10];

// Restock time.
sleep 1800;
};

put in the truck init field

null = this execVM "gun.sqf

I wanted only in the init.sqf as it is easier for me to controle as I'm dislectic and codes make me go bonkers :banghead:

What do I miss to make it work in the initfield ?

Anyone any idea ?

Thanks

Share this post


Link to post
Share on other sites

I think the problem may be that the truck has not yet been initialized. Add this before you do anything with the truck and see if that helps:

waitUntil {!isNul "truckyammo1"};

Share this post


Link to post
Share on other sites
clan Killer Bee;1728325']I want to controle the stuff from the ini.sqf

I'm not sure if you misspelled it just here' date=' but the init script should be [b']init.sqf[/b].

waitUntil {!isN[u]i[/u]l "truckyammo1"};

Fix'd. ;)

Edited by Celery

Share this post


Link to post
Share on other sites

Were do I have to place that ?

In the init.sqf ?

before I add things to the truck ?

---------- Post added at 01:08 PM ---------- Previous post was at 01:07 PM ----------

;1728341']Civilian vehicles have no cargo space.

Okay so that was it for the civi truck :D

---------- Post added at 01:42 PM ---------- Previous post was at 01:08 PM ----------

How do i than add weapons and ammo to a truck and what truck or car ?

---------- Post added at 02:07 PM ---------- Previous post was at 02:06 PM ----------

Solved problem

I found the problem.

This is what happend in my mission.

I got a empty truck.

I added a enemysoldier to drive the convoy.

Got the truck loaded.

Solong the enemydriver is in the truck you can't get dip out of it !

You shoot him and there it is, pandorabox is open !:yay:

Edited by [LOL]clan Killer Bee

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×