-RoCk-Alex Posted March 16, 2012 Share Posted March 16, 2012 (edited) Is it possible to just show an image just to the player when he dies ? Edited March 17, 2012 by Guest Link to comment
GanJaRuleZ Posted March 16, 2012 Share Posted March 16, 2012 Sure , if i know right , you have to make a server side like this : -- Server Side function lol() triggerClientEvent(source,"theBastardDied",source) end addEventHandler("onPlayerWasted",getRootElement(),lol) And in the clientside , just use dxDrawImage , addEventHandler , and a setTimer to removeEventHandler.. Btw , don't forget to add the image in meta.xml too Good Luck. Link to comment
-RoCk-Alex Posted March 16, 2012 Author Share Posted March 16, 2012 Sure , if i know right , you have to make a server side like this : -- Server Side function lol() triggerClientEvent(source,"theBastardDied",source) end addEventHandler("onPlayerWasted",getRootElement(),lol) Good Luck. i can't figure out was that a help or you are just taunting with those words? Link to comment
rolling11 Posted March 16, 2012 Share Posted March 16, 2012 i can't figure out was that a help or you are just taunting with those words? if you cant figure out that than go and read a tutorial and show some code.Show us what you tried yourself atleast..douchebag Link to comment
Castillo Posted March 16, 2012 Share Posted March 16, 2012 Sure , if i know right , you have to make a server side like this : -- Server Side function lol() triggerClientEvent(source,"theBastardDied",source) end addEventHandler("onPlayerWasted",getRootElement(),lol) And in the clientside , just use dxDrawImage , addEventHandler , and a setTimer to removeEventHandler.. Btw , don't forget to add the image in meta.xml too Good Luck. Why should he use onPlayerWasted instead of onClientPlayerWasted which would be a lot easier for him. Link to comment
Al3grab Posted March 16, 2012 Share Posted March 16, 2012 "onClientPlayerWasted" guiCreateStaticImage --or "onClientRender" dxDrawImage Link to comment
BorderLine Posted March 16, 2012 Share Posted March 16, 2012 (edited) local x,y,w,h = 0.1, 0.1, 0.7, 0.5 local blood = guiCreateStaticImage(x,y,w,h,"images/wasted.png",true) guiSetVisible(blood, false) function wasted (killer, weapon, bodypart) guiSetVisible(blood, true) setTimer (guiSetVisible, 5000, 1, blood, false ) end addEventHandler("onClientPlayerWasted", getLocalPlayer(), wasted) I made this te other day.Maybe can help you just change seconds showing or image resolution and position Edited March 16, 2012 by Guest Link to comment
X-SHADOW Posted March 16, 2012 Share Posted March 16, 2012 yours ? its copy form dev-point or Evil-Cod3r in the script section do you know why becuse the { blood } name you steal it Link to comment
BorderLine Posted March 16, 2012 Share Posted March 16, 2012 just cuz its the same name? anyway, he want that, and just i help him Link to comment
GanJaRuleZ Posted March 17, 2012 Share Posted March 17, 2012 Sure , if i know right , you have to make a server side like this : -- Server Side function lol() triggerClientEvent(source,"theBastardDied",source) end addEventHandler("onPlayerWasted",getRootElement(),lol) And in the clientside , just use dxDrawImage , addEventHandler , and a setTimer to removeEventHandler.. Btw , don't forget to add the image in meta.xml too Good Luck. Why should he use onPlayerWasted instead of onClientPlayerWasted which would be a lot easier for him. Ah , right , i forgot about that @Alex , try this script function bastardWasted() drawImage() destroyImage() end addEventHandler("onClientPlayerWasted",getRootElement(),bastardWasted) function destroyImage() setTimer( function () removeEventHandler("onClientRender",getRootElement(),drawImage) end,1000,1) -- Change here the time .. "1000" is what you want to change. end function drawImage() dxDrawImage(Arguments here) end addEventHandler("onClientRender",getRootElement(),drawImage) This code will put the image for 1 second , also you must put the arguments in dxDrawImage Don't forget to put the image in meta.xml Link to comment
TAPL Posted March 17, 2012 Share Posted March 17, 2012 Ah , right , i forgot about that @Alex , try this script function bastardWasted() drawImage() destroyImage() end addEventHandler("onClientPlayerWasted",getRootElement(),bastardWasted) function destroyImage() setTimer( function () removeEventHandler("onClientRender",getRootElement(),drawImage) end,1000,1) -- Change here the time .. "1000" is what you want to change. end function drawImage() dxDrawImage(Arguments here) end addEventHandler("onClientRender",getRootElement(),drawImage) This code will put the image for 1 second , also you must put the arguments in dxDrawImage Don't forget to put the image in meta.xml function bastardWasted() addEventHandler("onClientRender",root,drawImage) setTimer(function() removeEventHandler("onClientRender",root,drawImage) end,1000,1) end addEventHandler("onClientPlayerWasted",localPlayer,bastardWasted) function drawImage() dxDrawImage(Arguments here) end Link to comment
-RoCk-Alex Posted March 17, 2012 Author Share Posted March 17, 2012 thanks all for taking intrest in the topic i just tried the first script of Yakuza.Real and it worked thanks GanJaRuleZ ,SolidSnake ,Al3grab and Tapl for taking intrest Too Link to comment
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