Jump to content
  • 0

How to kick all guilds members except masters?


yazankayed

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  12/19/11
  • Last Seen:  

Hello:

 

How to kick all guilds members except masters? because i have reduced max guild members.

 

Thanks.



Any help guys :) ?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Run these SQL queries while your server is offline:

UPDATE `char` SET guild_id=0 WHERE char_id NOT IN (SELECT char_id FROM guild);

DELETE FROM guild_member WHERE char_id NOT IN (SELECT char_id FROM guild);

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  88
  • Reputation:   23
  • Joined:  01/30/12
  • Last Seen:  

Use the query below to delete all members (except the leader) from guilds that have more than 70 members (you can change this number in the query).

CHANGE THE 70 BELOW TO THE NEW MAX GUILD MEMBER!!! 

DELETE `guild_member`
    FROM `guild_member`
    LEFT JOIN `guild`
        ON `guild_member`.`char_id` = `guild`.`char_id`
    WHERE
        `guild`.`char_id` IS NULL
        AND `guild_member`.`guild_id` IN (
            SELECT `guild_id` FROM ( SELECT COUNT(*) members, `guild_id` FROM `guild_member` GROUP BY `guild_id` HAVING members > 70 ) gids
        );
And this is to update the characters that are not in a guild.
UPDATE `char`
	SET `guild_id` = 0
	WHERE `char_id` NOT IN ( SELECT `char_id` FROM `guild_member`	);
Edited by Digos
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  12/19/11
  • Last Seen:  

Thanks Brian :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...