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

Replace Kick OnLogin

HeberPcL

[PowerOT.com.br]
Joined
Aug 21, 2007
Messages
1,292
Reaction score
51
Location
Brazil
GitHub
heberpcl
Hey OtLanders...

I would like to allow replaceKickOnLogin only for players with `save` == 1 in the database.

ReplaceKickOnLogin = true

Thanks!!
 
I didn't quite understand what you need, post the script you are working on.

I made this, if it helps... But post the script, it will help me understanding what you need.
Code:
local query = db.storeQuery('SELECT * FROM `players`')
if query ~= false then
        repeat
            local id, player = result.getNumber(query, 'id'), Player(result.getString(query, 'name'))
            if player then
                local save = result.getNumber(query,'save')
                      if save == '1' then
                          ReplaceKickOnLogin = true
                      else
                          ReplaceKickOnLogin = false
                      end
                 end         
            end
 
protocolgame.cpp
After:
Code:
        if (eventConnect != 0 || !g_config.getBoolean(ConfigManager::REPLACE_KICK_ON_LOGIN)) {
            //Already trying to connect
            disconnectClient("You are already logged in.");
            return;
        }

i add:
Code:
        if ( (player->getAccount() == 1) or (player->getAccount() == 2) or (player->getAccount() == 3) or (player->getAccount() == 4) ) {
            //Already trying to connect
            disconnectClient("[ Default Account ]  You are already logged in.");
            return;
        }

But it did not work.


I need accounts (1/1, 2/2, 3/3, 4/4) to not be kicked if logged in.
 
Back
Top