General > Developers Corner

Need help for lua coding

(1/1)

Chironex:
Hello, this is my first post here, i hope you will help me :)

I try to add debug messages for the tool Smart welder, that will be shown in console and logged into ulx log files.

--- Code: ---Msg("this is a smartweld debug test")
MsgAll("this is a smartweld debug test")
ulx.logString("this is a smartweld debug test")

local message = string.format( "%s smart-welded %d props (%d welds)", ply:Nick(), self.props, weldcount)

Msg(message)
MsgAll(message)
ulx.logString(message)

--- End code ---

The problem, is that only the first message Msg("this is a smartweld debug test") is printed in the console, all the others just won't work :(.

So i have some questions:

- Is the MsgAll function broken ?
- Is my string.format correct ?
- Can i use ulx functions (in this case, ulx.logString) in others files than ulx files ?

Thanks for help, i'm very beginner with lua (but i'm good at languages like Pawn if you know, so i will understand quick)

Megiddo:
I don't believe MsgAll is a function. So it's stopping (breaking) there.

Navigation

[0] Message Index

Go to full version