-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
House Bid #470
Comments
I would query depotitems table for itemids associated to currency, calculate and sum their values together for each player. Getting the balance is the easy part though, removing the money can be a bit tricky. You need to keep track of the unique identifiers for each row containing some currency item, remove it until the last stack, and update the last stack to its appropriate value, or replace it with the remaining gold. The player has to be offline for this to work, so it might be best to do it in-game on server startup. If you link me your database schema structure, I might build a few queries for you. But I don't have time to test them. |
Many thanks for the reply. The work of paying directly for the corresponding depot is already set up directly in the source as you can see. |
In order to complement: |
Aha, well you can try to replace $yourChars = mysql_select_multi("
SELECT
`p`.`id`,
`p`.`name`,
(
SELECT
SUM(CASE
WHEN `d`.`itemtype` = 3043 THEN (`d`.`count` * 10000)
WHEN `d`.`itemtype` = 3035 THEN (`d`.`count` * 100)
ELSE `d`.`count`
END)
FROM `player_depotitems` AS `d`
WHERE
`d`.`player_id`=`p`.`id`
AND `d`.`itemtype` IN (3031, 3035, 3043)
) AS `balance`
FROM `players` AS `p`
WHERE
`p`.`account_id`='{$user_data['id']}';
"); |
Thats weird, did the query work, just not the balance part? Does the character ADM Viper have money in the same depot id the house is connected to? Are you using a custom version of Znote AAC to properly support Nostalrius? github URL? |
Znote, the query worked, but in the wrong way. She researched the money balance in players table, when the correct one was in the player_item table, right? As for the version I'm using the correct one, I'm just stuck on it, I believe that this would solve the problem of other znote x nostalrius users ... And thanks for your support! |
About the money, I left 100k in each city bank to be sure. |
@Znote any solution to help me? |
@Heitortadeu I'm not sure what the solution is, but I'm fairly certain I could get this solved if I had a development environment I could connect into and code a bit freely. But currently, I'm to busy to set it up. What is your discord tag? You could try to reach me on Discord |
Ok @Znote I already sent the request, thanks! |
Good afternoon!
Znote, I am not able to solve the problem regarding the purchase of house on the website.
I use the Nostalrius base, and when I try to buy a house it says that I have no money.
I imagine that the problem is associated with the balance, which in the case of nostalrius there is not.
Everything is done by players_items.
Would I have to change the balance check to look for money in players_items, in house.php?
$yourChars = mysql_select_multi("SELECT
id,
name,
balanceFROM
playersWHERE
account_id='". $user_data['id'] ."';");
How would I go about looking for money in the player instead of the balance on balance?
Thank you!
The text was updated successfully, but these errors were encountered: