SuperM Posted October 23, 2019 Share Posted October 23, 2019 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
Overkillz Posted October 23, 2019 Share Posted October 23, 2019 --##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
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