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!

cm.sendAcceptDecline

Experienced Elementalist
Joined
Jan 16, 2013
Messages
284
Reaction score
53
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 (cm.getPlayer().getStoryPoints() == 6) {
                    if (status == 0) {
                        cm.sendAcceptDecline("press a button");
                        } else if (status == 1) {
                            cm.sendNext("you pressed accept");
                        } else if (status == 2) {
                            cm.sendOk("goodbye!");
                            cm.dispose();
                        }
                        }
                        }
                        }

All I want to do is make it so that when you press Decline, it goes through a bunch of other statuses. I tried this script:

PHP:
if (cm.getPlayer().getStoryPoints() == 6) {
                    if (status == 0) {
                        cm.sendAcceptDecline("press a button");
                    } else if (mode != 1) {
                        cm.sendOk("you pressed decline");
                        cm.dispose();
                        } else if (status == 1) {
                            cm.sendNext("you pressed accept");
                        } else if (status == 2) {
                            cm.sendOk("goodbye!");
                            cm.dispose();


But, all that script does, it make the "you pressed decline" message pop up then dispose. How would I make it display "you pressed decline", and then more actions like "goodbye!"?


Help is greatly appreciated, thanks!
 
Junior Spellweaver
Joined
Apr 15, 2010
Messages
147
Reaction score
8
Isnt there something like the sendYesNo.

with mode and status. And if you hit no, it pops up another dialouge to exit - (could program the exit dialouge to be longer)
 
Upvote 0
Junior Spellweaver
Joined
May 16, 2012
Messages
116
Reaction score
2
I've tried thinking of the script and how it would work, currently trying to script one for you.

In the attempt to script this. I made this horrible troll machine!

PHP:
var status;

function start() {
    status = 0;
    action(1, 0, 0);
}
     
     
function action(mode, type, selection) {
	if (mode == 0 & status == 0) {
		cm.sendOk("You pressed decline.");
		cm.dispose();
		return;
	}
	if (status == 0) {
		//if (cm.getPlayer().getStoryPoints() == 6) {
		if (cm.getPlayer().isGM) {
			status = 1;
			cm.sendAcceptDecline("Press a button");
		} else {
			status = 1;
			cm.sendAcceptDecline("Press a button");
		}
	} else if (status == 1) {
		cm.sendOk("You pressed accept");
	}
}		cm.sendOk("You pressed decline.");
		cm.dispose();
		return;
	}
	if (status == 0) {
		//if (cm.getPlayer().getStoryPoints() == 6) {
		if (cm.getPlayer().isGM) {
			status = 1;
			cm.sendAcceptDecline("Press a button");
		} else {
			status = 1;
			cm.sendAcceptDecline("Press a button");
		}
	} else if (status == 1) {
		cm.sendOk("You pressed accept");
	}
}
 
Upvote 0
Mythic Archon
Joined
Dec 25, 2011
Messages
723
Reaction score
97
You are disposing right after declining, which basically finishes the script.

Edit: after the "you pressed decline" part, my bad.
 
Upvote 0
Experienced Elementalist
Joined
Jan 16, 2013
Messages
284
Reaction score
53
Thanks for all the replies! What I'm trying to accomplish is to be able to go through more than one status if you press decline (if mode != 1)
 
Upvote 0
Experienced Elementalist
Joined
Apr 18, 2009
Messages
211
Reaction score
38
PHP:
var status;
     
function start() {
	status = -1;
	action(1, 0, 0);
}
     
     
function action(mode, type, selection) {
	if (mode == 1) {
		status++;
	} else {
		if (mode == 0) {
			status--;
		} else {
			cm.dispose();
			return;
		}
	}
	if (cm.getPlayer().getStoryPoints() == 6) {
		if (status == 0) {
			if (mode == 1) {
				cm.sendNext("Sends this message first when NPC clicked");
			} else if (mode == 0) {
				cm.sendOk("Sends this if the Decline is hit.");
				cm.dispose();
			}
		} else if (status == 1) {
			cm.sendAcceptDecline("press a button");
		} else if (status == 1) {
			cm.sendNext("you pressed accept");
		} else if (status == 2) {
			cm.sendOk("goodbye!");
			cm.dispose();
		}
	}
}
 
Upvote 0
Back
Top