DeathMta Posted September 28, 2015 Share Posted September 28, 2015 este es un hud simple que hize para la comunidad y +10 puntos plis Caracteristicas : -Te muestra la velocidad de tu auto -Nuevos Nombres De Autos -Version Beta -Te Muestra el interior(partes del auto). -Nombre Del Auto -Script tipo Client-side -Multiresoluciones Autos = { ["Infernus"] ="Bugatti Veyron", ["Patriot"] ="Hummer H3", ["Sanchez"] = "Sanchez", ["Barracks"] = "Barracks", ["Bullet"] = "Ford Mustang", ["Rustler"] = "Avioneta", ["Maverick"] = "Maverick", ["Bobcat"] = "Bob Cat", ["Taxi"] = "Taxi", ["Freeway"] = "Free Way", ["Sandking"] = "Furgoneta", ["Tractor"] = "Tractor Campestre", ["Police Maverick"] = "Maverick Policial", ["Bandito"] = "Bandito", ["Ambulance"] = "Ambulancia", ["Police SF"] = "Auto Policial", ["Quadbike"] = "Cuatri Moto", ["Seasparrow"] = "Heli Kill", ["Monster 1"] = "Camion Monstruo", ["Clover"] = "Doge Challegend", ["Rhino"] = "Tanque Militar", ["NRG-500"] = "Kawasaki K23" } function HudAuto() local auto = getPedOccupiedVehicle(getLocalPlayer()) if auto then local x , y = guiGetScreenSize() local motor = getElementData(getElementData(auto,"parent"),"Engine_inVehicle") or 0 local rueda = getElementData(getElementData(auto,"parent"),"Tire_inVehicle") or 0 local tanque = getElementData(getElementData(auto,"parent"),"Parts_inVehicle") or 0 local rueda1 = getElementData(auto,"needtires") local motor1 = getElementData(auto,"needengines") local tanque1 = getElementData(auto,"needparts") local maxfuel = getElementData(auto,"maxfuel") local fuel = getElementData(getElementData(auto,"parent"),"fuel") dxDrawLine((16/1024)*x, (359/768)*y, (16/1024)*x, (520/768)*y, tocolor(50,199,42), 2, false) dxDrawLine((234/1024)*x, (374/768)*y, (16/1024)*x, (374/768)*y, tocolor(50,199,42), 2, false) dxDrawLine((16/1024)*x, (522/768)*y, (234/1024)*x, (522/768)*y, tocolor(50,199,42), 2, false) dxDrawLine((234/1024)*x, (522/768)*y, (234/1024)*x, (359/768)*y,tocolor(50,199,42), 2, false) dxDrawLine((16/1024)*x, (359/768)*y, (234/1024)*x, (359/768)*y, tocolor(50,199,42), 2, false) dxDrawRectangle((17/1024)*x, (375/800)*y, (217/1024)*x, (161/768)*y, tocolor(44, 43, 43, 173), false) dxDrawText(" "..Autos[tostring(getVehicleName(auto))].."", (49/1024)*x, (374/800)*y, (189/1024)*x,(385/768)*y, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, false, false, false) if rueda == rueda1 then r,g,b = 13,255,0 else r,g,b = 255, 0, 0 end dxDrawText("Ruedas: "..rueda..'',(18/1024)*x, (398/800)*y, (107/1024)*x,( 427/768)*y, tocolor(r,g,b), 1, "default-bold", "left", "top", false, false, false, false, false) if motor == motor1 then r,g,b = 13,255,0 else r,g,b = 255, 0, 0 end dxDrawText("Motores: "..motor..'', (117/1024)*x, (398/800)*y, (206/1024)*x, (427/768)*y, tocolor(r, g, b), 1, "default-bold", "left", "top", false, false, false, false, false) if fuel == maxfuel then r, g, b = 0, 255, 0 elseif fuel < maxfuel / 10 then r, g, b = 255, 0, 0 elseif fuel < maxfuel / 4 then r, g, b = 255, 50, 0 elseif fuel < maxfuel / 3 then r, g, b = 200, 100, 0 elseif fuel < maxfuel / 2 then r, g, b = 125, 200, 0 elseif fuel < maxfuel / 1.5 then r, g, b = 50, 200, 0 end dxDrawText("Gasolina:"..math.floor(fuel).."", (17/1024)*x, (437/800)*y, (106/1024)*x, (466/768)*y, tocolor(r, g, b), 1, "default-bold", "left", "top", false, false, false, false, false) if tanque == tanque1 then r,g,b = 13,255,0 else r,g,b = 255, 0, 0 end dxDrawText("Tanque: "..tanque..'',( 117/1024)*x, (437/800)*y, (206/1024)*x, (466/768)*y, tocolor(r, g, b), 1, "default-bold", "left", "top", false, false, false, false, false) dxDrawText(""..formatovec(math.round(getVehicleSpeed())).." Km/h", (25/1024)*x, (484/800)*y, (166/1024)*x, (520/768)*y, tocolor(0, 255, 0), 1.2, "default-bold", "left", "top", false, false, false, false, false) end end addEventHandler("onClientRender",getRootElement(),HudAuto) function getVehicleSpeed() local player = getLocalPlayer() local target = getCameraTarget() if isElement(target) then if getElementType(target) == "vehicle" then target = getVehicleController(target) end player = target end local sx, sy, sz = getElementVelocity(getPedOccupiedVehicle(player)) local speed = math.sqrt(sx ^ 2 + sy ^ 2 + sz ^ 2) return speed * 181 end function math.round(float) return math.floor(float + 0.5) end function formatovec(speed) speed = tonumber(speed) if speed < 10 then speed = "" .. speed elseif speed < 100 then speed = "" .. speed elseif speed < 1000 then elseif speed >= 1000 then speed = "999" end return speed end Link to comment
Enargy, Posted September 28, 2015 Share Posted September 28, 2015 (edited) Edit: Deberias subir tus resources en la comunidad de MTA y postear el codigo completo aca, Supongo. Edited September 28, 2015 by Guest Link to comment
Recommended Posts