Jump to content
  • 0

Playtime NPC


Nokia

Question


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  150
  • Reputation:   5
  • Joined:  12/28/11
  • Last Seen:  

hi

can i request an npc which can show the players playtime? example:

Playtime: xx hours

Playtime today: xx hours

some like this..

Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

OnPCLogin:
iLoop:
sleep2 3600000;
set @playhour,@playhour+1;
dispbottom "You have been playing for "+ @playhour +" hour(s)";
goto iLoop;
end;

There, that should do what you want... its been nearly 4years since i've been active in the scripting community, but I'm starting to come back, bigger and harder than ever, with the release of several advanced scripts, never before seen. So until then, I appologize if its bugged...

Basically, when a player logs on, it will do nothing for exactly 1 hour, after that, it will announce to the player only, that they have been on for X amount of hours, and will repeat the proccess every hour.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  150
  • Reputation:   5
  • Joined:  12/28/11
  • Last Seen:  

I see, thats nice.. but i thought like an npc for this:

[acc infos]

mes "overall playtime xx:xx hours/days";

mes "playtime today: xx:xx";

mes "login count: xxx";

etc.?

more like this x_x

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

poring_c01,100,100,0	script	TotalTimeOnline	910,{
mes "[Acc Infos]";
mes "For your account, you have been online a total of:";
mes callsub(S_SecToTime, @login_time ? (#secs_online + (gettimetick(2)-@login_time)) : #secs_online);

mes "Playtime today: " + callsub(S_SecToTime, (gettimetick(2)-@login_time));

query_sql "SELECT logincount FROM login WHERE account_id='"+playerattached()+"'", .@logincount;
mes "Login Count: " + .@logincount;
close;

S_SecToTime:
set .@seconds, getarg(0);

set .@seconds, .@seconds - set(.@weeks, .@seconds / 604800)*604800;
set .@str$, .@str$ + .@weeks+((.@weeks==1) ? " week":" weeks")+", ";

set .@seconds, .@seconds - set(.@days, .@seconds / 86400)*86400;
set .@str$, .@str$ +  .@days+((.@days==1) ? " day":" days")+", ";

set .@seconds, .@seconds - set(.@hours, .@seconds / 3600)*3600;
set .@str$, .@str$ +  .@hours+((.@hours==1) ? " hour":" hours")+", ";

set .@seconds, .@seconds - set(.@mins, .@seconds / 60)*60;
set .@str$, .@str$ +  .@mins+((.@mins==1) ? " min":" mins")+", and ";

set .@str$, .@str$ +  .@seconds+((.@seconds==1) ? " second":" seconds");

return .@str$;

OnPCLoginEvent:
set @login_time, gettimetick(2);
end;
OnPCLogoutEvent:
if (@login_time)
	set #secs_online, #secs_online + (gettimetick(2)-@login_time);
end;
}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  150
  • Reputation:   5
  • Joined:  12/28/11
  • Last Seen:  

is there a way to show the playtime for already existing players? it wont make sense if i add the script after my server is online for 2 month.

Link to comment
Share on other sites


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

i dont think there is a way for this...we cant calculate how long a players has been online for the past 2 month...

we wont know how long they have online during the 2 month...

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  150
  • Reputation:   5
  • Joined:  12/28/11
  • Last Seen:  

hmm.. isent there an account created date? like playing since / account created: date. or something?

Link to comment
Share on other sites


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

the logincount is exist in the login table of your SQL.

and the count will increase everytime you relog your account...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  117
  • Reputation:   8
  • Joined:  05/07/12
  • Last Seen:  

hmm, theres maybe a way to display the date when the char was created, the charlog saves it:

2012-05-22 05:40:53

name: blabla

char_msg: create new char

this is how the sql table looks.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  150
  • Reputation:   5
  • Joined:  12/28/11
  • Last Seen:  

hmm.. what about an login count ladder? like top 3 login accounts?

probably it should show charnames instead of accnames

Top 3 Logins:

Playername / Logins: xxxx

Playername / Logins: xxxx

Playername / Logins: xxxx

this would be nice i guess.

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