Jump to content

Help with command with two values


SuperM

Recommended Posts

Hello there,

I need some help, I have no clue on how to make a command that need two values to be correct with that I mean something like this:

/setvalue 1 100

Where 1 would be the ID of the interior ot something else and the 100 would be the value of that interior... How on my function I can tell that the user must write both numbers for example interior ID and Value and not only the Value or the ID???

 

I need to be able to change the value in SQL of one object that is inside one interior and for that the player must tell the object ID and the Value that he wants to set.

Link to comment
--##Client Side
function myClientCommandFunction(cmd, value1, value2)
	if tonumber(value1) and tonumber(value2) then
		--DO WHATEVER
	else
		--SAY SYNTAX ERROR (MISSING COMMAND OR NOT NUMBER)
	end
end
addCommandHandler("cCommand",myClientCommandFunction)

--##Server Side
function myServerCommandFunction(cmd, thePlayer, value1, value2)
	if tonumber(value1) and tonumber(value2) then
		--DO WHATEVER
	else
		--SAY SYNTAX ERROR (MISSING COMMAND OR NOT NUMBER)
	end
end
addCommandHandler("sCommand",myServerCommandFunction)

 

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...