Jump to content

Trade your briefcase with an rightclick option


Recommended Posts

Hello guys i reworked an script original published on opendayz.net (http://opendayz.net/threads/release-right-click-to-sell-brief.20739/)

so it works with the new singlecurrency version, that handles money as "cashMoney" and not "headshots"

if this in anyway inflicts with the copyright, then please remove this thread

first of all make a new file named SellBrief.sqf

and paste the following inside

Spoiler

// Sell briefcasescript by Nexus hellsplayground.us
//Special thanks to Matt L for the frame for this. Used his carepackage script.
//altered by Cherdenko for Zupa SC 3.0/4.0/Souls Hive

private ["_itemUse","_cost","_hasBriefs","_body", "_hisMoney", "_myMoney", "_killsH", "_test2", "_headShots", "_test","_playeridke","_humanity","_sellPrice"];
//////////////////////////CONFIG//////////////////////////////////////S
_cost = 1; //amount of item to take
_itemUse = "ItemBriefCase100oz";// type of item
_hasBriefs = {_itemUse == _x} count (magazines player); //no real use being here unless you make it require a tool, then change magazines to weapons

//END CONFIG

if (_hasBriefs >= _cost) then {

for "_i" from 0 to _cost - 1 do {
player removeMagazine _itemUse;
};

_myMoney = player getVariable ["cashMoney",0];
_myMoney = _myMoney + 50000;                           // Money trade value
_body setVariable ["cashMoney", 0 , true];
player setVariable ["cashMoney", _myMoney , true];

systemChat format ['You traded your brief for half price. Go to the trader next time for the full amount.'];
sleep 2;

_cid =    player getVariable ["CharacterID","0"];

_cashmoneyZupa = player getVariable ["cashMoney",0];


            if(_cashmoneyZupa > 0) then{
                
                }else{
                _cashmoneyZupa = 0;
                };

player setVariable ["moneychanged",1,true];    

} else {

};

after that add this

Spoiler

    class ItemBriefCase100oz {
        class Coin {
            text = "Sell for half value.";
            script = "execVM 'custom\SellBrief.sqf'";
        };
    };

to your extra_rc.hpp

maybe someone can also set up the code for deploy anything(im not using it at the moment, so i don´t know the format)

 

 

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

×
×
  • Create New...