ShaDoW Posted April 27, 2012 Share Posted April 27, 2012 Hello, I want to make a custom command !levlist. It must show a list of adminlevels like in other mods. But i don't know how to start a new line. I tried "/n" already but it doesn't work.Can u help me? greetz shadow Quote Link to comment Share on other sites More sharing options...
Management gaoesa Posted April 27, 2012 Management Share Posted April 27, 2012 You could make all of the lines separated prints. Quote Link to comment Share on other sites More sharing options...
ShaDoW Posted April 27, 2012 Author Share Posted April 27, 2012 How do u mean? Quote Link to comment Share on other sites More sharing options...
Management gaoesa Posted April 27, 2012 Management Share Posted April 27, 2012 exec = chat "Level 0 - Guest"; chat "Level 1 - Regular"; Quote Link to comment Share on other sites More sharing options...
ShaDoW Posted April 27, 2012 Author Share Posted April 27, 2012 Okay thanks it works! Do u know also how to sent it alone to the user of the command. That it isn't visible in mainchat. Quote Link to comment Share on other sites More sharing options...
Management gaoesa Posted April 27, 2012 Management Share Posted April 27, 2012 You could do that with Lua but not with custom commands. Quote Link to comment Share on other sites More sharing options...
ShaDoW Posted April 27, 2012 Author Share Posted April 27, 2012 hm don't know how lua works. Is it hard? Quote Link to comment Share on other sites More sharing options...
Management gaoesa Posted April 27, 2012 Management Share Posted April 27, 2012 It's not hard. But I don't have any examples I could post. Let's hope if someone who uses it more has something they could post to base the script on. Quote Link to comment Share on other sites More sharing options...
Management gaoesa Posted April 28, 2012 Management Share Posted April 28, 2012 Here is something similar to what you asked. It doesn't intercept !levlist command from chat but instead it will intercept the /levlist console command. Adding the code into a levlist.lua file in the server silent folder. Add the file name in lua_modules like this: set lua_modules "levlist.lua". Once the server starts it will load the Lua modules. You can add many modules into the lua_modules string. -- function body taken from the rules.lua from N!trox function et_ClientCommand(clientNum, command) command = string.lower(command) --If a client types "/levlist" in his console if (command == "levlist") then et.trap_SendServerCommand(clientNum, "chat \""Level 0 - Guest"^7\n\"") et.trap_SendServerCommand(clientNum, "chat \""Level 1 - Regular"^7\n\"") return 1 end end I didn't test the above but it is an example how to use Lua. More Lua documentation http://mygamingtalk.com/wiki/index.php/Silent_Mod_Server_Cvar#Lua and more detailed documentation in the server.html which came with the silent download. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.