Raised This Month: $ Target: $400
 0% 

Players Time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 01-04-2006 , 18:25   Players Time
Reply With Quote #1

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?
Styles is offline
Send a message via AIM to Styles
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 01-04-2006 , 18:53  
Reply With Quote #2

( 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.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 01-04-2006 , 18:58  
Reply With Quote #3

great! Thanks v3x! +KARM
Styles is offline
Send a message via AIM to Styles
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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