Jump to content

Need help - Trader system


N340

Recommended Posts

Ok so here is my issue. I have a coin currency system setup in my server and a banking system setup for people to same coins. I have terminals ("Notebook") setup at each trader so people can exchange the coins to gold and gold to coins. My big issue is that when one person access the terminal, no one else can till after a restart. Its individual per item too so each one can be accessed at each trader but only by the first person that gets to it. 

 

I have it setup to it first detects you around the notebook

_checkSellers = _pos nearEntities ["US_Soldier_EP1",15],["Notebook",15]; 

Then calls the menus

if ((_isNote) and (theActionNB == 0)) then {
Myaction8 = _name addaction[("<t color=""#ff0000"">" + ("Trade Currencies") +"</t>"),"@DayZofDuty\DOD\Goldstore\Goldstore.sqs",_myLevel,0,false,true,"", ""];
Myaction3 = _name addaction[("<t color=""#ff8800"">" + ("Send Money") +"</t>"),"@DayZofDuty\dod\send.sqf",_myLevel,0,false,true,"", ""];
Myaction4 = _name addaction[("<t color=""#ff8800"">" + ("Deposit Money") +"</t>"),"@DayZofDuty\dod\deposit.sqf",_myLevel,0,false,true,"", ""];
Myaction5 = _name addaction[("<t color=""#ff8800"">" + ("Withdraw Money") +"</t>"),"@DayZofDuty\dod\withdraw.sqf",_myLevel,0,false,true,"", ""];
_fixaction = 1;
_name setVariable["actionNB",_fixaction, true];
};



if ((_isAI) and (theActionAI == 0)) then
{
Myaction6 = _name addaction[("<t color=""#ff8800"">" + ("Check Stats") +"</t>"),"@DayZofDuty\dod\stats.sqf",_myLevel,0,false,true,"", ""];
Myaction2 = _name addaction[("<t color=""#ff8800"">" + ("Open Gun Shop") +"</t>"),"@DayZofDuty\dod\gunshop\gunshop.sqs",_myLevel,0,false,true,"", ""];
Myaction3 = _name addaction[("<t color=""#ff8800"">" + ("Send Money") +"</t>"),"@DayZofDuty\dod\send.sqf",_myLevel,0,false,true,"", ""];
Myaction4 = _name addaction[("<t color=""#ff8800"">" + ("Deposit Money") +"</t>"),"@DayZofDuty\dod\deposit.sqf",_myLevel,0,false,true,"", ""];
Myaction5 = _name addaction[("<t color=""#ff8800"">" + ("Withdraw Money") +"</t>"),"@DayZofDuty\dod\withdraw.sqf",_myLevel,0,false,true,"", ""];
_fixaction = 1;
_name setVariable["actionAI",_fixaction, true];
};

if (_isAI) then
{
//isbuying
} else
{ 
	_pos = getPos player;
	_AIS = _pos nearEntities ["CAManBase",20];
	_count = count _AIS;
	for "_i" from 0 to (_count -1) do
	{
		_AI = _AIS select _i;
	if (_AI isKindOf "US_Soldier_EP1") then
	{
	_redoaction = 0;
		_AI removeAction Myaction2;
        _AI removeAction Myaction3;
        _AI removeAction Myaction4;
        _AI removeAction Myaction5;
        _AI removeAction Myaction6;
        _AI removeAction Myaction7;
		_AI setVariable["actionAI",_redoaction, true];
	};
	};
};

if (_isNote) then
{
//isbuying
} else
{ 
	_pos = getPos player;
	_AIS = _pos nearEntities ["CAManBase",20];
	_count = count _AIS;
	for "_i" from 0 to (_count -1) do
	{
		_AI = _AIS select _i;
	if (_AI isKindOf "Notebook") then
	{
	_redoaction = 0;
		_AI removeAction Myaction2;
        _AI removeAction Myaction8;
        _AI removeAction Myaction4;
        _AI removeAction Myaction5;
        _AI removeAction Myaction3;
		_AI setVariable["actionNB",_redoaction, true];
	};
	};
};

After this, its just the gold store menus. but those should not effect anything. 

 

 

If anyone can see anything wrong here please let me know

Link to comment
Share on other sites

Ok fixed that issue by changing my CAManBase to Notebook but now only 1 person can access it at a time and the person in it will get spammed with the menus

if (_isNote) then
{
//isbuying
} else
{ 
	_pos = getPos player;
	_AIS = _pos nearEntities ["Notebook",5];
	_count = count _AIS;
	for "_i" from 0 to (_count -1) do
	{
		_AI = _AIS select _i;
	if (_AI isKindOf "Notebook") then
	{
	_redoaction = 0;
		_AI removeAction Myaction2;
        _AI removeAction Myaction8;
        _AI removeAction Myaction4;
        _AI removeAction Myaction5;
        _AI removeAction Myaction3;
		_AI setVariable["actionNB",_redoaction, true];
	};
	};
};

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

×
×
  • Create New...