arezu Posted June 11, 2012 Share Posted June 11, 2012 I have a problem with settings element data server sided. outputChatBox("set playing: "..tostring(setElementData(player, "race.playing", true))) outputChatBox("set ghostmode: "..tostring(setElementData(player, "race.ghostmode", true))) It says in chatbox: set playing: true set ghostmode: false There is no error in debugscript, so i dont know what the problem is. Also, race.ghostmode element data for vehicles work, but not for players. Link to comment
JR10 Posted June 12, 2012 Share Posted June 12, 2012 You're using setElementData, the function sets the element data, not gets. outputChatBox("set playing: "..tostring(getElementData(player, "race.playing"))) outputChatBox("set ghostmode: "..tostring(getElementData(player, "race.ghostmode"))) Link to comment
arezu Posted June 12, 2012 Author Share Posted June 12, 2012 You're using setElementData, the function sets the element data, not gets. outputChatBox("set playing: "..tostring(getElementData(player, "race.playing"))) outputChatBox("set ghostmode: "..tostring(getElementData(player, "race.ghostmode"))) Yes i know that, but i used outputChatBox to see if it was successfully set (setting element data doesn't work for some reason for the second one). Link to comment
Castillo Posted June 12, 2012 Share Posted June 12, 2012 Are you sure that the data isn't already "true"? Link to comment
arezu Posted June 12, 2012 Author Share Posted June 12, 2012 Are you sure that the data isn't already "true"? read wiki: Returns true if the data was set succesfully, false otherwise. Link to comment
Castillo Posted June 12, 2012 Share Posted June 12, 2012 I'm afraid the wiki is wrong then, take a look: Executing client-side command: outputChatBox("set playing: "..tostring(setElementData(localPlayer, "race.playing", true))) outputChatBox("set ghostmode: "..tostring(setElementData(localPlayer, "race.ghostmode", true)))set playing: true set ghostmode: true Command executed! Executing client-side command: outputChatBox("set playing: "..tostring(setElementData(localPlayer, "race.playing", true))) outputChatBox("set ghostmode: "..tostring(setElementData(localPlayer, "race.ghostmode", true))) set playing: false set ghostmode: false Command executed! Link to comment
arezu Posted June 12, 2012 Author Share Posted June 12, 2012 oh, so it returns false when new element data value is same as old, and onClientElementDataChange is not called. Thanks for the help wiki is not clear enough Link to comment
Castillo Posted June 12, 2012 Share Posted June 12, 2012 Yeah, that always happened to me, when I tried to set element data same as old, it returned false. You're welcome. 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