Jump to content

getAccountID + onPlayerSpawn = false. Why?


JeViCo

Recommended Posts

Hello everyone. Does somebody know why? Wiki says that source of that event is a player but it doesn't work for some reason.

Simple example (the second one works while the first one is not)

addEventHandler("onPlayerSpawn",root,function()
	outputChatBox(tostring(getAccountID(getPlayerAccount(source))))
end)

addCommandHandler("getID",function(p)
	outputChatBox(tostring(getAccountID(getPlayerAccount(p))))
end)
Link to comment
9 minutes ago, JeViCo said:

Hello everyone. Does somebody know why? Wiki says that source of that event is a player but it doesn't work for some reason.

Simple example (the second one works while the first one is not)


addEventHandler("onPlayerSpawn",root,function()
	outputChatBox(tostring(getAccountID(getPlayerAccount(source))))
end)

addCommandHandler("getID",function(p)
	outputChatBox(tostring(getAccountID(getPlayerAccount(p))))
end)

You need to check if he has an account.

Link to comment
  • 2 weeks later...

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