Jump to content
  • 0

Coins system for epoch 106


Th3-Hunter333

Question

11 answers to this question

Recommended Posts

  • 0

Try to check dayz_code/configVariables.sqf there have good answer. ;)

 

// Trader Menu
DZE_ConfigTrader = true; // Use config files for traders instead of database. Loads faster and uses less network traffic. False enables database traders with legacy trader menu.
DZE_serverLogTrades = true; // Log trades to server RPT (sent with publicVariableServer on every trade)
DZE_GemWorthArray = [["ItemTopaz",15000], ["ItemObsidian",20000], ["ItemSapphire",25000], ["ItemAmethyst",30000], ["ItemEmerald",35000], ["ItemCitrine",40000], ["ItemRuby",45000]]; // Array of gem prices, only works with config traders.
DZE_SaleRequiresKey = false; // Require the player has the key for a vehicle in order to sell it. The key can be in the player's toolbelt, backpack, or the vehicle's inventory.
DZE_TRADER_SPAWNMODE = false; // Vehicles purchased at traders will be parachuted in
Z_VehicleDistance = 40; // Max distance a vehicle can be sold or accessed from at a trader.
Z_AllowTakingMoneyFromBackpack = true; // Allow traders to take money from backpacks when buying with default currency.
Z_AllowTakingMoneyFromVehicle = true; // Allow traders to take money from vehicles when buying with default currency.
Z_SingleCurrency = false; // Does your server use a single currency system?
CurrencyName = "Coins"; // If using single currency this is the currency display name.
Z_MoneyVariable = "cashMoney"; // If using single currency this is the variable name used to store player wealth.
DZE_MoneyStorageClasses = []; // If using single currency this is an array of object classes players can store coins in.

 

Link to comment
Share on other sites

  • 0
14 hours ago, J.Dominic said:

Try to check dayz_code/configVariables.sqf there have good answer. ;)

 


// Trader Menu
DZE_ConfigTrader = true; // Use config files for traders instead of database. Loads faster and uses less network traffic. False enables database traders with legacy trader menu.
DZE_serverLogTrades = true; // Log trades to server RPT (sent with publicVariableServer on every trade)
DZE_GemWorthArray = [["ItemTopaz",15000], ["ItemObsidian",20000], ["ItemSapphire",25000], ["ItemAmethyst",30000], ["ItemEmerald",35000], ["ItemCitrine",40000], ["ItemRuby",45000]]; // Array of gem prices, only works with config traders.
DZE_SaleRequiresKey = false; // Require the player has the key for a vehicle in order to sell it. The key can be in the player's toolbelt, backpack, or the vehicle's inventory.
DZE_TRADER_SPAWNMODE = false; // Vehicles purchased at traders will be parachuted in
Z_VehicleDistance = 40; // Max distance a vehicle can be sold or accessed from at a trader.
Z_AllowTakingMoneyFromBackpack = true; // Allow traders to take money from backpacks when buying with default currency.
Z_AllowTakingMoneyFromVehicle = true; // Allow traders to take money from vehicles when buying with default currency.
Z_SingleCurrency = false; // Does your server use a single currency system?
CurrencyName = "Coins"; // If using single currency this is the currency display name.
Z_MoneyVariable = "cashMoney"; // If using single currency this is the variable name used to store player wealth.
DZE_MoneyStorageClasses = []; // If using single currency this is an array of object classes players can store coins in.

 

Yeah I've picked that file apart digging for more but when I added a file to take money from the player and put it in the bank, it does not update the player cash or the bank. I will make the transfer in the game and then refresh the database to confirm if it's been done. I'm sure it's something simple but just got to figure it out.

Link to comment
Share on other sites

  • 0

First things in 1.0.6 Epoch SingleCurrency have a bank? I know just players can hold on body and keep in MoneyStorage and you must set object_id first in this

DZE_MoneyStorageClasses = [];

And if you want to edit DB you must abort to lobby —> edit db —> save —> join to the game.

But in take money from players corpse i not sure, Usually we can do that or you edit script.

Link to comment
Share on other sites

  • 0
8 minutes ago, J.Dominic said:

First things in 1.0.6 Epoch SingleCurrency have a bank? I know just players can hold on body and keep in MoneyStorage and you must set object_id first in this


DZE_MoneyStorageClasses = [];

And if you want to edit DB you must abort to lobby —> edit db —> save —> join to the game.

But in take money from players corpse i not sure, Usually we can do that or you edit script.

In the db, if you go to the player_data table, you'll notice another area for player coins and bank coins. I can't figure out how to get the coins to flow from the cash on the player to the bank, which I'm assuming is replacing that extra table from 1.0.5.1 where the banking data was stored there.

I also added the classes to the DZE_MoneyStorageClasses array but nothing ever showed up until I took part of Zupa's money storage script and added it to the fn_selfactions file, which then I would get the option for Money Storage.

Link to comment
Share on other sites

  • 0
2 hours ago, JohnnyBravo666 said:

In the db, if you go to the player_data table, you'll notice another area for player coins and bank coins. I can't figure out how to get the coins to flow from the cash on the player to the bank, which I'm assuming is replacing that extra table from 1.0.5.1 where the banking data was stored there.

I also added the classes to the DZE_MoneyStorageClasses array but nothing ever showed up until I took part of Zupa's money storage script and added it to the fn_selfactions file, which then I would get the option for Money Storage.

to read wealth/coins from a player:

_coins = player getVariable [z_moneyVariable,0];

to update a player with 5000 wealth/coins:

player setVariable [z_moneyVariable,5000,true];

With objects (DZE_moneyStorageClasses array) we can do exactly the same.

to read wealth/coins from cursorTarget (let's say vaultStorage):

_bankCoins = cursorTarget getVariable [z_moneyVariable,0];

to update cursorTarget with 5000 wealth/coins (let's say vaultStorage)

cursorTarget setVariable [z_moneyVariable,5000,true];

 

Link to comment
Share on other sites

  • 0
14 hours ago, salival said:

to read wealth/coins from a player:


_coins = player getVariable [z_moneyVariable,0];

to update a player with 5000 wealth/coins:


player setVariable [z_moneyVariable,5000,true];

With objects (DZE_moneyStorageClasses array) we can do exactly the same.

to read wealth/coins from cursorTarget (let's say vaultStorage):


_bankCoins = cursorTarget getVariable [z_moneyVariable,0];

to update cursorTarget with 5000 wealth/coins (let's say vaultStorage)


cursorTarget setVariable [z_moneyVariable,5000,true];

 

I have tried changing up parts of the script to reflect on these variables and all that, but for some reason, I'm just struggling. Currently struggling getting the coins to display in the dialog that allows me to withdraw or deposit.

 

I have the coin display on the right side of my screen working just fine, but not this dialog box.

Link to comment
Share on other sites

  • 0
34 minutes ago, JohnnyBravo666 said:

I have tried changing up parts of the script to reflect on these variables and all that, but for some reason, I'm just struggling. Currently struggling getting the coins to display in the dialog that allows me to withdraw or deposit.

 

I have the coin display on the right side of my screen working just fine, but not this dialog box.

Can you post on a Dropbox or similar what you have ready? It works fine for me.

Link to comment
Share on other sites

  • 0
5 hours ago, salival said:

Can you post on a Dropbox or similar what you have ready? It works fine for me.

Not sure what I did before but I just deleted everything and started again. Now it's working for me. I must've messed something up before which was causing it not to work.

Thank you a lot for your help. It is very much appreciated.

Link to comment
Share on other sites

  • 0
6 hours ago, icomrade said:

You can look through the files I've posted in my replies to the Single Currency 1.1 thread, they may be helpful as to what has changed

 

Yeah I had gone through this initially because when I saw it, I was all hell bent on being able to get it to work but I believe I messed something up somewhere because I deleted everything I had and restarted with it and everything juts magically worked afterwards haha.

Thank you!

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