Search the Community
Showing results for tags 'firedman'.
Found 2 results
-
"FiredMan" and "Fired" event handlers on the same unit?
LSValmont posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
FiredMan can complete replace Fired. Problem solved, please close this.-
- event handlers
- fired
-
(and 2 more)
Tagged with:
-
Hi everyone ... I am player a mission on LAN multiplayer server ... I have an sqf file called (invincible_ai.sqf) ... This file is executed when ever I add new AI player to my squad ... The content of this file is as follows: { if ((side _x) == West) then { _x allowDamage false; _x setdamage 0; _x setCustomAimCoef 0.00; _x setUnitRecoilCoefficient 0; _x addEventHandler [ "Fired", { if ((_this select 1) == "launch_NLAW_F") then { (_this select 0) addMagazine "NLAW_F"; } else { (_this select 0) setvehicleammo 1; } } ]; _x addEventHandler [ "GetInMan", { (_this select 2) allowDamage false; (_this select 2) setdamage 0; (_this select 2) setFuel 1; (_this select 2) setCaptive true; } ]; _x addEventHandler [ "FiredMan", { ( _this select 7) setvehicleammo 1; } ]; } } forEach allUnits; in this (invincible_ai.sqf) file, this part of the cod is WORKING NICE: _x allowDamage false; _x setdamage 0; _x setCustomAimCoef 0.00; _x setUnitRecoilCoefficient 0; _x addEventHandler [ "Fired", { if ((_this select 1) == "launch_NLAW_F") then { (_this select 0) addMagazine "NLAW_F"; } else { (_this select 0) setvehicleammo 1; } } ]; _x addEventHandler [ "GetInMan", { (_this select 2) allowDamage false; (_this select 2) setdamage 0; (_this select 2) setFuel 1; (_this select 2) setCaptive true; } ]; But this part is NOT WORKING: _x addEventHandler [ "FiredMan", { ( _this select 7) setvehicleammo 1; } ]; What I am trying to do is: to give the AI unit infinite ammo when using a turret mounted on a vehicle ... I have another sqf file called (god_like_player.sqf) ... The content of this file is as follows: Player addEventHandler [ "Fired", { if ((_this select 1) == "launch_NLAW_F") then { Player addMagazine "NLAW_F"; } else { ( _this select 0) setvehicleammo 1; } } ]; Player addEventHandler [ "GetInMan", { (_this select 2) allowDamage false; (_this select 2) setdamage 0; (_this select 2) setFuel 1; (_this select 2) setCaptive true; } ]; Player addEventHandler [ "FiredMan", { ( _this select 7) setvehicleammo 1; } ]; This part in (god_like_player.sqf) is WORKING NICE: Player addEventHandler [ "FiredMan", { ( _this select 7) setvehicleammo 1; } ]; and myself as human player will have unlimited ammo for the turret of the vehicle ...... But this part in (invincible_ai.sqf) is NOT WORKING: _x addEventHandler [ "FiredMan", { ( _this select 7) setvehicleammo 1; } ]; and the AI unit is still having limited ammo for the turret of the vehicle ... Why this piece of code is working for me as human player, but not working for AI units ?????? Can someone help me with this FiredMan event handler so that it work on all AI united in my LAN multiplayer server ... Or maybe there is another solution ... What I need is to make all AI units in my LAN server to have unlimited ammo for the turret in a vehicle ... By the way: the AI units are created by script, so I don't have access to the init field of the unit in the editor.