• Server Side
    0 replies, posted
So, I'd like a little info on how to run a server side command from a lua script. Lets say that I make a lua script, and basically I want it to add a console command that when called, checks the steamID of the person who called it, then if it matches, they get added to superadmin, if not, it does nothing. (I know how to add an else statement and such to modify it later) Also, when they leave, they get removed from the superadmin group. I'm having trouble grasping the concept of functions in lua. I've only worked with Java and VB. I wrote this script: [lua] local enabled = false if SERVER then function dev() if enabled == false then game.ConsoleCommand("ttt_debug_preventwin 1\n"); game.ConsoleCommand("ttt_minimum_players 1\n"); enabled = true game.ConsoleCommand("say DEVMODE ENABLED\n"); else game.ConsoleCommand("ttt_debug_preventwin 0\n"); game.ConsoleCommand("ttt_minimum_players 2\n"); enabled = false game.ConsoleCommand("say DEVMODE DISABLED\n"); end end concommand.Add("devmode", dev) end [/lua] but it only works if I rcon in and run it. I want one that can be run from the client.
Sorry, you need to Log In to post a reply to this thread.