#Switch statement variables

1 messages · Page 1 of 1 (latest)

inland warren
#

https://paste.md-5.net/wogewitiga.cs <- Error - Class -> https://paste.md-5.net/uboyicovet.java // So the commands for /crewadmin "set", "add", "remove" all work no problem. The /crewadmin check <player> isn't working along with the basecommand, although the basecommand is working but returns error. I'm guessing it's how i declared the target variable and amount variable? Don't know any other way of declaring as if I declare seperately inside the case's i will get errors as it's in scope

void zealot
#

ensure args.length is at least 3

#

so you have a 0, 1 and 2

inland warren
#

if i use an if statement on that though it'll make the variables out of scope?

void zealot
#

get your variables in the switch cases

inland warren
#

Then i'm back to the original problem of the scope