(s)ection Posted May 29, 2014 Posted May 29, 2014 Hi, onClientPlayerJoin not work for me help pls: function onResourceStarted() buildStatsWindow() outputChatBox("Press F6 to open the shop!", 255, 255, 0, true) end addEventHandler("onClientPlayerJoin", getRootElement(), onResourceStarted)
shwaeki Posted May 29, 2014 Posted May 29, 2014 function onResourceStarted() buildStatsWindow() outputChatBox("Press F6 to open the shop!", 255, 255, 0, true) end addEventHandler("onClientResourceStart ", getRootElement(), onResourceStarted)
DakiLLa Posted May 29, 2014 Posted May 29, 2014 OnClientPlayerJoin won't work until client script download is complete. Use onClientResourceStart instead. shwaeki's example is ok, but you have to replace getRootElement() with resourceRoot.
(s)ection Posted May 29, 2014 Author Posted May 29, 2014 OnClientPlayerJoin won't work until client script download is complete. Use onClientResourceStart instead.shwaeki's example is ok, but you have to replace getRootElement() with resourceRoot. If I add setTimer it's same? And with this function it's work ? : onClientFileDownloadComplete
MIKI785 Posted May 29, 2014 Posted May 29, 2014 No, why would you put setTimer there? If you use root in onClientResourceStart, the function will get called on start of any resource. If you use resourceRoot it will get called just for your resource the code is in. Why would you use onClientFileDownloadComplete? If you want it to get called on player's join use onClientResourceStart. And these are events, not functions.
Mr_Moose Posted May 29, 2014 Posted May 29, 2014 onClientPlayerJoin will trigger for all clients except for the player that just joined.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now