Jump to content
  • 0

PVP points.


quesoph

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  210
  • Reputation:   10
  • Joined:  11/20/11
  • Last Seen:  

Hi, I am having a little trouble about the script i am trying to make.

what im trying to do is:

if player 1 killed player 2, and player 2 doesn't have any cash points

then player 1 will not gain cash points.

if player 1 killed player 2 with cash points then player 1 will gain cash points.

here is the script:

OnPCKillEvent:
	for (set .@a, 0; .@a < getarraysize(.maps$); set .@a, .@a + 1) {
	if ( strcharinfo(3) == .maps$ )
	if ( #CASHPOINTS == 0) end; //<- not working. 
	set #CASHPOINTS, #CASHPOINTS + 1;
	dispbottom "you gained 1 cash point, Total is "+#CASHPOINTS+" Cash Points.";
	end;
}

Thank you!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you need at attach the script to the player2 to check whether the victim of pvp got cashpoint or not..

in your current script , it only check for the killer's cashpoint...not killed person.

try this..hope this work for you..


- script Sample -1,{
OnPCDieEvent:
if( #CASHPOINTS ){
 attachrid( getcharid( 3,rid2name(killerrid) ) ){
  dispbottom "You gained 1 Cash Points.";
  set #CASHPOINTS,#CASHPOINTS + 1;
 }
}
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  210
  • Reputation:   10
  • Joined:  11/20/11
  • Last Seen:  

^ Thank you for you reply.

what i am trying to do is.

if the player 2 character doesn't have cash points then the player 1 will not acquire cash points.

is it possible that i could place a check on "OnPCKillEvent" about the player 2 cash points.

if player 2's cash points is equals to zero then print "The player you've killed doesn't have enough cash points." end script.

After reading so many threads i manage to figure it out.

thank you for your help. :D

please close thanks.

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