Jump to content

getAccountID + onPlayerSpawn = false. Why?


JeViCo

Recommended Posts

Posted

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

Experienced MTA developer for 4 years. | MTA خبرة 4 سنين في برمجة

ليس عليك اسعاد الجميع ,
ولكن عليك بإن لا تؤذي أحداً 

=========
You do not have to make everyone happy,
But you should not hurt anyone

 

Want to contact with me?

 

Discord: JustCarry#2616 (Always there)
Skype: Live:JustCarry10 (Not always)

Posted
12 hours ago, iMr.WiFi..! said:

You need to check if he has an account.

account existed

i replaced it with onPlayerLogin event and solved my problem. Thanks anyway

 

  • 2 weeks later...
Posted
  1. addEventHandler("onPlayerSpawn",root,function()
  2. outputChatBox(tostring(getAccountID(getPlayerAccount(source))))
  3. end)

this bro Try to make source identified 

addEventHandler("onPlayerSpawn",root,function(p)

RPG/CnR servers Developer , You want help ? contact me on discord >>>lilDawage#8508<<< i'm at your Service 10/24 hours 7/7 days , >>>Welcome<<<

Asking Discord Channel JOIN US ON here , you are welcome 10/24 active

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