Advertisement
DManstrator

Scoreboard 1.3

Aug 5th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. func Initialize()
  2. {
  3. //Scoreboard
  4. SetScoreboardData(SBRD_Caption, SBRD_Caption, "<c 0066ff>Trollboard</c>", 0); //Titel
  5. SetScoreboardData(SBRD_Caption,0,"{{SF5B}}"); //Namen
  6. SetScoreboardData(SBRD_Caption,1,"{{EFLN}}"); //Kills
  7. SetScoreboardData(SBRD_Caption,2,"{{NH5B}}"); //Relaunches
  8.  
  9. public func InitializePlayer(iPlr) {
  10. Global(iPlr)=CreateArray(2);
  11.  
  12. Global(iPlr)[2]=0; //Relaunches liegen bei 0
  13.  
  14. SetScoreboardData(iPlr,0,Format("<c %x>%s</c>",GetPlrColorDw(iPlr),GetPlayerName(iPlr))); //Namen
  15. SetScoreboardData(iPlr,1,Format("%d",Global(iPlr)[1]),0); //Kills (auf 0)
  16. SetScoreboardData(iPlr,2,Format("%d",Global(iPlr)[2]),Global(iPlr)[2]); //Relaunches
  17. }
  18.  
  19. public func OnClonkDeath(object pClonk, int iKiller) { //Funktion, wenn Clonk stirbt
  20. if(iKiller==GetOwner(pClonk) || iKiller==-1) { //Selbstmord != Kill + NaturKill != Kill
  21. Log("%s ist gerade so richtig auf die Fresse gefailt.",GetPlayerName(GetOwner(pClonk)));
  22. return(1);
  23. }
  24.  
  25. else {
  26. Global(iKiller)[1]++;
  27.  
  28. SetScoreboardData(iKiller,1,Format("%d",Global(iKiller)[1]),Global(iKiller)[1]); //Punkte ins Scoreboard
  29. SortScoreboard(1);
  30. Log("%s von %s wurde von %s geownt.",GetName(pClonk),GetPlayerName(GetOwner(pClonk)),GetPlayerName(iKiller));
  31. }
  32. }
  33.  
  34. public func RelaunchPlayer(int iPlr) {
  35. if(Global(iPlr)[2]<1) //Noch Leben übrig?
  36. {
  37. RemovePlayer(iPlr);
  38. return(1);
  39. }
  40.  
  41. Global(iPlr)[2]--; //Leben futsch
  42.  
  43. var Clonk;
  44. Clonk=CreateObject(SF5B,850,230,iPlr);
  45. MakeCrewMember(Clonk,iPlr);
  46. SetCursor(iPlr,Clonk);
  47.  
  48. SetScoreboardData(iPlr,2,Format("%d",Global(iPlr)[2]),Global(iPlr)[2]); //Update Scoreboard
  49. }
  50.  
  51. public func RemovePlayer(int iPlr) {
  52. SetScoreboardData(iPlr,0,0,0); //Alles auf 0 setzen
  53. SetScoreboardData(iPlr,1,0,0); //lässt die Zeile verschwinden
  54. SetScoreboardData(iPlr,2,0,0); //verschwinden
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement