Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

scripts for DayZ Editor

Newbie Spellweaver
Joined
Mar 8, 2017
Messages
13
Reaction score
1
Guys, write, please script for spawn weapons and clips in DayZ Editor.
in the DayZ Editor in the lists there are no weapons, and clips. You can only spam a script.
I know the script only for spawning weapons in character to the hands
player addmagazine "ID_Item"
player addweapon "ID_weapon"


And I need a script to spawn weapons on the ground.:(:
 
Newbie Spellweaver
Joined
Oct 21, 2017
Messages
15
Reaction score
3
_classname = "M4A1";_pos = getpos player;_gun = createVehicle [_classname, _pos, [], 0, "CAN_COLLIDE"];_arrAttachments = getArray (configFile >> 'CfgWeapons' >> typeOf _gun >> 'BaseAttachments');{_att = _gun createWeaponAttachment _x;} foreach _arrAttachments;_arrMagazines = getArray (configFile >> 'CfgWeapons' >> typeOf _gun >> 'magazines');_randomMag = _arrMagazines select floor random count _arrMagazines;_mag = _gun createWeaponAttachment _randomMag;
So this code will create an M4A1 under you with base attachments and random magazine.
 
Newbie Spellweaver
Joined
Oct 21, 2017
Messages
15
Reaction score
3
_classname = "M4A1";_pos = getpos player;_gun = createVehicle [_classname, _pos, [], 0, "CAN_COLLIDE"];
_arrAttachments = getArray (configFile >> 'CfgWeapons' >> typeOf _gun >> 'BaseAttachments');
{_att = _gun createWeaponAttachment _x;} foreach _arrAttachments;
_arrMagazines = getArray (configFile >> 'CfgWeapons' >> typeOf _gun >> 'magazines');
_randomMag = _arrMagazines select floor random count _arrMagazines;
_mag = _gun createWeaponAttachment _randomMag;

this will create M4A1 with base attachments and random magazine

 
Newbie Spellweaver
Joined
Mar 8, 2017
Messages
13
Reaction score
1
_classname = "M4A1";_pos = getpos player;_gun = createVehicle [_classname, _pos, [], 0, "CAN_COLLIDE"];
_arrAttachments = getArray (configFile >> 'CfgWeapons' >> typeOf _gun >> 'BaseAttachments');
{_att = _gun createWeaponAttachment _x;} foreach _arrAttachments;
_arrMagazines = getArray (configFile >> 'CfgWeapons' >> typeOf _gun >> 'magazines');
_randomMag = _arrMagazines select floor random count _arrMagazines;
_mag = _gun createWeaponAttachment _randomMag;

this will create M4A1 with base attachments and random magazine


I created a character in the editor and tried to copy your script into "Scripts"(F4), but nothing happened
 
Newbie Spellweaver
Joined
Oct 21, 2017
Messages
15
Reaction score
3
Create init.sqf in folder with your mission and put this code.
"Scripts"(F4) is an obsolete and almost disabled function from ArmA2
 
Back
Top