- script hourlypoints -1,{OnPCLoginEvent: if(#limit == 1) { dispbottom "You have already reached the maximum points per day."; dispbottom "Wait until the next day for the timer to start."; } else { dispbottom "Hourly Points has been initiated in this account.";} set #Clock,#minute; set .@i, (gettime(7) * 365 * 24) + (gettime(8) * 24) + gettime(3);// this will set time of origional loging if(.@i >= (#LastClock + .ResetHours)){ set #LastClock,.@i; set #Clock,0; } else { set #minute,#Clock; } attachnpctimer(); startnpctimer(); end;OnTimer60000: if(#limit == 1) { stopnpctimer(); } else { setarray .@h_maps$[0],"vend_zone","vip_lounge"; for (set .@a, 0; .@a < getarraysize(.@h_maps$); set .@a, .@a + 1) { if(strcharinfo(3) == .@h_maps$[.@a]) { dispbottom "Hourly points is restricted in this map."; dispbottom "Please change map and relog if you wish to continue Hourly points."; stopnpctimer(); end; } } set #minute, #minute + 1; if(#minute == 60){ set .point_amt, 1; set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt; dispbottom "You received "+.point_amt+" Free Donation points for staying in-game for 1 hour"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Free Donation Points"; } if(#minute == 120){ set .point_amt, 2; set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt; dispbottom "You received "+.point_amt+" Free Donation points for staying in-game for 2 hours"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Free Donation Points"; } if(#minute == 240){ set .point_amt, 4; set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt; dispbottom "You received "+.point_amt+" Free Donation points for staying in-game for 4 hours"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Free Donation Points"; } if(#minute == 480){ set #minute,0; set #limit,1; set .point_amt, 13; set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt; dispbottom "You received "+.point_amt+" Free Donation points for staying in-game for 8 hours"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Free Donation Points"; sleep2 2000; dispbottom "You have already reached the maximum points per day."; dispbottom "Wait until 12:01 for the timer to start."; } stopnpctimer(); initnpctimer(); } end;OnInit: set .ResetHours,24; OnClock0001: set #minute,0; set #limit,0; sleep2 1000; stopnpctimer(); initnpctimer(); dispbottom "Timer has been restarted."; end;}
So here is my hourly script. Based on multiple hourly points i have seen, however, i have this problem. I want to reset #minute and #limit to 0 when the server ticks to the next day. This script does that but only if the player is online. if he/she is not online, it wont be reset-ed.
So here is my hourly script. Based on multiple hourly points i have seen, however, i have this problem. I want to reset #minute and #limit to 0 when the server ticks to the next day. This script does that but only if the player is online. if he/she is not online, it wont be reset-ed.
Share this post
Link to post
Share on other sites