For some reason i cant choose currency to give when starting an race
TypeError: Cannot read properties of undefined (reading '__asyncLoader') (@cw-racingapp/html/dist/assets/index-7a605bca.js:1)
TypeError: Cannot read properties of null (reading 'parentNode') (@cw-racingapp/html/dist/assets/index-7a605bca.js:1)
TypeError: Cannot read properties of null (reading 'emitsOptions') (@cw-racingapp/html/dist/assets/index-7a605bca.js:1)
TypeError: Cannot read properties of null (reading 'emitsOptions') (@cw-racingapp/html/dist/assets/index-7a605bca.js:1)
TypeError: Cannot read properties of null (reading 'emitsOptions') (@cw-racingapp/html/dist/assets/index-7a605bca.js:1)
TypeError: Cannot read properties of null (reading 'emitsOptions') (@cw-racingapp/html/dist/assets/index-7a605bca.js:1)
TypeError: Cannot read properties of null (reading 'emitsOptions') (@cw-racingapp/html/dist/assets/index-7a605bca.js:1)
TypeError: Cannot read properties of null (reading 'emitsOptions') (@cw-racingapp/html/dist/assets/index-7a605bca.js:1)
TypeError: Cannot read properties of null (reading 'emitsOptions') (@cw-racingapp/html/dist/assets/index-7a605bca.js:1)
TypeError: Cannot destructure property 'bum' of 'x' as it is null. (@cw-racingapp/html/dist/assets/index-7a605bca.js:1)
#Participation currency [object Object]
1 messages ยท Page 1 of 1 (latest)
and these are all in 1 tab idk why
i tried with the default config and i still have this problem
Taking a look ๐๏ธ
Fixed 
There's also an option in the Config (participationCurrencyOptions in Config.Options) where you can select what shows up in the menu
No release yet, you'll have to grab the source code.
Yea that worked but any idea why the RAC menu is like that in your screenshots it was not all together
mine
yours
Does anything happen when you press sell/transfer?
Yea
And when you open the RAC menu you get no console printouts I assume since you did not include that?
It shouldnt change this.
You updated right? Did you just paste over the existing folders?
i updated
Could you try removing the html folder and replacing it with a fresh one?
How'd you go about with the config? Did you make sure everything new and changed was included?
Yea i used the 4.0.0 one and just changed the colour permision etc
also tried without any changes to the config and it was still like that
Found a potential reason
Not sure what the cause is
You can replace the dist folkder in the html folder with this, if you wanna test out the changes
i will try that in just a second
I'll see if I can find the reason, but it's probably some node packaging shit thats messing it up
that did not work
Did you remove the old dist folder?
yes
it got fixed
๐
just restarted my server
did that 2 times before but i guess the new dist worked
i just had to restart the server not the script
thanks alot
๐ nice
That'll work so you can test it at least. I'll try fixing the actual core issue
Unless there's more fix-fixes to the actual script you can probably skip the next version since it'll mainly just be fixing the NPM packages.
I update when a new patch is realised every time
So yea will do
Thanks again
Also i small issue i changed the buy to 0.01 because i wanted one RAC to cost $100 when u buy one it removes $99 from my cash not $100 any ideas
If i want it to cost $100 i should change it to 0.01 right
Because with 0.1 it removes $10
but for 0.01 removes $99
Looksl ike it's doing some rounding errors
here is the edits i made
conversionRate = 0.01, -- money * conversionRate = crypto amount, so if this is 0.1 and you pay $10 you get 1 Racing App Crypto. Changed from 0.1 to 0.01
sellCharge = 0.20, -- How much is lost upon selling. If 0.20 then you will lose 20% when the crypto is converted to cash
Changed from 0.05 to 0.20
You talked about the issue when buying, but I assume you meant when selling since thats what you posted later?
You sure?
I tried with your values and it did buying without issues
No idea why is that for me
i will try to restart the server to see
nah
it still removes 99 for me
I pushed a fix for the fee, it adds some more printouts
only need to update the server main.lua
nice
run with debug on
should i send you server side prints?
or client
also ran with debug and it gave me 99
also when selling it give it should have game me 160 for both but it gave me 159
๐
Server side prints
but if i make the conversionrate 0.1 and the sellcharge 0.5 it works
12:32:44 PM [ script:cw-racingapp] Crypto Amount: 1
12:32:44 PM [ script:cw-racingapp] In money: 10
12:32:44 PM [ script:cw-racingapp] Attempting to charge Valkata 10 cash
12:32:44 PM [ script:cw-racingapp] Payment successful```
12:33:02 PM [ script:cw-racingapp] Crypto Amount: 1
12:33:02 PM [ script:cw-racingapp] In money: 10.0
12:33:02 PM [ script:cw-racingapp] After fee: 5
12:33:02 PM [ script:cw-racingapp] Attempting to charge Valkata 1 racingcrypto
12:33:02 PM [ script:cw-racingapp] Attempting to give Valkata 5 cash```
Could you provide server logs when you do with the fee and conversion you wanted
when buying
12:34:48 PM [ script:cw-racingapp] Crypto Amount: 1
12:34:48 PM [ script:cw-racingapp] In money: 99
12:34:48 PM [ script:cw-racingapp] Attempting to charge Valkata 99 cash
12:34:48 PM [ script:cw-racingapp] Payment successful
12:34:48 PM [ script:cw-racingapp] Attempting to give Valkata 1 racingcrypto```
when selling with the fee
12:35:07 PM [ script:cw-racingapp] Crypto Amount: 1
12:35:07 PM [ script:cw-racingapp] In money: 99.999999999984
12:35:07 PM [ script:cw-racingapp] After fee: 79
12:35:07 PM [ script:cw-racingapp] Attempting to charge Valkata 1 racingcrypto
12:35:07 PM [ script:cw-racingapp] Attempting to give Valkata 79 cash```
i made some changes to the cw-racingapp:server:sellCrypto and now it gives me 80$
Ah it's probably that the 0.01 is to small
here is what i changed
local src = source
local rounded = math.floor((cryptoAmount / Config.Options.conversionRate) * 100 + 0.5) / 100
local feeAmount = math.floor((rounded * Config.Options.sellCharge) * 100 + 0.5) / 100
local afterFee = math.floor((rounded - feeAmount) * 100 + 0.5) / 100
if UseDebug then
print('Selling Crypto')
print('Crypto Amount:', cryptoAmount)
print('In money:', rounded)
print('Fee Amount:', feeAmount)
print('After fee:', afterFee)
end
if handleRemoveMoney(src, 'racingcrypto', cryptoAmount, racerName) then
handleAddMoney(src, Config.Payments.crypto, afterFee, racerName, 'sold_crypto')
return 'SUCCESS'
end
return 'NOT_ENOUGH'
end)```
after the changes it gives me $80 without problem
yea ๐
lua problems
fixed it in the cw-racingapp:server:purchaseCrypto also
local src = source
local moneyToPay = math.floor((cryptoAmount / Config.Options.conversionRate) * 100 + 0.5) / 100
if UseDebug then
print('Buying Crypto')
print('Crypto Amount:', cryptoAmount)
print('In money:', moneyToPay)
end
if handleRemoveMoney(src, Config.Payments.crypto, moneyToPay, racerName) then
handleAddMoney(src, 'racingcrypto', cryptoAmount, racerName, 'purchased_crypto')
return 'SUCCESS'
end
return 'NOT_ENOUGH'
end)```
local src = source
local moneyToPay = math.floor((cryptoAmount / Config.Options.conversionRate) * 100) / 100
if UseDebug then
print('Buying Crypto')
print('Crypto Amount:', cryptoAmount)
print('In money:', moneyToPay)
end
if handleRemoveMoney(src, Config.Payments.crypto, moneyToPay, racerName) then
handleAddMoney(src, 'racingcrypto', cryptoAmount, racerName, 'purchased_crypto')
return 'SUCCESS'
end
return 'NOT_ENOUGH'
end)
it should be good now right?
local src = source
local rounded = math.floor((cryptoAmount / Config.Options.conversionRate) * 100) / 100
local feeAmount = math.floor((rounded * Config.Options.sellCharge) * 100) / 100
local afterFee = math.floor((rounded - feeAmount) * 100) / 100
if UseDebug then
print('Selling Crypto')
print('Crypto Amount:', cryptoAmount)
print('In money:', rounded)
print('Fee Amount:', feeAmount)
print('After fee:', afterFee)
end
if handleRemoveMoney(src, 'racingcrypto', cryptoAmount, racerName) then
handleAddMoney(src, Config.Payments.crypto, afterFee, racerName, 'sold_crypto')
return 'SUCCESS'
end
return 'NOT_ENOUGH'
end)
oh idk
๐
Pushed an attempt to fix it
when running with 0.01 conversion and 0.2 fee it works perfectly for me now
LMAO
why it doesnt work for me
i guess i will stick with the one i wrote and try to the fix the 0.5 thingy
local src = source
local moneyToPay = (cryptoAmount / Config.Options.conversionRate)
moneyToPay = tonumber(string.format("%.2f", moneyToPay))
if UseDebug then
print('Buying Crypto')
print('Crypto Amount:', cryptoAmount)
print('In money:', moneyToPay)
end
if handleRemoveMoney(src, Config.Payments.crypto, moneyToPay, racerName) then
handleAddMoney(src, 'racingcrypto', cryptoAmount, racerName, 'purchased_crypto')
return 'SUCCESS'
end
return 'NOT_ENOUGH'
end)```
i removed the 0.05 now it should be an issue right?
Maybe you got something that is overwriting the default lua math.floor
it should be right i put your server/main..lua and its still $2 for 1 if i put the conversionrate to 0.5
01:01:49 PM [ script:cw-racingapp] Crypto Amount: 1
01:01:49 PM [ script:cw-racingapp] Conversion Rate: 0.5
01:01:49 PM [ script:cw-racingapp] Calculated Value (before floor): 200.0
01:01:49 PM [ script:cw-racingapp] Money to Pay (after rounding): 2.0
01:01:49 PM [ script:cw-racingapp] Buying Crypto
01:01:49 PM [ script:cw-racingapp] Crypto Amount: 1
01:01:49 PM [ script:cw-racingapp] In money: 2.0
01:01:49 PM [ script:cw-racingapp] Attempting to charge Valkata 2.0 cash
01:01:49 PM [ script:cw-racingapp] Payment successful
01:01:49 PM [ script:cw-racingapp] Attempting to give Valkata 1 racingcrypto```
added prints to check if its overwriting and i think its not
Good thing that it works for you ๐ not sure why the normal lua version does not