MildaBegginer Posted May 14, 2014 Share Posted May 14, 2014 Hello how to delete COLOR CODE from name in debugmonitor ? Link to comment
xXMADEXx Posted May 14, 2014 Share Posted May 14, 2014 You can use string.gsub and search and remove the hex color codes of the players name. Example: local pN = "#00ff00xX#ffff00MADE#00ff00Xx" local new_pn = pN:gsub ( "#%x%x%x%x%x%x", "" ) outputChatBox ( pN.." was converted to "..new_pn ) Link to comment
1LoL1 Posted May 14, 2014 Share Posted May 14, 2014 (edited) You can use string.gsub and search and remove the hex color codes of the players name. Example: local pN = "#00ff00xX#ffff00MADE#00ff00Xx" local new_pn = pN:gsub ( "#%x%x%x%x%x%x", "" ) outputChatBox ( pN.." was converted to "..new_pn ) And when I want to put this script? Edited May 16, 2014 by Guest Link to comment
Moderators Citizen Posted May 14, 2014 Moderators Share Posted May 14, 2014 Hello how to delete COLOR CODE from name in debugmonitor ? What is debug monitor, can you show us a screenshot about what you are talking about ? Link to comment
1LoL1 Posted May 14, 2014 Share Posted May 14, 2014 (edited) Hello how to delete COLOR CODE from name in debugmonitor ? What is debug monitor, can you show us a screenshot about what you are talking about ? He thinks what is DayZ the Debug Monitor my post there to be only some adjustments and it will go .. Edited May 14, 2014 by Guest Link to comment
Moderators Citizen Posted May 14, 2014 Moderators Share Posted May 14, 2014 Hello how to delete COLOR CODE from name in debugmonitor ? What is debug monitor, can you show us a screenshot about what you are talking about ? He thinks what is DayZ the Debug Monitor my post there to be only Niako edit and go to .. In english please ? Link to comment
1LoL1 Posted May 14, 2014 Share Posted May 14, 2014 (edited) This is my post .. here it need only modify those hex Edited May 16, 2014 by Guest Link to comment
Moderators Citizen Posted May 14, 2014 Moderators Share Posted May 14, 2014 Line 85: guiSetText(statsLabel["name"],"Meno: "..namenohex) Is it what you wanted ? EDIT: And please learn how to see errors on the client side: https://wiki.multitheftauto.com/wiki/Deb ... ug_console (/debugscript 3) Link to comment
1LoL1 Posted May 15, 2014 Share Posted May 15, 2014 Line 85: guiSetText(statsLabel["name"],"Meno: "..namenohex) Is it what you wanted ? EDIT: And please learn how to see errors on the client side: https://wiki.multitheftauto.com/wiki/Deb ... ug_console (/debugscript 3) This is the ERROR: ERROR: DayZ \ suraviavorSystem_client.lua_dayz: 492: bad argument # 2 to 'gsub' (string expected got no value) Link to comment
Moderators Citizen Posted May 15, 2014 Moderators Share Posted May 15, 2014 Can you show me this line 492 please ? Link to comment
1LoL1 Posted May 15, 2014 Share Posted May 15, 2014 Can you show me this line 492 please ? guiSetText(statsLabel["name"],"Name: "..string.gsub(namenohex)), "#%x%x%x%x%x%x", "" ) Link to comment
Moderators Citizen Posted May 15, 2014 Moderators Share Posted May 15, 2014 Can you show me this line 492 please ? guiSetText(statsLabel["name"],"Name: "..string.gsub(namenohex)), "#%x%x%x%x%x%x", "" ) You don't understand what you are copying, do you ? guiSetText(statsLabel["name"],"Name: "..namenohex ) namenohex is the name of the localPlayer without the hexa colors, so there is no need to use that string.gsub again. Link to comment
1LoL1 Posted May 15, 2014 Share Posted May 15, 2014 Can you show me this line 492 please ? guiSetText(statsLabel["name"],"Name: "..string.gsub(namenohex)), "#%x%x%x%x%x%x", "" ) You don't understand what you are copying, do you ? guiSetText(statsLabel["name"],"Name: "..namenohex ) namenohex is the name of the localPlayer without the hexa colors, so there is no need to use that string.gsub again. I only copy row 492, however, you wanted to or not? .. Like, the name will change and there is no written hexov but when he changed his name so that the name does not change .. Link to comment
MIKI785 Posted May 15, 2014 Share Posted May 15, 2014 I think im not the only one that can barely understand what youre trying to say here.. the code Civilian posted is correct. Link to comment
1LoL1 Posted May 15, 2014 Share Posted May 15, 2014 I think im not the only one that can barely understand what youre trying to say here.. the code Civilian posted is correct. So at least if it can do it's job so well understand .. Link to comment
Moderators Citizen Posted May 15, 2014 Moderators Share Posted May 15, 2014 I first fixed the line 85: Line 85: guiSetText(statsLabel["name"],"Meno: "..namenohex) Then you posted again with the exact same error but on line 492 ... You could fixed that line 492 if you understood what you copied on line 85. That's why I asked: You don't understand what you are copying, do you ? So for the exact same problem appears the exact same fix: guiSetText(statsLabel["name"],"Name: "..namenohex ) Link to comment
1LoL1 Posted May 15, 2014 Share Posted May 15, 2014 I first fixed the line 85:Line 85: guiSetText(statsLabel["name"],"Meno: "..namenohex) Then you posted again with the exact same error but on line 492 ... You could fixed that line 492 if you understood what you copied on line 85. That's why I asked: You don't understand what you are copying, do you ? So for the exact same problem appears the exact same fix: guiSetText(statsLabel["name"],"Name: "..namenohex ) Can you please write the whole post to it? Link to comment
1LoL1 Posted May 15, 2014 Share Posted May 15, 2014 I first fixed the line 85:Line 85: guiSetText(statsLabel["name"],"Meno: "..namenohex) Then you posted again with the exact same error but on line 492 ... You could fixed that line 492 if you understood what you copied on line 85. That's why I asked: You don't understand what you are copying, do you ? So for the exact same problem appears the exact same fix: guiSetText(statsLabel["name"],"Name: "..namenohex ) Can you please write the whole post to it? Link to comment
Moderators Citizen Posted May 15, 2014 Moderators Share Posted May 15, 2014 Is it a joke ?? Just replace line 492 with this: guiSetText(statsLabel["name"],"Name: "..namenohex ) (the "quoteception" isn't a fail) Link to comment
.:HyPeX:. Posted May 15, 2014 Share Posted May 15, 2014 Maybe you should just read a little bit.. https://wiki.multitheftauto.com/wiki/Sc ... troduction Link to comment
1LoL1 Posted May 16, 2014 Share Posted May 16, 2014 But the name change then .. it's been without hexov but when he changed his name so there remains the old and will not change .. Link to comment
Moderators Citizen Posted May 16, 2014 Moderators Share Posted May 16, 2014 Add this: function updateNameNoHex( _, newName ) namenohex = string.gsub ( newName, '#%x%x%x%x%x%x', '' ) end addEventHandler("onClientPlayerChangeNick", localPlayer, updateNameNoHex) Your whole server is made by the community and it's a shame for a "coder". You are wasting more time on the forum/community asking for help/scripts and copying and pasting codes you don't even understand than learning and fixing/making your server by yourself. (For me, you are also wasting our time because we are here to help others with their scripts, reply to scripting questions etc and not to help someone to make his gamemode from A to Z or to teach that guy how to script). 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