Jump to content

Strange problem


Drakath

Recommended Posts

Posted (edited)

I have element data called: "data". The script sets data to 0.

Then I use 'onElementDataChange'

if getElementData(source,"data") == 10 then

outputChatBox("k", source, 0, 255, 0, true)

And for some players it outputs k. How is this possible, if I ask data to be 10 and it stills passes the condition?

Usually everything works fine but for some people it happens. Why?

Everything is server side.

Edited by Guest

s.epicrow.com:22003.png

Posted

I really dont understand you fully but you said

if I ask data to be 10 and it stills passes the condition?

Well if its 10 then of course it will pass because you are checking if it's equal to 10.

Lua Scripter

?ucet=miki_cz

Owner of mshost.cz MTA portal.

Posted

Oh, I provided incorrect information. Data is set to 10 by client, then server sets it to 0 and finally server checks data with 'onElementDataChange'. and it is still 10.

s.epicrow.com:22003.png

Posted

The element data is synced with all clients and the server so each time you change it client side or server side the event 'onElementDataChange' and 'onClientElementDataChange' will get triggered unless the element doesn't exist on the other side or you choose to not sync the data, the event won't get triggered on the other side.

CiTLh.png

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