Jump to content

¿im good? IV


CheiN

Recommended Posts

function Moon ( ) 
          dxDrawText ( ..User.. Joined, 44, screenHeight -41, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1.10, "pricedown" ) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), Moon ) 

The thing:

¿IM GOOD?

Thx for your time

Link to comment
function Moon ( startedResource ) 
local ..User.. = getPlayerName 
if ..User.. = getPlayerName and onPlayerJoin then 
          dxDrawText ( ..User.. Joined, 44, screenHeight -41, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1.10, "pricedown" ) 
end 
addEventHandler ( "onClientResourceStart", getRootElement(), Moon ) 

again, im good?

Link to comment

No, it's all wrong.

startedResource parameter is useless.

You can't use symbols on variable names.

You didn't call a function, you are assigning getPlayerName function to "..User.."

The statement is all wrong.

No need for "and onPlayerJoin then"

dxDrawText must be used with onClientRender.

Link to comment
function Moon ( ) 
local visitor = getPlayerName 
          dxDrawText ( "visitor" Joined, 44, screenHeight -41, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1.10, "pricedown" ) 
end 
addEventHandler ( "onClientRender", root, Moon ) 

Link to comment

Server-side:

addEventHandler( 'onPlayerJoin', root, 
    function( ) 
        triggerClientEvent( 'onPlayerJoin', source ) 
    end 
) 

Client-side:

local newUser 
addEvent( 'onPlayerJoin', true ) 
  
addEventHandler( 'onPlayerJoin', root, 
    function( ) 
        addEventHandler( 'onClientRender', root, drawText ) 
        newUser = getPlayerName( source ) 
        setTimer( removeEventHandler, 10000, 1, 'onClientRender', root, drawText ) 
    end 
) 
  
function drawText( ) 
    dxDrawText( newUser .. ' joined!', 44, screenHeight - 41, screenWidth, screenHeight, tocolor( 255, 255, 255, 255 ), 1.1, "pricedown" ) 
end 
  

Link to comment
  • Other Languages Moderators

-- Client Side --

local newUser = "" 
local screenWidth, screenHeight = guiGetScreenSize() 
  
addEventHandler('onClientPlayerJoin', root, 
    function() 
        newUser = getPlayerName(source).." joined!" 
        if isTimer(tt) then killTimer(tt) end 
        tt = setTimer(function() newUser = "" end,10000,1) 
    end 
) 
  
function drawText() 
     dxDrawText(newUser, 44, screenHeight - 41, screenWidth, screenHeight, tocolor(255, 255, 255, 255), 1.1, "pricedown") 
end 
addEventHandler('onClientRender', root, drawText) 

Link to comment

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