Idk what you mean, can you be more often?
I'll most likely help you
|
okay so i have this problem with buying and selling X, when i do it the amount slowly rises or decreases, like it isnt an instant sell or buy. does anyone know how to fix this issue?
Idk what you mean, can you be more often?
I'll most likely help you
For both ? Or only one kind? I saw guides ( I recently followed them too ) and 85% of the people couldn't figure the looping problem, some said they got it working but noone released a fix
I figured out that one guide worked for buy and an other for sell so I implanted both. Can link you if you want :3!
Post your 'buy-x' and 'sell-x' method please.
When buying or selling, here's a hint:
Instead of looping, use some mathematical formulas:
amount = min(requestedAmount, affordableAmount, placeForAmount)
with requestedAmount being the requested amount, affordableAmount being the amount you can buy with your currency (ignore when selling as the shop can afford to buy an infinite amount off you), placeForAmount is the amount your inventory can handle.
when using fixed price/unit:
price = amount * pricePerUnit
deductCurrency(price)
addItems(amount)
And most important of all, send the packets after you've handled the buy/sell action.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |