Jump to content

onClientElementDataChange


undefined

Recommended Posts

Hey guys.

Im working on the faction system but i have a problem. When the "faction" data change, this code work succesfully but when the removed the data, this code not work. onClientElementDataChange code is not get the removed data. How to fix it?

addEventHandler("onClientElementDataChange", root, function(dataName) 
    if dataName == "faction" then 
        local row, col = guiGridListGetSelectedItem(factionsList) 
        if row and col and row ~= -1 and col ~= -1 then 
            local listData = guiGridListGetItemData(factionsList, row, 1) 
            setPlayerList(factionsPlayerList, factionsHexCodeChk, true, listData) 
        end 
        setPlayerList(addPlayerPlayerList, addPlayerHexCodeChk, false, false) 
    end 
end) 

Link to comment
  • Moderators

removeElementData(element,"faction") 
setElementData(element,"faction",false) 

I recommend you (if you use that event) to remove the elementdata only when you stop your resource.

Also when you start your resource, for every player the elementdata of the key "faction" to false.

Because this event does also not triggers if you add elementdata, only when it changes from something to something else.

Link to comment
removeElementData(element,"faction") 
setElementData(element,"faction",false) 

I recommend you (if you use that event) to remove the elementdata only when you stop your resource.

Also when you start your resource, for every player the elementdata of the key "faction" to false.

Because this event does also not triggers if you add elementdata, only when it changes from something to something else.

false is not work. Im solved it with "false". Thank you IIYAMA...

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