• 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 Myaac - Maximum guild members

_M4G0_

Well-Known Member
Joined
Feb 6, 2016
Messages
504
Solutions
16
Reaction score
98
Hello
I want to add maximum number of members in guild in myaac,
Can someone help ?
 
Solution
Almost!

I would do this this way:
PHP:
if(empty($errors))  {
    $query = $db->query('select count(player_id) as how_much from ' . GUILD_MEMBERS_TABLE . ' WHERE `guild_id` = ' . $guild->getId());
    if($query && $query->rowCount() == 1 && $query->fetch()['how_much'] >= 15) {
        $errors[] = 'The guild reached maximum  members.';
        }
    }
I don't understand the right php syntax, and the functions of myaac, but I think it's very simple, you will count how many people you already have in the guild_membership, and you will make a condition if it is bigger than you want, don't invite and send an error message.
 
i don't know if it works perfectly ... 🤣 🤣 🤣 :eek: :eek: :eek:

PHP:
if(empty($errors))  {
    $guild_mermrers_invite = $db->query('select player_id, count(player_id) from ' . GUILD_MEMBERS_TABLE . ' WHERE `guild_id` = ' . $guild->getId() . ' group by player_id having count(player_id)');
    if($guild_mermrers_invite->rowCount() >= 15) {
        $errors[] = 'The guild reached maximum  members.';
        }
    }

if someone more experienced can help
 
Almost!

I would do this this way:
PHP:
if(empty($errors))  {
    $query = $db->query('select count(player_id) as how_much from ' . GUILD_MEMBERS_TABLE . ' WHERE `guild_id` = ' . $guild->getId());
    if($query && $query->rowCount() == 1 && $query->fetch()['how_much'] >= 15) {
        $errors[] = 'The guild reached maximum  members.';
        }
    }
 
Solution
Almost!

I would do this this way:
PHP:
if(empty($errors))  {
    $query = $db->query('select count(player_id) as how_much from ' . GUILD_MEMBERS_TABLE . ' WHERE `guild_id` = ' . $guild->getId());
    if($query && $query->rowCount() == 1 && $query->fetch()['how_much'] >= 15) {
        $errors[] = 'The guild reached maximum  members.';
        }
    }
thanks for reply
 
Almost!

I would do this this way:
PHP:
if(empty($errors))  {
    $query = $db->query('select count(player_id) as how_much from ' . GUILD_MEMBERS_TABLE . ' WHERE `guild_id` = ' . $guild->getId());
    if($query && $query->rowCount() == 1 && $query->fetch()['how_much'] >= 15) {
        $errors[] = 'The guild reached maximum  members.';
        }
    }
where do i put it?
 
Almost!

I would do this this way:
PHP:
if(empty($errors))  {
    $query = $db->query('select count(player_id) as how_much from ' . GUILD_MEMBERS_TABLE . ' WHERE `guild_id` = ' . $guild->getId());
    if($query && $query->rowCount() == 1 && $query->fetch()['how_much'] >= 15) {
        $errors[] = 'The guild reached maximum  members.';
        }
    }
Screenshot_2.png
 
Back
Top