Jump to content

[HELP] Ping Kick


1LoL1

Recommended Posts

On the wiki there is an example which should do what you want.

https://wiki.multitheftauto.com/wiki/GetPlayerPing

function kickPing() -- Creates a function called kickPing 
    for i, player in ipairs(getElementsByType("player")) do -- Loop every player 
        if (getPlayerPing(player) >= 500) then -- If their ping is over 500 
            kickPlayer(player, "Ping over 500!") -- Kick them 
        end 
    end 
end 
setTimer(kickPing, 5000, 0) -- Every 5 seconds, the kickPing function is called. 

Link to comment
On the wiki there is an example which should do what you want.

https://wiki.multitheftauto.com/wiki/GetPlayerPing

function kickPing() -- Creates a function called kickPing 
    for i, player in ipairs(getElementsByType("player")) do -- Loop every player 
        if (getPlayerPing(player) >= 500) then -- If their ping is over 500 
            kickPlayer(player, "Ping over 500!") -- Kick them 
        end 
    end 
end 
setTimer(kickPing, 5000, 0) -- Every 5 seconds, the kickPing function is called. 

And to make it even typed into the chat?

function kickPing() 
    for i, player in ipairs(getElementsByType("player")) do 
        if (getPlayerPing(player) >= 250) then 
            kickPlayer(player, "Ping over 250!") 
        outputChatBox("..getPlayerName.."" has been kicked for hight ping!") 
        end 
    end 
end 
 setTimer(kickPing, 5000, 0)  
  
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...