Anubhav Posted August 10, 2014 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! See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
xXMADEXx Posted August 10, 2014 Posted August 10, 2014 Post your whole code. The Ultimate Lua Tutorial! | MTA PHP SDK
Anubhav Posted August 10, 2014 Author 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 ) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
xXMADEXx Posted August 10, 2014 Posted August 10, 2014 If that's all your code, the function setGroupData and refreshData aren't defined. The Ultimate Lua Tutorial! | MTA PHP SDK
Anubhav Posted August 10, 2014 Author 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. See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
xXMADEXx Posted August 10, 2014 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. The Ultimate Lua Tutorial! | MTA PHP SDK
Gr0x Posted August 10, 2014 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.
Anubhav Posted August 10, 2014 Author Posted August 10, 2014 Gr0x @ Why was it setting when I created the group?? (wonder) Why isn't it working now?? See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Gr0x Posted August 10, 2014 Posted August 10, 2014 Where should i know? Post the setGroupData function, and the event which triggers this if you need further help.
Anubhav Posted August 10, 2014 Author Posted August 10, 2014 function setGroupData(group,data,key) if ( group and data and key ) then return FILESet("MyGroup-##"..group.."-"..data,key) end end See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
xXMADEXx Posted August 10, 2014 Posted August 10, 2014 Need the FILESet function also. The Ultimate Lua Tutorial! | MTA PHP SDK
Anubhav Posted August 10, 2014 Author 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 See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Anubhav Posted August 10, 2014 Author Posted August 10, 2014 Any help please? Its very urgent! See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Saml1er Posted August 10, 2014 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.
Anubhav Posted August 10, 2014 Author 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 See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Et-win Posted August 10, 2014 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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Anubhav Posted August 10, 2014 Author 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! See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
Et-win Posted August 10, 2014 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 ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Anubhav Posted August 10, 2014 Author 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! See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
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