Raised This Month: $ Target: $400
 0% 

check <client> crash(not server!!)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 06-20-2009 , 11:15   check <client> crash(not server!!)
Reply With Quote #1

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]++
    }

__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!

Last edited by biscuit628; 06-20-2009 at 22:22.
biscuit628 is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 06-22-2009 , 01:31   Re: check <client> crash(not server!!)
Reply With Quote #2

anyone can help?
__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!
biscuit628 is offline
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-22-2009 , 01:38   Re: check <client> crash(not server!!)
Reply With Quote #3

Code:
Warning: Loose indentation on line 24
__________________
-Acid- is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-22-2009 , 01:42   Re: check <client> crash(not server!!)
Reply With Quote #4

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.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
biscuit628
Senior Member
Join Date: Jun 2007
Location: 香港HongKong
Old 06-22-2009 , 08:42   Re: check <client> crash(not server!!)
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
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?
__________________
My Plugins

C4man with fun

Sniper Skill bonus
-------------------------
Sorry for my poor English!
biscuit628 is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 06-22-2009 , 09:22   Re: check <client> crash(not server!!)
Reply With Quote #6

just set sv_timeout it will do the job
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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