Jump to content

tigerEvent help


boro

Recommended Posts

Hi all i make tiger for show gun image, it work but only first tigerEvent for show grenade image and when i use molotow then still show me grenade image, what is bad please help ty

addEventHandler("onPlayerDamage",getRootElement(), 
    function(attacker,weapon,bodypart,loss) 
        if getWeaponNameFromID(weapon, 16) then 
        triggerClientEvent ( "onGrenadeEvent", root, "text" ) 
        else 
        if getWeaponNameFromID(weapon, 18) then 
        triggerClientEvent ( "onMolotowEvent", root, "text" ) 
        end 
    end 
) 
  

Link to post
Hi all i make tiger for show gun image, it work but only first tigerEvent for show grenade image and when i use molotow then still show me grenade image, what is bad please help ty
addEventHandler("onPlayerDamage",getRootElement(), 
    function(attacker,weapon,bodypart,loss) 
        if getWeaponNameFromID(weapon, 16) then 
        triggerClientEvent ( "onGrenadeEvent", root, "text" ) 
        elseif 
        getWeaponNameFromID(weapon, 18) then 
        triggerClientEvent ( "onMolotowEvent", root, "text" ) 
        end 
    end 
) 
  

addEventHandler("onPlayerDamage",getRootElement(), 
    function(attacker,weapon,bodypart,loss) 
        if getWeaponNameFromID(weapon) == 16 then 
        triggerClientEvent ( "onGrenadeEvent", root, "text" ) 
        elseif getWeaponNameFromID(weapon) == 18 then 
        triggerClientEvent ( "onMolotowEvent", root, "text" ) 
        end 
    end 
) 
  

Didn't test it.

Show us the client codes, then we can fix those.

Link to post

this don't work

here is client

addEvent ( "onGrenadeEvent", true ) 
function grenadeEventHandler ( text ) 
        local x,y,w,h = 0.315, 0.780, 0.07, 0.07 
        local blood = guiCreateStaticImage(x,y,w,h,"images/grenade.png",true) 
        guiSetVisible(blood, true) 
        setTimer (guiSetVisible, 4000, 1, blood, false ) 
end 
addEventHandler ( "onGrenadeEvent", root, grenadeEventHandler ) 
  
addEvent ( "onMolotowEvent", true ) 
function molotowEventHandler ( text ) 
        local x,y,w,h = 0.315, 0.780, 0.07, 0.07 
        local blood = guiCreateStaticImage(x,y,w,h,"images/molotow.png",true) 
        guiSetVisible(blood, true) 
        setTimer (guiSetVisible, 4000, 1, blood, false ) 
end 
addEventHandler ( "onMolotowEvent", root, molotowEventHandler ) 
  

Link to post
addEventHandler("onPlayerDamage",getRootElement(), 
    function(attacker,weapon,bodypart,loss) 
        if weapon == 16 then 
        triggerClientEvent ( "onGrenadeEvent", root, "text" ) 
        elseif weapon == 18 then 
        triggerClientEvent ( "onMolotowEvent", root, "text" ) 
        end 
    end 
) 

Link to post

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