Hi, can anyone tell me how I run a console command on a player?
Any help is appreciated,
Spicy
Run console commands on players
Discussion in 'Rust Development' started by Spicy, Apr 27, 2015.
-
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" -
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. -
Code:C# player.Command("echo \"Printing some string\"") Lua player:Command("echo \"Printing some string\"")
Code:C# player.SendConsoleCommand("echo \"Printing some string\"") Lua player:SendConsoleCommand("echo \"Printing some string\"")
Code:C# player.ConsoleMessage("Printing some string") Lua player:ConsoleMessage("Printing some string")
-
Wulf Community Admin
Code:player:SendConsoleCommand("echo \"Hello world\"")
-
Ah I see now, thank you!
-
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?
-
Wulf Community Admin
-
thank i got it..