• 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!

TFS 1.X+ VIP LIST

Fortera Global

Intermediate OT User
Joined
Nov 20, 2015
Messages
1,180
Solutions
2
Reaction score
117
In the ot when the player changes the nick, it does not disappear from the vip of the others, what I need to do when the nickname is not the same, disappear from the VIP list (from database maybe, to affect all players)?
 
Solution
PHP:
        if(empty($newchar_errors))
        {
            echo '<img id="ContentBoxHeadline" class="Title" src="images/head/changename.png" alt="Contentbox headline">Name of character <b>' . htmlspecialchars($Char->getName()) . '</b> changed to <b>' . htmlspecialchars($newchar_name) . '</b>';
            $Char->setName($newchar_name);
            $Char->save();
            $SQL->query('DELETE FROM ' . $SQL->tableName('account_viplist'). ' WHERE '. $SQL->fieldName('player_id') . ' = ' . $Char->getID());

            $Account_In->setCustomField('premium_points', $Account_In->getCustomField('premium_points') - $changeNameCost);
        }


not tested
Code:
DELETE FROM  `account_viplist` WHERE `player_id` = ID_PLAYER_WHO_CHANGED_NICK;


sorry, I did not specify, it would be in php, would you also help me?


PHP:
            $Char = new Player($_REQUEST['player_id']);
            if(!$Char->isLoaded())
                $newchar_errors[] = 'This player does not exist.';
            if($Char->isOnline())
                $newchar_errors[] = 'This player is ONLINE. Logout first.';
            elseif($Account_In->getID() != $Char->getAccountID())
                $newchar_errors[] = 'This player is not on your account.';

            if(empty($newchar_errors))
            {
                echo '<img id="ContentBoxHeadline" class="Title" src="images/head/changename.png" alt="Contentbox headline">Name of character <b>' . htmlspecialchars($Char->getName()) . '</b> changed to <b>' . htmlspecialchars($newchar_name) . '</b>';
                $Char->setName($newchar_name);
                $Char->save();
                $Account_In->setCustomField('premium_points', $Account_In->getCustomField('premium_points') - $changeNameCost);
            }
 
PHP:
        if(empty($newchar_errors))
        {
            echo '<img id="ContentBoxHeadline" class="Title" src="images/head/changename.png" alt="Contentbox headline">Name of character <b>' . htmlspecialchars($Char->getName()) . '</b> changed to <b>' . htmlspecialchars($newchar_name) . '</b>';
            $Char->setName($newchar_name);
            $Char->save();
            $SQL->query('DELETE FROM ' . $SQL->tableName('account_viplist'). ' WHERE '. $SQL->fieldName('player_id') . ' = ' . $Char->getID());

            $Account_In->setCustomField('premium_points', $Account_In->getCustomField('premium_points') - $changeNameCost);
        }


not tested
 
Solution
Back
Top