AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   How can i get CSGO Player Hourse Played? (https://forums.alliedmods.net/showthread.php?t=292689)

juss 01-12-2017 00:55

How can i get CSGO Player Hourse Played?
 
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

juss 01-12-2017 01:31

Re: How can i get CSGO Player Hourse Played?
 
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?

asherkin 01-12-2017 02:26

Re: How can i get CSGO Player Hourse Played?
 
GetClientAuthId can return the 64-bit ID form if you ask nicely and read the docs.

juss 01-12-2017 02:32

Re: How can i get CSGO Player Hourse Played?
 
Quote:

Originally Posted by asherkin (Post 2485750)
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

Wilczek 01-12-2017 11:12

Re: How can i get CSGO Player Hourse Played?
 
https://forums.alliedmods.net/showthread.php?t=255871

Mitchell 01-12-2017 11:26

Re: How can i get CSGO Player Hourse Played?
 
Don't forget if a player actually wanted to they could get 400+ hours every two weeks making this method inaccurate.

juss 01-12-2017 14:27

Re: How can i get CSGO Player Hourse Played?
 
Quote:

Originally Posted by Wilczek (Post 2485844)

Thank you buddy <3

juss 01-12-2017 14:27

Re: How can i get CSGO Player Hourse Played?
 
Quote:

Originally Posted by Mitchell (Post 2485851)
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


All times are GMT -4. The time now is 06:01.

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