Author Topic: Suggest some bullshit... OH WAIT, SARP IS BULLSHIT LOL  (Read 429 times)

PSN✞

  • Starter
  • *
  • Posts: 7
  • Meet the king!!!!
    • View Profile
Re: Suggest some bullshit... OH WAIT, SARP IS BULLSHIT LOL
« on: June 11, 2012, 02:53:36 pm »
Vehicle health by PSN


Code: [Select]
----------------------------------------------------------------
-------------------- Digital Vehicle Health --------------------
-------------------- Scripted by PSN ----------------


function vehicleHealth()
    local vehicle = getPedOccupiedVehicle( localPlayer )
if ( vehicle ) then
local vehicleHealth = getElementHealth( vehicle )
local scx, scy = guiGetScreenSize()
if ( math.floor( vehicleHealth  / 10 ) ) > 70 then
-- If the vehicle health is higher then 70% the health is showed in a white color
dxDrawText( ( math.floor( vehicleHealth / 10 ) ) .. "% Health", scx - 125,scy - 70,scx,scx,tocolor(255,255,255,255),0.9, "bankgothic","right","top",false,false,false)
elseif ( math.floor( vehicleHealth / 10 ) ) > 40 and ( math.floor( vehicleHealth / 10 ) ) < 70 then
-- If the vehicle health is between 40% and 70% the health is showed in a orange color
dxDrawText( ( math.floor( vehicleHealth / 10 ) ) .. "% Health", scx - 125,scy - 70,scx,scx,tocolor(225,165,0,255),0.9, "bankgothic","right","top",false,false,false)
elseif ( math.floor( vehicleHealth / 10 ) ) < 40 then
-- If the vehicle health is lower then 40% the health is showed in a red color
dxDrawText( ( math.floor( vehicleHealth / 10 ) ) .. "% Health", scx - 125,scy - 70,scx,scx,tocolor(225,0,0,255),0.9, "bankgothic","right","top",false,false,false)
end
end
end
addEventHandler("onClientRender", root, vehicleHealth


Meta

Code: [Select]
<meta>
<info author="PSN" version="1.0" type="script" name="Vehicle Health" description="Vehicle Health" />

<script src="vehicleHealth.lua" type="client"/>
</meta>
Military Forces Trial Member