Jump to content

[C#] Params in commands


Recommended Posts

Hey. I've been recently working on a business system but I'm having a problem. I have inserted in the commands params the player and the int ID so the the script will receive the business' ID to be updated in the SQL. But everytime I use the command it asks me for the business' ID which I don't want. 

How can I solve this problem? Thanks.

Link to comment
Share on other sites

  • 4 weeks later...
public void BLAHBLAHBLAH(Player p, string id)
  if (!Regex.IsMatch(vehicle, @"^\d+$"))
    // Not an INT

  int id = int.Parse(id);

Add them in the function itself; You can change the Argument Parsing from string to what ever you want in the "Command" attribute.

Link to comment
Share on other sites

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