Jump to content
Repentz

[Tutorial] Simple Morphine/Bandages

Recommended Posts

SIMPLE MORPHINE AND BANDAGES

[Complete] You may attempt to install this, let me know if it works.

PNGPIX-COM-Medical-Kit-Box-PNG-Image.thumb.png.619e92ba8ca359d05a1ab0777fee73ec.png

 

 

Basically, this adds two new items: morphine and bandages, they heal over time instead of instantly, I removed all other sources of healing from my server to make it more realistic.

 

___________________________________________________________________________________________________________________________________________________________________________________

TUTORIAL

___________________________________________________________________________________________________________________________________________________________________________________

 

1. Download the attached icons.rar file

 

2. place them in your icons folder (make sure the virtual items code listed below calls to right location)

 

3. open config_vitems.sqf and place these in the class VirtualShops array:

class morphine {
        variable = "morphine";
        displayName = "STR_Item_Morphine";
        weight = 2;
        buyPrice = 1500;
        sellPrice = 300;
        illegal = true;
        edible = -1;
        icon = "images\icons\Morphine.paa";
    };

    class bandages {
        variable = "bandages";
        displayName = "STR_Item_Bandages";
        weight = 2;
        buyPrice = 200;
        sellPrice = 50;
        illegal = false;
        edible = -1;
        icon = "images\icons\ico_bandages.paa";
    };

 

 

4. Add 'morphine' and 'bandages' to whatever shops you want near the top of the file

 

5. Open stringtable.xml and add these:

<Key ID="STR_Item_Morphine">
            <Original>Morphine Syrette</Original>
        </Key>
        <Key ID="STR_Item_Bandages">
            <Original>Bandages</Original>
        </Key>

 

6. Open the useitem.sqf file, add these:

case (_item isEqualTo "morphine"):
	{
		[] spawn life_fnc_morphine;
	};

	case (_item isEqualTo "bandages"):
	{
		[] spawn life_fnc_bandages;
	};

 

7. (optional) If you want these items to save over restart/relog add them to the save_vehicle_items[] array in your config_master.hpp file

 

8. Download the scripts.rar file at the bottom, place the files inside into your core/items folder

 

9. Go into functions.h folder, add these into the core\items array:

class bandages {};
class morphine {};

 

icons.rar

scripts.rar

  • Like 5

Share this post


Link to post
Share on other sites
On 19/09/2017 at 9:11 PM, Deadlesszombie said:

Interesting script!

i myself added bandages and gave the action for players to heal players when they have them to simply 100%

Hello can you tell me how to do that please ?

i'm on Altis 5.0

Thanks

Share this post


Link to post
Share on other sites
1 hour ago, Thierry said:

Hello can you tell me how to do that please ?

i'm on Altis 5.0

Thanks

unfortunately i do not want to publically release that, but simply make a new vItem, add it to the Fn_UseItem and make it spawn a function that sets the player health to 100 for a very basic version

  • Like 2

Share this post


Link to post
Share on other sites
On 24/11/2017 at 10:33 PM, Deadlesszombie said:

unfortunately i do not want to publically release that, but simply make a new vItem, add it to the Fn_UseItem and make it spawn a function that sets the player health to 100 for a very basic version

Ok thanks

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

×