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

How can i get CSGO Player Hourse Played?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
juss
Senior Member
Join Date: Jan 2016
Old 01-12-2017 , 00:55   How can i get CSGO Player Hourse Played?
Reply With Quote #1

I wanna check the player on connect to know how many hours player played in csgo , so i could kick those players who played less then 1500 hours (just wanna keep it for those who going good)

edited
what i think is that i can use xml from steam api
http://api.steampowered.com/ISteamUs...xxx&format=xml

in output i can parse "total_time_played" but i dont know how to get data in script from steam api and how to parse it in sourcepawn, also maybe there is other way to get data without using steam api (cause i dont feel like using api key, is there a simplier way?)

Yet i also would need to convert clietn steam_id to Steam64 ID somehow

Last edited by juss; 01-12-2017 at 01:22.
juss is offline
juss
Senior Member
Join Date: Jan 2016
Old 01-12-2017 , 01:31   Re: How can i get CSGO Player Hourse Played?
Reply With Quote #2

as for convertion found 2 solutions:
from here https://forums.alliedmods.net/showthread.php?t=149587

First one
Code:
/**
 * Gives the 64-bit int SteamID for a client
 *
 * @param client        Client index of the player.
 * @param buffer        Destination string buffer.
 * @param maxlength     Maximum length of output string buffer.
 * @return              True on success, false on invalid client index or failure to find edict index.
 */
native bool:GetClientCSteamID(client, String:buffer[], maxlength);

/**
 * Given a 64-bit int SteamID, gives the SteamID associated with it
 *
 * @param input         64-bit integer stored in a string
 * @param buffer        Destination string buffer for the SteamID.
 * @param maxlength     Maximum length of the output string buffer.
 * @return              True on success, false on invalid input string.
 */
native bool:CSteamIDToSteamID(String:input[], String:buffer[], maxlength);

/**
 * Given a SteamID, gives the 64-bit int SteamID associated with it
 *
 * @param input         SteamID stored in a string
 * @param buffer        Destination string buffer for the 64-bit int SteamID.
 * @param maxlength     Maximum length of the output string buffer.
 * @return              True on success, false on invalid SteamID.
 */
native bool:SteamIDToCSteamID(String:input[], String:buffer[], maxlength);
and the Second one
Steam_GetCSteamIDForClient / Steam_GetCSteamIDFromRenderedID
from https://forums.alliedmods.net/showthread.php?t=129763


Or maybe is there other way?

Last edited by juss; 01-12-2017 at 01:45.
juss is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 01-12-2017 , 02:26   Re: How can i get CSGO Player Hourse Played?
Reply With Quote #3

GetClientAuthId can return the 64-bit ID form if you ask nicely and read the docs.
__________________
asherkin is offline
juss
Senior Member
Join Date: Jan 2016
Old 01-12-2017 , 02:32   Re: How can i get CSGO Player Hourse Played?
Reply With Quote #4

Quote:
Originally Posted by asherkin View Post
GetClientAuthId can return the 64-bit ID form if you ask nicely and read the docs.
I like the way your avatar changing =) , and thanks a lot <3
juss is offline
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 01-12-2017 , 11:12   Re: How can i get CSGO Player Hourse Played?
Reply With Quote #5

https://forums.alliedmods.net/showthread.php?t=255871
__________________
Wilczek is offline
juss
Senior Member
Join Date: Jan 2016
Old 01-12-2017 , 14:27   Re: How can i get CSGO Player Hourse Played?
Reply With Quote #6

Quote:
Originally Posted by Wilczek View Post
Thank you buddy <3
juss is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-12-2017 , 11:26   Re: How can i get CSGO Player Hourse Played?
Reply With Quote #7

Don't forget if a player actually wanted to they could get 400+ hours every two weeks making this method inaccurate.
Mitchell is offline
juss
Senior Member
Join Date: Jan 2016
Old 01-12-2017 , 14:27   Re: How can i get CSGO Player Hourse Played?
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
Don't forget if a player actually wanted to they could get 400+ hours every two weeks making this method inaccurate.
will note that <3
juss is offline
Reply


Thread Tools
Display Modes

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 06:49.


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