Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. damage = {
  2. [1] = 0,
  3. } hir kommt errorr
  4.  
  5. kills = {
  6. [1] = 0,
  7. }
  8.  
  9.  
  10. addEventHandler("onClientResourceStart", resourceRoot,
  11. function()
  12. addEventHandler ( "onClientRender", root, dxdraw )
  13. end
  14. )
  15.  
  16. function dxdraw ()
  17. dxDrawRectangle(1841*x, 296*y, 74*x, 59*y, tocolor(0, 0, 0, 215), true)
  18. dxDrawRectangle(1762*x, 296*y, 74*x, 59*y, tocolor(0, 0, 0, 215), true)
  19. dxDrawText("Kills:", 1768*x, 317*y, 1810*x, 327*y, tocolor(255, 255, 255, 255), 1.0, "default", "left", "top", false, false, true, false, false)
  20. dxDrawText("DMG:", 1846*x, 317*y, 1888*x, 327*y, tocolor(255, 255, 255, 255), 1.0, "default", "left", "top", false, false, true, false, false)
  21. dxDrawText(math.floor(damage[1]), 1876*x, 316.5*y, 1888*x, 327*y, tocolor(255, 255, 255, 255), 1.1, "default-bold", "left", "top", false, false, true, false, false)
  22. dxDrawText(kills[1], 1792*x, 316.5*y, 1820*x, 341*y, tocolor(255, 255, 255, 255), 1.1, "default-bold", "left", "top", false, false, true, false, false)
  23. end
  24.  
  25. function cancelPedDamage ( attacker, weapon, bodypart, loss )
  26. if attacker == getLocalPlayer() then
  27. table.insert(damage,1,tonumber(damage[1] + loss))
  28. end
  29. end
  30. addEvent("DMG:DAMAGE", true )
  31. addEventHandler ( "DMG:DAMAGE", getRootElement(), cancelPedDamage )
  32.  
  33. function onWasted(killer, weapon, bodypart)
  34. if killer == getLocalPlayer() then
  35. table.insert(kills,1,(kills[1] + 1))
  36. end
  37. end
  38. addEvent("DMG:KILL", true )
  39. addEventHandler("DMG:KILL", getRootElement(), onWasted)
  40.  
  41. function reset ( attacker, weapon, bodypart )
  42. table.insert(damage,1,tonumber(0))
  43. table.insert(kills,1,0)
  44. end
  45. addEventHandler ( "onClientRoundCountdownStarted", getLocalPlayer(), reset )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement