AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Ping Faker 1.5 (https://forums.alliedmods.net/showthread.php?t=86241)

MeRcyLeZZ 02-22-2009 22:34

Ping Faker 1.5
 
4 Attachment(s)
Ping Faker

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 having a specific IP/SteamID. 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.

Installation
  • Extract .amxx file to your plugins folder, and add its name to plugins.ini
  • Extract .ini file to your amxmodx/configs folder
CVARS
  • pingfake_enable <0/1> - Enable/disable ping faking
  • pingfake_ping <1337> - The ping you want displayed (min: 0 // max: 4095)
  • pingfake_flux <0> - Fake ping fluctuation amount (0 = none)
  • pingfake_target <0/1> - Whether to display fake ping to its target too
  • pingfake_bots <0/1/2> - Affect bots too (set to 2 for bots ONLY setting)
  • pingfake_multiplier <0.0> - Set this to have the fake ping be a multiple of the player's real ping instead of fixed values (0.0 = disabled)
  • pingfake_fileonly <0/1> - Enable this to fake pings ONLY for players listed on the .INI file

Commands
  • amx_fakeping <target> <ping> - Toggle fake ping override for player (use -1 to disable)
You can also have players automatically get fake pings according to IP/SteamID by editing the "fakepings.ini" file in your configs folder.

Changelog

Code:

- Version: 1.5a (Jun 11, 2014)
* Fixed to send a single SVC_PINGS message using the real arguments from HL (this just means the code is now much simpler to understand)

- Version: 1.5 (Jun 06, 2011)
* Fixed plugin so that it works on all HL mods
* Removed CVAR pingfake_flags (not really needed anymore)
* Added feature (+CVAR) to have the plugin fake pings ONLY for players listed on the .INI file
* Fixed fake pings overriden after DeathMsg/TeamInfo events in CS

- Version: 1.4 (Mar 15, 2009)
* Added feature (+CVAR) to have the fake ping be a multiple of the player's real ping

- Version: 1.3 (Feb 24, 2009)
* Added admin command to manually toggle fake ping for players
* Added feature to automatically load fake pings from file

- Version: 1.2a (Feb 24, 2009)
* Fixed is_user_bot flag not being reset on disconnect

- Version: 1.2 (Feb 23, 2009)
* Added fake ping fluctuation and affect bots settings

- Version: 1.1 (Feb 23, 2009)
* Managed to send up to 3 pings on a single message, thus reducing bandwidth usage by 26%

- Version: 1.0 (Feb 23, 2009)
* Public release


{PHILMAGROIN} 02-22-2009 23:22

Re: Ping Faker
 
Really cool and good idea! If i still used my dedicated server i would for surely use this. (too bad i have a job and school haha) +karma

letgoofmyeggs 02-22-2009 23:23

Re: Ping Faker
 
is ther a way to make it have a random range.meaning noones ping stays the same for the whole time theyr playin in the server. so can it bounce around from a range like 20-30. this would b useful if you don want people to no your runin bots lol

Hawk552 02-23-2009 00:37

Re: Ping Faker
 
This plugin is well done.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.

ScHrAnZ DiNgEnS 02-23-2009 04:30

Re: Ping Faker
 
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 =)

One 02-23-2009 04:38

Re: Ping Faker
 
Illl lovin it

C.H.U.D. 02-23-2009 05:13

Re: Ping Faker
 
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?

ExKiLL 02-23-2009 05:31

Re: Ping Faker
 
nice idea!

a random ping would be nice
between x and y
or
+5 & -5 of x

Owyn 02-23-2009 08:18

Re: Ping Faker
 
does it affect high ping kickers?

One 02-23-2009 08:26

Re: Ping Faker
 
So i wannt to give my members fake ping, how can i add for members special pings?
4example :

on user with id : STEAM_ID_234234234 ping 2
on user with id : STEAM_ID_234234234 ping 2345234
& ....

Bugsy 02-23-2009 11:44

Re: Ping Faker
 
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()
    }



One 02-23-2009 13:04

Re: Ping Faker
 
Hmmm... i know nothing about fakemeta :mrgreen: could anyone make it 4 me ? this will be realy nice.

MeRcyLeZZ 02-23-2009 13:55

Re: Ping Faker
 
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...

One 02-23-2009 14:08

Re: Ping Faker
 
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 :mrgreen:like an extra hat for players. then when they are on server, they have special hats/ping

C.H.U.D. 02-23-2009 16:09

Re: Ping Faker
 
so the CVAR "pingfake_flux" should be ??
What should it be and how does it work?

And thanks for the reply

Self-Serve 02-23-2009 17:06

Re: Ping Faker
 
Very unique idea!

FR0NTLINE 02-23-2009 20:07

Re: Ping Faker
 
nice work, sneaky

Bugsy 02-23-2009 21:53

Re: Ping Faker
 
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)

FR0NTLINE 02-23-2009 23:01

Re: Ping Faker
 
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?

FuZ!on 02-23-2009 23:04

Re: Ping Faker
 
Quote:

Originally Posted by FR0NTLINE (Post 767774)
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)

FR0NTLINE 02-23-2009 23:57

Re: Ping Faker
 
Thanks bud i shouldn't of missed that.

MeRcyLeZZ 02-24-2009 13:14

Re: Ping Faker
 
Quote:

Originally Posted by Bugsy
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)

That's VALVe you should ask. Maybe they have plans to release another CS update that will raise pings over 4000 and add lots of more useless avatars and ads where nobody wants them. Who knows...

Quote:

Originally Posted by C.H.U.D.
so the CVAR "pingfake_flux" should be ??
What should it be and how does it work?

The higher you set it, the more fluctuation you get, e.g.:
With a target ping of 100 and flux of 10 you'll get random values between 90 and 110.

Quote:

Originally Posted by One
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

I just uploaded version 1.3 which includes a fakepings.ini file for this, hope you find it useful.

KWo 02-24-2009 13:38

Re: Ping Faker
 
About this plugin and bots - do You want to say Your plugin is able to show on the scoreboard of the client the fixed numeric value of the ping for a bot? Since CS1.6 the ping of bots on the scoreboard was always shown as an empty field eventually it says a string "BOT". Does this plugin really can put there any numeric value or I misunderstood the idea?

xPaw 02-24-2009 13:53

Re: Ping Faker
 
how i can make what admins have 1337 and bots have random ?

edit: hey mercy. is it possible to clean up this code more?^^ i just wanna to have admins 1337 ping, really no more
PHP Code:

#include <amxmodx>
#include <fakemeta>

new g_connected[33], g_offset[33][2], g_argping[33][3], g_maxplayers;

public 
plugin_init() {
    
register_plugin"Admins Leet Ping""1.3""MeRcyLeZZ" )
    
    
g_maxplayers get_maxplayers()
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_forward(FM_UpdateClientData"fw_UpdateClientData")
    
    
event_round_start()
}

public 
event_round_start()
    
calculate_arguments()

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;
    
    
// Send fake player's pings
    
static playersending
    sending 
0
    
for (player 1player <= g_maxplayersplayer++) {
        if (!
g_connected[player] || (id == player) || !(get_user_flags(player) & ADMIN_RESERVATION))
            continue;
        
        
// 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[player][0] * 64) + (* (player 1)))
                
write_short(g_argping[player][0])
                
sending++
            }
            case 
1: {
                
// Append additional data
                
write_byte((g_offset[player][1] * 128) + (* (player 1)))
                
write_short(g_argping[player][1])
                
sending++
            }
            case 
2: {
                
// Append additional data and end message
                
write_byte((* (player 1)))
                
write_short(g_argping[player][2])
                
write_byte(0)
                
message_end()
                
sending 0
            
}
        }
    }
    
    
// End message if not yet sent
    
if (sending) {
        
write_byte(0)
        
message_end()
    }
}

public 
calculate_arguments() {
    static 
playerping
    
for (player 1player <= g_maxplayersplayer++) {
        
// Calculate target ping (clamp if out of bounds)
        
ping 1337;
        
        
// First argument's ping
        
for (g_offset[player][0] = 0g_offset[player][0] < 4g_offset[player][0]++) {
            if ((
ping g_offset[player][0]) % == 0) {
                
g_argping[player][0] = (ping g_offset[player][0]) / 4
                
break;
            }
        }
        
// Second argument's ping
        
for (g_offset[player][1] = 0g_offset[player][1] < 2g_offset[player][1]++) {
            if ((
ping g_offset[player][1]) % == 0) {
                
g_argping[player][1] = (ping g_offset[player][1]) / 2
                
break;
            }
        }
        
// Third argument's ping
        
g_argping[player][2] = ping
    
}



C.H.U.D. 02-24-2009 14:13

Re: Ping Faker
 
Quote:

Originally Posted by KWo (Post 768142)
About this plugin and bots - do You want to say Your plugin is able to show on the scoreboard of the client the fixed numeric value of the ping for a bot? Since CS1.6 the ping of bots on the scoreboard was always shown as an empty field eventually it says a string "BOT". Does this plugin really can put there any numeric value or I misunderstood the idea?

Yes the bots now have fluctuating pings, very cool

ScHrAnZ DiNgEnS 02-24-2009 14:58

Re: Ping Faker
 
Thaaaaaaaaaaaanks 4 the nice Plugin and the nice updates!!!

rebrain 02-27-2009 12:21

Re: Ping Faker
 
hi, nice plugin. One question though. Is it possible to just subtract a certain amount off of players ping? Not to set a fixed one but the amount that depends on the actual ping of a player.

One 02-27-2009 12:37

Re: Ping Faker
 
Ty,

but its not working :

fakeping.ini :
PHP Code:

"STEAM_0:0:19795224" "1337"
"STEAM_0:0:17432139" "1"
"STEAM_0:0:19154950" "7" 

plugins.ini
PHP Code:

deagsmapmanager.amxx
timelimitvote
.amxx
pingfaker
.amxx 

amxx.cfg
PHP Code:

pingfake_enable 1                    Enable/disable ping faking 

so... when i enable the plugin, all users have any fake pings....not random but all have 1337 or 1 ... only on me is the ping 7

** Dont ask 4 my plugins.ini... i have all plugins in maps folder by maps names :D

ScHrAnZ DiNgEnS 02-28-2009 02:43

Re: Ping Faker
 
That is because the cvar with the adminflag. if u choose no flag for this the plugin it sets all pings to 1337.

I think that the code with the flag can be completely removed, because there is an ini file since the last relase.

One 03-02-2009 04:15

Re: Ping Faker
 
Quote:

Originally Posted by ScHrAnZ DiNgEnS (Post 770746)
That is because the cvar with the adminflag. if u choose no flag for this the plugin it sets all pings to 1337.

I think that the code with the flag can be completely removed, because there is an ini file since the last relase.

ty... im waiting for update...................

or maybe new things in discription how can a user set this....

flintridge 03-02-2009 10:31

Re: Ping Faker
 
Quote:

Originally Posted by C.H.U.D. (Post 768172)
Yes the bots now have fluctuating pings, very cool

So if i changed my bots names and added this. The only way they would know they are bots is by the horrible way they play?

And the fact they obey radio commands :)

Bugsy 03-02-2009 10:42

Re: Ping Faker
 
Quote:

Originally Posted by flintridge (Post 772326)
So if i changed my bots names and added this. The only way they would know they are bots is by the horrible way they play?

And the fact they obey radio commands :)

People can also tell by looking at the players time; all bots will usually have the identical amount of time on the server. This can definitely fool players who will not check multiple items just to confirm there are bots.

cpxchiseenjai 03-03-2009 20:09

Re: Ping Faker
 
It's a very nice plugin, but one problem is that whenever someone joins a side, the pings go back to normal really quick then back to the fake ping really quick. is there anyway you can fix that? :)








#team.eXceed 24/7 De_Dust2 Server:69.12.100.190:27015
#team.eXceed 24/7 Deathmatch Server:69.12.100.193:27016

MeRcyLeZZ 03-15-2009 20:42

Re: Ping Faker
 
Quote:

Originally Posted by cpxchiseenjai
It's a very nice plugin, but one problem is that whenever someone joins a side, the pings go back to normal really quick then back to the fake ping really quick. is there anyway you can fix that?

Yeah, I've noticed that too. Not sure about what's wrong though. The messages are received by the client normally, but it looks like they're just ignored...

WhightKnight 03-16-2009 00:33

Re: Ping Faker
 
Is that 1337nis I smell?

Thanks for plugin,
wk

d3iu 03-16-2009 15:02

Re: Ping Faker
 
What's wrong?
L 03/16/2009 - 21:00:09: [AMXX] Plugin "pingfaker.amxx" failed to load: Plugin uses an unknown function (name "ArrayGetCell") - check your modules.ini.
How do I go?
His don't work (said):((

MeRcyLeZZ 03-17-2009 14:04

Re: Ping Faker
 
Quote:

Originally Posted by d3iu (Post 782068)
What's wrong?
L 03/16/2009 - 21:00:09: [AMXX] Plugin "pingfaker.amxx" failed to load: Plugin uses an unknown function (name "ArrayGetCell") - check your modules.ini.
How do I go?
His don't work (said):((

Try redownloading/updating your AMXX files.

Empowers 03-18-2009 11:12

Re: Ping Faker
 
Wow! very-very nice..
but when death message appears pings goes back to normal for about a second... it was really annoying on meat server.. when every second some is killed...
Here is a decision of this problem:
PHP Code:

//....

public plugin_init()
{
    
//....
    
register_event("DeathMsg""Event_death""a")
}
    
//....

public Event_death()
{
    for(new 
player=1;player<=g_maxplayers;player++)
    {
        if(!
g_connected[player] || g_bot[player])
            continue;
            
        
fw_UpdateClientData(player)
    }


And I have 1 more problem ping is changing to fast on my server :( sometimes even 3 times per second

Jellric 03-19-2009 01:23

Re: Ping Faker
 
Doesn't work for me unfortunately.

It says it's running but no pings are changed.

cs1.7 03-26-2009 01:20

Re: Ping Faker
 
excellent plugin

+karma this guy!

cs1.7

---

edit

can someone give me a version of this plugin that leaves the players pings alone but has all this stuff for bots only?

or add a cvar or somethig: pingfake_humans 0/1

thx + many many +karmas !


All times are GMT -4. The time now is 04:24.

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