Raised This Month: $51 Target: $400
 12% 

how count the time ??


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arvy
Member
Join Date: Oct 2007
Old 04-30-2008 , 03:04   how count the time ??
Reply With Quote #1

when a player joined(client_putinserver) the game statrt to count,how to?
thank you !
Arvy is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-30-2008 , 03:07   Re: how count the time ?
Reply With Quote #2

What? Count what?
Styles is offline
Send a message via AIM to Styles
Arvy
Member
Join Date: Oct 2007
Old 04-30-2008 , 03:12   Re: how count the time ?
Reply With Quote #3

i'm sorry for my bad english...

i just want to get the "joined time" from a player
Arvy is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-30-2008 , 03:21   Re: how count the time ?
Reply With Quote #4

Well, theres a few times. during client_putinserver do get_time(). thats how you can do it
Styles is offline
Send a message via AIM to Styles
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-30-2008 , 04:20   Re: how count the time ?
Reply With Quote #5

This will get the # of seconds from when the player was initialized in the game to the time he pressed the join key:
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_clcmd("jointeam""CmdJoinTeam");
}

new 
Float:g_pTime[33];

public 
client_putinserver(id)
    
g_pTime[id] = get_gametime();

public 
CmdJoinTeam(id)
{
    new 
Float:time get_gametime() - g_pTime[id];

    
client_print(idprint_chat"* It took %.2f second%s for you to connect"timefloatcmp(time1.9), "s""");

Not sure if it'll show up in chat this early.

You get the point
__________________
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 04-30-2008 , 04:23   Re: how count the time ?
Reply With Quote #6

v3x, that's what he wanted?
Styles is offline
Send a message via AIM to Styles
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-30-2008 , 04:40   Re: how count the time ?
Reply With Quote #7

Could be. If not, it's no biggie. It's only like 20 lines
__________________
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
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-30-2008 , 10:50   Re: how count the time ?
Reply With Quote #8

This also gets users connect time, http://www.amxmodx.org/funcwiki.php?go=func&id=160
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Arvy
Member
Join Date: Oct 2007
Old 04-30-2008 , 11:55   Re: how count the time ?
Reply With Quote #9

now i see ,thx ! +Karma for you !

Special v3x,you are lovely!
Arvy is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-30-2008 , 16:07   Re: how count the time ?
Reply With Quote #10

So is that what you wanted, Arvy?
__________________
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
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 07:09.


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