Jump to content
  • 0

Problem with my PK announcement.


Craves

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  02/27/12
  • Last Seen:  

- script KillAnnounce -1,{
OnPCKillEvent:
if(getgmlevel() >= 50) end;
if( killedrid == getcharid(3) ) end;
set @killstreak, @killstreak+1;
if (@killstreak == 1){
announce ""+strcharinfo(0)+" had just killed "+rid2name(killedrid)+" at "+strcharinfo(3)+".",bc_all;
}
else {
announce ""+strcharinfo(0)+" had just killed "+rid2name(killedrid)+" at "+strcharinfo(3)+".["+@killstreak+"]",bc_all;
}
attachrid killedrid;
if (@killstreak >= 2){
announce ""+rid2name(killedrid)+" had ended "+strcharinfo(0)+"'s ["+@killstreak+"] streak at "+strcharinfo(3)+".",bc_all;
set @killstreak,0;
}
if (@killstreak < 2){
set @killstreak,0;
}
end;
}

The problem with this is that, if A hit B but didn't kill him, then C killed B, the announcement would announce that A killed B instead of C killing B.. Anyone have any idea where did I did wrong? I'm quite new to scripting :(

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


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

i suggest you to use OnPCDieEvent instead of using the attachrid to attach the dead player.

- script Sample -1,{
OnPCKillEvent:
if( getgmlevel() >= 50 || killedrid == getcharid(3) ) end;
set @KillStreak,@KillStreak + 1;
announce strcharinfo(0)+" killed "+rid2name(killedrid)+" at "+strcharinfo(3)+". "+( ( @KillStreak > 1 )?"[ Kill Streak : "+@KillStreak+" ]":"" ),bc_all;
end;
OnPCDieEvent:
if( @KillStreak ){
announce rid2name(killerrid)+" ended "+strcharinfo(0)+"'s [ Kill Streak : "+@KillStreak+" ] at "+strcharinfo(3),bc_all;
set @KillStreak,0;
}
end;
}

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