1. Hi, can anyone tell me how I run a console command on a player?

    Any help is appreciated,
    Spicy
     
  2. depends on the console command, does it take a player argument? etc.
    normally it is just going to the console and doing "command playername options"
     
  3. Say I wanted to run "echo hello123" on them, how would I do that?

    Thanks for replying. :)

    Edit: I see what you mean now, sorry. I want to create a chat command that will run a client command on a player. E.g. "echo hello123" as above.
     
  4. Let's say we have our BasePlayer player:
    Code:
    C# player.Command("echo \"Printing some string\"")
    Lua player:Command("echo \"Printing some string\"")
    or
    Code:
    C# player.SendConsoleCommand("echo \"Printing some string\"")
    Lua player:SendConsoleCommand("echo \"Printing some string\"")
    And technically if you just want to run echo you can use the method ConsoleMessage(string msg)
    Code:
    C# player.ConsoleMessage("Printing some string")
    Lua player:ConsoleMessage("Printing some string")
     
  5. Wulf

    Wulf Community Admin

    Code:
    player:SendConsoleCommand("echo \"Hello world\"")
     
  6. Ah I see now, thank you! :)
     
  7. how would one make it execute something in the server console? example make it so it does "say $player welcome to the server." or runs a command using player id?
     
  8. Wulf

    Wulf Community Admin

    rust.RunServerCommand("command")
     
  9. thank i got it..