Jump to content
  • 0

Question

Posted (edited)

Hello there, any idea how to remove ---> close; thanks you for the help!

ps: see the picture

prontera,95,72,3    script    Breaker Points Shop    512,{
    query_sql("SELECT `count` FROM `breaker_ladder` WHERE `char_id` = "+ getcharid(0), .@count);
    cutin "woe_2020",2;
    mes "[ ^C6A518WoE Points Staff^000000 ]";
    mes "Hey sir!";
    mes " ";
    mes "WoE Points: ^1DCE63 "+#EMPBREAKERPTS+" Points^000000 ";
    mes "Did you enjoy the WoE today?, Hows your day?";
    next;
    switch(select("I want to check shop","I'm good thank you..",(getgmlevel()> 60) ? "~ [GM MENU] Reset data":"")) {
    case 1:
        callshop "EmpBreakerShop",4;
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Every and of the month the shop";
        mes "Will have a new headgears manually";
        mes "picked by the Players!";
        mes " ";
        mes "^FF0000NOTE^000000: Please choose wisely";
        break;

close.png

shop2.png

Edited by Mael
Use a codebox

10 answers to this question

Recommended Posts

  • 0
Posted (edited)

The only reason this will happen if you code on the wrong way...

prontera,x,y	script test	99{

	mes "blablabla";
	close; // <<<<---- Because of this
	switch(select("test:test2")){
		case 1:
		case 2:
				end;
	}
	end;
}


It should be like this

prontera,x,y	script test	99{

	mes "blablabla";
	switch(select("test:test2")){
		case 1:
		case 2:
				end;
	}
	end;
}


The cause of close is this following ( Close , End , Break )

Edited by Poring King
  • 0
Posted

Hello,

thanks to those who replied but I mean like this please look at the difference of two npc video and even open shop can walk player this a script sorry for my bad english thank you guys!!


guildhall,95,72,3    script    Breaker Points Shop    512,{
    query_sql("SELECT `count` FROM `breaker_ladder` WHERE `char_id` = "+ getcharid(0), .@count);
    cutin "woe_2020",2;
    mes "[ ^C6A518WoE Points Staff^000000 ]";
    mes "Hey sir!";
    mes " ";
    mes "Breaker Points: ^1DCE63 "+#EMPBREAKERPTS+" Points^000000 ";
    mes "Did you enjoy the WoE today?, Hows your day?";
    next;
    switch(select("I want to check shop","I'm good thank you..")) {
    case 1:
        callshop "EmpBreakerShop", 4;
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Every and of the month the shop";
        mes "Will have a new headgears manually";
        mes "picked by the Players!";
        mes " ";
        mes "^FF0000NOTE^000000: Please choose wisely";
        end;
    case 2:    
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Thats good to hear!";
        close2;
        cutin "",255;
        end;
    }
    close;

OnInit:
    // how much points gained per emp break?
    $@empbreakpoints = 1; 

    query_sql("CREATE TABLE IF NOT EXISTS `breaker_ladder` (`char_id` int(11) unsigned NOT NULL, `count` int(11) NOT NULL DEFAULT '0', PRIMARY KEY ( `char_id` )) ENGINE=InnoDB");
}

-    pointshop    EmpBreakerShop    -1,#EMPBREAKERPTS,12202:1,12203:1,12207:1,12206:1,12205:1,12204:1,13517:1,14004:2

guildhall    mapflag    loadevent

  • 0
Posted (edited)
21 minutes ago, Get Backers said:

 }
    close;

remove this close; from line 27.

replace the end; to break; line 19.
 

case 1:
        callshop "EmpBreakerShop", 4;
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Every and of the month the shop";
        mes "Will have a new headgears manually";
        mes "picked by the Players!";
        mes " ";
        mes "^FF0000NOTE^000000: Please choose wisely";
	break;
    case 2:    
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Thats good to hear!";
        close2;
        cutin "",255;
        end;
    }
    

image.png.f7897d0dd925bf2c1942c77184338421.png

Edited by Cookie-rae
  • 0
Posted (edited)

Hi Cookie-rae nothing changed. still not removed close on message


        callshop "EmpBreakerShop", 4;
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Every and of the month the shop";
        mes "Will have a new headgears manually";
        mes "picked by the Players!";
        mes " ";
        mes "^FF0000NOTE^000000: Please choose wisely";
        break;
    case 2:    
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Thats good to hear!";
        close2;
        cutin "",255;
        end;
    }
    close;

shop 1.png

Edited by Get Backers
  • 0
Posted

Well to understand the whole script and the behavior from my phone . Im very sure the fault is you call first the shop before it use break . 

This is what you do
 

	callshop "EmpBreakerShop", 4;
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Every and of the month the shop";
        mes "Will have a new headgears manually";
        mes "picked by the Players!";
        mes " ";
        mes "^FF0000NOTE^000000: Please choose wisely";
        break;


Im pretty sure this time it will fix.. Do this

        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Every and of the month the shop";
        mes "Will have a new headgears manually";
        mes "picked by the Players!";
        mes " ";
        mes "^FF0000NOTE^000000: Please choose wisely";
	callshop "EmpBreakerShop", 4;
        end;

 

  • 0
Posted
1 minute ago, Poring King said:

Well to understand the whole script and the behavior from my phone . Im very sure the fault is you call first the shop before it use break . 

This is what you do
 


	callshop "EmpBreakerShop", 4;
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Every and of the month the shop";
        mes "Will have a new headgears manually";
        mes "picked by the Players!";
        mes " ";
        mes "^FF0000NOTE^000000: Please choose wisely";
        break;


Im pretty sure this time it will fix.. Do this


        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Every and of the month the shop";
        mes "Will have a new headgears manually";
        mes "picked by the Players!";
        mes " ";
        mes "^FF0000NOTE^000000: Please choose wisely";
	callshop "EmpBreakerShop", 4;
        end;

 

I think this will still trigger close function because of the end; and the close; is in the end of switch he need to remove it first.
 

just a simple fix is this as i mention on my reply.

This is what exact should be.

guildhall,95,72,3    script    Breaker Points Shop    512,{
    query_sql("SELECT `count` FROM `breaker_ladder` WHERE `char_id` = "+ getcharid(0), .@count);
    cutin "woe_2020",2;
    mes "[ ^C6A518WoE Points Staff^000000 ]";
    mes "Hey sir!";
    mes " ";
    mes "Breaker Points: ^1DCE63 "+#EMPBREAKERPTS+" Points^000000 ";
    mes "Did you enjoy the WoE today?, Hows your day?";
    next;
    switch(select("I want to check shop","I'm good thank you..")) {
    case 1:
        callshop "EmpBreakerShop", 4;
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Every and of the month the shop";
        mes "Will have a new headgears manually";
        mes "picked by the Players!";
        mes " ";
        mes "^FF0000NOTE^000000: Please choose wisely";
        break;
    case 2:    
        mes "[ ^C6A518WoE Points Staff^000000 ]";
        mes "Thats good to hear!";
        close2;
        cutin "",255;
        end;
	break;
    }

OnInit:
    // how much points gained per emp break?
    $@empbreakpoints = 1; 

    query_sql("CREATE TABLE IF NOT EXISTS `breaker_ladder` (`char_id` int(11) unsigned NOT NULL, `count` int(11) NOT NULL DEFAULT '0', PRIMARY KEY ( `char_id` )) ENGINE=InnoDB");
}

-    pointshop    EmpBreakerShop    -1,#EMPBREAKERPTS,12202:1,12203:1,12207:1,12206:1,12205:1,12204:1,13517:1,14004:2

guildhall    mapflag    loadevent


Thus always break; a statement on switch case because it will continues until end of function.

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...