• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC [Znote AAC 1.5] admin.php

Shadow Dan

Sh4dowDan
Joined
Jun 5, 2010
Messages
344
Reaction score
88
Location
Poland
Give shop points to character is not working. Checking how many points i have is null?

post data
Print: - Array
(
[points_char] => [God] Shadow
[points_value] => 7
)

fetching account id from players table
Print: - Array
(
[id] => 7
)

Fetching existing points from znote_accounts

Points calculation:
Print: - Array
(
[Old:] =>
[New:] => 7
[Total:] => 7
)

Code:
    // Give points to character
    if (empty($_POST['points_char']) === false && empty($_POST['points_value']) === false) {
        $char = sanitize($_POST['points_char']);
        $points = (int)$_POST['points_value'];
        data_dump($_POST, false, "post data");
        $account = mysql_select_single("SELECT `id` FROM `players` WHERE `name`='$char' LIMIT 1;");
        data_dump($account, false, "fetching account id from players table");
        $znote_account = mysql_select_single("SELECT `id`, `premium_points` FROM `accounts` WHERE `id`='". $account['id'] ."';");
        data_dump($znote_account, false, "Fetching existing points from znote_accounts");

        data_dump(
            array(
                'Old:' => $znote_account['points'], 
                'New:' => $points, 
                'Total:' => ($znote_account['points'] + $points)
                ),
            false,
            "Points calculation:");
        $points += $znote_account['points'];
        mysql_update("UPDATE `accounts` SET `premium_points`='$points' WHERE `id`='". $account['id'] ."';");
    }
 
Solution
The account you are trying to add points to wasn't created by Znote AAC. So the account does not have the Znote AAC specific data such as znote_accounts.points.
Either delete your old account and create a new account (using Znote AAC), or convert your old account to work with Znote AAC.
ZnoteAAC/database2znoteaac.php at master · Znote/ZnoteAAC · GitHub
If your using 127.0.0.1 / localhost, enter http://127.0.0.1/special/database2znoteaac.php to convert your old accounts to work with Znote AAC.
If it is an external host, you might need to remove the .htaccess file in the folder named "special" before you enter the url.
it works adds points:
1jj6DxKISdCDkR6BWQ967g.png
 
The account you are trying to add points to wasn't created by Znote AAC. So the account does not have the Znote AAC specific data such as znote_accounts.points.
Either delete your old account and create a new account (using Znote AAC), or convert your old account to work with Znote AAC.
ZnoteAAC/database2znoteaac.php at master · Znote/ZnoteAAC · GitHub
If your using 127.0.0.1 / localhost, enter http://127.0.0.1/special/database2znoteaac.php to convert your old accounts to work with Znote AAC.
If it is an external host, you might need to remove the .htaccess file in the folder named "special" before you enter the url.
 
Solution
Back
Top