Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEventHandler("onClientRender", getRootElement(), function()
- if(enabled == true) and(isPlayerEingeloggt(gMe) == true) then
- local fontbig = {}
- -- Background --
- local x, y = sx/2, sy/2
- local fx, fy = sx-sx/5-20, 15
- dxDrawImage(fx, fy, sx/5, sy/7, "data/images/tacho/background.png")
- -- Uhr --
- fontbig.uhr = 2/1920*sx
- local time = getRealTime()
- local fx2, fy2 = sx-sx/12, 30/1080*sy
- local hour, minute, second = time.hour, time.minute, time.second
- local day = time.monthday
- local month = time.month+1
- local year = time.year+1900
- if(hour < 10) then hour = "0"..hour end
- if(minute < 10) then minute = "0"..minute end
- if(second < 10) then second = "0"..second end
- -- Tag
- dxDrawText(day.."."..month.."."..year, fx2+2, fy2+2, fx2, fy2, tocolor(0, 0, 0, 200), fontbig.uhr, font1)
- dxDrawText(day.."."..month.."."..year, fx2, fy2, fx2, fy2, tocolor(255, 255, 255, 200), fontbig.uhr, font1)
- -- Datum --
- dxDrawText(hour..":"..minute..":"..second, fx2+2, fy2+30/1080*sy+2, fx2, fy2+30, tocolor(0, 0, 0, 200), fontbig.uhr, font1)
- dxDrawText(hour..":"..minute..":"..second, fx2, fy2+30/1080*sy, fx2, fy2+30, tocolor(255, 255, 255, 200), fontbig.uhr, font1)
- -- Leben --
- local WIDTH, HEIGHT = 120, 20
- local NWIDTH, NHEIGHT = WIDTH/1920*sx-1, HEIGHT/1080*sy-5
- NWIDTH = NWIDTH/100*getElementHealth(gMe)
- 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))
- 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))
- -- Armour --
- local WIDTH2, HEIGHT2 = 120, 20
- local NWIDTH2, NHEIGHT2 = WIDTH2/1920*sx-1, HEIGHT2/1080*sy-5
- NWIDTH2 = NWIDTH2/100*getPedArmor(gMe)
- 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))
- 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))
- -- Fahrzeug --
- local veh
- fontbig.vehicle = 1.2/1920*sx
- if(isPedInVehicle(gMe)) then
- -- Name
- veh = getPedOccupiedVehicle(gMe)
- if(veh) then
- local vehname = getVehicleName(veh)
- local fx3, fy3 = sx-sx/5, 8/1080*sy
- dxDrawText("Vehicle: "..vehname, fx3+2, fy3+30/1080*sy+2, fx3, fy3+30, tocolor(0, 0, 0, 200), fontbig.vehicle, font1)
- dxDrawText("Vehicle: "..vehname, fx3, fy3+30/1080*sy, fx3, fy3+30, tocolor(255, 255, 255, 200), fontbig.vehicle, font1)
- -- Geschwindigkeit --
- local WIDTH3, HEIGHT3 = 180, 20
- local NWIDTH3, NHEIGHT3 = WIDTH3/1920*sx-1, HEIGHT3/1080*sy-5
- NWIDTH3 = NWIDTH3/100*getElementSpeed(veh)/2.5
- if(NWIDTH3 > WIDTH3) then NWIDTH3 = WIDTH3 end
- local r, g, b = gettok(COLORSPEED, 1, string.byte(",")), gettok(COLORSPEED, 2, string.byte(",")), gettok(COLORSPEED, 3, string.byte(","))
- dxDrawRectangle(fx3, fy3+70/1080*sy, WIDTH3/1920*sx, HEIGHT3/1080*sy, tocolor(r, g, b, 150))
- dxDrawRectangle(fx3, fy3+72.5/1080*sy, NWIDTH3, NHEIGHT3, tocolor(r, g, b, 255))
- 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)
- 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)
- -- Damage --
- local WIDTH4, HEIGHT4 = 180, 20
- local NWIDTH4, NHEIGHT4 = WIDTH4/1920*sx-1, HEIGHT4/1080*sy-5
- NWIDTH4 = NWIDTH4/1000*getElementHealth(veh)
- local r, g, b = gettok(COLORDAMAGE, 1, string.byte(",")), gettok(COLORDAMAGE, 2, string.byte(",")), gettok(COLORDAMAGE, 3, string.byte(","))
- -- Damagevalue --
- if(DAMAGEVALUE > 0) then
- DAMAGEVALUE = DAMAGEVALUE-3
- end
- b = b+DAMAGEVALUE
- r = r-DAMAGEVALUE
- dxDrawRectangle(fx3, fy3+100/1080*sy, WIDTH4/1920*sx, HEIGHT4/1080*sy, tocolor(r, g, b, 150))
- dxDrawRectangle(fx3, fy3+102.5/1080*sy, NWIDTH4, NHEIGHT4, tocolor(r, g, b, 255))
- 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)
- 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)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment