Jump to content

Recommended Posts

this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}]

 

Try the word "this" at the front

Share this post


Link to post
Share on other sites
7 hours ago, Furkan Aksakal said:

but didn't worked on the any uav's, so anyone can help me?

If you inserted that into unit's initialization line then yes, you have to either use this as Joe pointed out, or you have to name the unit by inserting something into name field and use that instead of this.

 

You could also insert something like below into init.sqf and have every unit of that type have unlimited ammo:

if (typeOf _veh == "B_UAV_02_dynamicLoadout_F") then {
    _veh addEventHandler ["Fired", {(_this select 0) setVehicleAmmo 1}];
};

 

Scripting Commands

Event Handlers

Assets

 

Share this post


Link to post
Share on other sites
6 hours ago, Joe98 said:

this addeventhandler ["fired", {(_this select 0) setvehicleammo 1}]

 

Try the word "this" at the front

Didn't worked.

 

2 hours ago, Janez said:

If you inserted that into unit's initialization line then yes, you have to either use this as Joe pointed out, or you have to name the unit by inserting something into name field and use that instead of this.

 

You could also insert something like below into init.sqf and have every unit of that type have unlimited ammo:


if (typeOf _veh == "B_UAV_02_dynamicLoadout_F") then {
    _veh addEventHandler ["Fired", {(_this select 0) setVehicleAmmo 1}];
};

 

Scripting Commands

Event Handlers

Assets

 

İ don't get it, this is so complicated for me, because ı'm simple and new player in arma 3.

Share this post


Link to post
Share on other sites

 OK. How exactly did you use the code in your first post? Where did you put it?

  • Like 1

Share this post


Link to post
Share on other sites
12 minutes ago, Furkan Aksakal said:

 

Don't run that in debug console. This is a magic variable which refers to the object (usually),so write this code in init field of the UAV.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
1 minute ago, pierremgi said:

 

Don't run that in debug console. This is a magic variable which refers to the object (usually),so write this code in init field of the UAV.

Can you explain for me how can i find uav init? I know ı'm asking a lot of question sorry :/

Share this post


Link to post
Share on other sites

Hi @Furkan Aksakal, welcome to the forums :).

 

2 hours ago, Furkan Aksakal said:

Can you explain for me how can i find uav init? I know ı'm asking a lot of question sorry :/

The BI Wiki (BIKI) gives a complete tutorial:
https://community.bistudio.com/wiki/Category:Eden_Editor

The "init" box is part of the object attributes, which is what you get when you double click on a unit.
https://community.bistudio.com/wiki/Eden_Editor:_Entity_Attributes
The different attributes are explained here:
https://community.bistudio.com/wiki/Eden_Editor:_Object
-> So you are looking to insert some code into the "init" part of your UAV's attributes. That is the box where you can enter expressions/program code.

If you prefer watching videos, there are also a lot of tutorials on YouTube. Most of them are in English.

If you have a very specific problem with something you are working on, and you cannot find the answer on search engine/forums, you can try posting here for help. There is also a Discord server. 

Happy editing!

  • Like 2

Share this post


Link to post
Share on other sites

Learn to give one soldier unlimited ammo and then work from there.

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

×