Raised This Month: $51 Target: $400
 12% 

Check for dead Player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asur
Member
Join Date: Dec 2014
Old 03-21-2015 , 04:06   Check for dead Player
Reply With Quote #1

Please provide me the codes for the following conditions :
-->If player connected is dead or not .
-->If player revived in the same round i.e full code of revive nd also check if particular player is revived.
Thanks
asur is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 03-21-2015 , 04:39   Re: Check for dead Player
Reply With Quote #2

User connected or not?

PHP Code:
is_user_connected 
User Alive or Not?

PHP Code:
is_user_alive 
As for the revive thing. You need to search around on the forum.
Spirit_12 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-21-2015 , 12:56   Re: Check for dead Player
Reply With Quote #3

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

new const Version[] = "0.1";

#define CheckIfRevived(%1)    (WasRevived & (1 << (%1 & 31)))
new WasRevived;

public 
plugin_init() 
{
    
register_plugin"Revive" Version "bugsy" );
    
    
register_event"HLTV""NewRound" "a" "1=0" "2=0" ); 
    
    
register_concmd"revive" "RevivePlayer" );
    
register_concmd"checkrevive" "CheckRevived" );
}

public 
NewRound() 
{
    
WasRevived 0;
}

public 
RevivePlayerid )
{
    new 
szArg32 ] , idPlayer;
    
read_argvszArg charsmaxszArg ) );
        
    if ( ( 
idPlayer cmd_targetid szArg ) ) && !is_user_aliveidPlayer ) )
    {
        
WasRevived |= ( << ( idPlayer 31 ) );
        
ExecuteHamBHam_CS_RoundRespawn idPlayer );
    }
    
    return 
PLUGIN_HANDLED;
}

public 
CheckRevivedid )
{
    new 
szArg32 ] , idPlayer;
    
read_argvszArg charsmaxszArg ) );
    
    if ( ( 
idPlayer cmd_targetid szArg ) ) )
    {
        
get_user_nameidPlayer szArg charsmaxszArg ) );
        
console_printid "%s was%s revived"  szArg CheckIfRevivedidPlayer ) ? "" " NOT" );
    }
    
    return 
PLUGIN_HANDLED;

__________________

Last edited by Bugsy; 03-21-2015 at 12:58.
Bugsy is offline
asur
Member
Join Date: Dec 2014
Old 03-22-2015 , 01:51   Re: Check for dead Player
Reply With Quote #4

Quote:
Originally Posted by Bugsy View Post
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

new const Version[] = "0.1";

#define CheckIfRevived(%1)    (WasRevived & (1 << (%1 & 31)))
new WasRevived;

public 
plugin_init() 
{
    
register_plugin"Revive" Version "bugsy" );
    
    
register_event"HLTV""NewRound" "a" "1=0" "2=0" ); 
    
    
register_concmd"revive" "RevivePlayer" );
    
register_concmd"checkrevive" "CheckRevived" );
}

public 
NewRound() 
{
    
WasRevived 0;
}

public 
RevivePlayerid )
{
    new 
szArg32 ] , idPlayer;
    
read_argvszArg charsmaxszArg ) );
        
    if ( ( 
idPlayer cmd_targetid szArg ) ) && !is_user_aliveidPlayer ) )
    {
        
WasRevived |= ( << ( idPlayer 31 ) );
        
ExecuteHamBHam_CS_RoundRespawn idPlayer );
    }
    
    return 
PLUGIN_HANDLED;
}

public 
CheckRevivedid )
{
    new 
szArg32 ] , idPlayer;
    
read_argvszArg charsmaxszArg ) );
    
    if ( ( 
idPlayer cmd_targetid szArg ) ) )
    {
        
get_user_nameidPlayer szArg charsmaxszArg ) );
        
console_printid "%s was%s revived"  szArg CheckIfRevivedidPlayer ) ? "" " NOT" );
    }
    
    return 
PLUGIN_HANDLED;

Thanks a lot
asur is offline
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:37.


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