Jump to content
  • 0

Question

Posted

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.

6 answers to this question

Recommended Posts

  • 1
Posted
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
  • 0
Posted (edited)

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
  • 0
Posted
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

  • 0
Posted (edited)
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
  • 0
Posted
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 ❤️

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...