Jump to content
  • 0

Adding feature to @pk command


Gidz Cross

Question


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

What is @pk command? ~ its like a @battleignore but only for Players. Refer to this 

Anyway i have that src into my trunk. It works alright. But there are limitation to it. My server setup is PK type. Even tho its PK type im opting to have the @pk command for the newbies. Anyways. What i was trying to accomplish is to have some function/checker to set/force the pk state into 1(if they @pk off) when they got into selected maps.

Selected maps?
~ Yes. Selected maps. Like PVP Room for example. Imagine player set his pk state to off and warp to pvp room. Players wont be able to attack that guy.

To put it simply. When players warped to selected maps their pk state should be force to on or normal state.


Can someone help me make a checker for @pk command? Or make some script to the the pk state into 1. Thanks!

my discord question snapchat from rA's discord.

image.png

Edited by gidzdlcrz
Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  208
  • Reputation:   22
  • Joined:  01/14/13
  • Last Seen:  

Sorry for late share.

I think this is the one you are looking for. I already added the feature you like.
https://github.com/coookie1010/Server-Patches/commit/02498a59983d7c1fdbfd56a69b33297e73320b14

 

 

On 12/23/2020 at 2:46 PM, EveeX said:

Try putting this in pc.cpp function in pc_setpos


	if (strncmp(mapdata->name, "map", strlen(mapdata->name)) == 0) { // in "map" choose the map what you prefeer
			sd->state.pk = 1;
	}

This method is so much harder than the mapflag function.


you can force a map with mapflag function for example
prontera mapflag pkarea
 

Edited by Cookie-rae
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  32
  • Reputation:   29
  • Joined:  09/16/20
  • Last Seen:  

Try putting this in pc.cpp function in pc_setpos

	if (strncmp(mapdata->name, "map", strlen(mapdata->name)) == 0) { // in "map" choose the map what you prefeer
			sd->state.pk = 1;
	}
Edited by EveeX
.
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  208
  • Reputation:   22
  • Joined:  01/14/13
  • Last Seen:  

On 11/30/2020 at 8:23 AM, Gidz Cross said:

Can someone help me make a checker for @pk command? Or make some script to the the pk state into 1. Thanks!

 

On 11/30/2020 at 8:23 AM, Gidz Cross said:

Selected maps?
~ Yes. Selected maps. Like PVP Room for example. Imagine player set his pk state to off and warp to pvp room. Players wont be able to attack that guy.

I already revamp change the script of this base on your explanation if you need just notify me.
 

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:  

On 1/22/2021 at 10:06 PM, Cookie-rae said:

 

I already revamp change the script of this base on your explanation if you need just notify me.
 

Wow! Can i check? Ive been away to ragnarok scene for 2 months now. ♥ But i want to check good sir!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  208
  • Reputation:   22
  • Joined:  01/14/13
  • Last Seen:  

On 3/2/2021 at 12:27 AM, Gidz Cross said:

Wow! Can i check? Ive been away to ragnarok scene for 2 months now. ♥ But i want to check good sir!

i implement it to mapflag on it. 

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:  

On 3/12/2021 at 1:36 PM, Cookie-rae said:

i implement it to mapflag on it. 

How?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

will this be available on public?

On 12/23/2020 at 2:46 PM, EveeX said:

Try putting this in pc.cpp function in pc_setpos


	if (strncmp(mapdata->name, "map", strlen(mapdata->name)) == 0) { // in "map" choose the map what you prefeer
			sd->state.pk = 1;
	}

where should i exactly put this? i want to try it out

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

thanks for the great share! i try it on my free time

okay i finally tested it.

i think it should be better if the force pk will automatically after warping. they could actually sit there/spectate on pvp map area ex. new_1-1/@go 15

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

On 11/30/2020 at 8:23 AM, Gidz Cross said:

What is @pk command? ~ its like a @battleignore but only for Players. Refer to this 

Anyway i have that src into my trunk. It works alright. But there are limitation to it. My server setup is PK type. Even tho its PK type im opting to have the @pk command for the newbies. Anyways. What i was trying to accomplish is to have some function/checker to set/force the pk state into 1(if they @pk off) when they got into selected maps.

Selected maps?
~ Yes. Selected maps. Like PVP Room for example. Imagine player set his pk state to off and warp to pvp room. Players wont be able to attack that guy.

To put it simply. When players warped to selected maps their pk state should be force to on or normal state.


Can someone help me make a checker for @pk command? Or make some script to the the pk state into 1. Thanks!

my discord question snapchat from rA's discord.

image.png

hello did you already fix this? 
and mind to share the diff? 
im having this problem too.

@Gidz Cross

 

On 12/23/2020 at 2:46 PM, EveeX said:

Try putting this in pc.cpp function in pc_setpos

	if (strncmp(mapdata->name, "map", strlen(mapdata->name)) == 0) { // in "map" choose the map what you prefeer
			sd->state.pk = 1;
	}

@EveeX where should i put this?

Edited by Takuyakii
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...