Anubhav Posted August 10, 2014 Share Posted August 10, 2014 Uhmm.. I realy need help now. The problem is this: setGroupData ( group, "TurfColor", table.concat ( { tostring ( r ), tostring ( g ), tostring ( b ) }, ", " ) ) When I create a group it works perfect and set it to 255,255,255 but here is its not setting it AT ALL! Link to comment
Anubhav Posted August 10, 2014 Author Share Posted August 10, 2014 function changeTurfColor ( r, g, b, group ) if ( not tonumber ( r ) or not tonumber ( g ) or not tonumber ( b ) or not group ) then outputChatBox ( "Invalid input - r"..tostring(r).." | g:"..tostring(g).." | b:"..tostring ( b ).." | group: "..tostring ( group ), source, 255, 0, 0 ) else outputChatBox ( "You have changed the turf color sucessfully!", source, 0, 255, 0 ) setGroupData ( group, "TurfColor", table.concat ( { tostring ( r ), tostring ( g ), tostring ( b ) }, ", " ) ) refreshData(source) return true end return false end addEvent ( "onClientPlayerChangeTurfColor", true ) addEventHandler ( "onClientPlayerChangeTurfColor", root, changeTurfColor ) Link to comment
xXMADEXx Posted August 10, 2014 Share Posted August 10, 2014 If that's all your code, the function setGroupData and refreshData aren't defined. Link to comment
Anubhav Posted August 10, 2014 Author Share Posted August 10, 2014 Lol, are you serious??? There are 804 lines.... Do you think I'll post whole code? Answer is no, If I do also you'll leak them. Link to comment
xXMADEXx Posted August 10, 2014 Share Posted August 10, 2014 Lol, are you serious??? There are 804 lines.... Do you think I'll post whole code? Answer is no, If I do also you'll leak them. I have no need or want for your code as for I could make it myself. If you're not willing to post your code, we can't help you. Link to comment
Gr0x Posted August 10, 2014 Share Posted August 10, 2014 Where should we know what is the syntax of setGroupData, etc without you posting them? Don't wait for answers if you don't post the main function that you have the problem with. Link to comment
Anubhav Posted August 10, 2014 Author Share Posted August 10, 2014 Gr0x @ Why was it setting when I created the group?? (wonder) Why isn't it working now?? Link to comment
Gr0x Posted August 10, 2014 Share Posted August 10, 2014 Where should i know? Post the setGroupData function, and the event which triggers this if you need further help. Link to comment
Anubhav Posted August 10, 2014 Author Share Posted August 10, 2014 function setGroupData(group,data,key) if ( group and data and key ) then return FILESet("MyGroup-##"..group.."-"..data,key) end end Link to comment
xXMADEXx Posted August 10, 2014 Share Posted August 10, 2014 Need the FILESet function also. Link to comment
Anubhav Posted August 10, 2014 Author Share Posted August 10, 2014 function FILESet(what,to) if what and to then local file = FILEGetFile(what) if file then if fileExists("Data/"..what..".data") then fileClose(file) fileDelete("Data/"..what..".data") end local file = FILEGetFile(what) if file then fileWrite(file,to) fileFlush(file) fileClose(file) end end end end Link to comment
Anubhav Posted August 10, 2014 Author Share Posted August 10, 2014 Any help please? Its very urgent! Link to comment
Saml1er Posted August 10, 2014 Share Posted August 10, 2014 Becaude we néed to see this function as well: FILEGetFile(what) , but if we ask you for more then you might think that we're trying to leak... Pm me your code if you want help. Link to comment
Anubhav Posted August 10, 2014 Author Share Posted August 10, 2014 function FILEGet(what) if what then local file = FILEGetFile(what) if file then local data while not fileIsEOF(file) do if data then data = data..fileRead(file, 500) else data = fileRead(file, 500) end end fileClose(file) -- return data or false end end end Link to comment
Et-win Posted August 10, 2014 Share Posted August 10, 2014 Checked or it returned the data? Also, maybe it's better to just to get the file size with fileGetSize and then fileRead. Link to comment
Anubhav Posted August 10, 2014 Author Share Posted August 10, 2014 Checked or it returned the data?Also, maybe it's better to just to get the file size with fileGetSize and then fileRead. What do you mean by checked or returned data? The data doesn't get setted, idk why. When I create the group I use same everything with everything defined! Here still it doesn't work. When I create the group it works PERFECT! Link to comment
Et-win Posted August 10, 2014 Share Posted August 10, 2014 The last script you posted, put an 'outputChatBox' a line before 'return' and check what 'data' output's. If that isn't the problem, then go to the next part until you find what doesn't work properly. It's what I always do, and it always works. Or someone else have to see what's wrong Link to comment
Anubhav Posted August 10, 2014 Author Share Posted August 10, 2014 Woah! I din't find any error, I outputted whatever it setted. Dude, whatever it setted was right, !! That means something is wrong in label coloring or something. I'll surely see it, and reply. Thanks for this TIP, this helped me alot! 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