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

[CSGO] Fake Ping


Post New Thread Reply   
 
Thread Tools Display Modes
skinheadxtreme
AlliedModders Donor
Join Date: Jul 2013
Old 04-28-2017 , 19:41   Re: [CSGO] Fake Ping
Reply With Quote #11

Make sure that you keep developing this please!
Also is there a way to make all players have a certain ping?

Last edited by skinheadxtreme; 04-28-2017 at 19:46.
skinheadxtreme is offline
qendrimgraphics
Junior Member
Join Date: Jan 2021
Old 01-31-2021 , 03:29   Re: [CSGO] Fake Ping
Reply With Quote #12

Quote:
Originally Posted by Mc_Daived View Post
Hello ,This is new plugin was developed by me
but i think it's against to the valve policy
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>


new String:g_szPlayerManager[50] = "";

// Entities
new g_iPlayerManager    = -1;

// Offsets
new g_iPing                = -1;

#define PLUGIN_URL "https://github.com/McDaived"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "McDaived"

public Plugin:myinfo =
{
    
name "Ping Faker",
    
author PLUGIN_AUTHOR,
    
description "Change ping for the players on scoreboard",
    
version PLUGIN_VERSION,
    
url PLUGIN_URL
};

public 
OnPluginStart()
{
    
CreateConVar("fp_version"PLUGIN_VERSION""FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_CHEAT|FCVAR_DONTRECORD);
    
    
g_iPing    FindSendPropOffs("CPlayerResource""sm_iPing");

    
decl String:szBuffer[64];
    
GetGameFolderName(szBuffersizeof(szBuffer));

    if (
StrEqual("cstrike"szBuffer))
        
strcopy(g_szPlayerManagersizeof(g_szPlayerManager), "cs_player_manager");
    else if (
StrEqual("dod"szBuffer))
        
strcopy(g_szPlayerManagersizeof(g_szPlayerManager), "dod_player_manager");
    else
        
strcopy(g_szPlayerManagersizeof(g_szPlayerManager), "player_manager");
    
    
CreateTimer(2.0LoopClients_TIMER_REPEAT);
}

public 
OnMapStart()
{
    
g_iPlayerManager    FindEntityByClassname(MaxClients 1g_szPlayerManager);
    if (
g_iPlayerManager == -|| g_iPing == -1)
    {
        
SetFailState("Something is missing!");
    }
    
SDKHook(g_iPlayerManagerSDKHook_ThinkPostOnThinkPost);
    
}

new 
iPing[MAXPLAYERS+1];
public 
Action:LoopClients(Handle:timer)
{
    for (new 
1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i)) continue;
        
        new 
ping Client_GetFakePing(ifalse);
        if (
ping <= 30)
        {
            continue;
        }
        else if (
ping <= 50)
        {
            
iPing[i] = GetRandomInt(2025);
        }
        else if (
ping <= 90)
        {
            
iPing[i] = GetRandomInt(5055);
        }
        else
        {
            
iPing[i] = GetRandomInt(7077);
        }
    }
}

public 
OnClientDisconnect(client)
{
    
iPing[client] = 0;
}

public 
OnThinkPost(entity)
{
    for (new 
target 1target <= MaxClientstarget++)
    {
        if (
iPing[target] != 0)
        {
            
SetEntData(g_iPlayerManagerg_iPing + (target 4), iPing[target]);
        }
    }
}

#define TICKS_TO_TIME(%1)    ( GetTickInterval() * %1 )

stock Client_GetFakePing(clientbool:goldSource=true)
{
    
decl ping;
    new 
Float:latency GetClientLatency(clientNetFlow_Outgoing); // in seconds
        
    // that should be the correct latency, we assume that cmdrate is higher 
    // then updaterate, what is the case for default settings
    
decl String:cl_cmdrate[4];
    
GetClientInfo(client"cl_cmdrate"cl_cmdratesizeof(cl_cmdrate));

    new 
Float:tickRate GetTickInterval();
    
latency -= (0.5 StringToInt(cl_cmdrate)) + TICKS_TO_TIME(1.0); // correct latency

    
if (goldSource) {
        
// in GoldSrc we had a different, not fixed tickrate. so we have to adjust
        // Source pings by half a tick to match the old GoldSrc pings.
        
latency -= tickRate 0.5;
    }

    
ping RoundFloat(latency 1000.0); // as msecs
    
ping Math_Clamp(ping51000); // set bounds, dont show pings under 5 msecs
    
    
return ping;
}

stock any:Math_Clamp(any:valueany:minany:max)
{
    
value Math_Min(valuemin);
    
value Math_Max(valuemax);

    return 
value;
}

stock any:Math_Max(any:valueany:max)
{    
    if (
value max) {
        
value max;
    }
    
    return 
value;
}

stock any:Math_Min(any:valueany:min)
{
    if (
value min) {
        
value min;
    }
    
    return 
value;
}

public 
Action OnClientCommand(int clientint args)
{
    
char cmd[16];
    
GetCmdArg(0cmdsizeof(cmd));
 
    if (
StrEqual(cmd"p_faker"))
    {

        return 
Plugin_Handled;
    }
 
    return 
Plugin_Continue;
}

public 
void_OnPluginStart()
{
    
RegConsoleCmd("iping"Command_Test);
}
 
public 
Action Command_Test(int clientint args)
{
    
char arg[128];
    
char full[256];
 
    
GetCmdArgString(fullsizeof(full));
 
    if (
client)
    {
        
PrintToServer("Ur Ping : %N");
    } else {
        
PrintToServer("done Fake ur Ping.");
    }
 
    
PrintToServer("done Fake ur Ping: %s"full);
    
PrintToServer("done Fake ur Ping: %d"args);
    for (
int i=1i<=argsi++)
    {
        
GetCmdArg(iargsizeof(arg));
        
PrintToServer("Argument %d: %s"iarg);
    }
    return 
Plugin_Handled;

Do you have discord i need help with this please?
qendrimgraphics 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 16:45.


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