Jump to content
  • 0
Sign in to follow this  
Zirius

attachrid killedrid & killerrid assigning temp character variable

Question

Hello! I am trying to code a PVP script and wants to make use of streak counting. Basically, the streak is incremented when you kill a char, and resets to 0 when you got killed. So if I understand correctly, the code should *basically* follows:
 

OnPCDieEvent:	attachrid killedrid;	set @char,0;  <~~~~ (1)	attachrid killerrid;	set @char,@char+1;  <~~~~ (2)end; 

(1) Does "attachrid killedrid;" means, any character variable declaration will go to the character of killed char?
(2) Does "attachrid killerrid;" means, any character variable declaration will go to the killer?
 
Because I tried to do the above but I am having undesirable result.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

yup

 

this one, when the character died, the streak is reset

as long as the player die, for what ever reason, the streak is reset

-	script	kjdhfkjdshf	-1,{OnPCKillEvent:	if ( killedrid == getcharid(3) ) end;	@streak++;	dispbottom "you killed "+ rid2name( killedrid ) +". streak count "+ @streak;	end;OnPCDieEvent:	@streak = 0;	dispbottom "your current streak count "+ @streak;	end;}
.

.

.

this one, when the character die from player's hand, the streak is reset

die from other means such as suicide, killed by non-human players doesn't count

-	script	skdfjhskdf	-1,{OnPCKillEvent:	if ( killedrid != getcharid(3) ) {		@streak++;		dispbottom "you killed "+ rid2name( killedrid ) +". streak count "+ @streak;	}	attachrid killedrid;	@streak = 0;	dispbottom "your current streak count "+ @streak;	end;}

Share this post


Link to post
Share on other sites
  • 0

LOL. I needed to remove the "attachrid xxx" in my script, don't know how they works, but without them the undesirable results had been removed.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.