Jump to content

Command through the server console


dima3367

Recommended Posts

Hello everybody! Please tell me how to make the team work through the server console? I need to make the /givemoney team work through the server console .  I made an export to meta to the function where the command is written, but this did not help. I would be grateful for your help.

 

Link to comment
  • Moderators
1 hour ago, dima3367 said:

function where the command is written

You can use the addCommandHandler.

 

addCommandHandler ( "givemoney", 
function (responsibleElement, commandName, teamName, money) 
	iprint("givemoney command used")
	
	if responsibleElement and getElementType(responsibleElement) == "console" then
		iprint("the one used the command is the console")
		money = tonumber(money)
		if teamName and money then
			iprint("parameters are valid!")
			-- do your stuff
		end
	end
end)

 

  • Like 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...