ZeusXBr Posted June 4, 2021 Share Posted June 4, 2021 I'm trying to get the command when some user put any command, example? onPlayerCommand: outputchatbox("User "..playername.." used "..Command.." command." Any suggestion ? Link to comment
Administrators Tut Posted June 5, 2021 Administrators Share Posted June 5, 2021 Your thread has been moved into a better section for receiving help with scripting 1 Link to comment
Addlibs Posted June 5, 2021 Share Posted June 5, 2021 (edited) -- (server side) function onPlayerCommandHandler(cmd) local playername = getPlayerName(source) outputChatBox(playername .. " entered command " .. cmd, root, 255, 0, 0) end addEventHandler("onPlayerCommand", root, onPlayerCommandHandler) source is the element of the player that entered the command, you can get the name using getPlayerName; the first parameter passed to the handler function is the command string that was entered. Edited June 5, 2021 by Addlibs 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now