Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: =RK=MarineForce on May 28, 2020, 02:04 PM

Title: Simple Ping System
Post by: =RK=MarineForce on May 28, 2020, 02:04 PM
onPlayerJoin
NewTimer( "pinglimit", 3000, 0, player.ID );
Class:
warning
function pinglimit(player)
{
local player = FindPlayer(player);
if(player.IsSpawned)
{
if(player.Ping > 400)
{
player.Pos.z += 5;
stats[player.ID].warning++;
MessagePlayer(" " + bazi + " You've been slapped due to having high ping! ",player);
if(stats[player.ID].warning = 1)Message(" " + bazi + " " + player.Name + " WARNED PING LIMIT (1/8) ");
if(stats[player.ID].warning = 2)Message(" " + bazi + " " + player.Name + " WARNED PING LIMIT (2/8) ");
if(stats[player.ID].warning = 3)Message(" " + bazi + " " + player.Name + " WARNED PING LIMIT (3/8) ");
if(stats[player.ID].warning = 4)Message(" " + bazi + " " + player.Name + " WARNED PING LIMIT (4/8) ");
if(stats[player.ID].warning = 5)Message(" " + bazi + " " + player.Name + " WARNED PING LIMIT (5/8) ");
if(stats[player.ID].warning = 6)Message(" " + bazi + " " + player.Name + " WARNED PING LIMIT (6/8) ");
if(stats[player.ID].warning = 7)Message(" " + bazi + " " + player.Name + " WARNED PING LIMIT (7/8) ");
if(stats[player.ID].warning = 8)Message(" " + bazi + " " + player.Name + "  KICKED DUE TO HAVING PING (8/8)");
if(stats[player.ID].warning = 8)KickPlayer(player);
}
}

}

you can freeze player too if him ping high or slap or drown . but this system is good. you can also add fps system just add FPS instead of Ping
Title: Re: Simple Ping System
Post by: SHy^ on May 28, 2020, 03:21 PM
Hmm. great. The warning shouldn't be sent after 3 seconds. Should be sent after every 1/2 mint btw.
It also contains wrong parameters(spaces) in some lines ( in function)

It's going to give you a lot of errors.
Title: Re: Simple Ping System
Post by: Gito Baloch on May 30, 2020, 04:59 AM
What is "+bazi+" ?
Title: Re: Simple Ping System
Post by: SHy^ on May 30, 2020, 09:12 AM
Quote from: Gitobaloch on May 30, 2020, 04:59 AMWhat is "+bazi+" ?
He uses it as like
const bazi = [#ff00ff] I guess,also he has released a broken code with too much errors.
Title: Re: Simple Ping System
Post by: Gito Baloch on May 30, 2020, 06:03 PM
But still appreciate him he did something to the community. thanks my love @=RK=MarineForce  for providing the system.
Title: Re: Simple Ping System
Post by: Saiyan Attack on May 30, 2020, 06:11 PM
Lol
Title: Re: Simple Ping System
Post by: Saiyan Attack on May 30, 2020, 06:14 PM
Instead of soo sooo many warning u can simply put message

Message(" " + noobmaster6162 + " " + player.Name + " WARNED PING LIMIT ("+stats[user.id].warning+"/8) ");
Title: Re: Simple Ping System
Post by: KX on May 31, 2020, 03:16 AM
if(stats[player.ID].warning = 1)https://developer.electricimp.com/squirrel/squirrel-guide/operators