PDA

View Full Version : [317][508] Making an Item Unwearable to Regular Players [317][508]



Techn0fev3r
June 17th, 2010, 23:45
Welcome to My Fifth tutorial
I think its Fifth

Difficulty: 2/10 Maybe 3
Classes Modified

ok first find



if(wearID

look for something like this



if(wearID == 1040 && playerRights < 2){
sM("How did you get a Perfect ring?");
removeAllItems();
return false;
}

If you have an item e.g Partyhat is just for Staff etc, Change the player rights 2 to 0
If you dont want it to remove all the items, take out removeAllItems();

then add this below the }



if(wearID == 1040 && playerRights < 2){
sM("You have permission to wear the partyhat");
return false;
}


if(wearID == 1040 && playerRights < 2){
When you add this, This makes the requirements PlayerRights 1 or higher


sM("Your Message Here <--");
sendMessage("Your Message Here <--");
this sends a message that will be sent to the player trying to wear item with a players rights of 1 or lower


this can also be use with donator if your server has that just do the same thing and replace the playerRights with dotnator and the 2 with 1

for example



if(wearID == 17165 && donator < 1){
sM("you need to be a donator to wear this item");
return false;
}

If you dont have donator, Go into player.java and find

public int delay;
Under that add

public int donator;

and compile and your done

Rog3r
June 18th, 2010, 00:01
Not bad, suggest you fix up the code tags however other then that - decent tutorial.

Pie
June 18th, 2010, 00:02
EOnly the registered members can see the link.