boro Posted January 25, 2013 Posted January 25, 2013 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 )
Cornelis Posted January 25, 2013 Posted January 25, 2013 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.
boro Posted January 25, 2013 Author Posted January 25, 2013 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 )
HunT Posted January 25, 2013 Posted January 25, 2013 What is the "text"? Check Again : https://wiki.multitheftauto.com/wiki/TriggerClientEvent
boro Posted January 25, 2013 Author Posted January 25, 2013 no this is not bad, client side is good and work i see image to screen but only grenade problem is in server side
TAPL Posted January 25, 2013 Posted January 25, 2013 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 )
boro Posted January 26, 2013 Author Posted January 26, 2013 yes it work but show me only Grenade Event (grenade image on screen) but if i use molotow then nothing please help
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now