San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
billy1337samp - 04.11.2017
Hello everyone. This is "ePing" from San Andreas Essentials. I have released a few earlier versions on Github but not on SA-MP forums as I believed it was too simple and 'buggy'. This is a stable release. Yes this script is small and simple and it's made to be like that. It's nothing serious.
I'm learning PAWN so my work isn't exactly 100% and my SAMP knowledge isn't 100% too.
You can edit this script as how you like but please do not release it under your own name. In-fact, do not release it at all. You can only edit it and use it for your own needs.
What is ePing?
ePing is a basic filterscript to make your server fair and making sure players with high pings do not have any advantages or disadvantages over any other players.
How does it work?
If a players ping is above
MAX_PING then they will be frozen.
Hey what if other players attack them while they are frozen?
That is not possible as the script
saves their current health health and gives them infinity health. After the players ping goes down then they will be
unfrozen and get their
original health back.
Credits
Code:
- fouzen (helped me on saving players original health and a few bugs)
- Billz (me)
Github
This project is being updated on it's Github page. There you can find it's
previous versions and latest updates.
How does the projects Github work?
Visit
/old/ for the projects previous (and current) versions
Visit
/updates/for the projects current updates
Visit the main dictionary for the latest .pwn project files
Finally, the download/link
Github
ePing.pwn:
https://raw.githubusercontent.com/SA...ster/ePing.pwn <
- Save as .pwn
Github UPDATES .txt:
https://raw.githubusercontent.com/SA...tes/ePing.txt?
Screenshots
My health before I got Ping Banned: (My health was 29.0)
My health while I was Ping Banned: (My health was INFINITE and I was FROZEN)
My health after I was Ping Banned: (My health after the Ping Ban returned back to 29.0)
Re: San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
Kaperstone - 04.11.2017
Quote:
Originally Posted by billy1337samp
What is ePing?
ePing is a basic filterscript to make your server fair and making sure players with high pings do not have any advantages or disadvantages over any other players.
How does it work?
If a players ping is above MAX_PING then they will be frozen.
Hey what if other players attack them while they are frozen?
That is not possible as the script saves their current health health and gives them infinity health. After the players ping goes down then they will be unfrozen and get their original health back.
|
That's still an advantage.
Re: San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
billy1337samp - 04.11.2017
Quote:
Originally Posted by Kaperstone
That's still an advantage.
|
How?
It's an advantage to the server - instead of kicking the player we are still keeping them and they can chat while they are ping banned
It's advantages to the player and other players - weird stuff happens when people lag
On the next update the
MAX_PING will change to
WARN_PING and freeze the player (like before) and then add
MAX_PING to
kick(i) the player (can be optional).
so
#define WARN_PING 150
#define MAX_PING 300
Re: San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
Kaperstone - 04.11.2017
Quote:
Originally Posted by billy1337samp
How? :S
|
Escape with low health on team death match.
You might be surrounded by enemies, you can get frozen in the middle of it - right before dying and if your team comes over right in time, you've basically escaped death.
Re: San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
billy1337samp - 04.11.2017
Quote:
Originally Posted by Kaperstone
Escape with low health on team death match.
You might be surrounded by enemies, you can get frozen in the middle of it - right before dying and if your team comes over right in time, you've basically escaped death.
|
In your scenario Player A was surrounded by enemies and gets frozen.
Player A's team mates came and killed
Player B and his team mates. So in the end
Player A was safe.
But what if, Player A got frozen,
player A's team came but
player B's team killed them all, leaving
player A to die last when their ping goes normal.
Or what if, Player A was a pro and him being frozen saved
Player B's team
Or, what if the person who was ping banned was a hacker on a
VPN and him being ping banned is a good thing.
In the end, it's a
50/50 chance what will happen.
Re: San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
Kaperstone - 04.11.2017
Quote:
Originally Posted by billy1337samp
In the end, it's a 50/50 chance what will happen.
|
No, launch yourself into a lag intentionally and look how's that 50/50 turns into an abuse of the filter script by a bunch of kiddos.
You don't even need to write a hack for it, just launch a few downloads.
Its better to kick them rather than leave them in-game.
Lag is no fun for the one who is lagging, but its a lot less fun for the one who needs to deal with other people's lag, lag can be utilized and it cannot be dealt with properly but have better connection.
Re: San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
Kaperstone - 04.11.2017
pawn Code:
new name[MAX_PLAYER_NAME]
MAX_PLAYER_NAME + 1 for the null character \0
pawn Code:
string[24+MAX_PLAYER_NAME]
pawn Code:
format(string, sizeof(string), "SERVER: %s has been ping banned.", name);
It will cut at `banned` if the player has 24 characters, it is 30 characters long without the username, not including the null character
You don't have to define it.
Why are you using PVar? You're sharing arrays with an unknown gamemode?
PVar is intended for it and you better not use it just like that because it is slower than using normal arrays.
Moreover, using OnPlayerUpdate is risky, it can be called over 30 times a second - depending on the players behavior.
I'd use a timer for this
Re: San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
billy1337samp - 04.11.2017
THanks I'm on a mobile device right now. I'll update it tomorrow or whenever I'm not busy
Re: San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
AjaxM - 05.11.2017
Kaperstone is absolutely right. I would also like to point out a few things:
a) You should check whether the player's ping is
65535 before "ping banning" him as it
sometimes happen that a player's ping is set to 65535 upon connecting to the server.
b) I'd advise you to rather use
PHP Code:
if(GetPlayerPing(playerid) < MAX_PING && isFrozen[playerid])
than
PHP Code:
else if(GetPlayerPing(playerid) < MAX_PING)
{
if(isFrozen[playerid])
c) Use a timer instead of OnPlayerUpdate
Overall, it's a good idea but needs improvement.
Re: San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
billy1337samp - 05.11.2017
Updated.
Re: San Andreas Essentials: ePing | Freeze Player With High Ping | Anti-High Ping | -
billy1337samp - 23.11.2017
-edit- wrong thread