Turbe$Z Posted October 9, 2016 Share Posted October 9, 2016 function stats(thePlayer) setPlayerStat ( player, 24, 1000 ) setElementHealth( thePlayer, 200 ) end addEventHandler("onPlayerJoin", stats) what wrong ?? Link to comment
Gravestone Posted October 9, 2016 Share Posted October 9, 2016 19 minutes ago, Turbo777 said: addEventHandler("onPlayerJoin", stats) The second argument of addEventHandler is the element the handler should be attached to. 'root' is a predefined variable which gets the root element of any function. Use this: addEventHandler("onPlayerJoin", root, stats) Visit addEventHandler for more information. Link to comment
Turbe$Z Posted October 9, 2016 Author Share Posted October 9, 2016 2 minutes ago, Gravestone said: The second argument of addEventHandler is the element the handler should be attached to. 'root' is a predefined variable which gets the root element of any function. Use this: addEventHandler("onPlayerJoin", root, stats) Visit addEventHandler for more information. i added "root," but doesn't working Link to comment
Gravestone Posted October 9, 2016 Share Posted October 9, 2016 Oh, setPlayerStat is deprecated, use setPedStat instead. Link to comment
Turbe$Z Posted October 9, 2016 Author Share Posted October 9, 2016 11 minutes ago, Gravestone said: Oh, setPlayerStat is deprecated, use setPedStat instead. function stats(thePlayer) setPedStat ( thePlayer, 24, 1000 ) setElementHealth( thePlayer, 200 ) end addEventHandler("onPlayerJoin", root, stats) still not working :c Link to comment
Walid Posted October 9, 2016 Share Posted October 9, 2016 (edited) function stats() setPedStat (source, 24, 1000) setElementHealth(source, 200) end addEventHandler("onPlayerJoin", root, stats) The source of this event is the player who joined. Edited October 9, 2016 by Walid Link to comment
Turbe$Z Posted October 9, 2016 Author Share Posted October 9, 2016 1 minute ago, Walid said: function stats() setPedStat (source, 24, 1000) setElementHealth(source, 200) end addEventHandler("onPlayerJoin", root, stats) The source of this event is the player who joined. Ohh thanks man :DDD Link to comment
Walid Posted October 9, 2016 Share Posted October 9, 2016 1 minute ago, Turbo777 said: Ohh thanks man :DDD np Link to comment
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