Jump to content
  • 0

Disable guilds entering WoE Maps


Psy Ops

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  70
  • Reputation:   0
  • Joined:  06/19/18
  • Last Seen:  

Hi all! is there any way that i can allow only certain guilds inside the WoE Castle?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

-	script	sample	-1,{
OnInit:
	setarray .guild_id, 89,202; // allowed guild ID
	.guild_id_size = getarraysize(.guild_id);
	
	setarray .map$, "prtg_cas03"; // restricted map
	.map_size = getarraysize(.map$);
	
	for ( .@i = 0; .@i < .map_size; .@i++ )
		setmapflag .map$[.@i], mf_loadevent;
	end;
	
OnPCLoadMapEvent:
//	GMs should bypass this kind of things
	if ( getgmlevel() >= 99 ) end;

	.@map$ = strcharinfo(3);
	for ( .@i = 0; .@i < .map_size; .@i++ ) {
		if ( .@map$ == .map$[.@i] ) { // is on the map
			for ( .@j = 0; .@j < .guild_id_size; .@j++ ) {
				if ( getcharid(2) == .guild_id[.@j] )
					end; // if the condition met, the player isn't warp away
			}
			warp "Save", 0,0;
			end;
		}
	}
	end;
}

Use this i hope its what do u want and work

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  70
  • Reputation:   0
  • Joined:  06/19/18
  • Last Seen:  

Hi! is there anyone who can help me with the script?

-    script    arugm    -1,{
    OnPCLoadMapEvent:
        getmapxy .@map$,.@x,.@y,0;
        if (.@map$ == "aru_gld" && getcharid(2)!=263) {
            dispbottom "You cannot enter this map.";
            warp "SavePoint",0,0;
        }
        end;
}
aru_gld    mapflag    loadevent


My Goals it just to put specific guilds to be able to warp to the castles areas.

Please help!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

I don't see anything wrong wit your script, do you have errors of some sort?

I suggest you use strcharinfo instead of getcharid.

https://github.com/rathena/rathena/blob/da83e6173857076d793820c40ce0cae67973d4a6/doc/script_commands.txt#L2325-L2336

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2347
  • Joined:  10/28/11
  • Last Seen:  

 if (.@map$ == "aru_gld" && getcharid(2)!=263) {

your condition statement only allow guild_id 263 to enter the map.

if you intend to disable the access for only 1 guild, then it should be like this

 if (.@map$ == "aru_gld" && getcharid(2) == 263) {

this will prevent player with guild_id 263 to enter the said map.

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