Advertisement
Guest User

Untitled

a guest
May 8th, 2015
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.04 KB | None | 0 0
  1. local max_players = 0
  2. function math.round(number, decimals, method)
  3.     decimals = decimals or 0
  4.     local factor = 10 ^ decimals
  5.     if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
  6.     else return tonumber(("%."..decimals.."f"):format(number)) end
  7. end
  8. local weaponName = getWeaponNameFromID(weaponID)
  9. local weaponID = getPedWeapon (getLocalPlayer());
  10. --dxDrawImage(screenW * 0.3266, screenH * 0.2375, screenW * 0.1961, screenH * 0.1069, "weapons/"..tostring( weaponID ).. ".png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  11. statsLabel = {}
  12. statsWindows = guiCreateStaticImage(0.85, 0.18, 0.15, 0.35, "debug_monitor.png", true)
  13.     guiSetAlpha(statsWindows, 0.95)
  14. weapon = guiCreateStaticImage(0.00, 0.12, 0.98, 0.27,"weapons/"..tostring( weaponID ).. ".png", true, statsWindows)  
  15. zombietext = guiCreateLabel(0.02, 0.55, 0.50, 0.06, "Zombies Killed:", true, statsWindows)
  16.     guiSetFont(zombietext, "default-bold-small")
  17.     guiLabelSetColor(zombietext, 219, 182, 69)
  18. statsLabel.zombieskilled = guiCreateLabel(0.52, 0.55, 0.46, 0.06, "0", true,statsWindows)
  19.     guiSetFont(statsLabel.zombieskilled, "default-bold-small")
  20.     guiLabelSetHorizontalAlign(statsLabel.zombieskilled, "right", false)
  21.     setElementData(statsLabel.zombieskilled, "identifikation", "zombieskilled")
  22. mortestext = guiCreateLabel(0.02, 0.61, 0.50, 0.06, "Murders:", true, statsWindows)
  23.     guiSetFont(mortestext , "default-bold-small")
  24.     guiLabelSetColor(mortestext, 219, 182, 69)      
  25. statsLabel.murders = guiCreateLabel(0.52, 0.61, 0.46, 0.06, "0", true, statsWindows)
  26.     guiSetFont(statsLabel.murders, "default-bold-small")
  27.     guiLabelSetHorizontalAlign(statsLabel.murders, "right", false)
  28.     setElementData(statsLabel.murders, "identifikation", "murders")
  29. banditstext = guiCreateLabel(0.02, 0.67, 0.50, 0.06, "Bandits Killed:", true, statsWindows)
  30.     guiSetFont(banditstext, "default-bold-small")
  31.     guiLabelSetColor(banditstext, 219, 182, 69)
  32. statsLabel.banditskilled = guiCreateLabel(0.52, 0.67, 0.46, 0.06, "0", true, statsWindows)
  33.     guiSetFont(statsLabel.banditskilled, "default-bold-small")
  34.     guiLabelSetHorizontalAlign(statsLabel.banditskilled, "right", false)
  35.     setElementData(statsLabel.banditskilled, "identifikation", "banditskilled")
  36. bloodtext = guiCreateLabel(0.02, 0.39, 0.50, 0.06, "Blood:", true, statsWindows)
  37.     guiSetFont(bloodtext, "default-bold-small")
  38.     guiLabelSetColor(bloodtext, 255, 0, 0)
  39. statsLabel.blood = guiCreateLabel(0.52, 0.39, 0.46, 0.06, "12000", true, statsWindows)
  40.     guiSetFont(statsLabel.blood, "default-bold-small")
  41.     guiLabelSetHorizontalAlign(statsLabel.blood, "right", false)
  42.     setElementData(statsLabel.blood, "identifikation", "blood")
  43. humanitytext = guiCreateLabel(0.02, 0.45, 0.50, 0.06, "Humanity:", true, statsWindows)
  44.     guiSetFont(humanitytext, "default-bold-small")
  45.     guiLabelSetColor(humanitytext, 26, 12, 158)
  46. statsLabel.humanity = guiCreateLabel(0.52, 0.45, 0.46, 0.06, "5000", true, statsWindows)
  47.     guiSetFont(statsLabel.humanity, "default-bold-small")
  48.     guiLabelSetHorizontalAlign(statsLabel.humanity, "right", false)
  49.     setElementData(statsLabel.humanity, "identifikation", "humanity")
  50. alivetimetext = guiCreateLabel(0.02, 0.77, 0.50, 0.06, "Survivor Time:", true, statsWindows)
  51.     guiSetFont(alivetimetext, "default-bold-small")
  52.     guiLabelSetColor(alivetimetext, 219, 182, 69)
  53. statsLabel.alive = guiCreateLabel(0.52, 0.77, 0.46, 0.06, "0 Min", true, statsWindows)
  54.     guiSetFont(statsLabel.alive, "default-bold-small")
  55.     guiLabelSetHorizontalAlign(statsLabel.alive, "right", false)
  56.     setElementData(statsLabel.alive, "identifikation", "alivetime")
  57. NamePag = guiCreateLabel(0.00, 0.92, 0.98, 0.06, "fb.com/SERVERNAME", true, statsWindows)
  58.     guiSetFont(NamePag, "default-bold-small")
  59.     guiLabelSetColor(NamePag, 255, 0, 0)
  60.     guiLabelSetHorizontalAlign(NamePag, "center", false)
  61.     guiLabelSetVerticalAlign(NamePag, "center")    
  62. FPSTEXT = guiCreateLabel(0.02, 0.83, 0.50, 0.06, "FPS:", true, statsWindows)
  63.     guiSetFont(FPSTEXT, "default-bold-small")
  64.     guiLabelSetColor(FPSTEXT, 219, 182, 69)
  65. FPS = guiCreateLabel(0.52, 0.83, 0.46, 0.06, "0", true,statsWindows)
  66.     guiSetFont(FPS, "default-bold-small")
  67.     guiLabelSetHorizontalAlign(FPS, "right", false)  
  68. statsLabel.name = guiCreateLabel(0.00, 0.00, 1.00, 0.06,"["..getPlayerName(getLocalPlayer()).."]", true, statsWindows)
  69.     guiSetFont(statsLabel.name, "default-bold-small")
  70.     guiLabelSetHorizontalAlign(statsLabel.name, "center", false)
  71.     guiLabelSetVerticalAlign(statsLabel.name, "center")
  72.     setElementData(statsLabel.name, "identifikation", "name")
  73.     --[[END]]
  74. statsLabel["ping"] = guiCreateLabel(0.00, 0.06, 1.00, 0.06,"Ping: 0",true,statsWindows)
  75.     guiLabelSetHorizontalAlign(statsLabel["ping"], "center", false)
  76.     guiLabelSetVerticalAlign(statsLabel["ping"], "center")
  77.     guiSetFont (statsLabel["ping"], "default-bold-small" )
  78.     setElementData(statsLabel["ping"],"identifikation","ping")
  79. if getElementData(localPlayer, "logedin") then
  80.   guiSetVisible(statsWindows, true)
  81. else
  82.   guiSetVisible(statsWindows, false)
  83. end
  84. function showDebugMonitor()
  85.   local visible = guiGetVisible(statsWindows)
  86.   guiSetVisible(statsWindows, not visible)
  87. end
  88. bindKey("F5", "down", showDebugMonitor)
  89. function showDebugMintorOnLogin()
  90.   guiSetVisible(statsWindows, true)
  91. end
  92. addEvent("onClientPlayerDayZLogin", true)
  93. addEventHandler("onClientPlayerDayZLogin", root, showDebugMintorOnLogin)
  94. FPSLimit=37
  95. FPSLimit=255/FPSLimit
  96. FPSCalc=0
  97. FPSTime=getTickCount()+1000
  98.  
  99. addEventHandler("onClientRender",getRootElement(),function()
  100.    if (getTickCount()<FPSTime) then
  101.       FPSCalc=FPSCalc+1
  102.    else
  103.       if (FPSCalc) then
  104.          FPSLimit=255/FPSCalc
  105.       end
  106.       guiSetText(FPS,FPSCalc)
  107.       FPSCalc=0
  108.       FPSTime=getTickCount()+1000
  109.    end
  110. end)
  111.  
  112. function refreshDebugMonitor()
  113.   if getElementData(getLocalPlayer(), "logedin") then
  114. local value = getElementData(getLocalPlayer(), getElementData(statsLabel.zombieskilled, "identifikation"))
  115.     guiSetText(statsLabel.zombieskilled,value)
  116. local value = getElementData(getLocalPlayer(), getElementData(statsLabel.banditskilled, "identifikation"))
  117.     guiSetText(statsLabel.banditskilled,value)
  118. local value = getElementData(getLocalPlayer(), getElementData(statsLabel.murders, "identifikation"))
  119.     guiSetText(statsLabel.murders,value)
  120. local value = getElementData(getLocalPlayer(), getElementData(statsLabel.blood, "identifikation"))
  121.     guiSetText(statsLabel.blood,value)
  122. local value = getElementData(getLocalPlayer(), getElementData(statsLabel.humanity, "identifikation"))
  123.     guiSetText(statsLabel.humanity,math.round(value, 2))
  124.     guiSetText(statsLabel.name, "["..getPlayerName(getLocalPlayer()).."]")
  125.     --guiSetText(playerson, "Players Online: "..getPlayerCount(getLocalPlayer()))
  126. local value = getElementData(getLocalPlayer(),getElementData(statsLabel.alive,"identifikation"))
  127.     guiSetText(statsLabel.alive,value.." Min")
  128.     guiSetText(statsLabel["ping"],"Ping: "..getPlayerPing(getLocalPlayer()))
  129.   end
  130. end
  131. setTimer(refreshDebugMonitor, 2000, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement