Jump to content

When a player connects for the first time?


Recommended Posts

Posted

Hello, I got a quuestion, when a player connects to my server for the first time, a GUI should be drawed, but I don't know what the event is named or don't i need an event :?:

Posted
setElementData 
getElementData 

like that:

function firstTimeJoin() 
     local mamamia = getElementData(source, "firsttimejoin") 
          if (mamamia == false) then 
          setElementData( source, "firsttimejoin", true) 
          end 
      end 
addEventHandler("onPlayerJoin", firstTimeJoin) 
  

I'm not completly sure about sample...

Posted

@@blazy, you're wrong. Element data is deleted when element is deleted. When player join, element data 'firsttimejoin' on player is nil. You must check by name, serial, account, ip or whatever you like.

Posted

You could use client-side XML functions, though this would be reset if the player deletes their client resources, etc. Alternatively you could base it on serial, in an SQL table, but it just depends on why you need this data.

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