Jump to content

Recommended Posts

slm

hadha il code 5dhito min script ama ma7abch ya5dem

function drawHudItems() 
    if not doDrawHUD then return end 
    dxSetRenderTarget(hudrendertarg,true) 
    local currBufferOff=40 
    local wantedlvl=getPlayerWantedLevel(localP) 
    local ticks=getTickCount() 
    if wantedlvl>0 then 
        local flashide=true 
        if wantedlvl~=lastwanlvl then 
            if wantedlvl>lastwanlvl then 
                doflash=true 
                setTimer(function() doflash=false end,5000,1) 
            end 
            lastwanlvl=wantedlvl 
        end 
        if doflash or overrideFlash then 
            flashhide=250>(ticks%500) 
        end 
        for i=1,6 do 
            dxDrawImage(256-21*i,hudY,32,32,(i<=wantedlvl and flashhide) and 'images/wanted.png' or 'images/wanted_a.png',0,0,0,finalCol) 
        end 
    end 
    local money=getPlayerMoney(localP) 
    if lastmoney~=money then 
        moneydiff=money-lastmoney 
        moneychangetime=ticks 
        moneychangestr=(moneydiff>0 and '+' or '')..tostring(moneydiff)..'$ ' 
        moneychangecol=moneydiff>0 and moneyGreenCol or moneyRedCol 
        moneydiffchangetime=ticks 
        lastmoney=money 
    end 
    if ticks-moneychangetime<15000 then 
        local moneystr=tostring(money)..'$ ' 
        local moneycol=money>=0 and moneyGreenCol or moneyRedCol 
        local moneyw=dxGetTextWidth(moneystr,1.2,'pricedown') 
        dxDrawTextBordered(moneystr,math.min(221-moneyw,191),currBufferOff,256,currBufferOff+32,moneycol,2,1.2,'pricedown','center','top',false,false,false) 
        if ticks-moneydiffchangetime<15000 then 
            currBufferOff=currBufferOff+30 
            local moneychangew=dxGetTextWidth(moneychangestr,1,'pricedown') 
            dxDrawTextBordered(moneychangestr,math.min(221-moneychangew,191),currBufferOff,256,currBufferOff+32,moneychangecol,2,1,'pricedown','center','top',false,false,false) 
        end 
        currBufferOff=currBufferOff+30 
    end 
    if ticks-wepswitchtime<10000 then --weapon icons and ammo count 
        local weapon=getPedWeapon(localP) 
        if weapon==13 then weapon=12 end 
        if weapon==45 then weapon=44 end 
        dxSetRenderTarget(weptarg,true) 
        local alpha=1 
        if ticks-wepswitchtime>8000 then 
            alpha=1-(ticks-wepswitchtime-8000)/2000 
        end 
        if wslot>1 and wslot<10 then 
            local ammo=' '..tostring(getPedTotalAmmo(localP)) 
            local clip=0 
            local ammow=dxGetTextWidth(ammo,1.2,'pricedown') 
            if not (weapon==25 or (weapon>32 and weapon<37) or wslot==8) then 
                clip=getPedAmmoInClip(localP) 
                local clipw=dxGetTextWidth(clip,1.2,'pricedown')+5 
                dxDrawTextBordered(clip,236-ammow-clipw,0,256,currBufferOff+32,clipCol,2,1.2,'pricedown','left','top',false,false,false) 
            end 
            dxDrawTextBordered(ammo-clip,236-ammow,0,256,currBufferOff+32,ammoCol,2,1.2,'pricedown','left','top',false,false,false) 
            currBufferOff=currBufferOff+32 
        else 
            currBufferOff=currBufferOff+16 
        end 
        dxDrawImage(0,32,256,128,'images/'..weapon..'.png',0,0,0,tocolor(255,255,255,255*alpha)) 
        dxSetRenderTarget(hudrendertarg) 
        dxDrawImage(0,currBufferOff-32,256,256,weptarg,0,0,0,normCol) 
    end 
    dxSetRenderTarget() 
    dxDrawImage(sx-hudX-256,hudY,256,300,hudrendertarg,0,0,0,finalCol,posGUI) 
end 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...