CheiN Posted September 12, 2012 Share Posted September 12, 2012 local screenWidth, screenHeight = getScreenSize ( ) function copter (killer) local killer = getPlayerName dxDrawText ( helid, 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) end addEventHandler ("onClientPlayerHeliKilled", getRootElement(), copter) Link to comment
Cadu12 Posted September 13, 2012 Share Posted September 13, 2012 Please read wiki: In order for the text to stay visible continuously, you need to call this function with the same parameters on each frame update (see onClientRender). Your code is wrong at all. Link to comment
Jaysds1 Posted September 13, 2012 Share Posted September 13, 2012 Cadu12 is right, here's some functions/event that you need: onClientRender dxDrawText getPlayerName guiGetScreenSize Link to comment
DNL291 Posted September 13, 2012 Share Posted September 13, 2012 local screenWidth, screenHeight = guiGetScreenSize ( ) local time = 8000 function copter (killerHeli) local killedName = getPlayerName(source) dxDrawText( killedName .." ".. killerHeli, 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown" ) end addEventHandler( "onClientPlayerHeliKilled", root, function () addEventHandler( "onClientRender", root, copter) setTimer( function() removeEventHandler( "onClientRender", root, copter) end, time, 1 ) end ) Link to comment
TAPL Posted September 13, 2012 Share Posted September 13, 2012 local screenWidth, screenHeight = guiGetScreenSize() local time = 8000 local killedName = "" function copter () dxDrawText(killedName, 44, screenHeight - 43, screenWidth, screenHeight, tocolor (255, 255, 255, 255), 1, "pricedown") end addEventHandler("onClientRender", root, copter) addEventHandler("onClientPlayerHeliKilled", root, function () killedName = getPlayerName(source) setTimer(function() killedName = "" end, time, 1) end) 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