Jump to content
  • 0

gold room with timer


Question

Posted (edited)

Hi there i'm using offline server but how to fix gold room with timer, 12 hours cool down is 43200 seconds  but appears in ingame is 2681696506 seconds then I waited for 12 hours, when I logged in the game I could not enter the gold room because I had to wait after the time. sorry for my bad english,

 

        if (gettimetick(0) < #GOLDROOM_CD) {
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "You can only re-enter after ^FF0000"+(#GOLDROOM_CD - gettimetick(0))+"^000000 seconds.";
            close2;
            cutin "",255;
            end;
        }
        else if (Zeny < .zeny) {
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "Sorry, but you can't enter the room.";
            close2;
            cutin "",255;
            end;
        }
        else {
            #GOLDROOM_CD = gettimetick(0) + (12 * 60 * 60); // 12 hours cooldown.
            deltimer strnpcinfo(3)+"::OnKick";
            addtimer (300 * 60 * 1000), strnpcinfo(3)+"::OnKick";
        }
        Zeny -= .zeny;
        warp "ordeal_1-2",151,154;
        end;

gr.png

Edited by Chasewalk

10 answers to this question

Recommended Posts

  • 0
Posted (edited)

You can try this.
 

   
	set .@time,gettimetick(1);
	if( .@time < #GOLDROOM_CD ){
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "You can only re-enter after ^FF0000"+(#GOLDROOM_CD - gettimetick(0))+"^000000 seconds.";
            mes "Time Gold Room : "+#GOLDROOM_CD;
            close2;
            cutin "",255;
            end;
        }
        else if (Zeny < .zeny) {
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "Sorry, but you can't enter the room.";
            close2;
            cutin "",255;
            end;
        }
        else {
            set #GOLDROOM_CD,( .@time + ( 3600 * 12 ) ); // 12 hours cooldown.
            deltimer strnpcinfo(3)+"::OnKick";
            addtimer (300 * 60 * 1000), strnpcinfo(3)+"::OnKick";
        }
        Zeny -= .zeny;
        warp "ordeal_1-2",151,154;
        end;

 

Edited by Cookie-rae
update
  • 0
Posted (edited)

Hi thanks bro but got error

 

[Error]:  Loading NPC file: npc/custom/goldroom.txt
script error on npc/custom/goldroom.txt line 93
    parse_line: expect command, missing function name or calling undeclared function
    88 :                        close2;
    89 :                        cutin "",255;
    90 :                        end;
    91 :                }
    92 :                else {
*   93 :                        '#'GOLDROOM_CD,( .@time + ( 3600 * 12 ) ); // 12 hours cooldown.
    94 :                        deltimer strnpcinfo(3)+"::OnKick";
    95 :                        addtimer (300 * 60 * 1000), strnpcinfo(3)+"::OnKick";
    96 :                }
    97 :                Zeny -= .zeny;
    98 :                warp "ordeal_1-2",151,154;

Edited by Chasewalk
  • 0
Posted (edited)

You can try this 

set .@time,gettimetick(1);
		if( .@time1 < #GOLDROOM_CD1 ){
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "You can only re-enter after ^FF0000"+#GOLDROOM_CD1+"^000000 seconds.";
            mes "Time Gold Room : "+#GOLDROOM_CD1;
            close;
            cutin "",255;
            end;
        }
		 else if (Zeny < .zeny) {
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "Sorry, but you can't enter the room.";
            close2;
            cutin "",255;
            end;
        }
        else {
            set #GOLDROOM_CD1,( .@time1 + ( 3600 * 12 ) ); // 12 hours cooldown.
            deltimer strnpcinfo(3)+"::OnKick";
        }
		Zeny -= .zeny;
        warp "ordeal_1-2",151,154;
        end;

Screen Shot

image.png.dc89142026f3a3b03143af3e2774dc35.png

 

On 1/19/2021 at 8:29 PM, Chasewalk said:

same bro not to change time.

 

 

Edited by Cookie-rae
  • 0
Posted
On 1/19/2021 at 7:34 PM, Cookie-rae said:

You can try this.
 


   
	set .@time,gettimetick(1);
	if( .@time < #GOLDROOM_CD ){
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "You can only re-enter after ^FF0000"+(#GOLDROOM_CD - gettimetick(0))+"^000000 seconds.";
            mes "Time Gold Room : "+#GOLDROOM_CD;
            close2;
            cutin "",255;
            end;
        }
        else if (Zeny < .zeny) {
            mes "[ ^C6A518Gold Room Assistant^000000 ]";
            mes "Sorry, but you can't enter the room.";
            close2;
            cutin "",255;
            end;
        }
        else {
            set #GOLDROOM_CD,( .@time + ( 3600 * 12 ) ); // 12 hours cooldown.
            deltimer strnpcinfo(3)+"::OnKick";
            addtimer (300 * 60 * 1000), strnpcinfo(3)+"::OnKick";
        }
        Zeny -= .zeny;
        warp "ordeal_1-2",151,154;
        end;

 

when you die or re enter the goldroom the cooldown will start right away

  • 0
Posted
On 1/19/2021 at 4:37 PM, Chasewalk said:

        if (gettimetick(0) < #GOLDROOM_CD) {

 

10 minutes ago, kalabasa said:

when you die or re enter the goldroom the cooldown will start right away

It is not my code it was from chasewalk. maybe the set value is keeping him reset.

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...