Welcome to the Iron Front Fan Forums!
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Tayuk

Avatar / Picture

Retired Admin/IFR
Registered:
Posts: 456
Reply with quote  #1 
Create a game logic, class object within units in the editor then put this in the init of the game logic:-
k98 = "WeaponHolder" createVehicle getPos this; k98 addWeaponCargo ["LIB_K98",1]; k98 SETDIR 180;


This will create a K98 at the game logic position rotated to 180 degrees.

To place some ammo next to it, add this:- (the 2 after the ammo class is the quantity of magazines).
k98 addMagazineCargo ["lib_5Rnd_792x57",2];


I think you can set its position and height with co-ordinates with this addition, but Iv'e not tested it:-
k98 setposATL [x,y,z]


 
0
Tayuk

Avatar / Picture

Retired Admin/IFR
Registered:
Posts: 456
Reply with quote  #2 
Ok I am using this code in the init on a game logic placed on the map in the editor to create various items on the ground, this works with no issues in the editor and me alone in my hosted server, but as soon as another player is in the server, and you try to pick the items up and the gear button flashes on and off and trying to select gear to be able to pick up the items is very hit and miss. Also If I do manage to pick up the gear so to me the floor is now clear, another player obviously still sees the gear and may also pick it up. Anyone any ideas how to get it to work properly?

Items1 = "WeaponHolder" createVehicle getPos this; Items1 addWeaponCargo ["LIB_w",2]; Items1 addWeaponCargo ["LIB_DP28",1]; Items1 addMagazineCargo ["lib_10Rnd_762x54",5]; Items1 addMagazineCargo ["Pipebomb",4]; items1 addMagazineCargo ["lib_47Rnd_762x54",5]; Items1 setPosATL [13882.1,14738.9,0.26268]; Items1 setDir 46.752
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.