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

PHP ZnoteACC - Maximum guild members

rafaeru

Member
Joined
Mar 6, 2013
Messages
94
Solutions
5
Reaction score
12
Hello, I want to add maximum number of members in guild in ZnoteACC but I'm not good in php.
Can someone help in this if statment ?
PHP:
if (!empty($_POST['invite'])) {
        if (user_character_exist($_POST['invite'])) {
            // Make sure they are not in another guild
               // HERE IF WITH CHECKING MEMBERS IN GUILD
                if ($config['TFSVersion'] != 'TFS_10') {
                    $charname = sanitize($_POST['invite']);
                    $playerdata = mysql_select_single("SELECT `id`, `rank_id` FROM `players` WHERE `name`='$charname' LIMIT 1;");
                    $charid = $playerdata['id'];
                    $membership = ($playerdata['rank_id'] > 0) ? true : false;
                } else {
                    $charid = user_character_id($_POST['invite']);
                    $membership = mysql_select_single("SELECT `rank_id` FROM `guild_membership` WHERE `player_id`='$charid' LIMIT 1;");
                }
                if (!$membership) {
                    //
                    $status = false;
                    if ($inv_data !== false) {
                        foreach ($inv_data as $inv) {
                            if ($inv['player_id'] == user_character_id($_POST['invite'])) $status = true;
                        }
                    }
                    foreach ($players as $player) {
                        if ($player['name'] == $_POST['invite']) $status = true;
                    }
                  
                    if ($status == false) {
                        guild_invite_player($charid, $gid);
                        header('Location: guilds.php?name='. $_GET['name']);
                        exit();
                    } else echo '<font color="red" size="4">That character is already invited(or a member) on this guild.</font>';
                } else echo '<font color="red" size="4">That character is already in a guild.</font>';
          
        } else echo '<font color="red" size="4">That character name does not exist.</font>';
    }
 
Last edited:
Solution
PHP:
if (!empty($_POST['invite'])) {
        if (user_character_exist($_POST['invite'])) {
            // Make sure they are not in another guild
            if ($gid['info']['players'] <= 20) {
                if ($config['TFSVersion'] != 'TFS_10') {
                    $charname = sanitize($_POST['invite']);
                    $playerdata = mysql_select_single("SELECT `id`, `rank_id` FROM `players` WHERE `name`='$charname' LIMIT 1;");
                    $charid = $playerdata['id'];
                    $membership = ($playerdata['rank_id'] > 0) ? true : false;
                } else {
                    $charid = user_character_id($_POST['invite']);
                    $membership = mysql_select_single("SELECT `rank_id` FROM...
OP
OP
rafaeru

rafaeru

Member
Joined
Mar 6, 2013
Messages
94
Solutions
5
Reaction score
12
PHP:
if (!empty($_POST['invite'])) {
        if (user_character_exist($_POST['invite'])) {
            // Make sure they are not in another guild
            if ($gid['info']['players'] <= 20) {
                if ($config['TFSVersion'] != 'TFS_10') {
                    $charname = sanitize($_POST['invite']);
                    $playerdata = mysql_select_single("SELECT `id`, `rank_id` FROM `players` WHERE `name`='$charname' LIMIT 1;");
                    $charid = $playerdata['id'];
                    $membership = ($playerdata['rank_id'] > 0) ? true : false;
                } else {
                    $charid = user_character_id($_POST['invite']);
                    $membership = mysql_select_single("SELECT `rank_id` FROM `guild_membership` WHERE `player_id`='$charid' LIMIT 1;");
                }
                if (!$membership) {
                    //
                    $status = false;
                    if ($inv_data !== false) {
                        foreach ($inv_data as $inv) {
                            if ($inv['player_id'] == user_character_id($_POST['invite'])) $status = true;
                        }
                    }
                    foreach ($players as $player) {
                        if ($player['name'] == $_POST['invite']) $status = true;
                    }
                    
                    if ($status == false) {
                        guild_invite_player($charid, $gid);
                        header('Location: guilds.php?name='. $_GET['name']);
                        exit();
                    } else echo '<font color="red" size="4">That character is already invited(or a member) on this guild.</font>';
                } else echo '<font color="red" size="4">That character is already in a guild.</font>';
            } else echo '<font color="red" size="4">You reached maximum guild members (20).</font>';
        } else echo '<font color="red" size="4">That character name does not exist.</font>';
    }
 
Solution
Top