Jump to content
  • 0
Sign in to follow this  
glemor123

Daily Reward Problem

Question

//======Name========================================// Daily Login Rewards//======Version=====================================// 1.1// Author: Sandbox, Winterfox//======Comments====================================// Updated outdated Syntax-// Made slight optimizations.// Added a delay of 2 hours before the player is// able to claim his reward and only if he has// not been idle longer than 5 minutes in this// time frame.//==================================================-	script	DailyLoginRewards	-1,{	OnInit:		//Set to your server name		.Serv_Name$ = "Republic";		 //Set to desired item prizes		setarray( .D_Prize, 11501, 11502, 14533, 12210, 7539 );				 //Amount of prize to be given		setarray( .D_Amt, 400, 400, 4, 3, 2 );	end;	OnPCLoginEvent:		if( gettimetick( 2 ) < #ClaimDelay ) {			dispbottom( "Daily Login Activated. You allready got your daily login reward. " );			end;		}		// Show notice about the Daily Login Rewards		dispbottom( "Daily Login Activated. Please be Online for 2 hours without being idle for more than 5 minutes to receive daily login reward. " );		// Start a timer after 1 minute to sum up idle time		addtimer( 60000, strnpcinfo(3 ) + "::OnIdleCheck" );		// Start a timer to clam the daily reward after 2 hours		addtimer( 7200000, strnpcinfo(3) + "::OnStartClaim" );	end;	OnIdleCheck:		// Add the current idle time to the idle time counter.		#overallIdleTime += checkidle();		// Set a new timer to recheck after 1 minute.		addtimer( 60000,  strnpcinfo( 3 ) + "::OnIdleCheck" );	end;	OnStartClaim:		// If the idle time was 5 minutes or more in the last 2 hours reset to check if the person is the next 2 hours less idle than 5 minutes.		if( #overallIdleTime >= 300 ) {			#overallIdleTime = 0;			// Start a timer to clam the daily reward after 2 hours			addtimer( 7200000, strnpcinfo(3) + "::OnStartClaim" );			dispbottom( "You were afk for 5 minutes therefore you have to wait 2 hours again without ideling for more than 5 minutes to get your prize." );			end;		}		deltimer( strnpcinfo(3 ) + "::OnIdleCheck" );		// If the streak was broken reset the streak count.		if( gettimetick( 2 ) > #StreakDelay )  #LogStreak = 0;		// If the rewards reached their end, reset them.		if( #RewardStreak > getarraysize( .D_Prize ) ) #RewardStreak = 0;		if( #RewardStreak == 0 )			dispbottom( "Welcome to " + .Serv_Name$ + "! You've received " + .D_Amt[ #RewardStreak ] + " " + getitemname( .D_Prize[ #RewardStreak ] )+" for logging in! Visit us daily to get more prize! When you've managed to play with us for 5 consecutive days, you will receive bonus prizes!" );		if( #RewardStreak > 0 )			dispbottom( "Welcome back to " + .Serv_Name$ + "! You've received " + .D_Amt[ #RewardStreak ] + " " + getitemname( .D_Prize[ #RewardStreak ] ) + " for logging in! Visit us daily to get more prize! When you've managed to play with us for 5 consecutive days, you will receive bonus prizes!" );		getitem( .D_Prize[ #RewardStreak ], .D_Amt[ #RewardStreak ]);				#RewardStreak += 1;		#LogStreak += 1;		#ClaimDelay = gettimetick( 2 ) + 86400;		#StreakDelay = gettimetick( 2 ) + 172800;		if( #LogStreak == 5 ) {			for( .@i = 0; .@i < getarraysize( .D_Prize ); set .@i, .@i++ )				getitem( .D_Prize[.@i], .D_Amt[.@i] );			dispbottom( "Congratulations! You've received all the daily rewards for logging in 5 consecutive days!" );			#LogStreak = 0;		}	end;	OnPCLogoutEvent:		// Reset idle time on logout.		#overallIdleTime = 0;	end;}

Hi, I've been trying the with my co-players the script didn't work. It doesn't give the daily reward. eventhough we've been playing for 2 hours without Idle time

 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

 

//======Name========================================// Daily Login Rewards//======Version=====================================// 1.1// Author: Sandbox, Winterfox//======Comments====================================// Updated outdated Syntax-// Made slight optimizations.// Added a delay of 2 hours before the player is// able to claim his reward and only if he has// not been idle longer than 5 minutes in this// time frame.//==================================================-	script	DailyLoginRewards	-1,{	OnInit:		//Set to your server name		.Serv_Name$ = "Republic";		 //Set to desired item prizes		setarray( .D_Prize, 11501, 11502, 14533, 12210, 7539 );				 //Amount of prize to be given		setarray( .D_Amt, 400, 400, 4, 3, 2 );	end;	OnPCLoginEvent:		if( gettimetick( 2 ) < #ClaimDelay ) {			dispbottom( "Daily Login Activated. You allready got your daily login reward. " );			end;		}		// Show notice about the Daily Login Rewards		dispbottom( "Daily Login Activated. Please be Online for 2 hours without being idle for more than 5 minutes to receive daily login reward. " );		// Start a timer after 1 minute to sum up idle time		addtimer( 60000, strnpcinfo(3 ) + "::OnIdleCheck" );		// Start a timer to clam the daily reward after 2 hours		addtimer( 7200000, strnpcinfo(3) + "::OnStartClaim" );	end;	OnIdleCheck:		// Add the current idle time to the idle time counter.		#overallIdleTime += checkidle();		// Set a new timer to recheck after 1 minute.		addtimer( 60000,  strnpcinfo( 3 ) + "::OnIdleCheck" );	end;	OnStartClaim:		// If the idle time was 5 minutes or more in the last 2 hours reset to check if the person is the next 2 hours less idle than 5 minutes.		if( #overallIdleTime >= 300 ) {			#overallIdleTime = 0;			// Start a timer to clam the daily reward after 2 hours			addtimer( 7200000, strnpcinfo(3) + "::OnStartClaim" );			dispbottom( "You were afk for 5 minutes therefore you have to wait 2 hours again without ideling for more than 5 minutes to get your prize." );			end;		}		deltimer( strnpcinfo(3 ) + "::OnIdleCheck" );		// If the streak was broken reset the streak count.		if( gettimetick( 2 ) > #StreakDelay )  #LogStreak = 0;		// If the rewards reached their end, reset them.		if( #RewardStreak > getarraysize( .D_Prize ) ) #RewardStreak = 0;		if( #RewardStreak == 0 )			dispbottom( "Welcome to " + .Serv_Name$ + "! You've received " + .D_Amt[ #RewardStreak ] + " " + getitemname( .D_Prize[ #RewardStreak ] )+" for logging in! Visit us daily to get more prize! When you've managed to play with us for 5 consecutive days, you will receive bonus prizes!" );		if( #RewardStreak > 0 )			dispbottom( "Welcome back to " + .Serv_Name$ + "! You've received " + .D_Amt[ #RewardStreak ] + " " + getitemname( .D_Prize[ #RewardStreak ] ) + " for logging in! Visit us daily to get more prize! When you've managed to play with us for 5 consecutive days, you will receive bonus prizes!" );		getitem( .D_Prize[ #RewardStreak ], .D_Amt[ #RewardStreak ]);				#RewardStreak += 1;		#LogStreak += 1;		#ClaimDelay = gettimetick( 2 ) + 86400;		#StreakDelay = gettimetick( 2 ) + 172800;		if( #LogStreak == 5 ) {			for( .@i = 0; .@i < getarraysize( .D_Prize ); set .@i, .@i++ )				getitem( .D_Prize[.@i], .D_Amt[.@i] );			dispbottom( "Congratulations! You've received all the daily rewards for logging in 5 consecutive days!" );			#LogStreak = 0;		}	end;	OnPCLogoutEvent:		// Reset idle time on logout.		#overallIdleTime = 0;	end;}

Hi, I've been trying the with my co-players the script didn't work. It doesn't give the daily reward. eventhough we've been playing for 2 hours without Idle time

What's not working? Any errors map-server?

Share this post


Link to post
Share on other sites
  • 0

 

 

//======Name========================================// Daily Login Rewards//======Version=====================================// 1.1// Author: Sandbox, Winterfox//======Comments====================================// Updated outdated Syntax-// Made slight optimizations.// Added a delay of 2 hours before the player is// able to claim his reward and only if he has// not been idle longer than 5 minutes in this// time frame.//==================================================-	script	DailyLoginRewards	-1,{	OnInit:		//Set to your server name		.Serv_Name$ = "Republic";		 //Set to desired item prizes		setarray( .D_Prize, 11501, 11502, 14533, 12210, 7539 );				 //Amount of prize to be given		setarray( .D_Amt, 400, 400, 4, 3, 2 );	end;	OnPCLoginEvent:		if( gettimetick( 2 ) < #ClaimDelay ) {			dispbottom( "Daily Login Activated. You allready got your daily login reward. " );			end;		}		// Show notice about the Daily Login Rewards		dispbottom( "Daily Login Activated. Please be Online for 2 hours without being idle for more than 5 minutes to receive daily login reward. " );		// Start a timer after 1 minute to sum up idle time		addtimer( 60000, strnpcinfo(3 ) + "::OnIdleCheck" );		// Start a timer to clam the daily reward after 2 hours		addtimer( 7200000, strnpcinfo(3) + "::OnStartClaim" );	end;	OnIdleCheck:		// Add the current idle time to the idle time counter.		#overallIdleTime += checkidle();		// Set a new timer to recheck after 1 minute.		addtimer( 60000,  strnpcinfo( 3 ) + "::OnIdleCheck" );	end;	OnStartClaim:		// If the idle time was 5 minutes or more in the last 2 hours reset to check if the person is the next 2 hours less idle than 5 minutes.		if( #overallIdleTime >= 300 ) {			#overallIdleTime = 0;			// Start a timer to clam the daily reward after 2 hours			addtimer( 7200000, strnpcinfo(3) + "::OnStartClaim" );			dispbottom( "You were afk for 5 minutes therefore you have to wait 2 hours again without ideling for more than 5 minutes to get your prize." );			end;		}		deltimer( strnpcinfo(3 ) + "::OnIdleCheck" );		// If the streak was broken reset the streak count.		if( gettimetick( 2 ) > #StreakDelay )  #LogStreak = 0;		// If the rewards reached their end, reset them.		if( #RewardStreak > getarraysize( .D_Prize ) ) #RewardStreak = 0;		if( #RewardStreak == 0 )			dispbottom( "Welcome to " + .Serv_Name$ + "! You've received " + .D_Amt[ #RewardStreak ] + " " + getitemname( .D_Prize[ #RewardStreak ] )+" for logging in! Visit us daily to get more prize! When you've managed to play with us for 5 consecutive days, you will receive bonus prizes!" );		if( #RewardStreak > 0 )			dispbottom( "Welcome back to " + .Serv_Name$ + "! You've received " + .D_Amt[ #RewardStreak ] + " " + getitemname( .D_Prize[ #RewardStreak ] ) + " for logging in! Visit us daily to get more prize! When you've managed to play with us for 5 consecutive days, you will receive bonus prizes!" );		getitem( .D_Prize[ #RewardStreak ], .D_Amt[ #RewardStreak ]);				#RewardStreak += 1;		#LogStreak += 1;		#ClaimDelay = gettimetick( 2 ) + 86400;		#StreakDelay = gettimetick( 2 ) + 172800;		if( #LogStreak == 5 ) {			for( .@i = 0; .@i < getarraysize( .D_Prize ); set .@i, .@i++ )				getitem( .D_Prize[.@i], .D_Amt[.@i] );			dispbottom( "Congratulations! You've received all the daily rewards for logging in 5 consecutive days!" );			#LogStreak = 0;		}	end;	OnPCLogoutEvent:		// Reset idle time on logout.		#overallIdleTime = 0;	end;}

Hi, I've been trying the with my co-players the script didn't work. It doesn't give the daily reward. eventhough we've been playing for 2 hours without Idle time

What's not working? Any errors map-server?

There had been no errors in map-server

Share this post


Link to post
Share on other sites
  • 0

 

 

 

//======Name========================================// Daily Login Rewards//======Version=====================================// 1.1// Author: Sandbox, Winterfox//======Comments====================================// Updated outdated Syntax-// Made slight optimizations.// Added a delay of 2 hours before the player is// able to claim his reward and only if he has// not been idle longer than 5 minutes in this// time frame.//==================================================-	script	DailyLoginRewards	-1,{	OnInit:		//Set to your server name		.Serv_Name$ = "Republic";		 //Set to desired item prizes		setarray( .D_Prize, 11501, 11502, 14533, 12210, 7539 );				 //Amount of prize to be given		setarray( .D_Amt, 400, 400, 4, 3, 2 );	end;	OnPCLoginEvent:		if( gettimetick( 2 ) < #ClaimDelay ) {			dispbottom( "Daily Login Activated. You allready got your daily login reward. " );			end;		}		// Show notice about the Daily Login Rewards		dispbottom( "Daily Login Activated. Please be Online for 2 hours without being idle for more than 5 minutes to receive daily login reward. " );		// Start a timer after 1 minute to sum up idle time		addtimer( 60000, strnpcinfo(3 ) + "::OnIdleCheck" );		// Start a timer to clam the daily reward after 2 hours		addtimer( 7200000, strnpcinfo(3) + "::OnStartClaim" );	end;	OnIdleCheck:		// Add the current idle time to the idle time counter.		#overallIdleTime += checkidle();		// Set a new timer to recheck after 1 minute.		addtimer( 60000,  strnpcinfo( 3 ) + "::OnIdleCheck" );	end;	OnStartClaim:		// If the idle time was 5 minutes or more in the last 2 hours reset to check if the person is the next 2 hours less idle than 5 minutes.		if( #overallIdleTime >= 300 ) {			#overallIdleTime = 0;			// Start a timer to clam the daily reward after 2 hours			addtimer( 7200000, strnpcinfo(3) + "::OnStartClaim" );			dispbottom( "You were afk for 5 minutes therefore you have to wait 2 hours again without ideling for more than 5 minutes to get your prize." );			end;		}		deltimer( strnpcinfo(3 ) + "::OnIdleCheck" );		// If the streak was broken reset the streak count.		if( gettimetick( 2 ) > #StreakDelay )  #LogStreak = 0;		// If the rewards reached their end, reset them.		if( #RewardStreak > getarraysize( .D_Prize ) ) #RewardStreak = 0;		if( #RewardStreak == 0 )			dispbottom( "Welcome to " + .Serv_Name$ + "! You've received " + .D_Amt[ #RewardStreak ] + " " + getitemname( .D_Prize[ #RewardStreak ] )+" for logging in! Visit us daily to get more prize! When you've managed to play with us for 5 consecutive days, you will receive bonus prizes!" );		if( #RewardStreak > 0 )			dispbottom( "Welcome back to " + .Serv_Name$ + "! You've received " + .D_Amt[ #RewardStreak ] + " " + getitemname( .D_Prize[ #RewardStreak ] ) + " for logging in! Visit us daily to get more prize! When you've managed to play with us for 5 consecutive days, you will receive bonus prizes!" );		getitem( .D_Prize[ #RewardStreak ], .D_Amt[ #RewardStreak ]);				#RewardStreak += 1;		#LogStreak += 1;		#ClaimDelay = gettimetick( 2 ) + 86400;		#StreakDelay = gettimetick( 2 ) + 172800;		if( #LogStreak == 5 ) {			for( .@i = 0; .@i < getarraysize( .D_Prize ); set .@i, .@i++ )				getitem( .D_Prize[.@i], .D_Amt[.@i] );			dispbottom( "Congratulations! You've received all the daily rewards for logging in 5 consecutive days!" );			#LogStreak = 0;		}	end;	OnPCLogoutEvent:		// Reset idle time on logout.		#overallIdleTime = 0;	end;}

Hi, I've been trying the with my co-players the script didn't work. It doesn't give the daily reward. eventhough we've been playing for 2 hours without Idle time

What's not working? Any errors map-server?

There had been no errors in map-server

Can't check the script by myself for now, for now I don't see any errors in script, but you could ask the original creator @@Winterfox, or maybe wait for somebody else, sorry for that!

Share this post


Link to post
Share on other sites
  • 0

@@Oxxy he did but just said it doesn't work and if i can look at it. When i asked him, what didn't work he told me he would ask the community to debug it. 

But atleast here he said what the problem seems to be.

Edited by Winterfox

Share this post


Link to post
Share on other sites
  • 0

I got a problem. even though I'm not  Idle the message still pop up"You were afk for 5 minutes therefore you have to wait 2 hours again without ideling for more than 5 minutes to get your prize."

 

//======Name========================================// Daily Login Rewards//======Version=====================================// 1.1// Author: Sandbox, Winterfox//======Comments====================================// Updated outdated Syntax-// Made slight optimizations.// Added a delay of 3 hours before the player is// able to claim his reward and only if he has// not been idle longer than 5 minutes in this// time frame.//==================================================-	script	DailyLoginRewards	-1,{	OnInit:		//Set to your server name		.Serv_Name$ = "Republic";		 //Set to desired item prizes		setarray( .D_Prize, 11501, 11502, 14533, 12210, 7539 );				 //Amount of prize to be given		setarray( .D_Amt, 400, 400, 4, 3, 2 );	end;	OnPCLoginEvent:		if( gettimetick( 2 ) < #ClaimDelay ) {			dispbottom( "Daily Login Activated. You allready got your daily login reward. " );			end;		}		// Show notice about the Daily Login Rewards		dispbottom( "Daily Login Activated. Please be Online for 2 hours without being idle for more than 5 minutes to receive daily login reward. " );		// Start a timer after 1 minute to sum up idle time		addtimer( 60000, strnpcinfo(3 ) + "::OnIdleCheck" );		// Start a timer to clam the daily reward after 3 hours		addtimer( 7200000, strnpcinfo(3) + "::OnStartClaim" );	end;	OnIdleCheck:		// Add the current idle time to the idle time counter.		#overallIdleTime += checkidle();		// Set a new timer to recheck after 1 minute.		addtimer( 60000,  strnpcinfo( 3 ) + "::OnIdleCheck" );	end;	OnStartClaim:		// If the idle time was 5 minutes or more in the last 3 hours reset to check if the person is the next 3 hours less idle than 5 minutes.		if( #overallIdleTime >= 300 ) {			#overallIdleTime = 0;			// Start a timer to clam the daily reward after 2 hours			addtimer( 7200000, strnpcinfo(3) + "::OnStartClaim" );			dispbottom( "You were afk for 5 minutes therefore you have to wait 2 hours again without ideling for more than 5 minutes to get your prize." );			end;		}		deltimer( strnpcinfo(3 ) + "::OnIdleCheck" );		// If the streak was broken reset the streak count.		if( gettimetick( 2 ) > #StreakDelay )  #LogStreak = 0;		// If the rewards reached their end, reset them.		if( #RewardStreak > getarraysize( .D_Prize ) ) #RewardStreak = 0;		if( #RewardStreak == 0 )			dispbottom( "Welcome to " + .Serv_Name$ + "! You've received " + .D_Amt[ #RewardStreak ] + " " + getitemname( .D_Prize[ #RewardStreak ] )+" for logging in! Visit us daily to get more prize! When you've managed to play with us for 5 consecutive days, you will receive bonus prizes!" );announce "Announcement: " + strcharinfo(0) + " have received the daily reward",0;		if( #RewardStreak > 0 )			dispbottom( "Welcome back to " + .Serv_Name$ + "! You've received " + .D_Amt[ #RewardStreak ] + " " + getitemname( .D_Prize[ #RewardStreak ] ) + " for logging in! Visit us daily to get more prize! When you've managed to play with us for 5 consecutive days, you will receive bonus prizes!" );		getitem( .D_Prize[ #RewardStreak ], .D_Amt[ #RewardStreak ]);				#RewardStreak += 1;		#LogStreak += 1;		#ClaimDelay = gettimetick( 2 ) + 86400;		#StreakDelay = gettimetick( 2 ) + 172800;		if( #LogStreak == 5 ) {			for( .@i = 0; .@i < getarraysize( .D_Prize ); set .@i, .@i++ )				getitem( .D_Prize[.@i], .D_Amt[.@i] );			dispbottom( "Congratulations! You've received all the daily rewards for logging in 5 consecutive days!" );announce "Announcement:" + strcharinfo(0) + " have received all the daily rewards for logging in 5 consecutive days!",0;			#LogStreak = 0;		}	end;	OnPCLogoutEvent:		// Reset idle time on logout.		#overallIdleTime = 0;	end;}
Edited by glemor123

Share this post


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