搜索
查看: 58021|回复: 139

[AMXX 带源码] CS伪造ping插件(带说明)

  [复制链接]
发表于 2011-4-22 15:17:10 | 显示全部楼层 |阅读模式 来自 中国–江苏–盐城
本帖最后由 381828358 于 2011-5-15 12:43 编辑

//欺骗延迟
pingfake_enable 1 //<0/1> - 打开关闭插件
pingfake_ping 20 //<1337> - 你想显示多少延迟 (min: 0 // max: 4095)
pingfake_flux 8 //<0> - 假延迟上下波动 (0 = none)
pingfake_target 1 //<0/1> - 无论如何也显示 假延迟到它 的 目标
pingfake_flags "" // - 只会影响有标记的玩家(留空=全部)
pingfake_bots 1 //<0/1/2> - 也影响机器人 (设定 2 只影响机器人)
pingfake_multiplier 0.0 //<0.0> - 被显示为真延迟的概率,而不是固定值(0.0 = 禁用 不显示真的延迟)
    -1 v 5 '      12:41:59
自己去研究吧。说明自己慢慢看吧。不多说了

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
 楼主| 发表于 2011-4-22 15:20:02 | 显示全部楼层 来自 中国–江苏–盐城
先给自己顶下。赚点通币。+1
回复

使用道具 举报

 楼主| 发表于 2011-4-22 15:21:34 | 显示全部楼层 来自 中国–江苏–盐城
如果不会可以加我QQ381828358
回复

使用道具 举报

发表于 2011-4-22 18:49:03 | 显示全部楼层 来自 中国–天津–天津
1.6可以用吗?
回复

使用道具 举报

 楼主| 发表于 2011-4-22 22:56:53 | 显示全部楼层 来自 中国–江苏–盐城
可以的。
通用的
回复

使用道具 举报

发表于 2011-4-24 17:59:04 | 显示全部楼层 来自 中国–湖南–株洲
这个有人在求。
回复

使用道具 举报

发表于 2011-4-26 10:19:31 | 显示全部楼层 来自 中国–福建–福州
这个插件有什么意义么?改Ping的值?
回复

使用道具 举报

发表于 2011-4-26 14:04:42 | 显示全部楼层 来自 中国–广东–云浮
我發源碼
/*================================================================================
       
        ----------------------
        -*- Ping Faker 1.0 -*-
        ----------------------
       
        ~~~~~~~~~~~~~~~
        - Description -
        ~~~~~~~~~~~~~~~
       
        This plugin can fake the display of a player's latency (ping) shown on
        the scoreboard. Unlike the "fakelag" command, it does not affect the
        player's real latency in any way.
       
        You can have all players report the same ping, or only fake it for those
        who have a specific admin flag. This last feature is especially useful
        when running a dedicated server from your own computer, when you don't
        want people to guess you're an admin/owner by looking at your low ping.
       
        ~~~~~~~~~
        - CVARS -
        ~~~~~~~~~
       
        * pingfake_enable [1/0] - Enable/disable ping faking
        * pingfake_ping [1337] - The ping you want displayed (min: 0 // max: 4095)
        * pingfake_flags [""] - Affect players with these flags only (empty = all)
        * pingfake_target [1/0] - Whether to display fake ping to its target too
       
        Note: changes to these will take effect after a new round.
       
        ~~~~~~~~
        - ToDo -
        ~~~~~~~~
       
        * Find out exactly what the arguments for the SVC_PINGS message mean, so
           as to send a single message with all pings on it and reduce bandwidth
           usage (does the HLSDK say anything about those?)
       
        ~~~~~~~~~~~~~~~~~~~
        - Developer Notes -
        ~~~~~~~~~~~~~~~~~~~
       
        The SVC_PINGS message can't be intercepted by Metamod/AMXX (it is purely
        handled by the engine) so the only way to supercede it is to send our own
        custom message right after the original is fired. This works as long as
        the custom message is parsed AFTER the original. To achieve this here, we
        send it as an unreliable message (cl_messages 1 helps see arrival order).
       
        The next difficulty is in figuring out what the message arguments are.
        For this I did some trial and error until I finally got it working, though
        in a really odd way. I also can't seem to send more than one ping on the
        same message without getting weird results or triggering heaps of message
        parsing errors (namely svc_bad).
       
        A final consideration is bandwidth usage. I found out (with cl_shownet 1)
        the packet size increases by 102 bytes when the original SVC_PINGS message
        is sent for 32 players. Sending our own message right after means the size
        will grow even larger, so we should only send the message when absolutely
        needed. In this case that's once every client data update (any less often
        than that and the ping wasn't properly overridden sometimes).
       
        ~~~~~~~~~~~~~
        - Changelog -
        ~~~~~~~~~~~~~
       
        * v1.0: (Feb 23, 2009)
           - Public release
       
=================================================================================*/

#include <amxmodx>
#include <fakemeta>

new cvar_enable, cvar_ping, cvar_flags, cvar_target
new g_enable, g_offset, g_ping, g_flags, g_target
new g_maxplayers, g_connected[33]

public plugin_init()
{
        register_plugin("Ping Faker", "1.0", "MeRcyLeZZ")
       
        cvar_enable = register_cvar("pingfake_enable", "1")
        cvar_ping = register_cvar("pingfake_ping", "1")
        cvar_flags = register_cvar("pingfake_flags", "")
        cvar_target = register_cvar("pingfake_target", "1")
        g_maxplayers = get_maxplayers()
       
        register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
        register_forward(FM_UpdateClientData, "fw_UpdateClientData")
       
        set_task(1.0, "event_round_start")
}

public event_round_start()
{
        // Cache CVAR values
        g_enable = get_pcvar_num(cvar_enable)
        g_ping = clamp(get_pcvar_num(cvar_ping), 0, 4095)
        g_target = get_pcvar_num(cvar_target)
       
        // Calculate weird argument values based on target ping
        for (g_offset = 0; g_offset <= 3; g_offset++)
        {
                if ((g_ping - g_offset) % 4 == 0)
                {
                        g_ping = (g_ping - g_offset) / 4
                        break;
                }
        }
       
        // Cache flags
        new flags[6]
        get_pcvar_string(cvar_flags, flags, sizeof flags - 1)
        g_flags = read_flags(flags)
}

public client_putinserver(id)
{
        g_connected[id] = true
}

public client_disconnect(id)
{
        g_connected[id] = false
}

public fw_UpdateClientData(id)
{
        // Ping faking disabled?
        if (!g_enable) return;
       
        // Scoreboard key being pressed?
        if (!(pev(id, pev_button) & IN_SCORE) && !(pev(id, pev_oldbuttons) & IN_SCORE))
                return;
       
        // Send fake player's pings
        static player
        for (player = 1; player <= g_maxplayers; player++)
        {
                // Player not in game?
                if (!g_connected[player])
                         continue;
               
                // Fake latency for its target too?
                if (!g_target && id == player)
                        continue;
               
                // Need to have specific flags?
                if (g_flags && !(get_user_flags(player) & g_flags))
                        continue;
               
                // Send message with the weird arguments
                message_begin(MSG_ONE_UNRELIABLE, SVC_PINGS, _, id)
                write_byte((g_offset*64) + (2*player-1))
                write_short(g_ping)
                write_byte(0)
                message_end()
        }
}
回复

使用道具 举报

发表于 2011-4-27 13:55:56 | 显示全部楼层 来自 中国–辽宁–锦州
看看。。。。。。。。。。
回复

使用道具 举报

发表于 2011-4-30 16:16:13 | 显示全部楼层 来自 中国–辽宁–沈阳
这东西好像很多人在找!高手现在都消失了
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表