Jump to content
  • 0

gold room timer script help after @reloadscript


AinsLord

Question


  • Group:  Members
  • Topic Count:  257
  • Topics Per Day:  0.08
  • Content Count:  737
  • Reputation:   18
  • Joined:  11/21/15
  • Last Seen:  

byako,157,144,5	script	Gold Room	757,{
if ( getmapusers( .map$ ) >= 30 )

dispbottom "You cant go in right now. There are already 30 peoples inside.";

else {

announce "["+ strcharinfo(0) +"] entered Gold Room. "+( 30 - getmapusers( .map$ ) - 1 )+" place left.", bc_all;

warp .map$, 0,0;

}

end;

OnWhisperGlobal:

OnClock0800:
OnClock1100:
OnClock1400:
OnClock1700:
OnClock2000:

announce "Gold Room : It is now open for 30, Only 30 players are allowed to join !", bc_all;
//sleep 60 * 1000; // 1 min
announce "Gold Room : It is now open for 30 minutes, Only 30 players are allowed to join !", bc_all;
hideoffnpc strnpcinfo(0);
.@timeover = gettimetick(2) + 30 * 60; // 59 mins

while ( .@timeover >= gettimetick(2) ) {

delwaitingroom;

.@left = .@timeover - gettimetick(2);

.@min = .@left / 60;

.@sec = .@left % 60;

waitingroom "Countdown "+ .@min +":"+( ( .@sec < 10 )? "0"+ .@sec : .@sec ), 0;

sleep 500;

}

delwaitingroom;

mapannounce .map$, "Time's Up !! You will be warped out right now..", bc_all;

mapwarp .map$, "byako",149,138;

hideonnpc strnpcinfo(0);

announce "Gold Room is now closed !", bc_all;

end;

OnMobKill:

.@r = rand(100);

if ( .@r < 5 )

getitem 969,20;

else if ( .@r < 25 )

getitem 969,5;

else if ( .@r < 50 )

getitem 969,3;

else

getitem 969,1;

monster .map$, 0,0, "Gold", 1369,1, strnpcinfo(0)+"::OnMobKill";

end;

OnInit:

.map$ = "goldroom";

hideonnpc strnpcinfo(0);

monster .map$, 0,0, "Gold", 1369,600, strnpcinfo(0)+"::OnMobKill";

end;

}
//ordeal_1-2.gat	mapflag	noskill
goldroom.gat	mapflag	nomemo
goldroom.gat	mapflag	nobranch
goldroom.gat	mapflag	noloot
goldroom.gat	mapflag	noexp
goldroom.gat	mapflag	nodrop
goldroom.gat	mapflag	novending
goldroom.gat	mapflag	nowarp
goldroom.gat	mapflag	nowarpto
goldroom.gat	mapflag	noreturn
goldroom.gat	mapflag	nosave

so here is the script i found here

example the gold room is now open

then when i do @reloadscript the NPC

will reset its timer and wait for 2hrs again to open

how can i prevent it like when i do @reloadscript

the gold room is still open and continues to countdown to 30mins

 

thanks in advance

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1571
  • Reputation:   243
  • Joined:  08/03/12
  • Last Seen:  

15 hours ago, AinsLord said:
byako,157,144,5	script	Gold Room	757,{
if ( getmapusers( .map$ ) >= 30 )

dispbottom "You cant go in right now. There are already 30 peoples inside.";

else {

announce "["+ strcharinfo(0) +"] entered Gold Room. "+( 30 - getmapusers( .map$ ) - 1 )+" place left.", bc_all;

warp .map$, 0,0;

}

end;

OnWhisperGlobal:

OnClock0800:
OnClock1100:
OnClock1400:
OnClock1700:
OnClock2000:

announce "Gold Room : It is now open for 30, Only 30 players are allowed to join !", bc_all;
//sleep 60 * 1000; // 1 min
announce "Gold Room : It is now open for 30 minutes, Only 30 players are allowed to join !", bc_all;
hideoffnpc strnpcinfo(0);
.@timeover = gettimetick(2) + 30 * 60; // 59 mins

while ( .@timeover >= gettimetick(2) ) {

delwaitingroom;

.@left = .@timeover - gettimetick(2);

.@min = .@left / 60;

.@sec = .@left % 60;

waitingroom "Countdown "+ .@min +":"+( ( .@sec < 10 )? "0"+ .@sec : .@sec ), 0;

sleep 500;

}

delwaitingroom;

mapannounce .map$, "Time's Up !! You will be warped out right now..", bc_all;

mapwarp .map$, "byako",149,138;

hideonnpc strnpcinfo(0);

announce "Gold Room is now closed !", bc_all;

end;

OnMobKill:

.@r = rand(100);

if ( .@r < 5 )

getitem 969,20;

else if ( .@r < 25 )

getitem 969,5;

else if ( .@r < 50 )

getitem 969,3;

else

getitem 969,1;

monster .map$, 0,0, "Gold", 1369,1, strnpcinfo(0)+"::OnMobKill";

end;

OnInit:

.map$ = "goldroom";

hideonnpc strnpcinfo(0);

monster .map$, 0,0, "Gold", 1369,600, strnpcinfo(0)+"::OnMobKill";

end;

}
//ordeal_1-2.gat	mapflag	noskill
goldroom.gat	mapflag	nomemo
goldroom.gat	mapflag	nobranch
goldroom.gat	mapflag	noloot
goldroom.gat	mapflag	noexp
goldroom.gat	mapflag	nodrop
goldroom.gat	mapflag	novending
goldroom.gat	mapflag	nowarp
goldroom.gat	mapflag	nowarpto
goldroom.gat	mapflag	noreturn
goldroom.gat	mapflag	nosave

so here is the script i found here

example the gold room is now open

then when i do @reloadscript the NPC

will reset its timer and wait for 2hrs again to open

how can i prevent it like when i do @reloadscript

the gold room is still open and continues to countdown to 30mins

 

thanks in advance

why do u need to use reloadscript ? For reloading what ?

Link to comment
Share on other sites

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.

×
×
  • Create New...