Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

help with a command

Newbie Spellweaver
Joined
Oct 23, 2016
Messages
15
Reaction score
0
Hi. i've added a command in "playercommand.java"

Code:
        } else if (splitted[0].equalsIgnoreCase("aio")|| splitted[0].equals("aio npc")) {
                NPCScriptManager.getInstance().start(c, 9901019, null, player);

It works fine when im near the npc. his location is on fm, but when im in henesys or anywhere else it just crashes. any ideas?
 
Junior Spellweaver
Joined
Dec 21, 2013
Messages
140
Reaction score
3
Based on the command and the command alone, the location shouldn't be the cause of your crashes.

Do any error messages pop up when you crash?
Which command are you using when you DC? "aio" or "aio npc"?
Try removing the || splitted[0].equals("aio npc")? I've never seen a command like that before.

So here's what I think I know about commands
@ (Start), aio (splitted[0]), npc (splitted[1])
is how they are counted. I'm not sure if that's the case with your command though, but worth a shot.
 
Upvote 0
Newbie Spellweaver
Joined
Jul 22, 2012
Messages
90
Reaction score
0
try this :

PHP:
            } else if (splitted[0].equals("@aio")) {
                NPCScriptManager.getInstance().start(c, 9901019);
 
Upvote 0
Newbie Spellweaver
Joined
Oct 23, 2016
Messages
15
Reaction score
0
Based on the command and the command alone, the location shouldn't be the cause of your crashes.

Do any error messages pop up when you crash?
Which command are you using when you DC? "aio" or "aio npc"?
Try removing the || splitted[0].equals("aio npc")? I've never seen a command like that before.

So here's what I think I know about commands
@ (Start), aio (splitted[0]), npc (splitted[1])
is how they are counted. I'm not sure if that's the case with your command though, but worth a shot.

nothing, not even an error npc.



see whether your start method in NPCScriptManager has a distance check or not?

Nope.



try this :

PHP:
            } else if (splitted[0].equals("@aio")) {
                NPCScriptManager.getInstance().start(c, 9901019);

didn't work and even deleted the command.
 
Upvote 0
Experienced Elementalist
Joined
Mar 12, 2015
Messages
238
Reaction score
43
Player npc's can't be opened unless ur on the same map as the npc.
Atleast not the the way its programmed now.

edit:
You also can't have spacebars in commands the way you do it.

This is because the text you send in game gets seperated by spacebars and put in an array.

So the text "hello i'm doing fine, how are you?" gets split like this:

String[] sentence = {"hello", "i'm", "doing", "fine.", "how", "are", "you?"};

thats why you check if splitted[0] equals a certain text string
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Oct 23, 2016
Messages
15
Reaction score
0
Player npc's can't be opened unless ur on the same map as the npc.
Atleast not the the way its programmed now.

edit:
You also can't have spacebars in commands the way you do it.

This is because the text you send in game gets seperated by spacebars and put in an array.

So the text "hello i'm doing fine, how are you?" gets split like this:

String[] sentence = {"hello", "i'm", "doing", "fine.", "how", "are", "you?"};

thats why you check if splitted[0] equals a certain text string
but i can use other npcs commands by using @<thecommand> and it works fine. either im in the same map or not at the same map
 
Upvote 0
Back
Top