cahadeyelo Posted December 10, 2016 Group: Members Topic Count: 70 Topics Per Day: 0.02 Content Count: 172 Reputation: 1 Joined: 11/13/14 Last Seen: Yesterday at 03:09 AM Share Posted December 10, 2016 Can i request a script that restricting them to go inside the castle if the online guild members are below 7. - script woe_restriction -1,{ OnPCLoadMapEvent: query_sql "SELECT guild_lv FROM guild WHERE guild_id = "+getcharid(2), .@guild_lv; if( getmapflag(strcharinfo(3),mf_gvg_castle)){ if((BaseLevel < 175) || (getcharid(2) == 0) || (.@guild_lv < 43) ) { warp "prontera",155,182; dispbottom "[ Server ]: You doesn't have a guild or you don't have enough Base Level."; } } end; } aldeg_cas01 mapflag loadevent aldeg_cas02 mapflag loadevent aldeg_cas03 mapflag loadevent aldeg_cas04 mapflag loadevent aldeg_cas05 mapflag loadevent gefg_cas01 mapflag loadevent gefg_cas02 mapflag loadevent gefg_cas03 mapflag loadevent gefg_cas04 mapflag loadevent gefg_cas05 mapflag loadevent payg_cas01 mapflag loadevent payg_cas02 mapflag loadevent payg_cas03 mapflag loadevent payg_cas04 mapflag loadevent payg_cas05 mapflag loadevent prtg_cas01 mapflag loadevent prtg_cas02 mapflag loadevent prtg_cas03 mapflag loadevent prtg_cas04 mapflag loadevent prtg_cas05 mapflag loadevent schg_cas01 mapflag loadevent schg_cas02 mapflag loadevent schg_cas03 mapflag loadevent schg_cas04 mapflag loadevent schg_cas05 mapflag loadevent arug_cas01 mapflag loadevent arug_cas02 mapflag loadevent arug_cas03 mapflag loadevent arug_cas04 mapflag loadevent arug_cas05 mapflag loadevent nguild_alde mapflag loadevent nguild_gef mapflag loadevent nguild_pay mapflag loadevent nguild_prt mapflag loadevent Quote Link to comment Share on other sites More sharing options...
2 Tokei Posted December 10, 2016 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 696 Reputation: 722 Joined: 11/12/12 Last Seen: 22 hours ago Share Posted December 10, 2016 (edited) It's easier to create custom script commands (it is more reliable than using SQL and it is faster). Plus, you'll be able to have more freedom if you want to add more guild options: script.c /*========================================== *------------------------------------------*/ BUILDIN_FUNC(getguildinfo) { struct guild *g = NULL; int result = 0; if ((g = guild_search(script_getnum(st,2))) != NULL) { int type = script_getnum(st,3); switch(type) { case 0: result = g->guild_lv; break; case 1: result = g->connect_member; break; case 2: script_pushstrcopy(st, g->name); return SCRIPT_CMD_SUCCESS; //case 3: // etc... // break; default: ShowError("buildin_getguildinfo: unknown type '%d'.\n", type); script_pushint(st, 0); return SCRIPT_CMD_FAILURE; } } script_pushint(st, result); return SCRIPT_CMD_SUCCESS; } def method: BUILDIN_DEF(getguildinfo,"ii"), Recompile your server, then your event would be: OnPCLoadMapEvent: if (getmapflag(strcharinfo(3), mf_gvg_castle)) { .@guild_id = getcharid(2); if (BaseLevel < 175 || .@guild_id == 0 || getguildinfo(.@guild_id, 0) < 43 || getguildinfo(.@guild_id, 1) < 7) { dispbottom "[ Server ]: You don't have a guild or your Base Level isn't high enough.", 0x00ff00; warp "prontera", 155, 182; } } end; Edited December 10, 2016 by Tokei 1 Quote Link to comment Share on other sites More sharing options...
0 Azeroth Posted December 10, 2016 Group: Members Topic Count: 36 Topics Per Day: 0.01 Content Count: 383 Reputation: 121 Joined: 03/31/12 Last Seen: January 29, 2023 Share Posted December 10, 2016 44 minutes ago, Tokei said: It's easier to create custom script commands (it is more reliable than using SQL and it is faster). Plus, you'll be able to have more freedom if you want to add more guild options: script.c /*========================================== *------------------------------------------*/ BUILDIN_FUNC(getguildinfo) { struct guild *g = NULL; int result = 0; if ((g = guild_search(script_getnum(st,2))) != NULL) { int type = script_getnum(st,3); switch(type) { case 0: result = g->guild_lv; break; case 1: result = g->connect_member; break; case 2: script_pushstrcopy(st, g->name); return SCRIPT_CMD_SUCCESS; //case 3: // etc... // break; default: ShowError("buildin_getguildinfo: unknown type '%d'.\n", type); script_pushint(st, 0); return SCRIPT_CMD_FAILURE; } } script_pushint(st, result); return SCRIPT_CMD_SUCCESS; } def method: BUILDIN_DEF(getguildinfo,"ii"), Recompile your server, then your event would be: OnPCLoadMapEvent: if (getmapflag(strcharinfo(3), mf_gvg_castle)) { .@guild_id = getcharid(2); if (BaseLevel < 175 || .@guild_id == 0 || getguildinfo(.@guild_id, 0) < 43 || getguildinfo(.@guild_id, 1) < 7) { dispbottom "[ Server ]: You don't have a guild or your Base Level isn't high enough.", 0x00ff00; warp "prontera", 155, 182; } } end; Indeed very useful thank you for this Tokei, hopefully 1 day you will released a custom src that comes from you Quote Link to comment Share on other sites More sharing options...
0 cahadeyelo Posted December 11, 2016 Group: Members Topic Count: 70 Topics Per Day: 0.02 Content Count: 172 Reputation: 1 Joined: 11/13/14 Last Seen: Yesterday at 03:09 AM Author Share Posted December 11, 2016 all your help and answers are purely reliable...thanks Quote Link to comment Share on other sites More sharing options...
0 cahadeyelo Posted December 19, 2016 Group: Members Topic Count: 70 Topics Per Day: 0.02 Content Count: 172 Reputation: 1 Joined: 11/13/14 Last Seen: Yesterday at 03:09 AM Author Share Posted December 19, 2016 On 12/11/2016 at 5:26 AM, Tokei said: It's easier to create custom script commands (it is more reliable than using SQL and it is faster). Plus, you'll be able to have more freedom if you want to add more guild options: script.c /*========================================== *------------------------------------------*/ BUILDIN_FUNC(getguildinfo) { struct guild *g = NULL; int result = 0; if ((g = guild_search(script_getnum(st,2))) != NULL) { int type = script_getnum(st,3); switch(type) { case 0: result = g->guild_lv; break; case 1: result = g->connect_member; break; case 2: script_pushstrcopy(st, g->name); return SCRIPT_CMD_SUCCESS; //case 3: // etc... // break; default: ShowError("buildin_getguildinfo: unknown type '%d'.\n", type); script_pushint(st, 0); return SCRIPT_CMD_FAILURE; } } script_pushint(st, result); return SCRIPT_CMD_SUCCESS; } def method: BUILDIN_DEF(getguildinfo,"ii"), Recompile your server, then your event would be: OnPCLoadMapEvent: if (getmapflag(strcharinfo(3), mf_gvg_castle)) { .@guild_id = getcharid(2); if (BaseLevel < 175 || .@guild_id == 0 || getguildinfo(.@guild_id, 0) < 43 || getguildinfo(.@guild_id, 1) < 7) { dispbottom "[ Server ]: You don't have a guild or your Base Level isn't high enough.", 0x00ff00; warp "prontera", 155, 182; } } end; sir can you extend the src code you made and add the total castle count of a guild Quote Link to comment Share on other sites More sharing options...
Question
cahadeyelo
Can i request a script that restricting them to go inside the castle if the online guild members are below 7.
- script woe_restriction -1,{ OnPCLoadMapEvent: query_sql "SELECT guild_lv FROM guild WHERE guild_id = "+getcharid(2), .@guild_lv; if( getmapflag(strcharinfo(3),mf_gvg_castle)){ if((BaseLevel < 175) || (getcharid(2) == 0) || (.@guild_lv < 43) ) { warp "prontera",155,182; dispbottom "[ Server ]: You doesn't have a guild or you don't have enough Base Level."; } } end; } aldeg_cas01 mapflag loadevent aldeg_cas02 mapflag loadevent aldeg_cas03 mapflag loadevent aldeg_cas04 mapflag loadevent aldeg_cas05 mapflag loadevent gefg_cas01 mapflag loadevent gefg_cas02 mapflag loadevent gefg_cas03 mapflag loadevent gefg_cas04 mapflag loadevent gefg_cas05 mapflag loadevent payg_cas01 mapflag loadevent payg_cas02 mapflag loadevent payg_cas03 mapflag loadevent payg_cas04 mapflag loadevent payg_cas05 mapflag loadevent prtg_cas01 mapflag loadevent prtg_cas02 mapflag loadevent prtg_cas03 mapflag loadevent prtg_cas04 mapflag loadevent prtg_cas05 mapflag loadevent schg_cas01 mapflag loadevent schg_cas02 mapflag loadevent schg_cas03 mapflag loadevent schg_cas04 mapflag loadevent schg_cas05 mapflag loadevent arug_cas01 mapflag loadevent arug_cas02 mapflag loadevent arug_cas03 mapflag loadevent arug_cas04 mapflag loadevent arug_cas05 mapflag loadevent nguild_alde mapflag loadevent nguild_gef mapflag loadevent nguild_pay mapflag loadevent nguild_prt mapflag loadevent
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.