Jump to content
  • 0

how to disable commands on a certain map


Question

9 answers to this question

Recommended Posts

Posted

  	 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.

Posted

@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;
}

Posted

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 ?

Posted

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

Posted

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.

Posted

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

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