I need a little help is this the correct way to write a command to make myself owner since i cant seem to figure out the other way
Code:case "admin" :
player.setRights(7);
return true;
Printable View
I need a little help is this the correct way to write a command to make myself owner since i cant seem to figure out the other way
Code:case "admin" :
player.setRights(7);
return true;
Login.java all the help im throwing at you.Quote:
Originally Posted by Syndicaz [Only registered and activated users can see links. Click Here To Register...]
Yes that's the right way to do that command....atleast that's how it is on my source...
The rights are being set upon login from not player.java the class you SHOULD set the rights for a certain username, is login.javaQuote:
Originally Posted by Piggy Piggy [Only registered and activated users can see links. Click Here To Register...]
//Create the array in the Settings.java class ;L put these loops before account.init in login.java
Code:
for(int names = 0;names < Settings.SERVER_ADMINISTRATORS.length;names++) {
if(account.getUsername().equalsIgnoreCase(Settings.SERVER_ADMINISTRATORS[names])) {
account.setRights(2);
}
}
for(int names = 0;names < Settings.SERVER_MODERATORS.length;names++) {
if(account.getUsername().equalsIgnoreCase(Settings.SERVER_MODERATORS[names])) {
account.setRights(1);
}
}
That's not what he was asking...he was asking if that's how you write the commandQuote:
Originally Posted by JTlr Frost [Only registered and activated users can see links. Click Here To Register...]
and i was stating since its apparently mx 'rs3' the way i put would be more efficient.Quote:
Originally Posted by Piggy Piggy [Only registered and activated users can see links. Click Here To Register...]
No actually; it wouldnt. You'd be looping (which is n(n)) everytime someone logged in over two seperate arrays. The command is the more efficient means of achieving the same thing.Quote:
Originally Posted by JTlr Frost [Only registered and activated users can see links. Click Here To Register...]
Yeah, which then he'd have to change how the message icons are read, which apparently is drawing the line when most people can't even see the login screen because finding the cache path is to difficult.Quote:
Originally Posted by hc747 [Only registered and activated users can see links. Click Here To Register...]
What in the world is n(N)? In computer science we use big-O notation for these things. The correct complexity for iterating over two mutually-exclusive arrays with the same size is 2*O(N) (or if you feel like being pedantic: 2*O(N) <=> O(2N) <=> O(N)).Quote:
Originally Posted by hc747 [Only registered and activated users can see links. Click Here To Register...]