AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Players Time (https://forums.alliedmods.net/showthread.php?t=22828)

Styles 01-04-2006 18:25

Players Time
 
I have an idea for a plugin Im going to make but I dont know how to log a players time connected to the server. How would you do somthing like that?

v3x 01-04-2006 18:53

( I made this for private use before )

Anywho.. There's 2 ways of doing this:

Method 1:
Use get_user_time and store the Steam ID in a variable and save it upon disconnect. Check if the player has existing time already, if so, add that time to the existing entry.

Method 2:
In client_putinserver use set_task at 1 second intervals like so:
Code:
set_task(1.0, "update_time", id, _, _, "b");
Then make a global variable and increase it by 1 in the update_time function. You might want to check if the player hasn't joined a team yet and set mp_autokick to 1. Then do the same as the ending part of method 1.

Styles 01-04-2006 18:58

great! Thanks v3x! +KARM


All times are GMT -4. The time now is 16:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.