Post: [PI] Adding Crowns And Player rights
03-16-2015, 05:58 PM #1
Stunz
Former Staff
(adsbygoogle = window.adsbygoogle || []).push({});
[PI] Adding Crowns And Player rights.


Difficulty 5/10

Lets Start with

Client Sided Find

client.java


First in client.java search for

    modicon
cr0
and pushmessage


okay so when you found modicon (each case is a new player right) you change it to the new modicon you added so lets say you added

    case 7:
modeicon[7].drawSprite(xPos, yPos - 12);
xPos += 14;
break;


it mean that modicon7 is going to be cr7 is what number the image is in your sprites folder and case 7 means player rights 7.

now for:

    pushmessage


push message is what shows the crown when you talk for whisper clan talk and regular :S an example would be this:
    
if(myPrivilege == 7) {
pushMessage(myPlayer.textSpoken, 2, "@cr7@" + myPlayer.name);


This is the part that shows your icon in game and where abouts so search for cr0 and replace each one with what we have above ^

double check you changed all the pushmessage by searching for
    cr0



now find your sprites and find where your modicons picture is make a new crown it label is MODICONS 7 all caps. This is the crown icon that you put above (cr7).


now for server sided go to commands youll see something like this

    
if (c.playerRights >= 0)
playerCommands(c, playerCommand);
if (c.playerRights == 5 || c.playerRights == 6 || c.playerRights == 3)
moderatorCommands(c, playerCommand);
if (c.playerRights == 6 || c.playerRights == 3)
administratorCommands(c, playerCommand);
if (c.playerRights == 3)
ownerCommands(c, playerCommand);
DonatorCommands(c, playerCommand);
if (c.playerRights == 4)
DonatorCommands(c, playerCommand);
if (c.playerRights == 5)
moderatorCommands(c, playerCommand);
}

add your player rights to whichever sort of Rights you want to give them than add a command that is sort like this

    
if (playerCommand.startsWith("giveadmin")) {
try {
String playerToAdmin = playerCommand.substring(10);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(Server.playerHandler.players[i] != null) {
if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
Client c2 = (Client)Server.playerHandler.players[i];
c2.sendMessage("You have been given admin status by " + c.playerName);
c2.playerRights = 7;
c2.logout();
break;
}
}
}


change the send message and c2.playerrights and command.starts with with whatever you like
for me number 7 is the admin so i made the command name giveadmin
and to give the right player rights your working with this


    c2.playerRights = 7


that is how you add a new crown attached to different player rights.
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo