I recently got a hold of a tokens api and I've been messing with it. I'm trying to run it off one command as it didnt really work using /tokens and /tokens give seperate. So I decided to turn to Bukkit (as usual). I've got it so if args = 0 send them their balance of tokens. I want to try it to they can do /tokens give <name> <amount> but I'm not sure how it'd come along. Anyone?
@timtower Could you possibly show an example. It's complicated explaining stuff to me w/ out a screenie xD
@DaChiimp I checked if the args lenght is equal to 3. I then checked if the args[0] of that was "add" then then arg[1] was the target but I'm not sure what to set the last arg which is the amount.
@MrConnn As @mythbusterma said you need to try parse the string to an integer. This is done by Integer.parseInt(args[2]); and it will throw a NumberFormatException if it is a string and not a integer.