I want to get the total time that player is online in the server, so I have this script:
OnPCLoginEvent:
@login_time = gettimetick(2);
end;
OnPCLogoutEvent:
query_sql("UPDATE login SET online_time = online_time + "+( gettimetick(2) - @login_time )+" WHERE account_id = "+getcharid(3));
end;
What I want to know is if the way I'm sum it is correct and how can I convert the final value in time as h:m:s I tried to find it but didn't
Thanks!
OnPCLoginEvent:
@login_time = gettimetick(2);
end;
OnPCLogoutEvent:
query_sql("UPDATE login SET online_time = online_time + "+( gettimetick(2) - @login_time )+" WHERE account_id = "+getcharid(3));
end;
What I want to know is if the way I'm sum it is correct and how can I convert the final value in time as h:m:s I tried to find it but didn't
Thanks!