Jump to content

OmigaaaD's weapon modification script


OmigaaaD

Recommended Posts

Big up to maca134 for posting how to add custom right click options to items!

 

I've made a simple script(s) that add right click upgrade/downgrade options to most of the guns with different variations, at the moment you only need scrap metal to upgrade and canvas to add camo to the M4 and SVD's.

 

1. Override player_selectSlot in your compiles.sqf

 

2. Replace your ui_selectSlot.sqf with http://pastebin.com/08rt8awZ

 

3. Add 

#include "OWS\ows.hpp"

 to your Description.ext.

 

4. Download http://d01.megashares.com/dl/BcfBloJ/OWS.rar and extract it to your mission file.

 

5. Compile your PBO and gooo.

 

I know it is not the most well made script so feel free to edit or make it better, all I ask is that you share your fixes/changes :) I hope someone finds any use for this.

Link to comment
Share on other sites

  • 3 weeks later...

I have never seen this before. Seems like a really cool idea. 

Could you fix the Download link so we can have a look at it ;) 

 

- Have you been running it on a open server? if so are there any downsides of this script. 

- does it run fine on the new epoch version 1.3.1?

Link to comment
Share on other sites

  • 2 weeks later...

hey,

this is a nice script  but i will more realistics, what must i change to need millitary flashlight and a windscreen too.

 

if (("M4A1" in weapons player) && ("PartGeneric" in magazines player) && ("ItemToolbox" in items player)) then {
player playActionNow "Medic";
sleep 2;
if (("M4A1" in weapons player) && ("PartGeneric" in magazines player)) then {
player removeWeapon "M4A1";
player removeMagazine "PartGeneric";
sleep 2;
player addWeapon "M4A1_Aim";
} else {
};
titleText ["You have attatched the Aimpoint Sight.","PLAIN DOWN"]; titleFadeOut 5;
} else {
titleText ["You don't have the required Tools/Items!","PLAIN DOWN"]; titleFadeOut 5;
};

 

 

i hope anybody can help me

 

cheers

Link to comment
Share on other sites

Not tested!

change "ItemFlashlight" to "ItemFlashlightRed" to use the military flashlight

private ["_neededItems","_itemsPlayer","_hasItems"];
_itemsPlayer = items player;
_itemsPlayer = _itemsPlayer + magazines player;
_itemsPlayer = _itemsPlayer + weapons player;
_neededItems = ["M4A1","ItemFlashLight","PartGeneric","ItemToolbox","PartGlass"];
_hasItems = {_x in _itemsPlayer} forEach _neededItems;

if (_hasItems) then {
	player playActionNow "Medic";
	sleep 2;
	player removeWeapon "M4A1";
	player removeMagazine "PartGeneric";
	player removeWeapon "ItemFlashlight";
        player removeMagazine "PartGlass";
	sleep 2;
	player addWeapon "M4A1_Aim";
	titleText ["You have attatched the Aimpoint Sight.","PLAIN DOWN"]; titleFadeOut 5;
} else {
	titleText ["You don't have the required Tools/Items!","PLAIN DOWN"]; titleFadeOut 5;
};

or this way:

private ["_neededItems","_itemsPlayer","_hasItems"];
_itemsPlayer = items player;
_itemsPlayer = _itemsPlayer + magazines player;
_itemsPlayer = _itemsPlayer + weapons player;
_neededItems = ["M4A1","ItemFlashLight","PartGeneric","PartGlass"];
_hasItems = {_x in _itemsPlayer} forEach _neededItems;

if (_hasItems && "ItemToolbox" in _itemsPlayer) then {
	player playActionNow "Medic";
	{[player, _x, 1] call BIS_fnc_invRemove} forEach _neededItems;
	player addWeapon "M4A1_Aim";
	titleText ["You have attatched the Aimpoint Sight.","PLAIN DOWN"]; titleFadeOut 5;
} else {
	titleText ["You don't have the required Tools/Items!","PLAIN DOWN"]; titleFadeOut 5;
};
Link to comment
Share on other sites

look for the classnames some are wrong

 

 

if (("M16A4_ACG" in weapons player) && ("ItemToolbox" in items player)) then {
    player playActionNow "Medic";
sleep 2;
if (("M16A4_ACG" in weapons player)) then {
player removeWeapon "M16A4_ACG";
sleep 2;
player addMagazine "PartGeneric";
player addWeapon "M16A2";
} else {
};
titleText ["You have detatched the Acog Scope.","PLAIN DOWN"]; titleFadeOut 5;
} else {
titleText ["You don't have the required Tools/Items!","PLAIN DOWN"]; titleFadeOut 5;
};

M16A4_ACG  is wrong  its M16A4_acg

Link to comment
Share on other sites

hmm this starts me thinking again. I like the concept.  

 

if you want you can help me. write me a pm

 

private ["_hasweapon","_hastool","_hastool2","_haspart","_haspart2"];


_hasweapon = "bizon" in weapons player;
_hastool = "ItemToolbox" in items player;
_hastool2 = "ItemKeyKit" in items Player;
_haspart = "PartGeneric" in magazines player;
_haspart2 = "ItemPole" in magazines player;


    if [_hasweapon && _hastool) then {
    sleep 1;
   if (_hasweapon && _hastool2) then {
        sleep 1;
       if (_hasweapon && _haspart) then {
       sleep 1;
if (_hasweapon && _haspart2) then {
               player playActionNow "Medic";
               [player,"repair",0,false] call dayz_zombieSpeak;
               player removeWeapon "bizon";
               player removeMagazine "PartGeneric";
               sleep 2;
               player addWeapon "bizon_silenced";
               titleText ["You have attatched a suppressor!","PLAIN DOWN"]; titleFadeOut 5;
           } else  { titleText ["dir fehlt metal pole","PLAIN DOWN"]; titleFadeOut 5;
           };
            } else { titleText ["dir fehlt scrap metal","PLAIN DOWN"]; titleFadeOut 5;
       }; 
        } else  { titleText ["dir fehlt ein keymakerkit","PLAIN DOWN"]; titleFadeOut 5;
        };
    } else  { titleText ["dir fehlt eine toolbox","PLAIN DOWN"]; titleFadeOut 5;
    };

this is not working but when i use it without _hastool2 and _haspart2 it will work,  anybody know why?

 

sorry for my bad english and the bad script but it´s my first script

 

cheers

Link to comment
Share on other sites

By "Override player_selectSlot in your compiles.sqf" does this mean completely comment it out? As theres no file to override with from what i can see

EDIT: Think i just worked out what it means now, override it with the custom ui_selectSlot.sqf, just checked my compiles.sqf and ui_selectSlot.sqf is the file player_selectSlot executes ^_^

EDIT #2: Using the modified ui_selectSlot causes my server to hang, i guess its outdated for epoch 1.0.3.1?

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
  • Advertisement
  • Discord

×
×
  • Create New...