Raised This Month: $ Target: $400
 0% 

Solved This Way is Good For Get Client Dead?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
nea
Junior Member
Join Date: Jan 2017
Old 03-10-2017 , 08:05   This Way is Good For Get Client Dead?
Reply With Quote #1

Hello i was wonder if this way can get client dead probably without any mistake

that i use register_message for "ScoreAttrib" and check if the flag was dead and else mean he's alive

for example of code :
PHP Code:
#include <amxmodx>

new g_IsDead=0
public plugin_init()
{
    
register_plugin("Get Client Dead","1.0","Nea")
    
register_message(get_user_msgid("ScoreAttrib"),"fn_CheckIfDied")
}
public 
fn_CheckIfDied(_1,_2,_3/*i don't care about them anyway*/)
{
    new 
id get_msg_arg_int(1// We Get User ID
    
new flag get_msg_arg_int(2// Get User Status 
    
if(flag ==1// He's Dead Now
        
g_IsDead |= (1<<(id 31))
    else 
// He's Alive
        
g_IsDead &= ~ ( 1<< ( id 31) )

so now we have a variable [g_IsDead] that we can use to check if player died in future use..and we can also use a function that can be run when client dead in fn_CheckIfDead..
but i wonder is that way is bad or something like that i don't know about?

cuz when i used DeathMsg,there's some cases that no detected ..
for example when player killed by C4 in (Counter-Strike) it's not sent message about that..

Last edited by nea; 03-10-2017 at 13:57.
nea is offline
 



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 17:53.


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