Jump to content
  • 0

point system loose and steal


Yaziid91

Question


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   0
  • Joined:  04/20/19
  • Last Seen:  

Good evening, I would like to know how to do so that when we kill a person on a certain map I steal the number of points they have? example if she has 10 kafra points and I have 0, by killing her I go to 10 and she has 0 thank you for your help

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  618
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

I won't explain exactly how to do this, but you could simply use the following information

OnPCKillEvent:

This special label triggers when a player kills another player. The variable
'killedrid' is set to the ID of the player killed.

 

*getmapxy("<variable for map name>",<variable for x>,<variable for y>{,<type>,"<search value>"})

*getcharid(<type>{,"<character name>"}) // Type = 3 (for Account ID)

#KAFRAPOINTS

*attachrid(<account_id>);

- Attaches Script to Account ID (reads information from attached account)

 

Using the information here, we can determine the following:

 

When the Trigger Runs, we can use getmapxy to determine the location of the user and check the map that they are on, the NPC should be hidden with a -1 and placed on the map... I believe it will only trigger if ON that map, but I could be mistaken, hence the reason to use getmapxy and check...

Once you determined if they are on that map, the next thing to do, would be to set a variable called origrid = getcharid(3); // this will allow you to go "back" to this user, once we go to the killed user to get their information...

So, then using attachrid(killedrid); you can attach the script to the killed player, and then store a variable (npc variable) to store the #KAFRAPOINTS they had, and no you can set those to ZERO...

Then reattach the script back to the origrid and add that npc variable with the #KAFRAPOINTS to the original killer's #KAFRAPOINTS

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  63
  • Topics Per Day:  0.02
  • Content Count:  1016
  • Reputation:   191
  • Joined:  11/27/14
  • Last Seen:  

3 hours ago, Z3R0 said:

I won't explain exactly how to do this, but you could simply use the following information

OnPCKillEvent:

This special label triggers when a player kills another player. The variable
'killedrid' is set to the ID of the player killed.

 

*getmapxy("<variable for map name>",<variable for x>,<variable for y>{,<type>,"<search value>"})

*getcharid(<type>{,"<character name>"}) // Type = 3 (for Account ID)

#KAFRAPOINTS

*attachrid(<account_id>);

- Attaches Script to Account ID (reads information from attached account)

 

Using the information here, we can determine the following:

 

When the Trigger Runs, we can use getmapxy to determine the location of the user and check the map that they are on, the NPC should be hidden with a -1 and placed on the map... I believe it will only trigger if ON that map, but I could be mistaken, hence the reason to use getmapxy and check...

Once you determined if they are on that map, the next thing to do, would be to set a variable called origrid = getcharid(3); // this will allow you to go "back" to this user, once we go to the killed user to get their information...

So, then using attachrid(killedrid); you can attach the script to the killed player, and then store a variable (npc variable) to store the #KAFRAPOINTS they had, and no you can set those to ZERO...

Then reattach the script back to the origrid and add that npc variable with the #KAFRAPOINTS to the original killer's #KAFRAPOINTS

Seems like from Chat GPT

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  618
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

BWA HA HA HA Absolutely not, it's actually copy and pasted from the rathena script_commands.txt 

 

https://github.com/rathena/rathena/blob/master/doc/script_commands.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  618
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Personally, if someone was asking this in Request, then I would help write the script, but when asking for support, I gave a more broad example of how to actually write the script yourself and all the things you should look for and focus on.

 

 

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