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

Solved [Gesior acc] Guilds.php

moudyyyy

New Member
Joined
May 14, 2013
Messages
42
Reaction score
0
hello
im using tfs dev 0.4 and ive got a problem with guild system, while I'm creating a new guild on a website while im in game, it does create a new one, but after I relog its kicking me out of it and guild stays empty, but if I create a new one while im not in game its work fine. i aint good at it, just trying to fix all the bugs that i got in it.

when we assume the cancellation guilds and I'm logged in the game when the guild is formed but the guild leader is empty in the game
 
Simply add an if statement that checks whether the character is online or not.
 
Simply add an if statement that checks whether the character is online or not.

Is it some kind of query i'm supposed to insert in to the database which modifies the current guildfunctions? I'm willing to learn, i got no idea where to start though. Thanks for the quick response!
 
No, something like this
PHP:
if($player->isOnline())
    $guild_errors[] = 'insert message here';

Which version of TFS/Gesior are you using?
 
guilds.php, replace line 1036-1042 with this
Code:
        if(empty($guild_errors))
        {
            if($player->getLevel() < $config['site']['guild_need_level'])
                $guild_errors[] = 'Character <b>'.htmlspecialchars($name).'</b> has too low level. To create guild you need character with level <b>'.$config['site']['guild_need_level'].'</b>.';
            if($player->isOnline())
                $guild_errors[] = 'insert message here';
            if($config['site']['guild_need_pacc'] && !$account_logged->isPremium())
                $guild_errors[] = 'Character <b>'.htmlspecialchars($name).'</b> is on FREE account. To create guild you need PREMIUM account.';
        }

Players should not be able to create guilds while they're online now.
 
guilds.php, replace line 1036-1042 with this
Code:
        if(empty($guild_errors))
        {
            if($player->getLevel() < $config['site']['guild_need_level'])
                $guild_errors[] = 'Character <b>'.htmlspecialchars($name).'</b> has too low level. To create guild you need character with level <b>'.$config['site']['guild_need_level'].'</b>.';
            if($player->isOnline())
                $guild_errors[] = 'insert message here';
            if($config['site']['guild_need_pacc'] && !$account_logged->isPremium())
                $guild_errors[] = 'Character <b>'.htmlspecialchars($name).'</b> is on FREE account. To create guild you need PREMIUM account.';
        }

Players should not be able to create guilds while they're online now.

Works flawlessly so far, thank you ALOT.
 
guilds.php, replace line 1036-1042 with this
Code:
        if(empty($guild_errors))
        {
            if($player->getLevel() < $config['site']['guild_need_level'])
                $guild_errors[] = 'Character <b>'.htmlspecialchars($name).'</b> has too low level. To create guild you need character with level <b>'.$config['site']['guild_need_level'].'</b>.';
            if($player->isOnline())
                $guild_errors[] = 'insert message here';
            if($config['site']['guild_need_pacc'] && !$account_logged->isPremium())
                $guild_errors[] = 'Character <b>'.htmlspecialchars($name).'</b> is on FREE account. To create guild you need PREMIUM account.';
        }

Players should not be able to create guilds while they're online now.

Works perefect :) Could you do the same thing that player can not join guild if he/she is online? I tried do it with almost the same script
Code:
if(empty($guild_errors))
{
       if($player->isOnline())
              $guild_errors[] = 'You can not join the guild while you are online.';
}
but I don't know where to paste it and it doesn't work for me :(
 
Paste it around line 660
Code:
    if(empty($guild_errors))
    {
        $player = new Player();
        $player->find($name);
        if($player->isOnline())
            $guild_errors[] = 'You can not join the guild while you are online.';
    }

T8EnnG9.png
 
Back
Top Bottom