Raised This Month: $64 Target: $400
 16% 

catch on client_disconnect


Post New Thread Reply   
 
Thread Tools Display Modes
E1_531G
Senior Member
Join Date: Dec 2017
Old 11-10-2018 , 13:32   Re: catch on client_disconnect
Reply With Quote #11

xPaw's solution didn't work anymore?
https://forums.alliedmods.net/showth...=xpaw+deathrun
__________________
My English is A0
E1_531G is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-10-2018 , 13:50   Re: catch on client_disconnect
Reply With Quote #12

Added 'e' flag and added Terrorist.

If using 1.9 then you should use get_players_ex() with the appropriate flags.
__________________
Bugsy is offline
JocAnis
Senior Member
Join Date: Jun 2010
Old 11-10-2018 , 14:06   Re: catch on client_disconnect
Reply With Quote #13

@e1, idk i dont use his plugin anymore
thanks bugsy for that..probably gonna use that func cuz i dont see how to detect if player timed_out without orpeu
__________________
KZ Public Autocup
DR Timer (selling) - Top15 images
JocAnis is online now
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-10-2018 , 14:35   Re: catch on client_disconnect
Reply With Quote #14

I wouldn't bother doing much more for this, what I gave you will cover what you need.
__________________
Bugsy is offline
shauli
Member
Join Date: Jun 2018
Old 11-11-2018 , 07:03   Re: catch on client_disconnect
Reply With Quote #15

Quote:
Originally Posted by JocAnis View Post
interesting, thanks..
but because its deathrun (1TR + othersCT) we can shorten it to not loop all players, but only to check TR ?
If you do that then save the new terrorist origin immediately after teleporting him, for the rare cases that the new terrorist will instantly retry before the loop happens.
shauli is offline
JocAnis
Senior Member
Join Date: Jun 2010
Old 11-11-2018 , 17:57   Re: catch on client_disconnect
Reply With Quote #16

@shauli, hmm didint undestand what exactly do you mean
idk why but i really have desire to it with client_disconnect ...tryed with kill process (if that includes task manager, dunno) and the origin was correct, the practical code would be:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <hamsandwich>
#include <colorchat>

#define PLUGIN "TR Replacer"
#define VERSION "1.0"
#define AUTHOR "doesntmatter"

new Float:fOrigin]
new 
g_Name33 ]

public 
plugin_init() 
{
    
register_pluginPLUGINVERSIONAUTHOR )
}
public 
client_disconnectid )
{
    if( 
is_user_botid ) || cs_get_user_teamid ) != CS_TEAM_T )
        return
    
    
entity_get_vectoridEV_VEC_originfOrigin )
    
get_user_nameidg_Namecharsmaxg_Name ) )
        
    new 
ctAlive32 ], ctDead32 ], ctDctAii
    
    get_players
ctAlivectA"aeh""CT" )
    
get_playersctDeadctD"beh""CT" )
    
    if( 
ctD >= && ctA >= //priority is to transfer dead players, but if there min 2cts
    
{
        
ii ctDeadrandomctD ) ]
        
Respawnii)
    }
    else if( 
ctD == && ctA >= )
    {
        
ii ctAliverandomctA ) ]
        
Respawnii)
    }    
}
public 
Respawnidtype )
{
    new 
name32 ]
    
get_user_nameidnamecharsmaxname ) )
    
cs_set_user_teamidCS_TEAM_T )
    
    if( 
type == //dead CT
    
{
        
ExecuteHamBHam_CS_RoundRespawnid )    
    }
    
entity_set_originidfOrigin )
    
    
ColorChat0BLUE"^4[DR]^1 %s disconnected, new terrorist is:^3 %s"g_Namename )

__________________
KZ Public Autocup
DR Timer (selling) - Top15 images

Last edited by JocAnis; 11-12-2018 at 08:20. Reason: check tr disconnect
JocAnis is online now
Reply


Thread Tools
Display Modes

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 22:25.


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