Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Use gettime(). You don't even need any extra variables or timers. You probably already set a variable to 1 once a player goes on duty so just replace that 1 with gettime() without parameters. When player goes off duty (or when the duty time is requested) you do gettime() - yourDutyVariable[playerid] and that will give you the time in seconds for the current session which can then be added to the total. That can then be converted into minutes and hours as desired.
Posts: 6,242
Threads: 8
Joined: Jun 2008
He's saying instead of using the timer, you could simply use gettime and count how long they were on duty for.
You'd be storing the time the admin went on duty currently as a variable. The time overall that the player has been on duty would be included in the playerinfo enum/account info.
The current gettime would be compared to the onduty "start" of the current session, and added to the overall time.
When the admin goes off duty then that time would be added to the players account info.
Posts: 6,242
Threads: 8
Joined: Jun 2008
Those hour minute second variables will only be visible IN that if statement, so close, but you'll need to learn a bit more.