Raised This Month: $ Target: $400
 0% 

Check if player WAS alive when he join spectator team


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 12-25-2008 , 08:52   Re: Check if player is alive when he join spectator team
Reply With Quote #4

Something like this:
PHP Code:
#include <amxmodx>

#define VERSION "1.0"

new bool:g_bAlive33 ];

public 
plugin_init()
{
    
register_plugin"Spectator Was Alive?"VERSION"Dores" );
    
    
register_event"DeathMsg""ev_Death""a" );
    
register_event"ResetHUD""ev_NotOnlyRespawnButThatsWhatINeed""b" );
    
register_event"TeamInfo""ev_TeamInfo""a" );
}

public 
ev_Death()
{
    
g_bAliveread_data) ] = false;
}

public 
ev_NotOnlyRespawnButThatsWhatINeedid )
{
    
g_bAlive bool:( is_user_aliveid ) );
}

public 
ev_TeamInfo()
{
    static 
id id read_data);
    
    static 
team15 ] ; read_data2teamcharsmaxteam ) );
    
    if( 
team] == 'S' && g_bAliveid ] )
    {
        
g_bAliveid ] = false;
        
client_print0print_chat"LoL Moved to Spectator team while being alive!" );
    }

Or instead of hooking ResetHUD use this:
PHP Code:
#include <fakemeta>

public plugin_init()
{
      
register_forwardFM_Spawn"Forward_Spawn");
}

// [...]
public Forward_Spawnent )
{
      static 
szClass32 ] ; peventpev_classnameszClasscharsmaxszClass ) );
      if( !
equalszClass"player" ) )
      {
            return;
      }
      
      
g_bAliveent ] = bool:( is_user_aliveent ) );
}

// Or this:
#include <hamsandwich>

public plugin_init()
{
      
RegisterHamHam_Spawn"player""Forward_PlayerSpawn");
}

public 
Forward_PlayerSpawnid )
{
      
g_bAliveid ] = bool:( is_user_aliveid ) );

__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 12-25-2008 at 12:56.
Dores 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 09:06.


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