Zsoltisz Posted October 15, 2016 Share Posted October 15, 2016 (edited) Hello guys. Can I change the debugscript colors? It's just an idea. I see in video and i see the debugscript is create with dxDrawText. How can i do it? Edited October 15, 2016 by Zsoltisz Link to comment
Gravestone Posted October 15, 2016 Share Posted October 15, 2016 (edited) You can not change the default MTA debugscript's colors but you can create your own debug system using dxDrawText. Oh and btw there's an MTA function which lets you output custom debug messages with custom colors. If that's what you need then visit outputDebugString. Edited October 15, 2016 by Gravestone Link to comment
Zsoltisz Posted October 15, 2016 Author Share Posted October 15, 2016 How? With outputDebugString? Link to comment
Gravestone Posted October 15, 2016 Share Posted October 15, 2016 1 minute ago, Zsoltisz said: How? With outputDebugString? Check my reply^ Link to comment
Zsoltisz Posted October 15, 2016 Author Share Posted October 15, 2016 (edited) Yeah. And can i color this with HEX Codes? Edited October 15, 2016 by Zsoltisz Link to comment
Gravestone Posted October 15, 2016 Share Posted October 15, 2016 No, you have to use RGB values. Link to comment
Zsoltisz Posted October 15, 2016 Author Share Posted October 15, 2016 Okay. It's looks hard How can i get the errors from scripts? Link to comment
Zsoltisz Posted October 15, 2016 Author Share Posted October 15, 2016 Thank you very much my friends! Link to comment
Dealman Posted October 15, 2016 Share Posted October 15, 2016 Ehm, yes you can change the colour of it quite easily. Use outputDebugString and set the message type to 0, meaning custom. After that you can specify the RGB values as you please. 1 Link to comment
Zsoltisz Posted October 15, 2016 Author Share Posted October 15, 2016 http://kepfeltoltes.hu/161015/461313452N_vtelen_www.kepfeltoltes.hu_.png I mean this. Link to comment
Dealman Posted October 15, 2016 Share Posted October 15, 2016 That looks like a custom system. You'd want to use onClientDebugMessage as previously mentioned for that. Link to comment
Zsoltisz Posted October 15, 2016 Author Share Posted October 15, 2016 I try this but it's dont working. What's the prob? addEventHandler ("onClientDebugMessage",getRootElement(), function(message,level,file,line) if exports.StarMTA_core:Fejleszto(thePlayer) then outputChatBox (message) end end) I just type for outputChatBox because i want to test first. Link to comment
Dealman Posted October 15, 2016 Share Posted October 15, 2016 thePlayer is not defined. As for the exported function, I have absolutely no idea what that does Link to comment
Zsoltisz Posted October 16, 2016 Author Share Posted October 16, 2016 I translate it i f exports.core:isPlayerDeveloper() then Link to comment
Dealman Posted October 16, 2016 Share Posted October 16, 2016 Still, thePlayer is not defined. Given that it is a client-sided script, try to replace thePlayer with localPlayer. Is that function server-sided? 1 Link to comment
Zsoltisz Posted October 16, 2016 Author Share Posted October 16, 2016 This script is client sided. Link to comment
Zsoltisz Posted October 16, 2016 Author Share Posted October 16, 2016 Oookay. It's still working. But i got some problem. Please help me. Code: function asd (message,level,file,line) if exports.StarMTA_core:Fejleszto(localPlayer) and level == 1 then outputChatBox("#7CC576[StarMTA-Debugscript]: #FF3333ERROR:#FFFFFF"..message.." (#FFA500"..line.."#FFFFFF)",255,255,255,true) end end addEventHandler ("onClientDebugMessage",getRootElement(),asd) Debugscript: ERROR:StarMTA_debugscript\client.lua:3 attempt to concatenate local 'line' (nil value) Link to comment
quindo Posted October 16, 2016 Share Posted October 16, 2016 maybe: if exports.StarMTA_core:Fejleszto(localPlayer) and level == 1 then if line then outputChatBox("#7CC576[StarMTA-Debugscript]: #FF3333ERROR:#FFFFFF"..message.." (#FFA500"..line.."#FFFFFF)",255,255,255,true) else outputChatBox("#7CC576[StarMTA-Debugscript]: #FF3333ERROR:#FFFFFF"..message,255,255,255,true) end end Link to comment
Zsoltisz Posted October 16, 2016 Author Share Posted October 16, 2016 Yepp. Works. Thanks a lot But now. I need to draw this with dxDrawText and row. Like this: How can i make it? BTW. Can i made this script in server side? Link to comment
pa3ck Posted October 21, 2016 Share Posted October 21, 2016 No, you can't do any sort of GUI on server side. You have to use onClientDebugMessage and store the messages in an array then use dxDrawText to draw it on the screen, but you might be better of downloading something like this from the community, to be honest. Link to comment
Dealman Posted October 21, 2016 Share Posted October 21, 2016 (edited) Store the messages in a table as pa3ck said. Then for example, only draw the last 5 entries to prevent it from cluttering the screen, use this to multiply the offset. To optimize it you can limit the table size, so whenever a new message is added - check the size of the table and if the table is at its limit(let's say 50) then remove the first entry. That way the table will remain at a size of 50 all the time. As for doing this server-side, you can, but the drawing has to happen client-side for obvious reasons. What you can do, however, is whenever onClientDebugMessage is executed, you send the information(message, level, file and line) to the server. This way, you can then transfer this information to another client and they will see it as well.@Necktrox was working on something similar I believe, which looked promising. You might want to check his resource out if it's released. Edited October 21, 2016 by Dealman Link to comment
MTA Team botder Posted October 21, 2016 MTA Team Share Posted October 21, 2016 Well, I didn't work on my resource for a long time, but I can also link to newer resources. 1 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