Jump to content
  • 0

how to disable gm account to enter gvg map


Question

9 answers to this question

Recommended Posts

Posted

I know this is script support, but I thought I'd put in a different fix for this issue.  It's a source fix.

 

pc.c in

int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y, clr_type clrtype)

FIND

m = map_mapindex2mapid(mapindex);

 

ADD AFTER

	if (map[m].flag.gvg && pc_get_group_level(sd) > 0)
		return 1;

 

Replace "0" with any number where you want the GM level to restrict GVG access.  For instance, if group level restricted 5 and above:

 

pc_get_group_level(sd) > 4

 

Just suggesting another option.

Posted
OnPCLoadMapEvent:
if( getgmlevel() ) warp "SavePoint";
end;


mapname    mapflag   loadevent
 

 

I think you should add a map name check, because if the loadevent mapflag is set on another map it'll warp the GM anyways.

Posted

just like this?

 

 

OnPCLoadMapEvent:
    if( getgmlevel() ) warp "SavePoint";
    end;
 
 
// Guild Castles ==========
aldeg_cas01    mapflag    gvg_castle
aldeg_cas02    mapflag    gvg_castle
aldeg_cas03    mapflag    gvg_castle
aldeg_cas04    mapflag    gvg_castle
aldeg_cas05    mapflag    gvg_castle
gefg_cas01    mapflag    gvg_castle
gefg_cas02    mapflag    gvg_castle
gefg_cas03    mapflag    gvg_castle
gefg_cas04    mapflag    gvg_castle
gefg_cas05    mapflag    gvg_castle
payg_cas01    mapflag    gvg_castle
payg_cas02    mapflag    gvg_castle
payg_cas03    mapflag    gvg_castle
payg_cas04    mapflag    gvg_castle
payg_cas05    mapflag    gvg_castle
prtg_cas01    mapflag    gvg_castle
prtg_cas02    mapflag    gvg_castle
prtg_cas03    mapflag    gvg_castle
prtg_cas04    mapflag    gvg_castle
prtg_cas05    mapflag    gvg_castle
schg_cas01    mapflag    gvg_castle
schg_cas02    mapflag    gvg_castle
schg_cas03    mapflag    gvg_castle
schg_cas04    mapflag    gvg_castle
schg_cas05    mapflag    gvg_castle
arug_cas01    mapflag    gvg_castle
arug_cas02    mapflag    gvg_castle
arug_cas03    mapflag    gvg_castle
arug_cas04    mapflag    gvg_castle
arug_cas05    mapflag    gvg_castle
 
// Novice Guild Castles ===
//n_castle    mapflag    gvg_castle
nguild_alde    mapflag    gvg_castle
nguild_gef    mapflag    gvg_castle
nguild_pay    mapflag    gvg_castle
nguild_prt    mapflag    gvg_castle
Posted

Nope, I'll take the lead of Emistry and fix the little problem it had. This should work: instead of a map name check I've used a mapflag check:

 

OnPCLoadMapEvent:
getmapxy (.@map$,.@x,.@y,0);
if( getgmlevel() && (gemapflag(.@map$,"mf_gvg") || (gemapflag(.@map$,"mf_gvg_noparty") || (gemapflag(.@map$,"mf_gvg_castle") || (gemapflag(.@map$,"mf_gvg_dungeon")) ) warp "SavePoint";
end;


mapname    mapflag   loadevent // Add this mapflag to every map that also has mapflag gvg of any kind AND you want this script to be run

 

Try this one.

Posted

Nope, I'll take the lead of Emistry and fix the little problem it had. This should work: instead of a map name check I've used a mapflag check:

 

OnPCLoadMapEvent:
getmapxy (.@map$,.@x,.@y,0);
if( getgmlevel() && (gemapflag(.@map$,"mf_gvg") || (gemapflag(.@map$,"mf_gvg_noparty") || (gemapflag(.@map$,"mf_gvg_castle") || (gemapflag(.@map$,"mf_gvg_dungeon")) ) warp "SavePoint";
end;


mapname    mapflag   loadevent // Add this mapflag to every map that also has mapflag gvg of any kind AND you want this script to be run

 

Try this one.

where should i add this?

Posted (edited)

You can add it to an already existing NPC (any NPC script) or if you want you can make a new one with this code and then load it:

 

-	script	GMdontwarptoGvG	-1,{

OnPCLoadMapEvent:
	getmapxy (.@map$,.@x,.@y,0);
	if( getgmlevel() && (gemapflag(.@map$,"mf_gvg")) || (gemapflag(.@map$,"mf_gvg_noparty")) || (gemapflag(.@map$,"mf_gvg_castle")) || (gemapflag(.@map$,"mf_gvg_dungeon")) ) 
		warp "SavePoint";
	end;
}

mapname	mapflag	loadevent // Add this mapflag to every map that also has mapflag gvg of any kind AND you want this script to be run
mapname2	mapflag	loadevent
mapname3	mapflag	loadevent
mapname4	mapflag	loadevent
mapname5	mapflag	loadevent
mapname6	mapflag	loadevent
mapname7	mapflag	loadevent

I personally would use a separate NPC.

 

P.S.: Careful, the script I made on the other post has unbalanced brackets and that's an error, that piece of code won't run.

Edited by jaBote
Posted

I know this is script support, but I thought I'd put in a different fix for this issue.  It's a source fix.

 

pc.c in

int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y, clr_type clrtype)

FIND

m = map_mapindex2mapid(mapindex);

 

ADD AFTER

	if (map[m].flag.gvg && pc_get_group_level(sd) > 0)
		return 1;

 

Replace "0" with any number where you want the GM level to restrict GVG access.  For instance, if group level restricted 5 and above:

 

pc_get_group_level(sd) > 4

 

Just suggesting another option.

thanks for this. i didn't know that this could be fix by source. thank you to all of you.

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