Hi guys so i have the below script and i want to add a 3min grace period time or leeway time so that a player can do character select without resetting the hourly counter.
- script hourlypoints3 -1,{
OnPointGet:
//Check for idle.
while(checkvending() >= 1) {
if( .@mes$ == "" ) {
dispbottom set( .@mes$, "The hourly points event stopped because you were vending, chatting, or idle!" );
set @hourly_points_timer, 0;
}
sleep2 .delay;
}
@consecutive_timer++;
.@time_string$ = Time2Str( @consecutive_timer * ( .timer / 1000 ) );
dispbottom "You received "+.points+" Free Point(s) by staying ingame for 1 hour.";
#HourlyRewards = #HourlyRewards + .points;
dispbottom "Current Balance = "+#HourlyRewards+" Free Point(s)";
@consecutive_bonus++;
//Check for consecutive timer.
if(@consecutive_bonus == .cdelay) {
@consecutive_bonus = 0;
#HourlyRewards = #HourlyRewards + .cpoints;
dispbottom "You receive a bonus "+.cpoints+" Free Point(s) by playing for minimum 3 hours consecutively!!!";
dispbottom "Current Balance = "+#HourlyRewards+" Free Point(s)";
}
OnPCLoginEvent:
addtimer .timer,"hourlypoints3::OnPointGet";
@hourly_points_timer = gettimetick(2) + ( .timer / 1000 );
end;
OnCheck:
message strcharinfo(0),@hourly_points_timer ? Time2Str( @hourly_points_timer )+" Remaining.":"Something went wrong relog!";
end;
OnInit:
bindatcmd "check","hourlypoints3::OnCheck"; //@check to view time till next point.
.timer = 1000*60*60; //Timer in milliseconds. ( Default: 1000*60*60 [ = 1 Hour ] )
.cdelay = 3; //Delay before receiving the consecutive bonus. ( Default: 3 [ { ~ 3 Hours } *Using default timer ] )
.cpoints = 10; //Points gained for consecutive time online. ( Default: 10 )
.points = 1; //Normal points gained. ( Default: 1 )
}
Question
erick26
Hi guys so i have the below script and i want to add a 3min grace period time or leeway time so that a player can do character select without resetting the hourly counter.
- script hourlypoints3 -1,{ OnPointGet: //Check for idle. while(checkvending() >= 1) { if( .@mes$ == "" ) { dispbottom set( .@mes$, "The hourly points event stopped because you were vending, chatting, or idle!" ); set @hourly_points_timer, 0; } sleep2 .delay; } @consecutive_timer++; .@time_string$ = Time2Str( @consecutive_timer * ( .timer / 1000 ) ); dispbottom "You received "+.points+" Free Point(s) by staying ingame for 1 hour."; #HourlyRewards = #HourlyRewards + .points; dispbottom "Current Balance = "+#HourlyRewards+" Free Point(s)"; @consecutive_bonus++; //Check for consecutive timer. if(@consecutive_bonus == .cdelay) { @consecutive_bonus = 0; #HourlyRewards = #HourlyRewards + .cpoints; dispbottom "You receive a bonus "+.cpoints+" Free Point(s) by playing for minimum 3 hours consecutively!!!"; dispbottom "Current Balance = "+#HourlyRewards+" Free Point(s)"; } OnPCLoginEvent: addtimer .timer,"hourlypoints3::OnPointGet"; @hourly_points_timer = gettimetick(2) + ( .timer / 1000 ); end; OnCheck: message strcharinfo(0),@hourly_points_timer ? Time2Str( @hourly_points_timer )+" Remaining.":"Something went wrong relog!"; end; OnInit: bindatcmd "check","hourlypoints3::OnCheck"; //@check to view time till next point. .timer = 1000*60*60; //Timer in milliseconds. ( Default: 1000*60*60 [ = 1 Hour ] ) .cdelay = 3; //Delay before receiving the consecutive bonus. ( Default: 3 [ { ~ 3 Hours } *Using default timer ] ) .cpoints = 10; //Points gained for consecutive time online. ( Default: 10 ) .points = 1; //Normal points gained. ( Default: 1 ) }
code
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.