Jump to content

Question

Posted

Hi guys.

Im using this script (Credits to Anakid)

-	script	hourlygift	-1,{
OnPCLoginEvent:
set .Hour,1;
if( #dailytimer < gettimetick(2) ) {
mes "You have Gained a Hourly Gift.";
set #dailytimer,gettimetick(2) + ( .Hour * 3600 );
getitem 6101,1; //set the price here
}else{
set .@last,#dailytimer - gettimetick(2);
set .@hour, .@last % ( 24 * 3600 ) / 3600;
set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
mes "You have to wait to get your next Hourly Gift.";
mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
}
close;
}

Everything was perfect but the thing is. When a player first  logged in. They already received the item.

Can it be done like this?

After a player logged in they have to wait for 1 hour in order for them to get the gift item.

 

Because of the previous case. A player can abuse and switch on other account. Hope you understand what im saying guys. And Thanks in advance for those who will help.

 

Thanks RATHENA.

4 answers to this question

Recommended Posts

  • 0
Posted


- script hourlygift -1,{

OnPCLoginEvent:

addtimer 3600000, strnpcinfo(3)+"::OnEvent";

end;

OnEvent:

set .Hour,1;

if( #dailytimer < gettimetick(2) ) {

mes "You have Gained a Hourly Gift.";

set #dailytimer,gettimetick(2) + ( .Hour * 3600 );

getitem 6101,1; //set the price here

}else{

set .@last,#dailytimer - gettimetick(2);

set .@hour, .@last % ( 24 * 3600 ) / 3600;

set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;

set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;

mes "You have to wait to get your next Hourly Gift.";

mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";

}

close;

}

  • 0
Posted
-	script	hourlygift	-1,{
OnPCLoginEvent:
	addtimer 3600000, strnpcinfo(3)+"::OnEvent";
	end;

OnEvent:
	set .Hour,1;
	if( #dailytimer < gettimetick(2) ) {
		mes "You have Gained a Hourly Gift.";
		set #dailytimer,gettimetick(2) + ( .Hour * 3600 );
		getitem 6101,1; //set the price here
	}else{
		set .@last,#dailytimer - gettimetick(2);
		set .@hour, .@last % ( 24 * 3600 ) / 3600;
		set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
		set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
		mes "You have to wait to get your next Hourly Gift.";
		mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
	}
	close;
}

 

 

 

A addtimer should do it

OnPCLoginEvent:
	addtimer 3600000, strnpcinfo(3)+"::OnEvent";
	end;
OnEvent:
	// your script

Thanks for the help guys.. Perfect! /no1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...