Jump to content
  • 0

disable a specific atcommand in a map?


johnbond

Question


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

Hello guys,

 

Is there a way to allow @refresh command on map that have the nocommand mapflag?

 

Or maybe, I will not use the nocommand mapflag but how can I make specific atcommands to be disabled on maps I want them disabled? Example is I want @storage and @load to be disabled on gvg and pvp maps but the other atcommands are enabled.

 

How can I do it?

 

Thank you guys.

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

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

just remove the extra bracket ...

if ( getmapflag( .@map$,mf_pvp ) || getmapflag( .@map$,mf_gvg ) ) {
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

how about use bindatcommand the check the group level and map first?

something like

-	script	CommandChecker	-1,{
	OnAtStorage:
		if (strcharinfo(3) == "map_name")
			end;
		useatcmd .@atcmd_command$;
		end;

	OnInit:
		bindatcmd "storage",strnpcinfo(3)+"::OnAtStorage";
		end;
}
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

how about use bindatcommand the check the group level and map first?

something like

-	script	CommandChecker	-1,{
	OnAtStorage:
		if (strcharinfo(3) == "map_name")
			end;
		useatcmd .@atcmd_command$;
		end;

	OnInit:
		bindatcmd "storage",strnpcinfo(3)+"::OnAtStorage";
		end;
}

 

 

Thanks for the reply.

 

What does this do?

 

What if I like the @storage and @load to be disabled on pvp/gvg maps?

Link to comment
Share on other sites

  • 0

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


- script atcommand_main -1,{

OnAtStorage:

.@map$ = strcharinfo(3);

if ( getmapflag( .@map$,mf_pvp ) ) || getmapflag( .@map$,mf_gvg ) ) {

dispbottom .@atcmd_command$+" failed in PVP/GVG maps";

}

else {

openstorage;

}

end;

OnAtLoad:

.@map$ = strcharinfo(3);

if ( getmapflag( .@map$,mf_pvp ) ) || getmapflag( .@map$,mf_gvg ) ) {

dispbottom .@atcmd_command$+" failed in PVP/GVG maps";

}

else {

warp "SavePoint",0,0;

}

end;

OnInit:

bindatcmd "storage",strnpcinfo(3)+"::OnAtStorage";

bindatcmd "load",strnpcinfo(3)+"::OnAtLoad";

end;

}

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  


-	script	atcommand_main	-1,{
	OnAtStorage:
		.@map$ = strcharinfo(3);
		if ( getmapflag( .@map$,mf_pvp ) ) || getmapflag( .@map$,mf_gvg ) ) {
			dispbottom .@atcmd_command$+" failed in PVP/GVG maps";
		}
		else {
			openstorage;
		}
		end;
		
	OnAtLoad:
		.@map$ = strcharinfo(3);
		if ( getmapflag( .@map$,mf_pvp ) ) || getmapflag( .@map$,mf_gvg ) ) {
			dispbottom .@atcmd_command$+" failed in PVP/GVG maps";
		}
		else {
			warp "SavePoint",0,0;
		}
		end;
	
	OnInit:
		bindatcmd "storage",strnpcinfo(3)+"::OnAtStorage";
		bindatcmd "load",strnpcinfo(3)+"::OnAtLoad";
		end;
}

 

 

Oh thanks!

 

How about if a GM level 10 and above will do the command then it will allow it?

 

I kidly request the edit.

 

Thank you.

Link to comment
Share on other sites

  • 0

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


if ( getgmlevel() < 10 && ( getmapflag( .@map$,mf_pvp ) ) || getmapflag( .@map$,mf_gvg ) ) ) {

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  


-	script	atcommand_main	-1,{
	OnAtStorage:
		.@map$ = strcharinfo(3);
		if ( getmapflag( .@map$,mf_pvp ) ) || getmapflag( .@map$,mf_gvg ) ) {
			dispbottom .@atcmd_command$+" failed in PVP/GVG maps";
		}
		else {
			openstorage;
		}
		end;
		
	OnAtLoad:
		.@map$ = strcharinfo(3);
		if ( getmapflag( .@map$,mf_pvp ) ) || getmapflag( .@map$,mf_gvg ) ) {
			dispbottom .@atcmd_command$+" failed in PVP/GVG maps";
		}
		else {
			warp "SavePoint",0,0;
		}
		end;
	
	OnInit:
		bindatcmd "storage",strnpcinfo(3)+"::OnAtStorage";
		bindatcmd "load",strnpcinfo(3)+"::OnAtLoad";
		end;
}

 

 

I loaded your NPC but I got this error:

 

    script:add_word: invalid word. A word consists of undercores and/or alphanum
eric characters, and valid variable prefixes/postfixes.
     1 : {
     2 :        OnAtStorage:
     3 :                .@map$ = strcharinfo(3);
*    4 :                if ( getmapflag( .@map$,mf_pvp ) ) || getmapflag( .@map$
,mf_gvg ) ')' {
     5 :                        dispbottom .@atcmd_command$+" is disabled in PVP
/GVG maps";
     6 :                }
     7 :                else {
     8 :                        openstorage;
     9 :                }

Please help me fix sir. Thank you.

Link to comment
Share on other sites

  • 0

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


if ( getgmlevel() < 10 && ( getmapflag( .@map$,mf_pvp ) || getmapflag( .@map$,mf_gvg ) ) ) {

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

if ( getgmlevel() < 10 && ( getmapflag( .@map$,mf_pvp ) || getmapflag( .@map$,mf_gvg ) ) ) {

 

No no the error is not on that part my friend. I even still was not using that GM option. I was just using the default script you gave and it had errors:

    script:add_word: invalid word. A word consists of undercores and/or alphanum

eric characters, and valid variable prefixes/postfixes.

     1 : {

     2 :        OnAtStorage:

     3 :                .@map$ = strcharinfo(3);

*    4 :                if ( getmapflag( .@map$,mf_pvp ) ) || getmapflag( .@map$

,mf_gvg ) ')' {

     5 :                        dispbottom .@atcmd_command$+" is disabled in PVP

/GVG maps";

     6 :                }

     7 :                else {

     8 :                        openstorage;

     9 :                }

 

 

 

Kindly please help me fix error sir.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

 

just remove the extra bracket ...

if ( getmapflag( .@map$,mf_pvp ) || getmapflag( .@map$,mf_gvg ) ) {

 

 

Oh there no more error in map console after removing the extra bracket. Perfect!

 

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