Raised This Month: $ Target: $400
 0% 

Proper way to cache user connection/alive state


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-14-2011 , 07:59   Proper way to cache user connection/alive state
Reply With Quote #1

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new boolg_isalive[33], bool:g_isconnected[33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_Killed"player""ham_PlayerKilled")
    
RegisterHam(Ham_Spawn"player""ham_PlayerSpawn_Post"1)
}

public 
client_putinserver(id)
    
g_isconnected[id]=true
    
public client_disconnect(id)
    
g_isconnected[id]=false
        
public ham_PlayerKilled(victimattackershouldgib)
    
g_isalive[victim]=false

public ham_PlayerSpawn_Post(id)
    
g_isalive[id]=true 
Is It this really enough? Will Ham detect if some other plugin will kill player some unusual way, DLLFunc_ClientKill, for example?
__________________

SonicSonedit is offline
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 04:18.


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