Jump to content

Question

Posted

Hello guys,I am sorry to bother you again.
I am trying to create new user command.Code seems pretty simple to me,just have one trouble.Where do I find what command what id has?
I mean,where do you say "/unstuck" = 52 or something like that,cause I failed to find it.
Thank you for help.

6 answers to this question

Recommended Posts

  • 0
Posted

 

    private static final int[] COMMAND_IDS =
    {
        52
    };

 

That's the id from the core side.

 

commandname-e.dat from system folder

 

 

nbr    id    name
53    52    unstuck
  • 0
Posted

Ohh,so it works like this:
You write the command ("/unstuck")
Client converts it to id (52)
Clients sends it to the server
Server recognizes ID and does what he needs to do
?

  • 0
Posted (edited)

No matter what name of the command you write. It's about the ID :)

 

If the Id fits with the one from core, //logic, else do nothing (doesnt exist on core side) :P

Edited by SweeTs
  • 0
Posted

Yeah,I got it to work.
Thank you again!
And if you could I got one more question,I can't find how to get character instance by using his objId or char name.
For example,I want to make player a hero and I can get his char name or objId,so how can I get variable character,so I can character.setHero(true);
 

  • 0
Posted (edited)

You don't have to. Simple player/activeChar/target.setHero(true);

 

Where you want to put it? How to obtain it? Need more info :P

Edited by SweeTs
  • 0
Posted

For example,I have a code that check who has most online,and the player who has the most is set to hero.
And I get it like that:
PreparedStatement statement = con.prepareStatement("SELECT char_name FROM characters ORDER BY online DESC LIMIT 1");

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock