Рет қаралды 1,929
N'oublier pas le petit pouce bleu et de vous abonner sur la chaîne, retrouvez-moi aussi sur twitch: / bochelan
Site: altisdev.com
Le Fichier DynMarket 5.0: www.dropbox.co...
les dossiers à modifier dans l'ordre de la vidéo:
Functions.hpp:
class DynMarket //kovix
{
file = "core\DynMarket";
class bought {};
class update {};
class DisplayPrices {};
class LoadIntoListbox {};
class ForcePrice {};
class DYNMARKET_getPrice {};
};
init.sqf :
//bourse 5.0
DYNAMICMARKET_boughtItems = [];
[player] remoteExec ["TON_fnc_playerLogged",RSERV];
MasterHandler.hpp:
#include "dynmarket_changeprice.hpp"
#include "dynmarket_prices.hpp"
player_inv.hpp:
class ButtonMarket : Life_RscButtonMenu {
idc = -1;
text = "Bourse";
onButtonClick = "createDialog ""life_dynmarket_prices"";";
x = 0.26 + (6.25 / 19.8) + (1 / 250 / (safezoneW / safezoneH));
y = 0.805;
w = (6.25 / 40);
h = (1 / 25);
};
fn_virt_sell.sqf:
#include "..\..\script_macros.hpp"
private["_type","_index","_price","_amount","_name"];
if ((lbCurSel 2402) isEqualTo -1) exitWith {};
_type = lbData[2402,(lbCurSel 2402)];
_price = -2;
_itemNameToSearchFor = _type;
{
_curItemName = _x select 0;
_curItemPrice = _x select 1;
if (_curItemName==_itemNameToSearchFor) then {_price=_curItemPrice};
} forEach DYNMARKET_prices;
if (_price isEqualTo -1) exitWith {};
if (_price isEqualTo -2) then {
_price = M_CONFIG(getNumber,"VirtualItems",_type,"sellPrice");
if (_price isEqualTo -1) exitWith {};
};
_amount = ctrlText 2405;
if (!([_amount] call TON_fnc_isnumber)) exitWith {hint localize "STR_Shop_Virt_NoNum";};
_amount = parseNumber (_amount);
if (_amount (ITEM_VALUE(_type))) exitWith {hint localize "STR_Shop_Virt_NotEnough"};
if ((time - life_action_delay) 0.2) exitWith {hint localize "STR_NOTF_ActionDelay";};
life_action_delay = time;
_price = (_price * _amount);
_name = M_CONFIG(getText,"VirtualItems",_type,"displayName");
if ([false,_type,_amount] call life_fnc_handleInv) then {
hint format[localize "STR_Shop_Virt_SellItem",_amount,(localize _name),[_price] call life_fnc_numberText];
CASH = CASH + _price;
[0] call SOCK_fnc_updatePartial;
[] call life_fnc_virt_update;
DYNAMICMARKET_boughtItems pushBack [_type,_amount];
};
if (life_shop_type isEqualTo "drugdealer") then {
private["_array","_ind","_val"];
_array = life_shop_npc getVariable["sellers",[]];
_ind = [getPlayerUID player,_array] call TON_fnc_index;
if (!(_ind isEqualTo -1)) then {
_val = ((_array select _ind) select 2);
_val = _val + _price;
_array set[_ind,[getPlayerUID player,profileName,_val]];
life_shop_npc setVariable["sellers",_array,true];
} else {
_array pushBack [getPlayerUID player,profileName,_price];
life_shop_npc setVariable["sellers",_array,true];
};
};
if (life_shop_type isEqualTo "gold" && (LIFE_SETTINGS(getNumber,"noatm_timer")) 0) then {
[] spawn {
life_use_atm = false;
sleep ((LIFE_SETTINGS(getNumber,"noatm_timer")) * 60);
life_use_atm = true;
};
};
[0] call SOCK_fnc_updatePartial;
[3] call SOCK_fnc_updatePartial;
config.cpp:
class DynMarket // Kovix
{
file = "\life_server\Functions\DynMarket";
class calculatePrices {};
class changePrice {};
class config {};
class getUpdate {};
class HandleDB {};
class playerLogged {};
class sleeper {};
};
init.sqf:
// Initialisation de la bourse (DynMarket).
[] execVM "\life_server\Functions\DynMarket\fn_config.sqf";
base de donnée:
CREATE TABLE `dynmarket` (
`id` INT NOT NULL DEFAULT 1,
`prices` TEXT NOT NULL,
PRIMARY KEY (`id`));
base de donnée 2:
INSERT INTO `dynmarket` VALUES (1,'[]');
CfgRemoteExec.hpp:
FWondershare Filmora