Raised This Month: $32 Target: $400
 8% 

Solved [CSGO] check profile status in csgo


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 04-13-2019 , 02:18   [CSGO] check profile status in csgo
Reply With Quote #1

hi guys!
i need to check the time play csgo for this plugin!!
check profile status and Minimum amount of playtime a user has to have on CSGO must 50 hours for join to server.

please help me !!
this cod dont work for me

sorry for bad speak english

simple cod(cowac edited):
https://github.com/Deniel00/Cow-Anti...owanticheat.sp
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <SteamWorks>

public void OnPluginStart()
{
    
sm_cac_hourcheck CreateConVar("sm_cac_hourcheck""1""Enable hour checker (1 = Yes, 0 = No)"FCVAR_NOTIFYtrue0.0true1.0);
    
sm_cac_hourcheck_value CreateConVar("sm_cac_hourcheck_value""50""Minimum amount of playtime a user has to have on CS:GO (Default: 50)");
    
sm_cac_profilecheck CreateConVar("sm_cac_profilecheck""1""Enable profile checker, this makes it so users need to have a public profile to connect. (1 = Yes, 0 = No)"FCVAR_NOTIFYtrue0.0true1.0);
    
sm_cac_steamapi_key CreateConVar("sm_cac_steamapi_key""xxxxxxxxxxxxxxxxxxxxxxxxxxxx""Need for ProfileCheck and HourCheck. (https://steamcommunity.com/dev/apikey)"FCVAR_NOTIFY);
}

public 
void OnClientPutInServer(int client)
{
    if(
IsValidClient(client))
    {
        if(
sm_cac_profilecheck.BoolValue)
        {
            
Handle request CreateRequest_ProfileStatus(client);
            
SteamWorks_SendHTTPRequest(request);
        }
        
        if(
sm_cac_hourcheck.BoolValue)
        {
            
Handle request CreateRequest_TimePlayed(client);
            
SteamWorks_SendHTTPRequest(request);
        }
    }
}

Handle CreateRequest_TimePlayed(int client)
{
    
char request_url[256];
    
char s_Steamapi[256];
    
sm_cac_steamapi_key.GetString(s_Steamapisizeof(s_Steamapi));
    
Format(request_urlsizeof(request_url), "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=%s",s_Steamapi);
    
Handle request SteamWorks_CreateHTTPRequest(k_EHTTPMethodGETrequest_url);
    
    
char steamid[64];
    
GetClientAuthId(clientAuthId_SteamID64steamidsizeof(steamid));
    
    
SteamWorks_SetHTTPRequestGetOrPostParameter(request"steamid"steamid);
    
SteamWorks_SetHTTPRequestContextValue(requestclient);
    
SteamWorks_SetHTTPCallbacks(requestTimePlayed_OnHTTPResponse);
    return 
request;
}

public 
int TimePlayed_OnHTTPResponse(Handle requestbool bFailurebool bRequestSuccessfulEHTTPStatusCode eStatusCodeint client)
{
    if (!
bRequestSuccessful || eStatusCode != k_EHTTPStatusCode200OK)
    {
        
delete request;
        return;
    }

    
int iBufferSize;
    
SteamWorks_GetHTTPResponseBodySize(requestiBufferSize);
    
    
char[] sBody = new char[iBufferSize];
    
SteamWorks_GetHTTPResponseBodyData(requestsBodyiBufferSize);
    
    
int time StringToInt(sBody10) / 60 60;
    
    if(
time <= 0)
    {
        
KickClient(client"Please connect with a public steam profile.");
    }
    else if(
time sm_cac_hourcheck_value.IntValue)
    {
        
KickClient(client"You do not meet the minimum hour requirement to play here! (%i/%i)"timesm_cac_hourcheck_value.IntValue);
    }
    
    
delete request;
}

Handle CreateRequest_ProfileStatus(int client)
{
    
char request_url[256];
    
char s_Steamapi[256];
    
sm_cac_steamapi_key.GetString(s_Steamapisizeof(s_Steamapi));
    
Format(request_urlsizeof(request_url), "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=%s",s_Steamapi);
    
Handle request SteamWorks_CreateHTTPRequest(k_EHTTPMethodGETrequest_url);
    
    
char steamid[64];
    
GetClientAuthId(clientAuthId_SteamID64steamidsizeof(steamid));
    
    
SteamWorks_SetHTTPRequestGetOrPostParameter(request"steamid"steamid);
    
SteamWorks_SetHTTPRequestContextValue(requestclient);
    
SteamWorks_SetHTTPCallbacks(requestProfileStatus_OnHTTPResponse);
    return 
request;
}

public 
int ProfileStatus_OnHTTPResponse(Handle requestbool bFailurebool bRequestSuccessfulEHTTPStatusCode eStatusCodeint client)
{
    if (!
bRequestSuccessful || eStatusCode != k_EHTTPStatusCode200OK)
    {
        
delete request;
        return;
    }

    
int iBufferSize;
    
SteamWorks_GetHTTPResponseBodySize(requestiBufferSize);
    
    
char[] sBody = new char[iBufferSize];
    
SteamWorks_GetHTTPResponseBodyData(requestsBodyiBufferSize);
    
    
int profile StringToInt(sBody10) / 60 60;
    
    if(
profile 3)
    {
        
KickClient(client"Please connect with a public steam profile.");
    }
    
    
delete request;


Last edited by Dr.Mohammad; 07-21-2019 at 16:05.
Dr.Mohammad is offline
 



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 19:16.


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