Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEventHandler("onClientResourceStart",getResourceRootElement(),
- function()
- showPlayerHudComponent("ammo",false)
- showPlayerHudComponent("area_name",false)
- showPlayerHudComponent("armour",false)
- showPlayerHudComponent("breath",false)
- showPlayerHudComponent("clock",false)
- showPlayerHudComponent("health",false)
- showPlayerHudComponent("money",false)
- showPlayerHudComponent("weapon",false)
- showPlayerHudComponent("wanted",false)
- end )
- function drawCustomHUD()
- screenx,screeny=guiGetScreenSize()
- bgSX=screenx*0.75
- bgSY=screeny*0.0
- bgX=screenx*0.3
- bgY=screeny*0.15
- --Basic background
- dxDrawRectangle(bgSX,bgSY,bgX,bgY,tocolor(100,100,100,50),true)
- --Health, armour and breath
- --Health
- dxDrawLine(bgSX+bgX*0.05,bgSY+bgY*0.05,bgSX+bgX*0.4,bgSY+bgY*0.05,tocolor(0,0,0,255),bgY*0.015) -- -
- dxDrawLine(bgSX+bgX*0.05,bgSY+bgY*0.15,bgSX+bgX*0.4,bgSY+bgY*0.15,tocolor(0,0,0,255),bgY*0.015) -- -
- dxDrawLine(bgSX+bgX*0.05,bgSY+bgY*0.05,bgSX+bgX*0.05,bgSY+bgY*0.15,tocolor(0,0,0,255),bgY*0.015) -- |
- dxDrawLine(bgSX+bgX*0.4,bgSY+bgY*0.05,bgSX+bgX*0.4,bgSY+bgY*0.15,tocolor(0,0,0,255),bgY*0.015) -- |
- HP=getElementHealth(getLocalPlayer())
- BarLenght=bgSX+bgX*0.4
- HPLenght=BarLenght/820*HP
- dxDrawLine(bgSX+bgX*0.05,bgSY+bgY*0.1,bgSX+bgX*0.05+HPLenght,bgSY+bgY*0.1,tocolor(200,0,0,200),bgY*0.085)
- dxDrawLine(bgSX+bgX*0.05+HPLenght,bgSY+bgY*0.1,BarLenght,bgSY+bgY*0.1,tocolor(50,50,50,200),bgY*0.085)
- dxDrawText("Health : "..math.floor(HP).."%",bgSX+bgX*0.05,bgSY+bgY*0.05,bgSX+bgX*0.4,bgSY+bgY*0.28,tocolor(255,255,255,255),1,"sans","center","top",false,false,true,false,false)
- --armour
- dxDrawLine(bgSX+bgX*0.05,bgSY+bgY*0.18,bgSX+bgX*0.4,bgSY+bgY*0.18,tocolor(0,0,0,255),bgY*0.015) -- -
- dxDrawLine(bgSX+bgX*0.05,bgSY+bgY*0.28,bgSX+bgX*0.4,bgSY+bgY*0.28,tocolor(0,0,0,255),bgY*0.015) -- -
- dxDrawLine(bgSX+bgX*0.05,bgSY+bgY*0.18,bgSX+bgX*0.05,bgSY+bgY*0.28,tocolor(0,0,0,255),bgY*0.015) -- |
- dxDrawLine(bgSX+bgX*0.4,bgSY+bgY*0.18,bgSX+bgX*0.4,bgSY+bgY*0.28,tocolor(0,0,0,255),bgY*0.015) -- |
- Armour=getPedArmor(getLocalPlayer())
- if Armour~=nil then
- ArmourLenght=BarLenght/820*Armour
- dxDrawLine(bgSX+bgX*0.05,bgSY+bgY*0.23,bgSX+bgX*0.05+ArmourLenght,bgSY+bgY*0.23,tocolor(255,255,255,200),bgY*0.085)
- dxDrawLine(bgSX+bgX*0.05+ArmourLenght,bgSY+bgY*0.23,BarLenght,bgSY+bgY*0.23,tocolor(50,50,50,200),bgY*0.085)
- dxDrawText("Armour : "..math.floor(Armour).."%",bgSX+bgX*0.05,bgSY+bgY*0.05,bgSX+bgX*0.4,bgSY+bgY*0.28,tocolor(255,255,255,255),1,"sans","center","bottom",false,false,true,false,false)
- end
- --breath
- --weapons
- SelectedWeapon=getPedWeapon(getLocalPlayer())
- if SelectedWeapon==0 then
- slectedWeaponImageName="HUDImages/fist"
- elseif SelectedWeapon==1 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==2 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==3 then
- slectedWeaponImageName="HUDImages/nite"
- elseif SelectedWeapon==4 then
- slectedWeaponImageName="HUDImages/knife"
- elseif SelectedWeapon==5 then
- slectedWeaponImageName="HUDImages/bat"
- elseif SelectedWeapon==6 then
- slectedWeaponImageName="HUDImages/shovel"
- elseif SelectedWeapon==7 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==8 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==9 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==10 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==11 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==12 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==13 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==14 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==15 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==16 then
- slectedWeaponImageName="HUDImages/nade"
- elseif SelectedWeapon==17 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==18 then
- slectedWeaponImageName="HUDImages/molotov"
- elseif SelectedWeapon==19 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==20 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==21 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==22 then
- slectedWeaponImageName="HUDImages/colt"
- elseif SelectedWeapon==23 then
- slectedWeaponImageName="HUDImages/silenced"
- elseif SelectedWeapon==24 then
- slectedWeaponImageName="HUDImages/deagle"
- elseif SelectedWeapon==25 then
- slectedWeaponImageName="HUDImages/shotgun"
- elseif SelectedWeapon==26 then
- slectedWeaponImageName="HUDImages/sawnoff"
- elseif SelectedWeapon==27 then
- slectedWeaponImageName="HUDImages/combat"
- elseif SelectedWeapon==28 then
- slectedWeaponImageName="HUDImages/uzi"
- elseif SelectedWeapon==29 then
- slectedWeaponImageName="HUDImages/smg"
- elseif SelectedWeapon==30 then
- slectedWeaponImageName="HUDImages/AK"
- elseif SelectedWeapon==31 then
- slectedWeaponImageName="HUDImages/m4"
- elseif SelectedWeapon==32 then
- slectedWeaponImageName="HUDImages/tec"
- elseif SelectedWeapon==33 then
- slectedWeaponImageName="HUDImages/cuntgun"
- elseif SelectedWeapon==34 then
- slectedWeaponImageName="HUDImages/sniper"
- elseif SelectedWeapon==35 then
- slectedWeaponImageName="HUDImages/RPG"
- elseif SelectedWeapon==36 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==37 then
- slectedWeaponImageName="HUDImages/flame"
- elseif SelectedWeapon==38 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==39 then
- slectedWeaponImageName="HUDImages/satchel"
- elseif SelectedWeapon==40 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==41 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==42 then
- slectedWeaponImageName="HUDImages/fire"
- elseif SelectedWeapon==43 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==44 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==45 then
- slectedWeaponImageName="HUDImages/"
- elseif SelectedWeapon==46 then
- slectedWeaponImageName="HUDImages/para"
- end
- dxDrawImage(bgSX+bgX*0.45,bgSY+bgY*0.05,208,78,slectedWeaponImageName..".png")
- --ammo
- totalammo=getPedTotalAmmo(getLocalPlayer())
- clipAmmo=getPedAmmoInClip(getLocalPlayer())
- if getPedWeaponSlot(getLocalPlayer())~=0 and getPedWeaponSlot(getLocalPlayer())~=1 and getPedWeaponSlot(getLocalPlayer())~=12 and getPedWeaponSlot(getLocalPlayer())~=11 and getPedWeaponSlot(getLocalPlayer())~=10 and getPedWeaponSlot(getLocalPlayer())~=9 then
- dxDrawText(totalammo-clipAmmo..":"..clipAmmo,bgSX+bgX*0.45,bgSY+bgY*0.3,screenx,screeny,tocolor(200,200,200,255),1,"pricedown","center","top",false,false,true,false,true)
- end
- --money
- moneyCount=getElementData(getLocalPlayer(),"FGNMoney")
- if moneyCount~=false then
- dxDrawText("$"..moneyCount,bgSX+bgX*0.45,bgSY+bgY*0.6,screenx,screeny,tocolor(0,200,0,255),1,"pricedown","right","top",false,false,true,false,true)
- end
- --wanted level
- wantedLevel=getElementData(getLocalPlayer(),"wantedStars")
- if wantedLevel~=false then
- WSX=bgSX+bgX*0.7
- WSY=bgSY+bgY*0.8
- for i=1,wantedLevel do
- dxDrawImage(WSX,WSY,bgSY+bgY*0.2,bgSY+bgY*0.2,"HUDImages/wantedstar.png",0,0,0,tocolor(255,255,255,255,true))
- WSX=WSX-(bgSY+bgY*0.25)
- end
- end
- end
- addEventHandler("onClientRender",getRootElement(),drawCustomHUD)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement