Jump to content
  • 0

Help with my script. (Hourly points)


Mabuhay

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   230
  • Joined:  03/20/12
  • Last Seen:  

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

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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