Jump to content
  • 0

how to disable commands on a certain map


emery

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  01/29/12
  • Last Seen:  

i want to disable @storage and @die in my pvp room thanks

Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

  	 if( map_flag_vs(sd->bl.m) ) {
       clif_displaymessage(fd,"Sorry, you can't use this command on a PvP map.");
       return -0;
       }

Paste it under your @die and @storage command.

Don't forget to recompile, though.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

@Legato, after that you can set a @die mapflag or what ?

any explanation?

Link to comment
Share on other sites


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

@tr0n....

:) ...like title mentioned...those command will be disabled at pvp map..

when player use the command...

a message of disabling they use the command will be shown to player..

( just a 4 line code...how come you didnt saw the 2nd line ? )

"Sorry , you cant use this command at pvp map."

@legato/....

there is a little typo mistake at your code..

return -0; -------> should be -1;

anyway..if legato didnt work..maybe you can try this..

if( map[sd->bl.m].flag.pvp ){
 clif_displaymessage(fd, "This Command is Disabled in PVP Map.");
return -1;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   152
  • Joined:  02/21/12
  • Last Seen:  

I didn't understand this:

if( map_flag_vs(sd->bl.m) ) {

but yours I understand:

if( map[sd->bl.m].flag.pvp ){

I'm not that dumb <.<

Is mapflag VS same as PVP ?

Link to comment
Share on other sites


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

erm..ya...actually i feel the same as you...

and i didnt found any example for map_flag_vs inside the src part.. >.<

that's why i write 1 using the current exist mapflag checking code..

anyway..hope it work...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  87
  • Reputation:   1
  • Joined:  11/20/11
  • Last Seen:  

I wrote it that way, Emistry. Thanks for pointing it out, though. You can put either -0 or -1.

Return -1 will show the @storage / @die failed message when a player tries to use any of these 2 commands inside a PvP map.

While return -0 won't show any failed message.

@Tr0n, you don't have to set any mapflag. With that piece of code, no one will be able to use the commands inside a pvp map(including WoE maps, and when you use @pvpon). And Emistry's code would only work on the maps that has a mapflag pvp enabled.

Link to comment
Share on other sites


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

owh..thx for the explaination legato xD

it though it was wrong..coz i didnt found any sample with -0 and that map_flag_vs also haha

and thx you teach me a great lesson on src

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  50
  • Reputation:   0
  • Joined:  07/24/12
  • Last Seen:  

I am sorry, but i cant follow, which file should I edit and add in that code?

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