• Printmessage simple syntax issue that I don't understand
    2 replies, posted
Hi Guys, I have a problem with ulx luarun and using the printmessage function [CODE] ulx luarun for k, v in pairs(player.GetAll()) do PrintMessage( HUD_PRINTTALK,( v:IPAddress() ) ) end [/CODE] This seems to work fine printing all the players ip addresses in the chatbox. I want to do this though and print the name next to the address [CODE] ulx luarun for k, v in pairs(player.GetAll()) do PrintMessage( HUD_PRINTTALK,( v:IPAddress() ) ( v:Nick() ) ) end [/CODE] It does not appear to be working, What am I doing wrong I'm sure I've got the syntax correct? I usually rely on the console to give me the error when I'm coding to fix simple syntax errors (Bad I know) Very simple error I know I really have trouble with luarun sometimes.
[code]PrintMessage(HUD_PRINTTALK, v:IPAddress(), v:Nick())[/code]
[QUOTE=Wizard of Ass;49651109][code]PrintMessage(HUD_PRINTTALK, v:IPAddress(), v:Nick())[/code][/QUOTE] Unless the wiki is wrong, [URL="http://wiki.garrysmod.com/page/Global/PrintMessage"]PrintMessage[/URL] doesn't take varags. You need to concatenate the strings together: [code]PrintMessage( HUD_PRINTTALK, v:IPAddress() .. " " .. v:Nick() )[/code]
Sorry, you need to Log In to post a reply to this thread.