Jump to content
  • 0

Question

11 answers to this question

Recommended Posts

  • 0
Posted

Gettimetick(2) is the number of seconds since the unix epoch (Jan 1st 1970). When you log out, "set LogOutTick, gettimetick(2)". For example, let's say 1000000.

When you log in, "set LogInTick, gettimetick(2)". For example, let's say 1100000.

So "LogInTick - LogOutTick" is 1100000 - 1000000 = 100000. The player has been offline for 100000 seconds.

  • 0
Posted

how would the calculation be? The description says it counts the second since start of current day. However, what if, for instance the player played at 01:00 server time, and then log back in the next day at 12:00, would it not result in a negative number?

  • 0
Posted

I see now, thanks.

Now, for instance, limit is 24 hours, then I should do this?

OnPCLogoutEvent:
	
	set checkday,gettimetick(1);
	
	end;
	
OnPCLoginEvent:

	if(gettimetick(1) >= checkday)
		dispbottom "You have been away for more than 1 day";
		
	end;
  • 0
Posted

How about this?

OnPCLogoutEvent:
	
	set checkday,gettimetick(2) + 84600; //logout time + 24 hours
	
	end;
	
OnPCLoginEvent:

	if(gettimetick(2) >= checkday)
		dispbottom "You have been away for more than 1 day";
		
	end;

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