Turbe$Z Posted October 9, 2016 Posted October 9, 2016 function stats(thePlayer) setPlayerStat ( player, 24, 1000 ) setElementHealth( thePlayer, 200 ) end addEventHandler("onPlayerJoin", stats) what wrong ??
Gravestone Posted October 9, 2016 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.
Turbe$Z Posted October 9, 2016 Author 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
Gravestone Posted October 9, 2016 Posted October 9, 2016 Oh, setPlayerStat is deprecated, use setPedStat instead.
Turbe$Z Posted October 9, 2016 Author 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
Walid Posted October 9, 2016 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
Turbe$Z Posted October 9, 2016 Author 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
Walid Posted October 9, 2016 Posted October 9, 2016 1 minute ago, Turbo777 said: Ohh thanks man :DDD np
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