Jump to content
Erih

Shop ERROR

Recommended Posts

Help me. When shopping, the product list does not appear.

#include "..\..\script_macros.hpp"

private ["_type","_price","_amount","_diff","_name","_hideout"];
if ((lbCurSel 2401) isEqualTo -1) exitWith {hint localize "STR_Shop_Virt_Nothing"};
_type = lbData[2401,(lbCurSel 2401)];
_price = lbValue[2401,(lbCurSel 2401)];
_amount = ctrlText 2404;



if (!([_amount] call RodinaClient_system_isnumber)) exitWith {hint localize "STR_Shop_Virt_NoNum";};
_diff = [_type,parseNumber(_amount),life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
_amount = parseNumber(_amount);
if (_diff <= 0) exitWith {hint localize "STR_NOTF_NoSpace"};
_amount = _diff;
_hideout = (nearestObjects[getPosATL player,["Land_u_Barracks_V2_F","Land_i_Barracks_V2_F"],25]) select 0;

if ((_price * _amount) > CASH && {!isNil "_hideout" && {!isNil {group player getVariable "gang_bank"}} && {(group player getVariable "gang_bank") <= _price * _amount}}) exitWith {hint localize "STR_NOTF_NotEnoughMoney"};
if ((time - life_action_delay) < 0.2) exitWith {hint localize "STR_NOTF_ActionDelay";};
life_action_delay = time;

_name = M_CONFIG(getText,"LifeCfgVirtualItems",_type,"displayName");

if ([true,_type,_amount] call RodinaClient_system_handleInv) then {
    if (!isNil "_hideout" && {!isNil {group player getVariable "gang_bank"}} && {(group player getVariable "gang_bank") >= _price}) then {
        _action = [
            format [(localize "STR_Shop_Virt_Gang_FundsMSG")+ "<br/><br/>" +(localize "STR_Shop_Virt_Gang_Funds")+ " <t color='#8cff9b'>$%1 рублей</t><br/>" +(localize "STR_Shop_Virt_YourFunds")+ " <t color='#8cff9b'>$%2 рублей</t>",
                [(group player getVariable "gang_bank")] call RodinaClient_system_numberText,
                [CASH] call RodinaClient_system_numberText
            ],
            localize "STR_Shop_Virt_YourorGang",
            localize "STR_Shop_Virt_UI_GangFunds",
            localize "STR_Shop_Virt_UI_YourCash"
        ] call BIS_fnc_guiMessage;
        if (_action) then {
            hint format [localize "STR_Shop_Virt_BoughtGang",_amount,(localize _name),[(_price * _amount)] call RodinaClient_system_numberText];
            _funds = group player getVariable "gang_bank";
            _funds = _funds - (_price * _amount);
            group player setVariable ["gang_bank",_funds,true];

            if (life_HC_isActive) then {
                [1,group player] remoteExecCall ["HC_fnc_updateGang",HC_Life];
            } else {
                [1,group player] remoteExecCall ["TON_fnc_updateGang",RSERV];
            };

        } else {
            if ((_price * _amount) > CASH) exitWith {[false,_type,_amount] call RodinaClient_system_handleInv; hint localize "STR_NOTF_NotEnoughMoney";};
            hint format [localize "STR_Shop_Virt_BoughtItem",_amount,(localize _name),[(_price * _amount)] call RodinaClient_system_numberText];
            CASH = CASH - _price * _amount;
        };
    } else {
        if ((_price * _amount) > CASH) exitWith {hint localize "STR_NOTF_NotEnoughMoney"; [false,_type,_amount] call RodinaClient_system_handleInv;};
        hint format [localize "STR_Shop_Virt_BoughtItem",_amount,(localize _name),[(_price * _amount)] call RodinaClient_system_numberText];
        CASH = CASH - _price * _amount;
    };
    [] call RodinaClient_system_virt_update;
};

[] call RodinaClient_system_saveGear;
life_action_inUse = false;

 

Share this post


Link to post
Share on other sites
8 hours ago, Erih said:

Help me. When shopping, the product list does not appear.

#include "..\..\script_macros.hpp"

private ["_type","_price","_amount","_diff","_name","_hideout"];
if ((lbCurSel 2401) isEqualTo -1) exitWith {hint localize "STR_Shop_Virt_Nothing"};
_type = lbData[2401,(lbCurSel 2401)];
_price = lbValue[2401,(lbCurSel 2401)];
_amount = ctrlText 2404;



if (!([_amount] call RodinaClient_system_isnumber)) exitWith {hint localize "STR_Shop_Virt_NoNum";};
_diff = [_type,parseNumber(_amount),life_carryWeight,life_maxWeight] call life_fnc_calWeightDiff;
_amount = parseNumber(_amount);
if (_diff <= 0) exitWith {hint localize "STR_NOTF_NoSpace"};
_amount = _diff;
_hideout = (nearestObjects[getPosATL player,["Land_u_Barracks_V2_F","Land_i_Barracks_V2_F"],25]) select 0;

if ((_price * _amount) > CASH && {!isNil "_hideout" && {!isNil {group player getVariable "gang_bank"}} && {(group player getVariable "gang_bank") <= _price * _amount}}) exitWith {hint localize "STR_NOTF_NotEnoughMoney"};
if ((time - life_action_delay) < 0.2) exitWith {hint localize "STR_NOTF_ActionDelay";};
life_action_delay = time;

_name = M_CONFIG(getText,"LifeCfgVirtualItems",_type,"displayName");

if ([true,_type,_amount] call RodinaClient_system_handleInv) then {
    if (!isNil "_hideout" && {!isNil {group player getVariable "gang_bank"}} && {(group player getVariable "gang_bank") >= _price}) then {
        _action = [
            format [(localize "STR_Shop_Virt_Gang_FundsMSG")+ "<br/><br/>" +(localize "STR_Shop_Virt_Gang_Funds")+ " <t color='#8cff9b'>$%1 рублей</t><br/>" +(localize "STR_Shop_Virt_YourFunds")+ " <t color='#8cff9b'>$%2 рублей</t>",
                [(group player getVariable "gang_bank")] call RodinaClient_system_numberText,
                [CASH] call RodinaClient_system_numberText
            ],
            localize "STR_Shop_Virt_YourorGang",
            localize "STR_Shop_Virt_UI_GangFunds",
            localize "STR_Shop_Virt_UI_YourCash"
        ] call BIS_fnc_guiMessage;
        if (_action) then {
            hint format [localize "STR_Shop_Virt_BoughtGang",_amount,(localize _name),[(_price * _amount)] call RodinaClient_system_numberText];
            _funds = group player getVariable "gang_bank";
            _funds = _funds - (_price * _amount);
            group player setVariable ["gang_bank",_funds,true];

            if (life_HC_isActive) then {
                [1,group player] remoteExecCall ["HC_fnc_updateGang",HC_Life];
            } else {
                [1,group player] remoteExecCall ["TON_fnc_updateGang",RSERV];
            };

        } else {
            if ((_price * _amount) > CASH) exitWith {[false,_type,_amount] call RodinaClient_system_handleInv; hint localize "STR_NOTF_NotEnoughMoney";};
            hint format [localize "STR_Shop_Virt_BoughtItem",_amount,(localize _name),[(_price * _amount)] call RodinaClient_system_numberText];
            CASH = CASH - _price * _amount;
        };
    } else {
        if ((_price * _amount) > CASH) exitWith {hint localize "STR_NOTF_NotEnoughMoney"; [false,_type,_amount] call RodinaClient_system_handleInv;};
        hint format [localize "STR_Shop_Virt_BoughtItem",_amount,(localize _name),[(_price * _amount)] call RodinaClient_system_numberText];
        CASH = CASH - _price * _amount;
    };
    [] call RodinaClient_system_virt_update;
};

[] call RodinaClient_system_saveGear;
life_action_inUse = false;

 

do you have a custom shop gui?

Share this post


Link to post
Share on other sites
18 hours ago, ToxicRageTv said:

do you have a custom shop gui?

My server is based on Altis Life Union. But initially there is no purchase function.

Link on Altis Life Union

I tried to move the function from Altis Life 5.0 & Altis Life 4.0, but nothing helped.

If you can, please help me.

Edited by Erih

Share this post


Link to post
Share on other sites
45 minutes ago, Semprus Gaming said:

@Erih That github does not even have a sql file so how are you even running it.

> mpmission

> SQF files

Share this post


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

This is what happens when you don’t use a supported framework & someone else’s files

What if there is no buy function?

Share this post


Link to post
Share on other sites
23 minutes ago, Deadlesszombie said:

You aren't understanding what i am telling you

this is someones custom framework they adapted on from an old version of altisliferpg

if you want support and recent files, build your server off of this

https://github.com/AsYetUntitled/Framework

 

This is standart Altis Life ?

Share this post


Link to post
Share on other sites

Oh-oh, system_virt_sell code:

#include "..\..\script_macros.hpp"
if (life_action_inUse) exitWith {};
if (EQUAL((lbCurSel 2402),-1)) exitWith {};
call RodinaClient_actions_inUse;
private _type = CONTROL_DATA(2402);
if (EQUAL(life_shop_type,"bar") && (_type in ["bottledwhiskey","bottledbeer"])) exitWith {
	hint "The bar does not buy alcoholic beverages. The buyer is in a different place.";
	life_action_inUse = false;
};
private _index = [_type,sell_array] call RodinaClient_system_index;
if (EQUAL(_index,-1)) exitWith {life_action_inUse = false};

if ((time - life_vshop_timer) < 3) exitWith {hint "You push the SELL button too fast! We recommend that you specify the required number when selling the same items, instead of pressing the button a hundred times!"; life_action_inUse = false};
life_vshop_timer = time;

private _amount = ctrlText 2403;
if !([_amount] call RodinaClient_system_isnumber) exitWith {hint localize "STR_Shop_Virt_NoNum"; life_action_inUse = false};
_amount = parseNumber (_amount);

private _sellall = param [0,false,[true]];
if (_sellall) then {_amount = ITEM_VALUE(_type)};
if (_amount > ITEM_VALUE(_type)) exitWith {hint localize "STR_Shop_Virt_NotEnough"; life_action_inUse = false};

private _legal = [_type,life_illegal_items] call RodinaClient_system_index;
private _price = (((sell_array select _index) select 1) * _amount);
if ((FETCH_CONST(life_donator) > 0) && (playerSide in [civilian,east])) then {_price = [_price,1] call RodinaClient_system_discount};
if (life_is_arrested) then {_price = round _price/2};

if ([false,_type,_amount] call RodinaClient_system_handleInv) then {
	if (EQUAL(_legal,-1)) then {
		private _tax = round (_price * (server_tax/100));
		ADD(life_tmp_tax,_tax);
		SUB(_price,_tax);
		_index = [_type,life_tmp_selled] call RodinaClient_system_index;
		if (EQUAL(_index,-1)) then {
			life_tmp_selled pushBack [_type,_amount];
		} else {
			_tmpamount = ((life_tmp_selled select _index) select 1) + _amount;
			life_tmp_selled set [_index,[_type,_tmpamount]];
		};

		hint format[localize "STR_Shop_Virt_SellItem_Tax",_amount,ITEM_NAME(_type),[_price] call RodinaClient_system_numberText,server_tax,"%",_tax];
		["cash","add",_price,"virtItemSell"] call RodinaClient_system_myCash;
	} else {
		hint format[localize "STR_Shop_Virt_SellItem",_amount,ITEM_NAME(_type),[_price] call RodinaClient_system_numberText];
		["dcash","add",_price,"virtItemSellillegal"] call RodinaClient_system_myCash;
	};
	[] call RodinaClient_system_virt_update;
};

if ((life_shop_type in ["heroin","uranium"]) && !(EQUAL(_legal,-1))) then {
	private["_array","_ind","_val"];
	_array = life_shop_npc GVAR ["sellers",[]];
	_ind = [steamid,_array] call RodinaClient_system_index;
	if !(EQUAL(_ind,-1)) then {
		_val = (_array select _ind) select 2;
		ADD(_val,_price);
		_array set[_ind,[steamid,GVAR_RNAME(player),_val]];
		life_shop_npc SVAR ["sellers",_array,true];
	} else {
		_array pushBack [steamid,GVAR_RNAME(player),_price];
		life_shop_npc SVAR ["sellers",_array,true];
	};
};

[] call RodinaClient_system_saveGear;
life_action_inUse = false;

 

Edited by Erih

Share this post


Link to post
Share on other sites
38 minutes ago, Erih said:

Oh-oh, system_virt_sell code:

#include "..\..\script_macros.hpp"
if (life_action_inUse) exitWith {};
if (EQUAL((lbCurSel 2402),-1)) exitWith {};
call RodinaClient_actions_inUse;
private _type = CONTROL_DATA(2402);
if (EQUAL(life_shop_type,"bar") && (_type in ["bottledwhiskey","bottledbeer"])) exitWith {
	hint "The bar does not buy alcoholic beverages. The buyer is in a different place.";
	life_action_inUse = false;
};
private _index = [_type,sell_array] call RodinaClient_system_index;
if (EQUAL(_index,-1)) exitWith {life_action_inUse = false};

if ((time - life_vshop_timer) < 3) exitWith {hint "You push the SELL button too fast! We recommend that you specify the required number when selling the same items, instead of pressing the button a hundred times!"; life_action_inUse = false};
life_vshop_timer = time;

private _amount = ctrlText 2403;
if !([_amount] call RodinaClient_system_isnumber) exitWith {hint localize "STR_Shop_Virt_NoNum"; life_action_inUse = false};
_amount = parseNumber (_amount);

private _sellall = param [0,false,[true]];
if (_sellall) then {_amount = ITEM_VALUE(_type)};
if (_amount > ITEM_VALUE(_type)) exitWith {hint localize "STR_Shop_Virt_NotEnough"; life_action_inUse = false};

private _legal = [_type,life_illegal_items] call RodinaClient_system_index;
private _price = (((sell_array select _index) select 1) * _amount);
if ((FETCH_CONST(life_donator) > 0) && (playerSide in [civilian,east])) then {_price = [_price,1] call RodinaClient_system_discount};
if (life_is_arrested) then {_price = round _price/2};

if ([false,_type,_amount] call RodinaClient_system_handleInv) then {
	if (EQUAL(_legal,-1)) then {
		private _tax = round (_price * (server_tax/100));
		ADD(life_tmp_tax,_tax);
		SUB(_price,_tax);
		_index = [_type,life_tmp_selled] call RodinaClient_system_index;
		if (EQUAL(_index,-1)) then {
			life_tmp_selled pushBack [_type,_amount];
		} else {
			_tmpamount = ((life_tmp_selled select _index) select 1) + _amount;
			life_tmp_selled set [_index,[_type,_tmpamount]];
		};

		hint format[localize "STR_Shop_Virt_SellItem_Tax",_amount,ITEM_NAME(_type),[_price] call RodinaClient_system_numberText,server_tax,"%",_tax];
		["cash","add",_price,"virtItemSell"] call RodinaClient_system_myCash;
	} else {
		hint format[localize "STR_Shop_Virt_SellItem",_amount,ITEM_NAME(_type),[_price] call RodinaClient_system_numberText];
		["dcash","add",_price,"virtItemSellillegal"] call RodinaClient_system_myCash;
	};
	[] call RodinaClient_system_virt_update;
};

if ((life_shop_type in ["heroin","uranium"]) && !(EQUAL(_legal,-1))) then {
	private["_array","_ind","_val"];
	_array = life_shop_npc GVAR ["sellers",[]];
	_ind = [steamid,_array] call RodinaClient_system_index;
	if !(EQUAL(_ind,-1)) then {
		_val = (_array select _ind) select 2;
		ADD(_val,_price);
		_array set[_ind,[steamid,GVAR_RNAME(player),_val]];
		life_shop_npc SVAR ["sellers",_array,true];
	} else {
		_array pushBack [steamid,GVAR_RNAME(player),_price];
		life_shop_npc SVAR ["sellers",_array,true];
	};
};

[] call RodinaClient_system_saveGear;
life_action_inUse = false;

 

this is not standard

Share this post


Link to post
Share on other sites
10 hours ago, Erih said:

:biblethump:

Did you contact the union Altis life people. Also what exactly is your problem? First you said the shop was empty but then you said something about a buy function. And also whenever you have a problem, post your rpt logs in a pastebin so we can get a little more info

Share this post


Link to post
Share on other sites
5 hours ago, ToxicRageTv said:

Did you contact the union Altis life people. Also what exactly is your problem? First you said the shop was empty but then you said something about a buy function. And also whenever you have a problem, post your rpt logs in a pastebin so we can get a little more info

Oh, sorry. Initially there was no buying function. Only the function of sale. I tried to add, but nothing happened.

Share this post


Link to post
Share on other sites

If this issue has been resolved, please confirm and reply with the resolution.  This topic will be closed if no reply is given in 72 hours. 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×