Jump to content

[RELEASE] Banker NPCs (to replace ATM objects)


Recommended Posts

Hi Dave,

 

No, no fix was found. I'm not that familiar with coding, so I tried my hand at a few things, broke most of it, and then reverted to original and gave up. I think someone more experienced is going to have to step in and help.

 

It doesn't seem to affect anything though. So it's not a critical issue.

Link to comment
Share on other sites

yea i made all my traders bankers and traders with gold/coin exchange also added Advanced Trading did not add any extra trader to my server just used my current traders cut and paste lol also changed the coin.paa to a bitcoin.paa  cos bitcoins are the future of currency wait 10 years and u will all use crypto coins just wish the bitcoins on my server were real lol

 

Very nice instead of ATM's no need to have those map markers flooding the map

Link to comment
Share on other sites

  • 3 weeks later...

Hi Dave,

 

No, no fix was found. I'm not that familiar with coding, so I tried my hand at a few things, broke most of it, and then reverted to original and gave up. I think someone more experienced is going to have to step in and help.

 

It doesn't seem to affect anything though. So it's not a critical issue.

I dont get an error in my server RPT but I get a very similar error in my client RPT. I belive there needs to be a

 

if (!isNil cursorTarget ) then {

somewhere in the fn self actions block of code but Im not very good with debugging

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 3 weeks later...

any fix sorted for this please?

 

 

_banker = _cursorTarget getVariable["BankerBot",0]>

  Error position: <_cursorTarget getVariable["BankerBot",0]>
  Error Undefined variable in expression: _cursortarget
File mpmissions\__CUR_MP.Chernarus\custom\fn_selfActions.sqf, line 1255
Error in expression <gazines player);
Link to comment
Share on other sites

  • 4 weeks later...

+1 this

Currently trying to get this to work with Soul Coins 2.0 as well. Looks like Bankerbot variable is undefined.

 

Do your bankers have the variable set?

 

-edit-

 

Found the problem. _cursorTarget is the unset variable not an action.... What the code should look like.... [For Soul's 2.0]

if((cursorTarget getVariable ["BankerBot",0] == 1) and (player distance cursorTarget < 3)) then {          
        if (s_bank_dialog3 < 0) then {
            s_bank_dialog3 = player addAction ["your bank here", "Scripts\Gold_Coin_system\Bank_Dialog\bank_dialog.sqf", cursorTarget, 3, true, true, "", ""];
        };            
    } else {        
        player removeAction s_bank_dialog3;
        s_bank_dialog3 = -1;
    };

Link to comment
Share on other sites

Currently trying to get this to work with Soul Coins 2.0 as well. Looks like Bankerbot variable is undefined.

 

Do your bankers have the variable set?

 

-edit-

 

Found the problem. _cursorTarget is the unset variable not an action.... What the code should look like.... [For Soul's 2.0]

if((cursorTarget getVariable ["BankerBot",0] == 1) and (player distance cursorTarget < 3)) then {          
        if (s_bank_dialog3 < 0) then {
            s_bank_dialog3 = player addAction ["your bank here", "Scripts\Gold_Coin_system\Bank_Dialog\bank_dialog.sqf", cursorTarget, 3, true, true, "", ""];
        };            
    } else {        
        player removeAction s_bank_dialog3;
        s_bank_dialog3 = -1;
    };

I think the issue with cursorTarget being undefined has to do with where you are calling this in the fn_selfActions.sqf. There is an area in fn_selfActions.sqf which defines cursor target.

It's a huge block of code but it starts off defining cursortarget.

 

if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) then {	//Has some kind of target

	_cursorTarget = cursorTarget;
	_typeOfCursorTarget = typeOf _cursorTarget;
	_isVehicle = _cursorTarget isKindOf "AllVehicles";
	_isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
	_isnewstorage = _typeOfCursorTarget in DZE_isNewStorage;
	_magazinesPlayer = magazines player;
	_hasbottleitem = "ItemWaterbottle" in _magazinesPlayer;
	_hastinitem = false;
Link to comment
Share on other sites

_cursorTarget is being called inside the code of....

if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) then {  

After that code finishes after the " }; " it frees the variable _cursorTarget. Any variable defined with an _ prefix is considered local only to the block of code that it is being ran in.

So instead of increasing the size of the block of code by re adding the _cursorTarget variable and definition... I shrunk it down so that it performs the same function with cursorTarget (which is a global define, (lacks "_")).

 

I have it running smoothly for the most part other than getting the error....

Error Undefined variable in expression: s_bank_dialog3
File mpmissions\__CUR_MP.chernarus\Scripts\Fn_SelfActions\fn_selfActions.sqf, line 880

I'm thinking that's because I set the changed bottom to dialog3, instead of like dialog4 or something else I did foolishly.

(But otherwise the code works flawlessly)

 

-edit-

The issue Im thinking, is with adding the code to the bottom then having step 3( B ) add the extra >> s_bank_dialog3 = -1; << above it. So moving the block I supplied to say above...

if(_cursorTarget isKindOf "Generator_DZ") then {

Should probably work.

 

-edit2-

Just realized the _cursorTarget should be defined for the original script as it falls inside the block where it's defined, still a little odd. Might have to look into that some more.

-edit 3-

More derp-ness, if you put the code block at the bottom it isn't included with _cursorTarget. (The code that defines _cursorTarget ends about 3 lines after the first >>> s_player_followdog = -1; <<<

Link to comment
Share on other sites

_cursorTarget is being called inside the code of....

if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) then {  

After that code finishes after the " }; " it frees the variable _cursorTarget. Any variable defined with an _ prefix is considered local only to the block of code that it is being ran in.

So instead of increasing the size of the block of code by re adding the _cursorTarget variable and definition... I shrunk it down so that it performs the same function with cursorTarget (which is a global define, (lacks "_")).

 

I have it running smoothly for the most part other than getting the error....

Error Undefined variable in expression: s_bank_dialog3
File mpmissions\__CUR_MP.chernarus\Scripts\Fn_SelfActions\fn_selfActions.sqf, line 880

I'm thinking that's because I set the changed bottom to dialog3, instead of like dialog4 or something else I did foolishly.

(But otherwise the code works flawlessly)

 

-edit-

The issue Im thinking, is with adding the code to the bottom then having step 3( B ) add the extra >> s_bank_dialog3 = -1; << above it. So moving the block I supplied to say above...

if(_cursorTarget isKindOf "Generator_DZ") then {

Should probably work.

 

-edit2-

Just realized the _cursorTarget should be defined for the original script as it falls inside the block where it's defined, still a little odd. Might have to look into that some more.

-edit 3-

More derp-ness, if you put the code block at the bottom it isn't included with _cursorTarget. (The code that defines _cursorTarget ends about 3 lines after the first >>> s_player_followdog = -1; <<<

Once I moved that block of code up into the the cursortarget block that error went away for me. I could be wrong though I have another script which is spamming my client RPT like crazy which Ive been fooling with.

Link to comment
Share on other sites

I believe i have a possible fix for this, if using souls single currency mainly.

Basically just remove the banker bot line from fn_selfactions and open variables.sqf. At the top you should see something similar to this:

 

Bank_Object = ["BANKOBJECT"]; // Object to get option to bank

 

just change the BANKOBJECT to your banker class name ie Functionary2 and have all your bankers the same skin and no more spam.

 

Hope this helped.

Max

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

yea i made all my traders bankers and traders with gold/coin exchange also added Advanced Trading did not add any extra trader to my server just used my current traders cut and paste lol also changed the coin.paa to a bitcoin.paa  cos bitcoins are the future of currency wait 10 years and u will all use crypto coins just wish the bitcoins on my server were real lol

 

Very nice instead of ATM's no need to have those map markers flooding the map

Can you explain how you did this? I have been looking for a way and all the things I tried have failed.

Link to comment
Share on other sites

  • 7 months later...

^^ What a noob I was then.

 

Here is a much easier way (not taking credit away from the post)

Find this in your fnSelfActions.sqf:

 

} else {
        {player removeAction _x} count s_player_combi;s_player_combi = [];
        s_player_unlockvault = -1;
    };

Below add this:

(Make sure to edit the file path)

 

if(_traderType in bankTraders and (player distance _cursorTarget < 3)) then {        
        if (s_banktrader_dialog < 0) then {
            s_banktrader_dialog = player addAction ["Bank", "FilePath\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
        };            
    } else {        
        player removeAction s_banktrader_dialog;
        s_banktrader_dialog = -1;
 };

In server_traders.sqf add:

(Add whatever trader's you want to have the Bank Option)

 

bankTraders = ["Functionary1_EP1_DZ"];

Again in fnselfactions find:

 

player removeAction s_player_fuelauto;

s_player_fuelauto = -1;

Add this underneath:

 

player removeAction s_banktrader_dialog;

s_banktrader_dialog = -1;

To stop any client side errors - in variables.sqf find:

 

dayz_resetSelfActions

Add the following to that list:

 

s_banktrader_dialog = -1;

Complete :)

Again, not trying to take away from this post. If I am violating any rules please delete this :)

Link to comment
Share on other sites

  • 5 weeks later...

For all those people that are having issues with being able to access the bank menu from ages away from where you bank actually is, i found how to fix it after like 2 hours. Thank me later:

 

First go to your fn_selfactions.sqf:

1. Search for:

player removeAction s_player_towing;
    s_player_towing = -1;
    player removeAction s_player_fuelauto;
    s_player_fuelauto = -1;
    player removeAction s_player_fuelauto2;
    s_player_fuelauto2 = -1;

Copy & Paste this directly under that code:

        // Banks
    player removeAction s_bank_dialog9;
    s_bank_dialog9 = -1;

 

2. Go to the bottom of your fn_selfactions.sqf file, find this:

if((_banker == 1) and (player distance _cursorTarget < 3)) then {        
        if (s_bank_dialog9 < 0) then {
            s_bank_dialog9 = player addAction ["OzGT Bank", "gold\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
        };            
    } else {        
        player removeAction s_bank_dialog3;
        s_bank_dialog3 = -1;
    };

Copy & paste this code over the old code:

if((_banker == 1) and (player distance _cursorTarget < 3)) then {        
        if (s_bank_dialog9 < 0) then {
            s_bank_dialog9 = player addAction ["OzGT Bank", "gold\bank_dialog.sqf",_cursorTarget, 3, true, true, "", ""];
        };            
    } else {        
        player removeAction s_bank_dialog9;
        s_bank_dialog9 = -1;
    };

 

3. Navigate to: @Dayz_Epoch/addons/dayz_code.pbo  drag that file to your desktop or where you want to, use pbo manager to unpack it navigate to dayz_code/compile drag the new fn_SelfActions.sqf file to the compile folder and overwrite the old fn_SelfActions.sqf file.

 

4. Navigate to: MPMissions/YourMissionYouUse/Compile drop the new fn_SelfActions.sqf file there and overwrite the old one,

 

That's it! that fixed it for me, if anyone needs help at all just jump on my teamspeak ill be more then happy to try and help you!

ts: 27.50.70.178:10101

Best of luck fixing it!

 

 

 

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...