Jump to content
  • 0

count guild members in map


DevilSupremeRO

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.02
  • Content Count:  55
  • Reputation:   0
  • Joined:  08/21/20
  • Last Seen:  

Hi, I need a script that checks quantity of guild members in guild castles.


- Max users allowed per guild in the same castle = 15
-If users are > 15, the 16th user member of the same guild will be warped to save point automatically.

note: i know there's a way to modify the guild members qty (like changing the guild extension skill lvl) but i prefer to use the script.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   35
  • Joined:  07/04/19
  • Last Seen:  

6 hours ago, DevilSupremeRO said:

it's not working i tried to set it to 1 but my other dual character still can access inside

sorry i had a typo in the code.
this one should work :
 

-	script	max_castle_guild_members	-1,{

OnInit:
    //settings here 
    setarray .maps$, "prtg_cas01","prtg_cas03"; // insert your woe castles here
    .max_members_in_castle = 1;    // set the maximum number of guild members in a castle
 
    //don't edit this
 
    for(.@i = 0; .@i < getarraysize(.maps$); .@i++) {
        if(!getmapflag(.maps$[.@i], mf_loadevent)) setmapflag .maps$[.@i], mf_loadevent;
    }
    end;
 
OnPCLoadMapEvent:
    if(inarray(.maps$, strcharinfo(3)) == -1) end;
    if(getmapguildusers(strcharinfo(3), getcharid(2)) > .max_members_in_castle) {
        dispbottom "There can only be "+.max_members_in_castle+" guild members inside a castle during woe.";
        warp "SavePoint",0,0;
    }
    end;
}

 

awd.jpg

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   35
  • Joined:  07/04/19
  • Last Seen:  

here you go :

 

-   script  max_castle_guild_members    -1,{

OnInit:
    //settings here
    setarray .maps$, "prtg_cas01","prtg_cas03"; // insert your woe castles here
    .max_members_in_castle = 15;    // set the maximum number of guild members in a castle
 
    //don't edit this
 
    for(.@i = 0; .@i < getarraysize(.maps$); .@i++) {
        if(!getmapflag(.maps$[.@i], mf_loadevent)) setmapflag .maps$[.@i], mf_loadevent;
    }
    end;
 
OnPCLoadMapEvent:
    if(inarray(.maps$, strcharinfo(3)) == -1 || ) end;
    if(getmapguildusers(strcharinfo(3), getcharid(2)) > .max_members_in_castle) {
        dispbottom "There can only be "+.max_castle_guild_members+" guild members inside a castle during woe.";
        warp "SavePoint",0,0;
    }
    end;
}

 

Edited by Mastagoon
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.02
  • Content Count:  55
  • Reputation:   0
  • Joined:  08/21/20
  • Last Seen:  

8 hours ago, Mastagoon said:

here you go :

 


-   script  max_castle_guild_members    -1,{

OnInit:
    //settings here
    setarray .maps$, "prtg_cas01","prtg_cas03"; // insert your woe castles here
    .max_members_in_castle = 15;    // set the maximum number of guild members in a castle
 
    //don't edit this
 
    for(.@i = 0; .@i < getarraysize(.maps$); .@i++) {
        if(!getmapflag(.maps$[.@i], mf_loadevent)) setmapflag .maps$[.@i], mf_loadevent;
    }
    end;
 
OnPCLoadMapEvent:
    if(inarray(.maps$, strcharinfo(3)) == -1 || ) end;
    if(getmapguildusers(strcharinfo(3), getcharid(2)) > .max_members_in_castle) {
        dispbottom "There can only be "+.max_castle_guild_members+" guild members inside a castle during woe.";
        warp "SavePoint",0,0;
    }
    end;
}

 

it's not working i tried to set it to 1 but my other dual character still can access inside

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.02
  • Content Count:  55
  • Reputation:   0
  • Joined:  08/21/20
  • Last Seen:  

4 hours ago, Mastagoon said:

sorry i had a typo in the code.
this one should work :
 


-	script	max_castle_guild_members	-1,{

OnInit:
    //settings here 
    setarray .maps$, "prtg_cas01","prtg_cas03"; // insert your woe castles here
    .max_members_in_castle = 1;    // set the maximum number of guild members in a castle
 
    //don't edit this
 
    for(.@i = 0; .@i < getarraysize(.maps$); .@i++) {
        if(!getmapflag(.maps$[.@i], mf_loadevent)) setmapflag .maps$[.@i], mf_loadevent;
    }
    end;
 
OnPCLoadMapEvent:
    if(inarray(.maps$, strcharinfo(3)) == -1) end;
    if(getmapguildusers(strcharinfo(3), getcharid(2)) > .max_members_in_castle) {
        dispbottom "There can only be "+.max_members_in_castle+" guild members inside a castle during woe.";
        warp "SavePoint",0,0;
    }
    end;
}

 

awd.jpg

oh man you saved my life thankyou so much it works perfectly! what if im going to add the map should i do it like "prtg_cas01","prtg_cas02","prtg_cas03"; should it be like this?

Edited by DevilSupremeRO
i missed type the words
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   35
  • Joined:  07/04/19
  • Last Seen:  

2 hours ago, DevilSupremeRO said:

oh man you saved my life thankyou so much it works perfectly! what if im going to add the map should i do it like "prtg_cas01","prtg_cas02","prtg_cas03"; should it be like this?

yes exactly. goodluck ❤️

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...