freakystyle Posted May 15, 2014 Report Share Posted May 15, 2014 Hey is it possible that one the An2 Cargo Plane and Cessna with a 240 Weapon to embellish? I found this and not work by me. click me can you help me? Link to comment Share on other sites More sharing options...
0 Namindu Posted May 15, 2014 Report Share Posted May 15, 2014 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. Link to comment Share on other sites More sharing options...
0 freakystyle Posted May 15, 2014 Author Report Share Posted May 15, 2014 Yeah and this not work. Link to comment Share on other sites More sharing options...
0 jOoPs Posted May 15, 2014 Report Share Posted May 15, 2014 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 freakystyle 1 Link to comment Share on other sites More sharing options...
0 freakystyle Posted May 15, 2014 Author Report Share Posted May 15, 2014 @jOoPs Thank you i test this tomorrow. Link to comment Share on other sites More sharing options...
0 freakystyle Posted May 16, 2014 Author Report Share Posted May 16, 2014 a little bug, he shows me the menu but when I click on it nothing happens! and yes i have ammo in my gear! Link to comment Share on other sites More sharing options...
0 Saltzman Posted July 13, 2015 Report Share Posted July 13, 2015 Why does this only work for server spawned planes and not bought or admin spawned planes? Link to comment Share on other sites More sharing options...
0 Hux Posted July 13, 2015 Report Share Posted July 13, 2015 On 7/13/2015 at 12:13 AM, Saltzman said: Why does this only work for server spawned planes and not bought or admin spawned planes? Maybe be different class names? Link to comment Share on other sites More sharing options...
0 Buck0 Posted July 13, 2015 Report Share Posted July 13, 2015 Add it to trader spawned vehicles From memory its publish object2? Link to comment Share on other sites More sharing options...
0 Saltzman Posted July 13, 2015 Report Share Posted July 13, 2015 Ok so this will not work for planes spawned by Infistar. Bought planes and server spawns have them. Same exact class names lol. Link to comment Share on other sites More sharing options...
0 JakeQue Posted November 6, 2018 Report Share Posted November 6, 2018 The easiest way to do this is put your VehicleAmmo.sqf in the server > compile folder, then call it in each file like so : Reveal hidden contents // 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: Reveal hidden contents clearMagazineCargoGlobal _object; There are 3 of these. Look for the next two also. Under each one add the same VehicleAmmo include like this: Reveal hidden contents // VEHICLE AMMO #include "\z\addons\dayz_server\compile\VehicleAmmo.sqf"; //END This works for all vehicles spawned in via hive or without. Link to comment Share on other sites More sharing options...
Question
freakystyle
Hey is it possible that one the An2 Cargo Plane and Cessna with a 240 Weapon to embellish?
I found this and not work by me. click me
can you help me?
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now