Jump to content
  • 0
Sign in to follow this  
DearDrew

[Check Same IP] and [TIMER] NPC Help.

Question

prontera,148,178,5 script BlessingAngel 501,{
SC_START SC_BLESSING,240000,10;
SC_START SC_INCREASEAGI,240000,10;
sc_start SC_ASSUMPTIO,240000,5;
sc_start SC_MAGNIFICAT,240000,10;
percentheal 100,100;
end;

OnInit:
waitingroom "-Blessing Angel-",0;


end;
}

I would like to set a timer to this script that the user can only use this funtion every 10min. the npc will also tell you the time remaining of next use.  How should i add to that?

 

function	script	dayitem	{
	
//=======================//
	setarray .@item[1],668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668,668;

//=============//
	setarray .@num[1],1,2,3,4,5,6,7,8,9,10,10,10,10,10,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15;
	
//===================//
	setarray .@add,5,10,15,20,25;

//==============================//
	setarray .@aitem[0],21600,21600,21600,21600,21600;

//===========//
	setarray .@anum[0],1,1,1,1,1;
	
//================================================//

for ( set .@i,0; .@i<getarraysize(.@add); set .@i,.@i+1 )
{
	if ( getArg(0) == .@add[.@i] )
	{
		set .@j,1;
		getitem .@aitem[.@i],.@anum[.@i];
		break;
	}
}	
	set .@dayn,gettime(5);
	getitem .@item[.@dayn],.@num[.@dayn];
	announce "============================================",bc_self,0xCD1039;
	announce "==                                        ",bc_self,0xFF7F50;
	announce "==       You have Logged in [ "+getarg(0)+" ] days",bc_self,0xFFDC3C;
	announce "==                                        ",bc_self,0x80E12A;
	announce "==         The Price for Today is.. !!!         ",bc_self,0x00BFFF;
	announce "==                                        ",bc_self,0x7B68EE;
	if ( .@j ) { announce "==    "+.@num[.@dayn]+"  [ "+getitemname(.@item[.@dayn])+" ] and extra "+.@anum[.@i]+"  [ "+getitemname(.@aitem[.@i])+" ] 	",bc_self,0x00000; }
	else { announce "==          "+.@num[.@dayn]+"  [ "+getitemname(.@item[.@dayn])+" ]  	",bc_self,0x00000; }
	announce "==                                        ",bc_self,0x9932CC;
	announce "==  The price can be different every day!>.0  ",bc_self,0xF08080;
	announce "==                                        ",bc_self,0x00E1F0;
	announce "============================================",bc_self,0x783C3C;
	end;
}

-	script	daylogin	-1,{
		
OnPCLoginEvent:

	if( gettime(7)%4==0 ) set .@pr,1;
	if ( #daytime >= 366+.@pr )  set #daytime,1; 
if ( #daytime )
	{
		if ( #daytime == gettime(8) )
		{
			set #daytime,gettime(8)+1;
			set #daylogin,#daylogin+1;
			callfunc "dayitem",#daylogin;
			end;
		}
		if ( #daytime < gettime(8) && #daytime != 1 )
		{
			set #daytime,gettime(8)+1;
			set #daylogin,1;
			callfunc "dayitem",1;
			end;
		}
		end;
	}
		set #daytime,gettime(8)+1;
		set #daylogin,1;
		callfunc "dayitem",1;
		end;
}	

This is a daily reward system, but H\how do i add a IP check to this script, so only 1 acct from same ip can get the price? 

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.