Jump to content
  • 0

how to disable gm account to enter gvg map


Brynner

Question


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

is it possible to disable all gm accounts to enter gvg maps?

Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  247
  • Reputation:   207
  • Joined:  10/23/12
  • Last Seen:  

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.

Link to comment
Share on other sites


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


OnPCLoadMapEvent:

if( getgmlevel() ) warp "SavePoint";

end;

mapname    mapflag   loadevent

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  182
  • Reputation:   36
  • Joined:  01/26/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

If your players warp via an NPC, why not create a check there before the warp?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  182
  • Reputation:   36
  • Joined:  01/26/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  182
  • Reputation:   36
  • Joined:  01/26/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

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.

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