In my plugin I want to be able to trigger chat commands. For example, lets say another plugin registers a command /backpack. I want to be able to trigger that command from within my plugin and pass a player through that way. So its as if that player has typed the command. Is this possible?
Trigger a chat commandSolved
You'd be better off calling the method in the specific plugin rather than the command as commands may change. If you want to listen for when the command is called by a player though, there's a hook for that. To run a command as a player though, you'd essentially just run the say command on the specific player's client with the chat command as the chat.
Wulf
You'd be better off calling the method in the specific plugin rather than the command as commands may change. If you want to listen for when the command is called by a player though, there's a hook for that. To run a command as a player though, you'd essentially just run the say command on the specific player's client with the chat command as the chat.
Is that say command essentially messaging as that player then?
If you have time, can you show an example?
player.SendConsoleCommand("chat.add", 2, player.userID, "say /backpack"); player.SendConsoleCommand("chat.say \"/backpack\""); Wulf
player.SendConsoleCommand("chat.say \"/backpack\"");
This works, Thanks :)
Locked automatically
