Jump to content
  • 0
freakystyle

BiPlanes and Cessna with a m240 rounds!

Question

10 answers to this question

Recommended Posts

  • 0

yea the code would look like this:

 

// Adds M240's with 100rds to AN2 and Cessna's
if (_entity isKindOf "AN2_DZ") then {
    _entity addWeapon "M240_veh";
    _entity addMagazine "100Rnd_762x51_M240";
    _entity addMagazine "100Rnd_762x51_M240";
};
if (_entity isKindOf "Cessna's_Classname") then {
    _entity addWeapon "M240_veh";
    _entity addMagazine "100Rnd_762x51_M240";
    _entity addMagazine "100Rnd_762x51_M240";
};

 

Is red, change that to the real classname of the Cessna. I would get it myself, but i got to leave for school. You can find this classname in the database, or if you have infistars anit-hack, look at one of the cessna's and hit "I" or "U" and it should tell you the name in the text box.

Share this post


Link to post
Share on other sites
  • 0

previous example wont work...

follow that steps to get an An2_DZ with gun PKT - read comments!

Step 1:

open dayz_server.pbo\system\servermonitor.sqf
and search for...
 

            if (_object isKindOf "AllVehicles") then {
                {
                    _selection = _x select 0;
                    _dam = _x select 1;
                    if (_selection in dayZ_explosiveParts and _dam > 0.8) then {_dam = 0.8};
                    [_object,_selection,_dam] call object_setFixServer;
                } forEach _hitpoints;

                _object setFuel _fuel;

under it insert...
 

                //AN2_DZ add weapon - for all AN2-Types use "AN2_base" as classname
                if (_object isKindOf "AN2_DZ") then {
                    _object addWeapon "PKT"; //M240_veh
                    //add two magazines
                    //_object addMagazine "100Rnd_762x54_PK"; //"100Rnd_762x51_M240"
                    //_object addMagazine "100Rnd_762x54_PK"; //remove comment to add a magazine
                    _object setVehicleAmmo 0; //comment out if publish with ammo
                };

Step 2:
                
now open dayz_server.pbo\compile\server_publishVehicle2.sqf
and search for...
 

    clearWeaponCargoGlobal  _object;
    clearMagazineCargoGlobal  _object;
    // _object setVehicleAmmo DZE_vehicleAmmo;

    
under it insert...
 

                //AN2_DZ add weapon - for all AN2-Types use "AN2_base" as classname
                if (_object isKindOf "AN2_DZ") then {
                    _object addWeapon "PKT"; //M240_veh
                    //add two magazines
                    //_object addMagazine "100Rnd_762x54_PK"; //"100Rnd_762x51_M240"
                    //_object addMagazine "100Rnd_762x54_PK"; //remove comment to add a magazine
                    _object setVehicleAmmo 0; //comment out if publish with ammo
                };

to add a reload-option to pilotseat you need a custom-compiles with fn_selfActions.sqf and variables.sqf

Step 3: (additional)

open fn_selfActions.sqf

and search for...
 

if (!DZE_ForceNameTagsOff) then {
    if (s_player_showname < 0 and !_isPZombie) then {
        if (DZE_ForceNameTags) then {
            s_player_showname = 1;
            player setVariable["DZE_display_name",true,true];
        } else {
            s_player_showname = player addAction [localize "STR_EPOCH_ACTIONS_NAMEYES", "\z\addons\dayz_code\actions\display_name.sqf",true, 0, true, false, "",""];
            s_player_showname1 = player addAction [localize "STR_EPOCH_ACTIONS_NAMENO", "\z\addons\dayz_code\actions\display_name.sqf",false, 0, true, false, "",""];
        };
    };
};

under it insert...
 

// option to add ammo to An2 PKT gun
if(_inVehicle and (_vehicle isKindOf "An2_DZ")) then {
    if (s_player_an2_reload < 0) then {
        dayz_An2Vehicle = _vehicle;
        s_player_an2_reload = dayz_An2Vehicle addAction ["Add AMMO to PKT gun", "dayz_code\actions\An2_ammo.sqf",dayz_An2Vehicle,-10,false,true,"","player == driver _target"];
    };
} else {
    dayz_An2Vehicle removeAction s_player_an2_reload;
    s_player_an2_reload = -1;
};

Step 4: (additional)

open variables.sqf
and search for...
 

    s_player_heli_lift = -1;
    s_player_heli_detach = -1;
    s_player_lockUnlock_crtl = -1;

under it insert...
 

    s_player_an2_reload = -1;

now search for...
 

    DZE_myHaloVehicle = objNull;
    dayz_myLiftVehicle = objNull;

under it insert...
 

    dayz_An2Vehicle = objNull;

Step 5: (additional)

create folders and file in your missionfile dayz_code\actions\An2_ammo.sqf

and insert this...
 

private["_ammo","_vehicle","_hasAmmo","_text","_weapon","_weaponname","_ammoname"];
    _vehicle = _this select 0;
    _weapon = "PKT"; //vehicleweapon
    _ammo = "100Rnd_762x54_PK"; //weaponammo
    _weaponname = _weapon; //cant read from config, coz there is no turret or what ever - so its hardcoded
    _ammoname = getText (configFile >> "cfgMagazines" >> _ammo >> "displayName");
    _text = [_ammoname,_weaponname];
    
    _hasAmmo = _ammo in magazines player;
    if (_hasAmmo) exitWith {
        player removeMagazine _ammo;
        ["<t size='0.6'>3</t>",0,0.8,0.5,0,0,8] spawn BIS_fnc_dynamicText;
        sleep 1;
        ["<t size='0.6'>2</t>",0,0.8,0.5,0,0,8] spawn BIS_fnc_dynamicText;
        sleep 1;
        ["<t size='0.6'>1</t>",0,0.8,0.5,0,0,8] spawn BIS_fnc_dynamicText;
        sleep 1;
        _vehicle addMagazine _ammo;
        cutText [format[(localize "str_epoch_player_127"),_ammoname], "PLAIN DOWN"];
    };
    cutText [format[(localize "str_epoch_player_128"),_text], "PLAIN DOWN"];

for cessna use GNT_C185 as baseclass... possible cessna-vehicle classnames are ...

 

GNT_C185

GNT_C185F

GNT_C185C

GNT_C185R

GNT_C185U

 

this should be enough

 

note: use the given code-snippets, duplicate all steps with the needed changes and you are fine


cheers

Share this post


Link to post
Share on other sites
  • 0

The easiest way to do this is put your VehicleAmmo.sqf in the server > compile folder, then call it in each file like so :

Spoiler

    // VEHICLE AMMO
            #include "\z\addons\dayz_server\compile\VehicleAmmo.sqf";            
            //END

 

You can also get it working for infistar too. 

In infistar folder, open AH.sqf.


Find: 

Spoiler

clearMagazineCargoGlobal _object;

There are 3 of these. Look for the next two also. Under each one add the same VehicleAmmo include like this:

Spoiler

    // VEHICLE AMMO
            #include "\z\addons\dayz_server\compile\VehicleAmmo.sqf";            
            //END

This works for all vehicles spawned in via hive or without.

Share this post


Link to post
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

  • Advertisement
  • Advertisement
  • Supporters
  • Advertisement
  • Discord

×