Jump to content
  • 0

Hourly Gift


rayleigh

Question


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

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.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   616
  • Joined:  07/05/12
  • Last Seen:  

A addtimer should do it

OnPCLoginEvent:
	addtimer 3600000, strnpcinfo(3)+"::OnEvent";
	end;
OnEvent:
	// your script
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

 

A addtimer should do it

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

Where will I going to put that sir?

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  588
  • Reputation:   437
  • Joined:  01/26/16
  • Last Seen:  


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

}

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  220
  • Reputation:   0
  • Joined:  09/05/13
  • Last Seen:  

-	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

Link to comment
Share on other sites

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