Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: Kewun on Aug 20, 2016, 11:54 AM

Title: Simple Low Fps, High Ping Kick
Post by: Kewun on Aug 20, 2016, 11:54 AM
function onPlayerHighPingCheck(playername,playerid)
{
local player = FindPlayer(playerid);
if (player == null || player.Name != playername) return 0;
if ( player.Ping > 220 ) {
Message(player.Name + " has been kicked for high ping ("+player.Ping+")")
MessagePlayer("[#ff0000]You were kicked for high ping ("+player.Ping+")",player)
player.Kick();
}
}
function onPlayerLowFPS(playername,playerid)
{
local player = FindPlayer(playerid);
if (player == null || player.Name != playername) return 0;
if ( player.FPS < 20 ) {
Message("[#ff0000]Server Security System has kicked ("+player.Name + ") for low fps ("+player.FPS+")")
MessagePlayer("[#ff0000]You were kicked for low fps ("+player.FPS+")",player)
player.Kick();
}
}

onplayer join:

NewTimer("onPlayerLowFPS", 500, 0, player.Name, player.ID )
NewTimer("onPlayerHighPingCheck",500,0, player.Name, player.ID )


code tested, and works.
Title: Re: Simple Low Fps, High Ping Kick
Post by: Cool on Aug 20, 2016, 12:55 PM
This can be done without timer see precious version pings
Title: Re: Simple Low Fps, High Ping Kick
Post by: KAKAN on Aug 20, 2016, 01:16 PM
Take an average ping else if the ping fluctuates, the player would be keeked
Title: Re: Simple Low Fps, High Ping Kick
Post by: Xmair on Aug 20, 2016, 04:38 PM
This is better. (http://viceunderdogs.com/index.php?topic=7288)
Title: Re: Simple Low Fps, High Ping Kick
Post by: Kewun on Aug 20, 2016, 05:41 PM
I Only released a basic script. I dont need anyone's recommendation for other scripts.