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

[CSGO] Fake Ping


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Mc_Daived
Junior Member
Join Date: Apr 2017
Location: IRAQ
Plugin ID:
5609
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
    Plugin Description:
    Hello , this is new plugin was developed by me
    Old 04-21-2017 , 07:38   [CSGO] Fake Ping
    Reply With Quote #1

    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;

    Attached Files
    File Type: 7z Ping Faker.7z (8.6 KB, 1350 views)

    Last edited by asherkin; 05-15-2020 at 12:10.
    Mc_Daived is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 04-21-2017 , 08:44   Re: [CSGO] Fake Ping
    Reply With Quote #2

    Pretty sure it's against the Valve policy.

    EDIT: Or at least, I can't see anything that will prevent a admin from faking the ping of the bot.
    __________________
    Want to check my plugins ?

    Last edited by Arkarr; 04-21-2017 at 08:46.
    Arkarr is offline
    Mc_Daived
    Junior Member
    Join Date: Apr 2017
    Location: IRAQ
    Old 04-21-2017 , 12:34   Re: [CSGO] Fake Ping
    Reply With Quote #3

    Quote:
    Originally Posted by Arkarr View Post
    Pretty sure it's against the Valve policy.

    EDIT: Or at least, I can't see anything that will prevent a admin from faking the ping of the bot.
    I don't think it is against a valve policy, because it's simple plugin
    Mc_Daived is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 04-21-2017 , 12:40   Re: [CSGO] Fake Ping
    Reply With Quote #4

    Quote:
    Originally Posted by Mc_Daived View Post
    I don't think it is against a valve policy, because it's simple plugin
    Faking information is against valve's policy. We've had this kind of submission several times before.
    See: https://forums.alliedmods.net/showth...ight=fake+ping

    Last edited by Mitchell; 04-21-2017 at 12:41.
    Mitchell is offline
    Mc_Daived
    Junior Member
    Join Date: Apr 2017
    Location: IRAQ
    Old 04-21-2017 , 12:58   Re: [CSGO] Fake Ping
    Reply With Quote #5

    Quote:
    Originally Posted by Mitchell View Post
    Faking information is against valve's policy. We've had this kind of submission several times before.
    See: https://forums.alliedmods.net/showth...ight=fake+ping
    hhmmmmmmmmmmmm

    Last edited by Mc_Daived; 04-21-2017 at 13:00.
    Mc_Daived is offline
    Mc_Daived
    Junior Member
    Join Date: Apr 2017
    Location: IRAQ
    Old 04-21-2017 , 13:08   Re: [CSGO] Fake Ping
    Reply With Quote #6

    Quote:
    Originally Posted by Mitchell View Post
    Faking information is against valve's policy. We've had this kind of submission several times before.
    See: https://forums.alliedmods.net/showth...ight=fake+ping
    this makes it similar to plugins knifes
    Mc_Daived is offline
    Zuby24
    Member
    Join Date: Apr 2017
    Location: Romania/Bucharest
    Old 04-22-2017 , 04:30   Re: [CSGO] Fake Ping
    Reply With Quote #7

    did you try this plugin? because it gave me errors, also in compilation and when i try to load...

    L 04/22/2017 - 07:45:04: [SM] Exception reported: Something is missing!
    L 04/22/2017 - 07:45:04: [SM] Blaming: ping.smx
    L 04/22/2017 - 07:45:04: [SM] Call stack trace:
    L 04/22/2017 - 07:45:04: [SM] [0] SetFailState
    L 04/22/2017 - 07:45:04: [SM] [1] Line 51, C:\Users\zuby\Documents\scripting\ping.sp::On MapStart
    L 04/22/2017 - 07:45:04: [SM] [3] ServerCommandEx
    L 04/22/2017 - 07:45:04: [SM] [4] Line 400, /home/builds/sourcemod/linux-1.9/build/plugins/basecommands.sp::Command_Rcon
    __________________

    Last edited by Zuby24; 04-23-2017 at 04:18.
    Zuby24 is offline
    Mc_Daived
    Junior Member
    Join Date: Apr 2017
    Location: IRAQ
    Old 04-22-2017 , 11:33   Re: [CSGO] Fake Ping
    Reply With Quote #8

    Quote:
    Originally Posted by Zuby24 View Post
    did you try this plugin? because it gave me errors, also in compilation and when i try to load...

    L 04/22/2017 - 07:45:04: [SM] Exception reported: Something is missing!
    L 04/22/2017 - 07:45:04: [SM] Blaming: ping.smx
    L 04/22/2017 - 07:45:04: [SM] Call stack trace:
    L 04/22/2017 - 07:45:04: [SM] [0] SetFailState
    L 04/22/2017 - 07:45:04: [SM] [1] Line 51, C:\Users\zuby\Documents\scripting\ping.sp::On MapStart
    L 04/22/2017 - 07:45:04: [SM] [3] ServerCommandEx
    L 04/22/2017 - 07:45:04: [SM] [4] Line 400, /home/builds/sourcemod/linux-1.9/build/plugins/basecommands.sp::Command_Rcon
    I'll see where the problem is and resolve this mistake ,
    Mc_Daived is offline
    Zuby24
    Member
    Join Date: Apr 2017
    Location: Romania/Bucharest
    Old 04-23-2017 , 03:16   Re: [CSGO] Fake Ping
    Reply With Quote #9

    Quote:
    Originally Posted by Mc_Daived View Post
    I'll see where the problem is and resolve this mistake ,
    Ok thanks.. I dont care about Valve policy....
    __________________

    Last edited by Zuby24; 04-23-2017 at 04:17.
    Zuby24 is offline
    cravenge
    Veteran Member
    Join Date: Nov 2015
    Location: Chocolate Factory
    Old 04-27-2017 , 11:53   Re: [CSGO] Fake Ping
    Reply With Quote #10

    PHP Code:
     g_iPing    FindSendPropOffs("CPlayerResource""sm_iPing"); 
    A little extra there. It should be "m_iPing".

    PHP Code:
    g_iPlayerManager    FindEntityByClassname(MaxClients 1g_szPlayerManager); 
    Shouldn't MaxClients + 1 be -1 instead?

    Also, I think this should be ANY? instead of just CSGO. Just by looking at the code, it seems to support multiple mods.

    Last edited by cravenge; 04-27-2017 at 11:57.
    cravenge 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 01:32.


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