Jump to content

[Help] In about "addEventHandler" from client


Recommended Posts

Posted

sorry, my bad english.

What is the difference of addEventHandler("onClientPlayerJoin", getLocalPlayer(), ClientPlayerJoin) and addEventHandler("onClientPlayerJoin", getRootElement(), ClientPlayerJoin)?

Posted

https://wiki.multitheftauto.com/wiki/AddEventHandler ;)

if you put

getLocalPlayer()

the function will be executed only when local player join the server (so it will be executed once)

if you put

getRootElement()

the function will be executed everytime anobody join the server

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

Actually, onClientPlayerJoin isn't triggered by local player because client-side scripts start after player has already joined the server. Use onClientResourceStart attached to getResourceRootElement(getThisResource()) instead.

-

Posted
then, If I uses "getLocalPlayer()", if it uses "createFire" function, in only one player the fire this it creates?

no, its not workign that way.. read some topics about difference betweeen client-side and server-side scripts, find some tutorials, and good luck :)

btw: are you translating your text with google translate, or by yourself?

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