Jump to content

Why is bad!?


CheiN

Recommended Posts

Posted
  
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) 

Posted

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.

Posted
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 
) 

Posted
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) 

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