Autor: RYAN TT.
1. mpmissions/Functions.hpp und sucht nach class Dialog_Controls schreibt darunter das hier:
Code
class DynMarket
{
file = "core\DynMarket";
class bought {};
class update {};
class DisplayPrices {};
class LoadIntoListbox {};
class ForcePrice {};
class DYNMARKET_getPrice {};
};
2. mpmissions/core/init.sqf und schreibt das ganz unten rein:
Code
DYNAMICMARKET_boughtItems = [];
[[getPlayerUID player],"TON_fnc_playerLogged",false,false] spawn life_fnc_MP;
3. mpmissions/dialog/MasterHandler.hpp schreibt das rein:
4. mpmissions/dialog/player_inv.hpp sucht nach class ButtonSyncData : life_RscButtonMenu und schreibt unter den Button das rein:
Code
class ButtonMarket : Life_RscButtonMenu {
idc = -1;
text = "Markt";
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);
};
5.
Ersetzt den Inhalt von der fn_virt_sell.sqf durch das:
Code: fn_virt_sell.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_virt_sell.sqf
Author: Bryan "Tonic" Boardwine
Description:
Sell a virtual item to the store / shop
*/
private["_type","_index","_price","_amount","_name"];
if(EQUAL(lbCurSel 2402,-1)) exitWith {};
_type = lbData[2402,(lbCurSel 2402)];
_price = 0.0;
_itemNameToSearchFor = _type;
{
_curItemName = _x select 0;
_curItemPrice = _x select 1;
if (_curItemName==_itemNameToSearchFor) then {_price=_curItemPrice};
} forEach DYNMARKET_prices;
//_price = [_type] call life_fnc_DYNMARKET_getPrice;
//_price = M_CONFIG(getNumber,"VirtualItems",_type,"sellPrice");
if(EQUAL(_price,-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"};
_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];
ADD(CASH,_price);
[] call life_fnc_virt_update;
DYNAMICMARKET_boughtItems pushBack [_type,_amount];
};
if(EQUAL(life_shop_type,"drugdealer")) then {
private["_array","_ind","_val"];
_array = life_shop_npc getVariable["sellers",[]];
_ind = [getPlayerUID player,_array] call TON_fnc_index;
if(!(EQUAL(_ind,-1))) then {
_val = SEL(SEL(_array,_ind),2);
ADD(_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];
};
};
[0] call SOCK_fnc_updatePartial;
[3] call SOCK_fnc_updatePartial;
Alles anzeigen
6. Ladet euch den DynMarket herunter und fügt Ordner ein !
DER LIVE SERVER TEIL:
1. life_server/config.cpp sucht nach:
schreibt das darunter:
Code
class DynMarket
{
file = "\life_server\Functions\DynMarket";
class calculatePrices {};
class config {};
class getUpdate {};
class HandleDB {};
class playerLogged {};
class sleeper {};
};
2. life_server/init.sqf
Datenbank: