undefined Posted September 10, 2014 Share Posted September 10, 2014 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 IIYAMA Posted September 10, 2014 Moderators Share Posted September 10, 2014 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
undefined Posted September 10, 2014 Author Share Posted September 10, 2014 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
Moderators IIYAMA Posted September 10, 2014 Moderators Share Posted September 10, 2014 nice Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now