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!

NPC Problem

Experienced Elementalist
Joined
Jan 16, 2013
Messages
284
Reaction score
53


Essentially, all this is supposed to do is check if the player is an officer. If the player is an officer, than two messages are supposed to be displayed (first message in status 1 and second message in status 2).

If the player is NOT and officer, then it just moves to the else at the bottom.


Problem is, only the first status shows if I click on the NPC as an officer, the second status never arrives.
 
Experienced Elementalist
Joined
Aug 24, 2012
Messages
280
Reaction score
101
Well. It's supposed to be an instead of and in the second part for the speech part.

I'd recon it's not checking properly if the player isn't an officer. That's what I think might be the problem.
 
Upvote 0
Experienced Elementalist
Joined
Jan 16, 2013
Messages
284
Reaction score
53
Well. It's supposed to be an instead of and in the second part for the speech part.

I'd recon it's not checking properly if the player isn't an officer. That's what I think might be the problem.
It checks if the player is a thug or officer perfectly fine. Like I said, if player is an officer than it shows the first status and never gets to the second one. If the player is not an officer, it just goes to the else.

Just having trouble getting to the next status.
 
Upvote 0
Experienced Elementalist
Joined
Apr 8, 2008
Messages
203
Reaction score
29
its just the pastebin file only uses cm.sendOk - didnt see any use of cm.sendNext
 
Upvote 0
Initiate Mage
Joined
Feb 18, 2013
Messages
13
Reaction score
1
Only if I was on my computer now on my server I could fix this for you lawl you should use cm.semdnext
 
Upvote 0
Experienced Elementalist
Joined
Jan 16, 2013
Messages
284
Reaction score
53
Only if I was on my computer now on my server I could fix this for you lawl you should use cm.semdnext
I've already tried switching it with sendNext for the first status, just gives me the same shenanigans! It would be great if you could help me fix it, though.
 
Upvote 0
Experienced Elementalist
Joined
Apr 8, 2008
Messages
203
Reaction score
29
I may be wrong, but I think if a script executes without error - you cannot just change it to a new one, without restarting, as if I remember correctly it uses the compilable option on the script engine. Maybe this is why you are seeing the same results.
As I said I could be wrong.
 
Upvote 0
Junior Spellweaver
Joined
May 16, 2012
Messages
116
Reaction score
2
If that doesn't work above... THIS IS TESTED AND WORKING.

PHP:
var status;
 
function start() {
        status = -1;
        action(1, 0, 0);
}
 
function action(mode, type, selection) {
    if (mode == -1)
        cm.dispose();
    else {
        if (mode == 1) {
            status++;
        } else { 
            status--;
			}
		if (status == 0) {
			if (cm.getPlayer().isOfficer()) {
			status = 1;
			cm.sendOk("You are an Officer.");
			} else {
			status = 3;
			cm.sendOk("You are NOT and Officer.");
			}
		} else if (status == 2) {
			cm.sendOk("Suck my ballsack.");
            cm.dispose();
		}
	}
}
 
Last edited:
Upvote 0
Custom Title Activated
Member
Joined
Aug 21, 2009
Messages
1,149
Reaction score
598
What just happen to this community?

PHP:
function start() {
	if (cm.getPlayer().isOfficer()) {
	    cm.sendOk("You are an Officer.");
	} else {
	    cm.sendOk("You are NOT and Officer.");
		cm.dispose();
	}
}

function action(mode, type, selection) {
    if (mode == 1) {
        cm.sendOk("Suck my ballsack.");
	}
	cm.dispose();
}
 
Upvote 0
Back
Top