Jump to content
  • 0

Q> regarding guild limiter script


Sallycantdance

Question


  • Group:  Members
  • Topic Count:  225
  • Topics Per Day:  0.14
  • Content Count:  798
  • Reputation:   12
  • Joined:  12/04/20
  • Last Seen:  

hello im trying to use this script in koe map example in ra_koe

after adding the map in the script its not working how to modify it properly thank you!

 

Quote

//Modified by - PandaLovesHamster
//Custom Guild Limiter
//Credits to the owners of the individual makers of the script, I just tied them all together to create this script
 
sec_in01,176,176,5    script    guilder     833,{
 
// this part registers the guild
    function sf {
        function s;
        .@a = getarg(2);
        .@len = getarg(3);
        return (
            sprintf( getarg(0),
                s(.@a, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), 
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), 
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1))
            )
            +(( .@a+1 < .@len )?":Next":":")
            +(( .@a-11 > 0 )?":Back":":")
            +":Cancel"
        );
        function s {
            if( getarg(0) >= getarg(1) ) return "";
            else {
                .@name$ = getguildname(getelementofarray(getarg(2),getarg(0)));
                return .@name$=="null"?"":.@name$;
            }
        };
    };
    function nex { return((getarg(0)+10)<getarg(1)?getarg(0)+10:getarg(1)-(getarg(1)%10)); };
    function bac { return((getarg(0)-10)>=0?getarg(0)-10:0); };
 
    if(getgmlevel()>=80 ) {
        mes .Npc_Name$;
        mes "Hello Mr. GM what would you like to do?";
        next;
        switch( select("Add/Remove Guilds:Clear Guild Data:Player Menu:Cancel") ) {
            case 1:
                mes .Npc_Name$;
                mes "Would you like to add or remove a guild?";
                .@a_len = getarraysize($App_Guilds);
                .@format$ = "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s";
                next;
                if( select("Remove:Add") == 1 ) {
                    while( .@a != 9999 ) {
                        select( sf( .@format$, $App_Guilds, .@a, .@a_len ) );
                        switch( @menu ) {
                            case 11: .@a = nex( .@a, .@a_len ); break;
                            case 12: .@a = bac( .@a ); break;
                            case 13: end;
 
                            default:
                                .@select = .@a+@menu-1;
                                mes .Npc_Name$;
                                mes "You've selected ^0000FF["+getguildname($App_Guilds[.@select])+"]^000000 guild. Would you like to remove them from the accepted guilds?";
                                next;
                                if( select("Yes:No") == 1 ) {
                                    deletearray($App_Guilds[.@select],1);
                                    mes .Npc_Name$;
                                    mes "The guild has been removed!";
                                }
                                close;
                        }
                    }
                } else {
                    mes .Npc_Name$;
                    mes "Please input guild name or masters name.";
                    next;
                    input(.@input$);
                    .@len = query_sql( "Select `guild_id` from `guild` where `name` like '%"+escape_sql(.@input$)+"%' or `master` like '%"+escape_sql(.@input$)+"%';",.@guild_id );
                    while( .@a != 9999 ) {
                        select( sf( .@format$, .@guild_id, .@a, .@len ) );
                        switch( @menu ) {
                            case 11: .@a = nex( .@a, .@len ); break;
                            case 12: .@a = bac( .@a ); break;
                            case 13: end;
 
                            default:
                                .@select = .@a+@menu-1;
                                .@a_len = getarraysize($App_Guilds);
                                for(.@b=0;.@b<.@a_len;.@b++)
                                    if( $App_Guilds[.@b]==.@guild_id[.@select] ) {
                                        mes .Npc_Name$;
                                        mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. I'm sorry but that guild has already been added to the accepted list.";
                                        close;
                                    }
                                mes .Npc_Name$;
                                mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. Would you like to add them to the accepted guilds?";
                                next;
                                if( select("Yes:No") == 1 ) {
                                    .@a_len = getarraysize($App_Guilds);
                                    if( .@a_len>=128 ) {
                                        mes .Npc_Name$;
                                        mes "I'm sorry but the accepted list is full please make some room and try again...";
                                    } else {
                                        mes .Npc_Name$;
                                        mes "The guild was successfully added!";
                                        $App_Guilds[.@a_len] = .@guild_id[.@select];
                                    }
                                }
                                close;
                        }
                    }
                }
            case 2:
                mes .Npc_Name$;
                mes "Are you sure you want to clear the guild data?!";
                next;
                if( select("Yes!:No!")==1 ) {
                    mes .Npc_Name$;
                    mes "This is you last chance. Are you surely sure as sure can be?";
                    next;
                    if( select("Surly!:No, wait... Where am I?!!")==1 )
                        deletearray($App_Guilds);
                }
                if( @menu==1 ) {
                    mes .Npc_Name$;
                    mes "The deed is done...";
                } else {
                    mes .Npc_Name$;
                    mes "Wow that was a close one... Have a nice day!";
                }
                close;
 
            case 3: break;
 
            case 4:
                mes .Npc_Name$;
                mes "Alright, have a nice day!";
                close;
        }
    }
 
    .@len = getarraysize($App_Guilds);
    for( .@i=0; .@i <= .@len; .@i++ ) {
        if( getcharid(2) == $App_Guilds[.@i] )
            set .@Guild_Check, .@Guild_Check+1;
    }
 
 
// This part ejects players when they are in the map 
    OnPCLoadMapEvent:
    if( getcharid(2) == $App_Guilds[.@i] ){
    .count = 0;
    .@origin = getcharid(3);
    addrid 3, 0, getcharid(2);
    if ( strcharinfo(3) == .checkmap$ )
        .count++;
    if ( !.@origin ) end;
    if ( .count > 26 ) { // 26 means only 26 players per guild allowed in a map.
        message strcharinfo(0), "Your guild members are over the limit";
        sleep2 2000;
        warp "SavePoint", 0,0;
    }
    }
    end;
OnInit:
    setarray .@checkmap$, "ra_koe", "arug_cas01", "arug_cas02", "arug_cas03", "arug_cas04", "arug_cas05", "schg_cas01", "schg_cas02", "schg_cas03", "schg_cas04", "schg_cas05";
    .@len = getarraysize( .@checkmap$ );
    for ( .@i = 0; .@i < .@size; .@i++ ) {
        setmapflag .@checkmap$[.@i], mf_loadevent;
        setd "."+ .@checkmap$[.@i], 1;
    }
    end;
}
 
-    script    kjdhfkjshf    -1,{
OnPCLoadMapEvent:
    if ( getmapflag( strcharinfo(3), mf_gvg_castle ) && ( agitcheck() || agitcheck2() )) {
    .@len = getarraysize($App_Guilds);
    for( .@i=0; .@i <= .@len; .@i++ ) {
        if( getcharid(2) == $App_Guilds[.@i] )
            set .@Guild_Check, .@Guild_Check+1;
    }
    if( .@Guild_Check < 1 ) {
        dispbottom "Your guild has not yet been approved, please contact the GMs";
        sleep2 3000;
        warp "SavePoint",0,0;
        end;
    }
    if( !getcharid(2) ) {
        dispbottom "Sorry only members of a guild may enter a castle.";
        sleep2 3000;
        warp "SavePoint",0,0;
        end;
    }
}
    end;
OnInit:
    setarray .castles$[0],
        "ra_koe","prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
        "payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
        "gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
        "aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
        "arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
        "schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
    for ( .@i = 0; .@i < 30; .@i++ )
        setmapflag .castles$[.@i], mf_loadevent;
    end;
}

 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   34
  • Joined:  11/08/15
  • Last Seen:  

Exactly, what's the problem? i tested that script and it works as intended.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  225
  • Topics Per Day:  0.14
  • Content Count:  798
  • Reputation:   12
  • Joined:  12/04/20
  • Last Seen:  

7 minutes ago, Scanty said:

Exactly, what's the problem? i tested that script and it works as intended.

hello sir i try to add my KOE maps here im using this script in woe map its working but in koe maps its not

 

Quote


sec_in01,179,176,5    script    KOEREG     833,{

// this part registers the guild
    function sf {
        function s;
        .@a = getarg(2);
        .@len = getarg(3);
        return (
            sprintf( getarg(0),
                s(.@a, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), 
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), 
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1))
            )
            +(( .@a+1 < .@len )?":Next":":")
            +(( .@a-11 > 0 )?":Back":":")
            +":Cancel"
        );
        function s {
            if( getarg(0) >= getarg(1) ) return "";
            else {
                .@name$ = getguildname(getelementofarray(getarg(2),getarg(0)));
                return .@name$=="null"?"":.@name$;
            }
        };
    };
    function nex { return((getarg(0)+10)<getarg(1)?getarg(0)+10:getarg(1)-(getarg(1)%10)); };
    function bac { return((getarg(0)-10)>=0?getarg(0)-10:0); };

    if(getgmlevel()>=80 ) {
        mes .Npc_Name$;
        mes "Hello Mr. GM what would you like to do?";
        next;
        switch( select("Add/Remove Guilds:Clear Guild Data:Player Menu:Cancel") ) {
            case 1:
                mes .Npc_Name$;
                mes "Would you like to add or remove a guild?";
                .@a_len = getarraysize($App_Guilds);
                .@format$ = "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s";
                next;
                if( select("Remove:Add") == 1 ) {
                    while( .@a != 9999 ) {
                        select( sf( .@format$, $App_Guilds, .@a, .@a_len ) );
                        switch( @menu ) {
                            case 11: .@a = nex( .@a, .@a_len ); break;
                            case 12: .@a = bac( .@a ); break;
                            case 13: end;
                            
                            default:
                                .@select = .@a+@menu-1;
                                mes .Npc_Name$;
                                mes "You've selected ^0000FF["+getguildname($App_Guilds[.@select])+"]^000000 guild. Would you like to remove them from the accepted guilds?";
                                next;
                                if( select("Yes:No") == 1 ) {
                                    deletearray($App_Guilds[.@select],1);
                                    mes .Npc_Name$;
                                    mes "The guild has been removed!";
                                }
                                close;
                        }
                    }
                } else {
                    mes .Npc_Name$;
                    mes "Please input guild name or masters name.";
                    next;
                    input(.@input$);
                    .@len = query_sql( "Select `guild_id` from `guild` where `name` like '%"+escape_sql(.@input$)+"%' or `master` like '%"+escape_sql(.@input$)+"%';",.@guild_id );
                    while( .@a != 9999 ) {
                        select( sf( .@format$, .@guild_id, .@a, .@len ) );
                        switch( @menu ) {
                            case 11: .@a = nex( .@a, .@len ); break;
                            case 12: .@a = bac( .@a ); break;
                            case 13: end;
                            
                            default:
                                .@select = .@a+@menu-1;
                                .@a_len = getarraysize($App_Guilds);
                                for(.@b=0;.@b<.@a_len;.@b++)
                                    if( $App_Guilds[.@b]==.@guild_id[.@select] ) {
                                        mes .Npc_Name$;
                                        mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. I'm sorry but that guild has already been added to the accepted list.";
                                        close;
                                    }
                                mes .Npc_Name$;
                                mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. Would you like to add them to the accepted guilds?";
                                next;
                                if( select("Yes:No") == 1 ) {
                                    .@a_len = getarraysize($App_Guilds);
                                    if( .@a_len>=128 ) {
                                        mes .Npc_Name$;
                                        mes "I'm sorry but the accepted list is full please make some room and try again...";
                                    } else {
                                        mes .Npc_Name$;
                                        mes "The guild was successfully added!";
                                        $App_Guilds[.@a_len] = .@guild_id[.@select];
                                    }
                                }
                                close;
                        }
                    }
                }
            case 2:
                mes .Npc_Name$;
                mes "Are you sure you want to clear the guild data?!";
                next;
                if( select("Yes!:No!")==1 ) {
                    mes .Npc_Name$;
                    mes "This is you last chance. Are you surely sure as sure can be?";
                    next;
                    if( select("Surly!:No, wait... Where am I?!!")==1 )
                        deletearray($App_Guilds);
                }
                if( @menu==1 ) {
                    mes .Npc_Name$;
                    mes "The deed is done...";
                } else {
                    mes .Npc_Name$;
                    mes "Wow that was a close one... Have a nice day!";
                }
                close;
                
            case 3: break;
            
            case 4:
                mes .Npc_Name$;
                mes "Alright, have a nice day!";
                close;
        }
    }

    .@len = getarraysize($App_Guilds);
    for( .@i=0; .@i <= .@len; .@i++ ) {
        if( getcharid(2) == $App_Guilds[.@i] )
            set .@Guild_Check, .@Guild_Check+1;
    }

    
// This part ejects players when they are in the map 
    OnPCLoadMapEvent:
    if( getcharid(2) == $App_Guilds[.@i] ){
    .count = 0;
    .@origin = getcharid(3);
    addrid 3, 0, getcharid(2);
    if ( strcharinfo(3) == .checkmap$ )
        .count++;
    if ( !.@origin ) end;
    if ( .count > 5 ) { // 5 means only 5 players per guild allowed in a map.
        message strcharinfo(0), "Your guild members are over the limit";
        sleep2 2000;
        warp "SavePoint", 0,0;
    }
    }
    end;
OnInit:
    setarray .@checkmap$, "freya_vs", "ra_koe", "guild_vs1", "koe_grim", "arug_cas05", "schg_cas01", "schg_cas02", "schg_cas03", "schg_cas04", "schg_cas05";
    .@len = getarraysize( .@checkmap$ );
    for ( .@i = 0; .@i < .@size; .@i++ ) {
        setmapflag .@checkmap$[.@i], mf_loadevent;
        setd "."+ .@checkmap$[.@i], 1;
    }
    end;
}

-    script    KOEREGS    -1,{
OnPCLoadMapEvent:
    if ( getmapflag( strcharinfo(3), mf_gvg_castle ) && ( agitcheck() || agitcheck2() )) {
    .@len = getarraysize($App_Guilds);
    for( .@i=0; .@i <= .@len; .@i++ ) {
        if( getcharid(2) == $App_Guilds[.@i] )
            set .@Guild_Check, .@Guild_Check+1;
    }
    if( .@Guild_Check < 1 ) {
        dispbottom "Your guild has not yet been approved, please contact the GMs";
        sleep2 3000;
        warp "SavePoint",0,0;
        end;
    }
    if( !getcharid(2) ) {
        dispbottom "Sorry only members of a guild may enter a castle.";
        sleep2 3000;
        warp "SavePoint",0,0;
        end;
    }
}
    end;
OnInit:
    setarray .castles$[0],
        "freya_vs","ra_koe","guild_vs1","koe_grim","prtg_cas05",
        "payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
        "gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
        "aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
        "arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
        "schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
    for ( .@i = 0; .@i < 30; .@i++ )
        setmapflag .castles$[.@i], mf_loadevent;
    end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   34
  • Joined:  11/08/15
  • Last Seen:  

Change this.

for ( .@i = 0; .@i < .@size; .@i++ )

To this

for ( .@i = 0; .@i < .@len; .@i++ )



 .@len = getarraysize( .@checkmap$ ); 

Edited by Scanty
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  225
  • Topics Per Day:  0.14
  • Content Count:  798
  • Reputation:   12
  • Joined:  12/04/20
  • Last Seen:  

33 minutes ago, Scanty said:

Change this.

for ( .@i = 0; .@i < .@size; .@i++ )

To this

for ( .@i = 0; .@i < .@len; .@i++ )



 .@len = getarraysize( .@checkmap$ ); 

hello while trying it it does have error but still i can enter in koe map "freya_vs" even i added it in the map in the script in WOE its working in KOE its not 

 

Quote

//Modified by - PandaLovesHamster
//Custom Guild Limiter
//Credits to the owners of the individual makers of the script, I just tied them all together to create this script
 
sec_in01,176,176,5    script    guilder     833,{
 
// this part registers the guild
    function sf {
        function s;
        .@a = getarg(2);
        .@len = getarg(3);
        return (
            sprintf( getarg(0),
                s(.@a, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)),
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), 
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1)), 
                s(.@a++, .@len, getarg(1)), s(.@a++, .@len, getarg(1))
            )
            +(( .@a+1 < .@len )?":Next":":")
            +(( .@a-11 > 0 )?":Back":":")
            +":Cancel"
        );
        function s {
            if( getarg(0) >= getarg(1) ) return "";
            else {
                .@name$ = getguildname(getelementofarray(getarg(2),getarg(0)));
                return .@name$=="null"?"":.@name$;
            }
        };
    };
    function nex { return((getarg(0)+10)<getarg(1)?getarg(0)+10:getarg(1)-(getarg(1)%10)); };
    function bac { return((getarg(0)-10)>=0?getarg(0)-10:0); };
 
    if(getgmlevel()>=80 ) {
        mes .Npc_Name$;
        mes "Hello Mr. GM what would you like to do?";
        next;
        switch( select("Add/Remove Guilds:Clear Guild Data:Player Menu:Cancel") ) {
            case 1:
                mes .Npc_Name$;
                mes "Would you like to add or remove a guild?";
                .@a_len = getarraysize($App_Guilds);
                .@format$ = "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s";
                next;
                if( select("Remove:Add") == 1 ) {
                    while( .@a != 9999 ) {
                        select( sf( .@format$, $App_Guilds, .@a, .@a_len ) );
                        switch( @menu ) {
                            case 11: .@a = nex( .@a, .@a_len ); break;
                            case 12: .@a = bac( .@a ); break;
                            case 13: end;
 
                            default:
                                .@select = .@a+@menu-1;
                                mes .Npc_Name$;
                                mes "You've selected ^0000FF["+getguildname($App_Guilds[.@select])+"]^000000 guild. Would you like to remove them from the accepted guilds?";
                                next;
                                if( select("Yes:No") == 1 ) {
                                    deletearray($App_Guilds[.@select],1);
                                    mes .Npc_Name$;
                                    mes "The guild has been removed!";
                                }
                                close;
                        }
                    }
                } else {
                    mes .Npc_Name$;
                    mes "Please input guild name or masters name.";
                    next;
                    input(.@input$);
                    .@len = query_sql( "Select `guild_id` from `guild` where `name` like '%"+escape_sql(.@input$)+"%' or `master` like '%"+escape_sql(.@input$)+"%';",.@guild_id );
                    while( .@a != 9999 ) {
                        select( sf( .@format$, .@guild_id, .@a, .@len ) );
                        switch( @menu ) {
                            case 11: .@a = nex( .@a, .@len ); break;
                            case 12: .@a = bac( .@a ); break;
                            case 13: end;
 
                            default:
                                .@select = .@a+@menu-1;
                                .@a_len = getarraysize($App_Guilds);
                                for(.@b=0;.@b<.@a_len;.@b++)
                                    if( $App_Guilds[.@b]==.@guild_id[.@select] ) {
                                        mes .Npc_Name$;
                                        mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. I'm sorry but that guild has already been added to the accepted list.";
                                        close;
                                    }
                                mes .Npc_Name$;
                                mes "You've selected ^0000FF["+getguildname(.@guild_id[.@select])+"]^000000 guild. Would you like to add them to the accepted guilds?";
                                next;
                                if( select("Yes:No") == 1 ) {
                                    .@a_len = getarraysize($App_Guilds);
                                    if( .@a_len>=128 ) {
                                        mes .Npc_Name$;
                                        mes "I'm sorry but the accepted list is full please make some room and try again...";
                                    } else {
                                        mes .Npc_Name$;
                                        mes "The guild was successfully added!";
                                        $App_Guilds[.@a_len] = .@guild_id[.@select];
                                    }
                                }
                                close;
                        }
                    }
                }
            case 2:
                mes .Npc_Name$;
                mes "Are you sure you want to clear the guild data?!";
                next;
                if( select("Yes!:No!")==1 ) {
                    mes .Npc_Name$;
                    mes "This is you last chance. Are you surely sure as sure can be?";
                    next;
                    if( select("Surly!:No, wait... Where am I?!!")==1 )
                        deletearray($App_Guilds);
                }
                if( @menu==1 ) {
                    mes .Npc_Name$;
                    mes "The deed is done...";
                } else {
                    mes .Npc_Name$;
                    mes "Wow that was a close one... Have a nice day!";
                }
                close;
 
            case 3: break;
 
            case 4:
                mes .Npc_Name$;
                mes "Alright, have a nice day!";
                close;
        }
    }
 
    .@len = getarraysize($App_Guilds);
    for( .@i=0; .@i <= .@len; .@i++ ) {
        if( getcharid(2) == $App_Guilds[.@i] )
            set .@Guild_Check, .@Guild_Check+1;
    }
 
 
// This part ejects players when they are in the map 
    OnPCLoadMapEvent:
    if( getcharid(2) == $App_Guilds[.@i] ){
    .count = 0;
    .@origin = getcharid(3);
    addrid 3, 0, getcharid(2);
    if ( strcharinfo(3) == .checkmap$ )
        .count++;
    if ( !.@origin ) end;
    if ( .count > 26 ) { // 26 means only 26 players per guild allowed in a map.
        message strcharinfo(0), "Your guild members are over the limit";
        sleep2 2000;
        warp "SavePoint", 0,0;
    }
    }
    end;
OnInit:
    setarray .@checkmap$, "freya_vs", "arug_cas01", "arug_cas02", "arug_cas03", "arug_cas04", "arug_cas05", "schg_cas01", "schg_cas02", "schg_cas03", "schg_cas04", "schg_cas05";
    .@len = getarraysize( .@checkmap$ );
    for ( .@i = 0; .@i < .@len; .@i++ ) {
        setmapflag .@checkmap$[.@i], mf_loadevent;
        setd "."+ .@checkmap$[.@i], 1;
    }
    end;
}
 
-    script    kjdhfkjshf    -1,{
OnPCLoadMapEvent:
    if ( getmapflag( strcharinfo(3), mf_gvg_castle ) && ( agitcheck() || agitcheck2() )) {
    .@len = getarraysize($App_Guilds);
    for( .@i=0; .@i <= .@len; .@i++ ) {
        if( getcharid(2) == $App_Guilds[.@i] )
            set .@Guild_Check, .@Guild_Check+1;
    }
    if( .@Guild_Check < 1 ) {
        dispbottom "Your guild has not yet been approved, please contact the GMs";
        sleep2 3000;
        warp "SavePoint",0,0;
        end;
    }
    if( !getcharid(2) ) {
        dispbottom "Sorry only members of a guild may enter a castle.";
        sleep2 3000;
        warp "SavePoint",0,0;
        end;
    }
}
    end;
OnInit:
    setarray .castles$[0],
        "freya_vs","prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
        "payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
        "gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
        "aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
        "arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
        "schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
    for ( .@i = 0; .@i < 30; .@i++ )
        setmapflag .castles$[.@i], mf_loadevent;
    end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  93
  • Reputation:   34
  • Joined:  11/08/15
  • Last Seen:  

maybe because this... 

 if ( getmapflag( strcharinfo(3), mf_gvg_castle ) && ( agitcheck() || agitcheck2() )) {

your koe map doesn't have that mapflag right? mf_gvg_castle maybe you need to check if you have it

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  225
  • Topics Per Day:  0.14
  • Content Count:  798
  • Reputation:   12
  • Joined:  12/04/20
  • Last Seen:  

2 hours ago, Scanty said:

maybe because this... 

 if ( getmapflag( strcharinfo(3), mf_gvg_castle ) && ( agitcheck() || agitcheck2() )) {

your koe map doesn't have that mapflag right? mf_gvg_castle maybe you need to check if you have it

okay thanks yes maybe since koe maps are custom i will check where to add it i only add the maps in the castle db but in mapflag i think i didnt ill search for it thank you sir!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  225
  • Topics Per Day:  0.14
  • Content Count:  798
  • Reputation:   12
  • Joined:  12/04/20
  • Last Seen:  

its already in 
db/castle_db.yml
102,freya_vs,King of Emperium Hill,KoE#freya_vs

npc/mapflag
and gvg mapflag
freya_vs    mapflag    gvg

hmm dont know where i missed

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