Jump to content
  • 0

@unjail return location


darking123

Question


  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

when a player has been unjailed or the jailtime lapsed.  The player returns to it's original position before it went to the prison.

 

may I ask how to change it so that the player will return to his savepoint instead or specific map and coordinates? Thank you!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  35
  • Reputation:   24
  • Joined:  10/17/13
  • Last Seen:  

let me see if i get it, you want to player be teleported to a specific location when jail is over?

u can use part of @go command (https://github.com/rathena/rathena/blob/ca56c060cf3d4c11b0f6da9c5d5b2d8e8e5c3d7e/src/map/atcommand.cpp#L1939)

if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == SETPOS_OK) {
	clif_displaymessage(fd, msg_txt(sd,0)); // Warped.
}

in @unjail (https://github.com/rathena/rathena/blob/ca56c060cf3d4c11b0f6da9c5d5b2d8e8e5c3d7e/src/map/atcommand.cpp#L4957)

//Reset jail time to 1 sec.
sc_start(NULL,&pl_sd->bl,SC_JAILED,100,1,1000);
clif_displaymessage(pl_sd->fd, msg_txt(sd,120)); // A GM has discharged you from jail.
clif_displaymessage(fd, msg_txt(sd,121)); // Player unjailed.
return 0;

i'm not sure but would be something like that(?)

//Reset jail time to 1 sec.
pc_setpos(sd, mapindex_name2id(prontera), 150, 150, CLR_TELEPORT); // really not sure
sc_start(NULL,&pl_sd->bl,SC_JAILED,100,1,1000);
clif_displaymessage(pl_sd->fd, msg_txt(sd,120)); // A GM has discharged you from jail.
clif_displaymessage(fd, msg_txt(sd,121)); // Player unjailed.
return 0;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  318
  • Topics Per Day:  0.07
  • Content Count:  931
  • Reputation:   13
  • Joined:  12/20/11
  • Last Seen:  

33 minutes ago, HaureN said:

let me see if i get it, you want to player be teleported to a specific location when jail is over?

u can use part of @go command (https://github.com/rathena/rathena/blob/ca56c060cf3d4c11b0f6da9c5d5b2d8e8e5c3d7e/src/map/atcommand.cpp#L1939)


if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == SETPOS_OK) {
	clif_displaymessage(fd, msg_txt(sd,0)); // Warped.
}

in @unjail (https://github.com/rathena/rathena/blob/ca56c060cf3d4c11b0f6da9c5d5b2d8e8e5c3d7e/src/map/atcommand.cpp#L4957)


//Reset jail time to 1 sec.
sc_start(NULL,&pl_sd->bl,SC_JAILED,100,1,1000);
clif_displaymessage(pl_sd->fd, msg_txt(sd,120)); // A GM has discharged you from jail.
clif_displaymessage(fd, msg_txt(sd,121)); // Player unjailed.
return 0;

i'm not sure but would be something like that(?)


//Reset jail time to 1 sec.
pc_setpos(sd, mapindex_name2id(prontera), 150, 150, CLR_TELEPORT); // really not sure
sc_start(NULL,&pl_sd->bl,SC_JAILED,100,1,1000);
clif_displaymessage(pl_sd->fd, msg_txt(sd,120)); // A GM has discharged you from jail.
clif_displaymessage(fd, msg_txt(sd,121)); // Player unjailed.
return 0;

 

thank you for your response however that is not working. It just teleport the player back to his original position.

I think it is something to do with how SC_JAILED bahave. hmm.

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