Hyunsu_Oh Posted April 3, 2010 Share Posted April 3, 2010 (edited) sorry, my bad english. --Source .1 function ClientPlayerSpawn() setWeather(0) end addEventHandler("onClientPlayerSpawn", getLocalPlayer(), ClientPlayerSpawn) --Source .2 function ClientPlayerSpawn() setWeather(0) end addEventHandler("onClientPlayerSpawn", getRootElement(), ClientPlayerSpawn) What is difference of source.1 and source.2 ? please ,explain detailed for me. Edited April 3, 2010 by Guest Link to comment
karlis Posted April 3, 2010 Share Posted April 3, 2010 1)wont work because that event isnt triggered on local player join, but why you make more topics about same problem?? Link to comment
Hyunsu_Oh Posted April 3, 2010 Author Share Posted April 3, 2010 sorry, my question edited Link to comment
dzek (varez) Posted April 3, 2010 Share Posted April 3, 2010 1. will work only when spawn is do AFTER client download resources.. and if it work, it will work only once, when local player spawn 2. will be runned every time ANY player spawn. read about client-side and server-side scripts https://wiki.multitheftauto.com/wiki/Main_Page check Scripting section Link to comment
Hyunsu_Oh Posted April 3, 2010 Author Share Posted April 3, 2010 These are client side script. I want only one person changing weather. Maybe, When it uses getLocalPlayer(), the weather of only that person it changes? When it uses getRootEelement (), does the weather of all people change? Link to comment
dzek (varez) Posted April 3, 2010 Share Posted April 3, 2010 no, all the things you are doing on client side script is working only for one player (client).. 2nd script will be changing weather only for client, when any player spawn 1st script should (theoretically) change weather only for the client, on that client/local player spawn Link to comment
Hyunsu_Oh Posted April 3, 2010 Author Share Posted April 3, 2010 sorry, i dont understand. Please, Show the example which uses a difference. Link to comment
dzek (varez) Posted April 3, 2010 Share Posted April 3, 2010 ok, better example function localPlayerDied() outputChatBox("you died") end function somebodyDied() outputChatBox(getPlayerName(source)).." died") end addEventHandler("onClientPlayerWasted", getLocalPlayer(), localPlayerDied) addEventHandler("onClientPlayerWasted", getRootElement(), somebodyDied) save that script, run a server with it, run the script, invite somebody to your server, and try it.. you will see the difference easy 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