Jump to content

Stoping script


progamerz

Recommended Posts

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
Link to comment
Share on other sites

 

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...