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

Ping Faker 1.5


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-23-2009 , 11:44   Re: Ping Faker
Reply With Quote #11

I've been looking for something like this for a long time since I run bots on my server. I through this together real fast to see if it would work. It will make only bots appear to have a realistic ping. I'm sure it can be optimized but it's a start.

PHP Code:
#include <amxmodx>
#include <fakemeta>

new  g_offset[2], g_ping[3]
new 
g_maxplayersg_connected[33]

public 
plugin_init()
{
    
register_plugin("Bot Ping Faker""1.1""MeRcyLeZZ\bugsy")

    
g_maxplayers get_maxplayers()
    
    
register_forward(FM_UpdateClientData"fw_UpdateClientData")
}

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

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

public 
fw_UpdateClientData(id)
{
    
// Scoreboard key being pressed?
    
if (!(pev(idpev_button) & IN_SCORE) && !(pev(idpev_oldbuttons) & IN_SCORE))
        return;
    
    static 
playersendingping
    sending 
0
    
    
for (player 1player <= g_maxplayersplayer++)
    {
        if (!
g_connected[player] || !is_user_bot(player))
             continue;
 
        
//make each players ping vary a bit
        
switch( player )
        {
            case 
1,2,3,4ping random_num1535)
            case 
5,6,7,8ping random_num(4060)
            case 
9,10,11,12ping random_num6080)
            case 
13,14,15,16ping random_num75100)
            case 
17,18,19,20ping random_num7090)
            case 
21,22,23,24ping random_num5080)
            case 
25,26,27,28ping random_num2040)
            default: 
ping random_num4565)
        }
        
        
// Calculate weird argument values based on target ping
        // -> first ping
        
for (g_offset[0] = 0g_offset[0] < 4g_offset[0]++)
        {
            if ((
ping g_offset[0]) % == 0)
            {
                
g_ping[0] = (ping g_offset[0]) / 4
                
break;
            }
        }
        
// -> second ping
        
for (g_offset[1] = 0g_offset[1] < 2g_offset[1]++)
        {
            if ((
ping g_offset[1]) % == 0)
            {
                
g_ping[1] = (ping g_offset[1]) / 2
                
break;
            }
        }
        
        
// -> third ping
        
g_ping[2] = ping
        
        
// Send message with the weird arguments
        
switch (sending)
        {
            case 
0:
            {
                
// Start a new message
                
message_begin(MSG_ONE_UNRELIABLESVC_PINGS_id)
                
write_byte((g_offset[0] * 64) + ((player) - 1))
                
write_short(g_ping[0])
                
sending++
            }
            case 
1:
            {
                
// Append additional data
                
write_byte((g_offset[1] * 128) + (* (player 1)))
                
write_short(g_ping[1])
                
sending++
            }
            case 
2:
            {
                
// Append additional data and end message
                
write_byte((* (player 1)))
                
write_short(g_ping[2])
                
write_byte(0)
                
message_end()
                
sending 0
            
}
        }
    }
    
    
// End message if not yet sent
    
if (sending)
    {
        
write_byte(0)
        
message_end()
    }

__________________
Bugsy is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-23-2009 , 13:04   Re: Ping Faker
Reply With Quote #12

Hmmm... i know nothing about fakemeta could anyone make it 4 me ? this will be realy nice.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
MeRcyLeZZ
Veteran Member
Join Date: Dec 2007
Old 02-23-2009 , 13:55   Re: Ping Faker
Reply With Quote #13

Nice to know your finding good uses for it, it took quite a while of testing to get this b*tch working...

Quote:
Originally Posted by C.H.U.D.
A couple of questions

1. Anyway to get the pings to randomly fluctuate between 2 sets of numbers?
2. Is there anyway to have this applied only to bots?
3. How does this affect a High Ping Kicker?
1. Yeah, just updated plugin with that feature (CVAR: pingfake_flux)
2. Added that also (set pingfake_bots to 2)
3. It doesn't. The real ping is not affected in any way, so all other AMXX plugins will work fine regardless...

Quote:
Originally Posted by One
So i wannt to give my members fake ping, how can i add for members special pings?
Give them some special flags ("m", "n", etc.) on users.ini, then set fakeping_flags to the ones you gave them.

Quote:
Originally Posted by ScHrAnZ DiNgEnS
A command for set pings of other players was nice, and a command that u whrite /1337 in chat and after that the plugin change ure ping to 1337 =)
Yeah, I might add an admin command for changing player's pings manually...
__________________
MeRcyLeZZ is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-23-2009 , 14:08   Re: Ping Faker
Reply With Quote #14

Quote:
Give them some special flags ("m", "n", etc.) on users.ini, then set fakeping_flags to the ones you gave them.
thats the problem. a user want a 1er ping & another 200 & another 1337 & ... when i give them m or n or etc. flags, i have only 1 cvar to set the ping.how can i add a extra users. file for this & type 4 exam :

PHP Code:
 Steam id              Ping
_______________________
"STEAM_ID_XXXXX"      "12"
"STEAM_ID_XXXXX"      "1337"
"STEAM_ID_XXXXX"      "1"
"STEAM_ID_XXXXX"      "1123" 
anything like this like an extra hat for players. then when they are on server, they have special hats/ping
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
C.H.U.D.
BANNED
Join Date: Apr 2008
Location: Long Island, NY
Old 02-23-2009 , 16:09   Re: Ping Faker
Reply With Quote #15

so the CVAR "pingfake_flux" should be ??
What should it be and how does it work?

And thanks for the reply
C.H.U.D. is offline
Self-Serve
Member
Join Date: Jul 2008
Old 02-23-2009 , 17:06   Re: Ping Faker
Reply With Quote #16

Very unique idea!
__________________
Self-Serve is offline
Send a message via AIM to Self-Serve
FR0NTLINE
AlliedModders Donor
Join Date: Apr 2006
Location: Riverside Cali
Old 02-23-2009 , 20:07   Re: Ping Faker
Reply With Quote #17

nice work, sneaky
__________________
FR0NTLINE is offline
Send a message via AIM to FR0NTLINE Send a message via MSN to FR0NTLINE Send a message via Yahoo to FR0NTLINE
Old 02-23-2009, 21:48
FR0NTLINE
This message has been deleted by FR0NTLINE.
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-23-2009 , 21:53   Re: Ping Faker
Reply With Quote #18

Why so high of a number for max ping? I think it should be capped off at like 200 tops or even less. No? :\

ping = clamp(g_ping + random_num(-g_flux, g_flux), 0, 4095)
__________________

Last edited by Bugsy; 02-23-2009 at 23:12.
Bugsy is offline
FR0NTLINE
AlliedModders Donor
Join Date: Apr 2006
Location: Riverside Cali
Old 02-23-2009 , 23:01   Re: Ping Faker
Reply With Quote #19

Coo Plugin, but when i put the ping say at 34 for my bots these pings do not change. I'm thinkin they are suppose to jump around a lil?
__________________
FR0NTLINE is offline
Send a message via AIM to FR0NTLINE Send a message via MSN to FR0NTLINE Send a message via Yahoo to FR0NTLINE
FuZ!on
Senior Member
Join Date: Aug 2007
Old 02-23-2009 , 23:04   Re: Ping Faker
Reply With Quote #20

Quote:
Originally Posted by FR0NTLINE View Post
Coo Plugin, but when i put the ping say at 34 for my bots these pings do not change. I'm thinkin they are suppose to jump around a lil?
Quote:
pingfake_flux <0> - Fake ping fluctuation amount (0 = none)
FuZ!on is offline
Reply


Thread Tools
Display Modes

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


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