Jump to content
  • 0

is this correct?


bearnope246

Question


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

if((gettimetick(2) - #login) - (gettimetick(2)- #logout) > 3600)

So time doesn't count when logout?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   46
  • Joined:  08/14/12
  • Last Seen:  

What does #login and #logout contain?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

gettimetick(2) from onlogin and onlogout event?

Iknow i messed up,

How to make a timer that only count when they are in game?

thanks

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2371
  • Joined:  10/28/11
  • Last Seen:  


OnPCLoginEvent:

@online_time = gettimetick(2);

end;

OnPCLogoutEvent:

#total_online_time += ( gettimetick(2) - @online_time );

end;

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

OnPCLoginEvent:
	@online_time = gettimetick(2);
	end;
	
OnPCLogoutEvent:
	#total_online_time += ( gettimetick(2) - @online_time ); 
	end;

i kneed to get te var right away,

not only when they logout :(

will ontimer work?

Im redo my script like this:

OnPCLoginEvent:
if(!#login){
#login = gettimetick(2);}
end;

OnPCLogoutEvent:
#logout = gettimetick(2);
end;

set .@online, gettimetick(2)- #login -(gettimetick(2)-#logout);
if( .@online > 3600){
mes"ok";
close;}
else{
set .@left, .@online/60;
mes ""+.@left+" minutes left."
close;
}

is this ok?

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