Jump to content

[Ajuda] Colocar Imagem para Aparecer quando quase sem ammo


Recommended Posts

local weaponsEnabled = {[30] = true, [31] = true} 
  
function draw() 
    if weaponsEnabled[getPedWeapon(localPlayer)] and getPedAmmoInClip(localPlayer) =< 10 then 
    --dxDrawImage() 
    end 
end 
addEventHandler("onClientRender", root, draw) 

ainda nao funcionou ! :/

mais nao vou desisitir !

local weaponsEnabled = {[30] = true, [31] = true, [28] = true, [29] = true, [32] = true, [22] = true, [23] = true, [24] = true} 
  
function draw() 
    if weaponsEnabled[getPedWeapon(localPlayer)] and getPedAmmoInClip(localPlayer) =< 10 then 
    --dxDrawImage() 
    dxDrawImage(623, 244, 128, 80, "items.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) 
    end 
end 
addEventHandler("onClientRender", root, draw) 

Link to comment
  • Moderators
addEventHandler --> "onClientRender" 
getPedWeapon 
getPedTotalAmmo 
getPedAmmoInClip 
dxDrawImage 

Sobre o recarregamento da arma, acho melhor modificar o recurso reload e chamar um evento personalizado quando recarregar a arma. Então, use tal evento nesse script para definir uma variável para ser usada num if statement em que será mostrada a imagem de acordo com essa condição.

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...