Jump to content
  • 0

@pk on/off in Towns (Latest Git)


Vale

Question


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   1
  • Joined:  03/16/20
  • Last Seen:  

Hi ! Can you help me with this kind of error in my PK Command?

My Script for this Command is


   

int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) {

        nullpo_retr(-1, sd);

        if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) {
            clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
            return -1;
        }
        
        else if (!sd->state.pk_mode) {
            sd->state.pk_mode = 1;
            clif_displaymessage(sd->fd, "You are now no longer in PK mode."); 
        }
        
        else {
            sd->state.pk_mode = 0;
            clif_displaymessage(sd->fd, "Returned to normal state.");
        }
        
        return 0;
    } 


 

error.png

Edited by Mabuhay
use codebox
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  109
  • Reputation:   5
  • Joined:  03/17/16
  • Last Seen:  

5 hours ago, Vale said:

Hi ! Can you help me with this kind of error in my PK Command?

My Script for this Command is

 

    int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) {

        nullpo_retr(-1, sd);

        if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) {
            clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
            return -1;
        }
        
        else if (!sd->state.pk_mode) {
            sd->state.pk_mode = 1;
            clif_displaymessage(sd->fd, "You are now no longer in PK mode."); 
        }
        
        else {
            sd->state.pk_mode = 0;
            clif_displaymessage(sd->fd, "Returned to normal state.");
        }
        
        return 0;
    } 
 

error.png

int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) {

        nullpo_retr(-1, sd);

        if( map_getmapflag(sd->bl.m, MF_PVP) || map_getmapflag(sd->bl.m, MF_PVP) || map_getmapflag(sd->bl.m, MF_GVG_CASTLE) || map_getmapflag(sd->bl.m, MF_GVG_DUNGEON) ) {
            clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
            return -1;
        }

        else if (!sd->state.pk_mode) {
            sd->state.pk_mode = 1;
            clif_displaymessage(sd->fd, "You are now no longer in PK mode.");
        }

        else {
            sd->state.pk_mode = 0;
            clif_displaymessage(sd->fd, "Returned to normal state.");
        }

        return 0;
    }

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   1
  • Joined:  03/16/20
  • Last Seen:  

11 hours ago, noobzter003 said:

int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) {

        nullpo_retr(-1, sd);

        if( map_getmapflag(sd->bl.m, MF_PVP) || map_getmapflag(sd->bl.m, MF_PVP) || map_getmapflag(sd->bl.m, MF_GVG_CASTLE) || map_getmapflag(sd->bl.m, MF_GVG_DUNGEON) ) {
            clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
            return -1;
        }

        else if (!sd->state.pk_mode) {
            sd->state.pk_mode = 1;
            clif_displaymessage(sd->fd, "You are now no longer in PK mode.");
        }

        else {
            sd->state.pk_mode = 0;
            clif_displaymessage(sd->fd, "Returned to normal state.");
        }

        return 0;
    }

 

Thanks ! It Works

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

Can you share the diff file for this bro?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

12 hours ago, gidzdlcrz said:

Can you share the diff file for this bro?

You can check my comment here 

 

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

2 hours ago, Patskie said:

You can check my comment here 

 

Omg sir @Patskie! You da MVP!!!!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

sir @Patskie you know how to add delay when using the @pk? I want to put like 3 minutes cooldown before using it again.

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