Jump to content

[Help] help me


Recommended Posts

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 by Guest
Link to comment

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

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

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