• 0

java command set a player clan


Question

hello mxc forum :)

can anyone help me to create a command in java or to use if exisiting , to make a character set to a clan ?

i don't know if it's possible but i have an example

 

"        int _nameColor0 = 0xFFFFFF; 

               _Player.getAppearance().setNameColor(_nameColor0);        "

this makes the character to get name color white ,

can someone tell me how i can make the character to set into a clan , clan id that i want to ?

im trying this way Player.setClan(268436844); 

268436844 is clanid in database , but i think i miss something 

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

acis382 ->RequestAnswerJoinPledge.java line 48 and below (ignore the onRequestResponse part since you are forcing this). As for the clan to join, either put an argument on your bypass and parse it's id/name (using ClanTable#getClan or ClanTable#getClanByName) or get the whole clan list from ClanTable, display it into an npchtmlmessage (using a pagination ofc)

Share this post


Link to post
Share on other sites
  • 0
StringTokenizer st = new StringTokenizer(command, " ");
st.nextToken();
Clan clan = ClanTable.getInstance().getClanByName(st.nextToken());
PlayerInstance target = admin.getTarget().getActingPlayer();
if (target == null || clan == null || !target.isPlayer())
{
	admin.sendMessage("Invalid target/clan.");
	return false;
}
clan.addClanMember(target);
target.broadcastCharInfo();

 

Share this post


Link to post
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.

Guest
Answer this question...

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