Jump to content

Packet loss last second + Packet total kicker


Quited

Recommended Posts

Posted

I search in community.multitheftauto.com for packet loss kicker , but No result

Can someone give me Packet loss second + total kicker ?

Packet loss kicker in gamemode (tactics + aspect)

But i want it in BaseMode

  • MTA Team
Posted

You want things? Make things.

You can check the differences in ping and kick accordingly.

  
getPlayerPing() 
kickPlayer() 
setTimer() -- probably dont even need it 
  

Posted (edited)
  
-- PacketLoss Last second Kicker 
function packetLossCheck() 
    local loss = getNetworkStats()["packetlossLastSecond"] 
    if (loss > 33) then 
        kickPlayer ( source , High PacketLoss 33) 
    end 
end 
setTimer(packetLossCheck, 1000, 0) 

True or not ؟

And

  
-- PacketLoss Total Kicker 
function packetLossCheck() 
    local loss = getNetworkStats()["packetlossTotal"] 
    if (loss > 33) then 
        kickPlayer ( source , High PacketLoss 33) 
    end 
end 
setTimer(packetLossCheck, 1000 , 0) 

Edited by Guest
  • Moderators
Posted

Jep, + 3

  
--not very efficient... 
setTimer(function ()--packetLossCheck 
    for player,i in pairs(getElementsByType("player")) do 
        if getNetworkStats(player)["packetlossTotal"] > 33 then 
            kickPlayer ( player , "High PacketLoss. ") 
        end 
    end 
end, 1000 , 0) 

Posted
Jep, + 3
  
--not very efficient... 
setTimer(function ()--packetLossCheck 
    for player,i in pairs(getElementsByType("player")) do 
        if getNetworkStats(player)["packetlossTotal"] > 33 then 
            kickPlayer ( player , "High PacketLoss. ") 
        end 
    end 
end, 1000 , 0) 

ffs... timers?

Use getTickCount()...

Posted
Jep, + 3
  
--not very efficient... 
setTimer(function ()--packetLossCheck 
    for player,i in pairs(getElementsByType("player")) do 
        if getNetworkStats(player)["packetlossTotal"] > 33 then 
            kickPlayer ( player , "High PacketLoss. ") 
        end 
    end 
end, 1000 , 0) 

ffs... timers?

Use getTickCount()...

It's server sided, how are you expecting him to use getTickCount() to check if one second passed without having something that runs constantly? and there is no problem with timers when there is only one timer.

Also, 'i' and 'player' should which places in the loop.

  • Moderators
Posted
ffs... timers?

Use getTickCount()...

It is just 1 timer at server side.

I use(normally) tickcount but tickcount does not loop,,,.,.,.,.

Loop on client render can also sometimes be laggy, now you use also GPU power to loop.(+1 event), of course it is the best solution at client side.

@arezu

ah yes, my bad.

I wasn't really ..... and..

Posted

It wouldn't matter if you had 100 timers running at the same time if the server is just good enough to handle all that. One timer is nothing, not even if it had 50ms as it's duration and looped to infinite.

Posted
Jep, + 3
  
--not very efficient... 
setTimer(function ()--packetLossCheck 
    for player,i in pairs(getElementsByType("player")) do 
        if getNetworkStats(player)["packetlossTotal"] > 33 then 
            kickPlayer ( player , "High PacketLoss. ") 
        end 
    end 
end, 1000 , 0) 

ffs... timers?

Use getTickCount()...

It's server sided, how are you expecting him to use getTickCount() to check if one second passed without having something that runs constantly? and there is no problem with timers when there is only one timer.

Also, 'i' and 'player' should which places in the loop.

getTickCount() is still way better.

Oh and by the way, both functions are client-sided too.

Except for kickPlayer.

ffs... timers?

Use getTickCount()...

It is just 1 timer at server side.

I use(normally) tickcount but tickcount does not loop,,,.,.,.,.

Loop on client render can also sometimes be laggy, now you use also GPU power to loop.(+1 event), of course it is the best solution at client side.

@arezu

ah yes, my bad.

I wasn't really ..... and..

onClientRender laggy?

I'd upgrade your PC if I were you, because San Andreas is built in 2004 lol.

Also, what would you rather have... A lagging server or a lagging PC.

  • Moderators
Posted

Well maybe you should mind the differences.

-- why make a loop at clientside? You can't check other players their packetlossTotal at client side. 
for player, i in pairs --etc. 
  
  
-- server 
getNetworkStats(player)  -- or player is nill for the server network. 
  
-- client 
getNetworkStats() 
  

onClientRender laggy?

I'd upgrade your PC if I were you, because San Andreas is built in 2004 lol.

Also, what would you rather have... A lagging server or a lagging PC.

- HD 7970

- CPU Type QuadCore Intel Core i7, 3700 MHz (37 x 100) (hyperthreading)

- Module Name Corsair CML32GX3M4A1600C10 8 GB X 4

I am not laggy at all. Gta san is for that system a pathetic game. I am only play it, because I can modify it. :!:

But some people are playing at very weak pc's(especially laptops) . A little bit script performance would be welcome.

I already told you that I use getTickCount()!

I even use table(tickcount) timers to manage respawn from the players.

  • 7 months later...
Posted
i don't understand

You see this?

for player,i in pairs(getElementsByType("player")) do 

It should be:

for i,player in pairs(getElementsByType("player")) do 

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...