Open RuisSoftware opened 4 years ago
It works fine with ESX 1.2. I installed it, and it does calculate the right tax for vehicles. But the banking requires a re-write. As of now, the script selects the 'users' table, and the column 'bank', but essx 1.2 uses a column called 'accounts' where it concatenates all accounts into one column and stores it as JSON.
{"money":89567234,"bank":15623245,"black_money":562000000}
So, one need to parse this before calculating the tax. The function BankTax takes all values stored in JSON format...it takes all users 'bank' column value...ie. you current amount in the bank. Now, we could maybe parse this from the accounts column instead and feed them all into an array of sorts...since that 'Alluser' seem to have the users id.
Or maybe select all from accounts instead, and parse out the value before setting it to the tax-variable.
I'll see if I have the time to get it working, or wait for the author to fix it.
I cannot fix it ymself. Can you fix it?
Hey, I got this problem:
SCRIPT ERROR: @esx_tax/server/main.lua:17: attempt to compare nil with number
> async void MySQLAsync.Operation<System.Collections.Generic.List<System.Collections.Generic.Dictionary<string, object>>>+<ExecuteAsync>d__7.MoveNext() (@mysql-async/MySQLAsync.net.dll:0)
> async Task<List<Dictionary<string, object>>> MySQLAsync.FetchAll.ReaderAsync(MySqlCommand command) (@mysql-async/MySQLAsync.net.dll:0)
> async Task<bool> MySqlConnector.Core.ResultSet.ReadAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) (@mysql-async/MySqlConnector.dll:0)
> async ValueTask<Row> MySqlConnector.Core.ResultSet.ScanRowAsync(IOBehavior ioBehavior, Row row, CancellationToken cancellationToken)+ScanRowAsyncAwaited(?) (@mysql-async/MySqlConnector.dll:0)
@dutchplayers common you guys I know you can do it :D But here is the fix:
https://github.com/NebelBankNet/esx_tax/blob/master/server/main.lua#L13-L51
Creating a PR for this
Thank you very much. 👍
Any idea how to fix this error?
AllUser[i].bank is giving nil