Jump to content

Stoping script


Recommended Posts

Posted (edited)

if and no else ? 

if(getClient().getUsername().equalsIgnoreCase("Char")){
log("Welcome"+ getClient().getUsername().toString() + "!" + "You are authorized");
}
else {
log("Welcome" + getClient().getUsername().toString() + "!" + "You're not authorized to use this script!");
stop();
}
Edited by Charlotte
Posted (edited)

 

if and no else ? 

if(getClient().getUsername().equalsIgnoreCase("Char")){
log("Welcome"+ getClient().getUsername().toString() + "!" + "You are authorized");
}
else {
log("Welcome" + getClient().getUsername().toString() + "!" + "You're not authorized to use this script!");
stop();
}

 

 

 

you have to use comparators with non-value types, namely .equals() in this case.

 

try

if(!getClient().getUsername().equals("progamerz") ){
log("Take permission from progamerz please.");
this.stop();
}

Will try and let u know!

 

EDIT : both working thanks!

Edited by progamerz
  • Like 1

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