Noneatme

Untitled

Jul 8th, 2012
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.60 KB | None | 0 0
  1.  
  2. addEventHandler("onClientRender", getRootElement(), function()
  3.     if(enabled == true) and(isPlayerEingeloggt(gMe) == true) then
  4.         local fontbig = {}
  5.         -- Background --
  6.         local x, y = sx/2, sy/2
  7.         local fx, fy = sx-sx/5-20, 15
  8.         dxDrawImage(fx, fy, sx/5, sy/7, "data/images/tacho/background.png")
  9.         -- Uhr --
  10.         fontbig.uhr = 2/1920*sx
  11.         local time = getRealTime()
  12.         local fx2, fy2 = sx-sx/12, 30/1080*sy
  13.         local hour, minute, second = time.hour, time.minute, time.second
  14.         local day = time.monthday
  15.         local month = time.month+1
  16.         local year = time.year+1900
  17.         if(hour < 10) then hour = "0"..hour end
  18.         if(minute < 10) then minute = "0"..minute end
  19.         if(second < 10) then second = "0"..second end
  20.         -- Tag
  21.         dxDrawText(day.."."..month.."."..year, fx2+2, fy2+2, fx2, fy2, tocolor(0, 0, 0, 200), fontbig.uhr, font1)
  22.         dxDrawText(day.."."..month.."."..year, fx2, fy2, fx2, fy2, tocolor(255, 255, 255, 200), fontbig.uhr, font1)
  23.         -- Datum --
  24.         dxDrawText(hour..":"..minute..":"..second, fx2+2, fy2+30/1080*sy+2, fx2, fy2+30, tocolor(0, 0, 0, 200), fontbig.uhr, font1)
  25.         dxDrawText(hour..":"..minute..":"..second, fx2, fy2+30/1080*sy, fx2, fy2+30, tocolor(255, 255, 255, 200), fontbig.uhr, font1)
  26.         -- Leben --
  27.         local WIDTH, HEIGHT = 120, 20
  28.         local NWIDTH, NHEIGHT = WIDTH/1920*sx-1, HEIGHT/1080*sy-5
  29.         NWIDTH = NWIDTH/100*getElementHealth(gMe)
  30.         dxDrawRectangle(fx2, fy2+70/1080*sy, WIDTH/1920*sx, HEIGHT/1080*sy, tocolor(gettok(COLORHEALTH, 1, string.byte(",")), gettok(COLORHEALTH, 2, string.byte(",")), gettok(COLORHEALTH, 3, string.byte(",")), 150))
  31.         dxDrawRectangle(fx2, fy2+72.5/1080*sy, NWIDTH, NHEIGHT, tocolor(gettok(COLORHEALTH, 1, string.byte(",")), gettok(COLORHEALTH, 2, string.byte(",")), gettok(COLORHEALTH, 3, string.byte(",")), 255))
  32.         -- Armour --
  33.         local WIDTH2, HEIGHT2 = 120, 20
  34.         local NWIDTH2, NHEIGHT2 = WIDTH2/1920*sx-1, HEIGHT2/1080*sy-5
  35.         NWIDTH2 = NWIDTH2/100*getPedArmor(gMe)
  36.         dxDrawRectangle(fx2, fy2+100/1080*sy, WIDTH2/1920*sx, HEIGHT2/1080*sy, tocolor(gettok(COLORARMOUR, 1, string.byte(",")), gettok(COLORARMOUR, 2, string.byte(",")), gettok(COLORARMOUR, 3, string.byte(",")), 150))
  37.         dxDrawRectangle(fx2, fy2+102.5/1080*sy, NWIDTH2, NHEIGHT2, tocolor(gettok(COLORARMOUR, 1, string.byte(",")), gettok(COLORARMOUR, 2, string.byte(",")), gettok(COLORARMOUR, 3, string.byte(",")), 255))
  38.         -- Fahrzeug --
  39.         local veh
  40.         fontbig.vehicle = 1.2/1920*sx
  41.         if(isPedInVehicle(gMe)) then
  42.             -- Name
  43.             veh = getPedOccupiedVehicle(gMe)
  44.             if(veh) then
  45.                 local vehname = getVehicleName(veh)
  46.                 local fx3, fy3 = sx-sx/5, 8/1080*sy
  47.                 dxDrawText("Vehicle: "..vehname, fx3+2, fy3+30/1080*sy+2, fx3, fy3+30, tocolor(0, 0, 0, 200), fontbig.vehicle, font1)
  48.                 dxDrawText("Vehicle: "..vehname, fx3, fy3+30/1080*sy, fx3, fy3+30, tocolor(255, 255, 255, 200), fontbig.vehicle, font1)
  49.                 -- Geschwindigkeit --
  50.                 local WIDTH3, HEIGHT3 = 180, 20
  51.                 local NWIDTH3, NHEIGHT3 = WIDTH3/1920*sx-1, HEIGHT3/1080*sy-5
  52.                 NWIDTH3 = NWIDTH3/100*getElementSpeed(veh)/2.5
  53.                 if(NWIDTH3 > WIDTH3) then NWIDTH3 = WIDTH3 end
  54.                 local r, g, b = gettok(COLORSPEED, 1, string.byte(",")), gettok(COLORSPEED, 2, string.byte(",")), gettok(COLORSPEED, 3, string.byte(","))
  55.                 dxDrawRectangle(fx3, fy3+70/1080*sy, WIDTH3/1920*sx, HEIGHT3/1080*sy, tocolor(r, g, b, 150))
  56.                 dxDrawRectangle(fx3, fy3+72.5/1080*sy, NWIDTH3, NHEIGHT3, tocolor(r, g, b, 255))
  57.                 dxDrawText(math.floor(getElementSpeed(veh)/1.5).." KM/H", sx-sx/5, 8/1080*sy+71/1080*sy, fx2, fy2+30, tocolor(255, 255, 255, 200), fontbig.vehicle, font1)
  58.                 dxDrawText(math.floor(getElementSpeed(veh)/1.5).." KM/H", sx-sx/5+2, 8/1080*sy+71/1080*sy+2, fx2, fy2+30, tocolor(0, 0, 0, 200), fontbig.vehicle, font1)
  59.                 -- Damage --
  60.                 local WIDTH4, HEIGHT4 = 180, 20
  61.                 local NWIDTH4, NHEIGHT4 = WIDTH4/1920*sx-1, HEIGHT4/1080*sy-5
  62.                 NWIDTH4 = NWIDTH4/1000*getElementHealth(veh)
  63.                 local r, g, b = gettok(COLORDAMAGE, 1, string.byte(",")), gettok(COLORDAMAGE, 2, string.byte(",")), gettok(COLORDAMAGE, 3, string.byte(","))
  64.                 -- Damagevalue --
  65.                 if(DAMAGEVALUE > 0) then
  66.                     DAMAGEVALUE = DAMAGEVALUE-3
  67.                 end
  68.                 b = b+DAMAGEVALUE
  69.                 r = r-DAMAGEVALUE
  70.                 dxDrawRectangle(fx3, fy3+100/1080*sy, WIDTH4/1920*sx, HEIGHT4/1080*sy, tocolor(r, g, b, 150))
  71.                 dxDrawRectangle(fx3, fy3+102.5/1080*sy, NWIDTH4, NHEIGHT4, tocolor(r, g, b, 255))
  72.                 dxDrawText(math.floor(getElementHealth(veh)*0.1).." %", sx-sx/5, 8/1080*sy+101/1080*sy, fx2, fy2+30, tocolor(255, 255, 255, 200), fontbig.vehicle, font1)
  73.                 dxDrawText(math.floor(getElementHealth(veh)*0.1).." %", sx-sx/5+2, 8/1080*sy+101/1080*sy+2, fx2, fy2+30, tocolor(0, 0, 0, 200), fontbig.vehicle, font1)
  74.             end
  75.         end
  76.     end
  77. end)
Advertisement
Add Comment
Please, Sign In to add comment