AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   check <client> crash(not server!!) (https://forums.alliedmods.net/showthread.php?t=95166)

biscuit628 06-20-2009 11:15

check <client> crash(not server!!)
 
is this a good way to check is client get crash?
PHP Code:

#include <amxmodx>

new oldping[33],oldloss[33]
new 
ping[33],loss[33]
new 
iscrash[33]

public 
checkping1(id)
{
    
get_user_ping(id,oldping[id],oldloss[id])
    if(
oldping[id] > 2000)
        
server_cmd("kick #%d over2000",get_user_userid(id))
    
set_task(2.0,"checkping2",id)
}

public 
checkping2(id)
{
    
get_user_ping(id,ping[id],loss[id])
    if(
ping[id] == oldping[id])
    {
        if(
iscrash[id] > 2)
            
server_cmd("kick #%d oldping",get_user_userid(id))
        else
            
set_task(2.0,"checkping1",id)
            
iscrash[id]++
    }



biscuit628 06-22-2009 01:31

Re: check <client> crash(not server!!)
 
anyone can help?

-Acid- 06-22-2009 01:38

Re: check <client> crash(not server!!)
 
Code:

Warning: Loose indentation on line 24

ConnorMcLeod 06-22-2009 01:42

Re: check <client> crash(not server!!)
 
I think clients can have the same ping 3 times in a row, so this method wouldn't be reliable.
Make a test version, and when your plugin detects players, ask them or see score if their ping is stuck or still variate.

biscuit628 06-22-2009 08:42

Re: check <client> crash(not server!!)
 
Quote:

Originally Posted by ConnorMcLeod (Post 853941)
I think clients can have the same ping 3 times in a row, so this method wouldn't be reliable.
Make a test version, and when your plugin detects players, ask them or see score if their ping is stuck or still variate.

oh..
so is that have another way to check?

Owyn 06-22-2009 09:22

Re: check <client> crash(not server!!)
 
just set sv_timeout it will do the job


All times are GMT -4. The time now is 15:28.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.