Jump to content
  • 0

1.6 SET AI AS GUNNER


juandayz

Question

hello have a lil question about how to set an unit ai as gunner of static weapon.

im using this code.. the ai set as gunner as well but after 10 seconds, the ai die alone :mellow:

server side script

_spawnstaticsguns = true;

if (_spawnstaticsguns) then {

_statictype = ["KORD_high_TK_EP1","DSHKM_Ins","M2StaticMG"] call BIS_fnc_selectRandom;

_objectsm2 = createVehicle [_statictype, [(_position select 0) - 5, (_position select 1) - 4,0],[], 0, "CAN_COLLIDE"];
_objectsm2 setDir 0;
_objectsm2 setVectorUp surfaceNormal position _objectsm2;
_objectsm2 setVehicleLock "LOCKED";
_objectsm2 	setVehicleAmmo 1;
//_objectsm2 setVehicleVarName "gun";

sleep 1;
_group_gunner = createGroup _center_1;
_enemygunner = objNull;
_enemygunner = _group_gunner createUnit [_enemytype,_mainpos,[],0,"CAN_COLLIDE"];
_enemygunner moveingunner _objectsm2;
//_enemygunner setVehicleInit "this MoveInGunner gun;";


};

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

I use WAI and have static weapons at different locations. Works awesome.

 

Place your custom static weapon spawns below
    */
    
    [
        [                                    // Position(s) (can be multiple)
            [22215.723, 19780.213, 13.0001],
            [22338.311, 19738.691, 23.540525],
            [22884.711, 19856.395, 11.0001],
            [22446.395, 20098.475, 6.8244929],
            [22893.8,20123.3,0.00158596],
            [22328.6,20185.3,0.00143862],
            [22499.5,18999.8,0.00143862],
            [23054.1,19151.2,0.00143862],
            [22536.129, 19998.018, 6.6184354],
            [23064.297, 19371.266, 10.033691]
            
        ],
        "M2StaticMG",                        // Classname of turret
        "extreme",                            // Skill level of unit (easy, medium, hard, extreme, Random)
        "Random",                            // Skin classname, use "Random" or classname here
        "Bandit",                            // AI Type, "Hero" or "Bandit".
        "Random",                            // Primary gun set number. "Random" for random weapon set
        9,                                    // Number of magazines
        "Random",                            // Backpack classname, use "Random" or classname here
        "random"                            // Gearset classname, use "Random" or classname here
    ] call spawn_static;

 

 

Link to comment
Share on other sites

  • 0
3 hours ago, salival said:

@juandayzIs the AI getting killed for being a hacker?

 

You will need to do:


dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_objectsm2];

 

Yes i do it at first by any way the ai still die.

//spawn gunner if staticsguns is true
if (_spawnstaticsguns) then {

_statictype = ["KORD_high_TK_EP1","DSHKM_Ins","M2StaticMG"] call BIS_fnc_selectRandom;

//_objectsm2 = createVehicle [_statictype, [(_position select 0) - 5, (_position select 1) - 4,0],[], 0, "CAN_COLLIDE"];
_objectsm2 = createVehicle [_statictype, [(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];
_objectsm2 setDir round(random 360);
//_objectsm2 setDir 0;
_objectsm2 setVectorUp surfaceNormal position _objectsm2;
_objectsm2 setVehicleLock "LOCKED";
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_objectsm2];
//_objectsm2     setVehicleAmmo 1;


dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_objectsm2];

sleep 1;
_group_gunner = createGroup _center_1;
_enemygunner = objNull;
_enemygunner = _group_gunner createUnit [_enemytype,_mainpos,[],0,"CAN_COLLIDE"];
_enemygunner moveingunner _objectsm2;

};

 

Seems like when ai in mounted wepon spottt a player and try To aim he die inmediatly. I also think is being killed for use the weapon.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...