Jump to content

[Help] help me


Recommended Posts

Posted (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 by Guest
Posted

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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?

Posted

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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 :)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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