Jump to content

[HELP] onClientLogin


IceBrasill

Recommended Posts

function showClientImage() 
    myImage = guiCreateStaticImage( 0.0,0.0,1279.0,767.0, "images/image.png", true ) 
end 
addEventHandler ( "onClientLogin", getRootElement(), showClientImage ) 
  
  
function hideClientImage() 
    if isElement ( myImage ) then destroyElement ( myImage ) end 
end 
bindKey("space", "down", hideClientImage) 

The image does not appear after the player log. :/

Link to comment

Because this event doesn't exist, you must use "onPlayerLogin" on server-side and trigger to client.

  
--// Server 
  
addEventHandler("onPlayerLogin",getElementRoot(), 
function() 
     triggerClientEvent(source,"onPlayerLogged",source) 
end 
) 
  
--// Client 
  
addEvent( "onPlayerLogged", true ) 
addEventHandler( "onPlayerLogged", localPlayer, 
function() 
     --stuff 
end 
) 
  

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