View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2020 , 01:17   Re: Revive plugin - some problem with compiling.
Reply With Quote #9

Here, work with this. Untested
PHP Code:

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

new const Version[] = "0.1";

new 
g_NumRevivesMAX_PLAYERS ];
new 
g_pTotalRevives g_pRequiredFlags;

public 
plugin_init() 
{
    
register_plugin"Revive" Version "bugsy" );
    
    
g_pTotalRevives register_cvar"allowed_revives" "3" );
    
g_pRequiredFlags register_cvar"revive_flags" "o" );
    
    
register_event"HLTV" "NewRound" "a" "1=0" "2=0" );
    
    
register_clcmd"say /revive" "Revive" );
    
register_clcmd"say_team /revive" "Revive" );
}

public 
NewRound()
{
    
arraysetg_NumRevives sizeofg_NumRevives ) );
}

public 
Reviveid )
{    
    new 
iTotalRevives szFlags26 ] , iFlags;
    
    
iTotalRevives get_pcvar_numg_pTotalRevives );
    
get_pcvar_stringg_pRequiredFlags szFlags charsmaxszFlags ) );
    
iFlags read_flagsszFlags );
    
    if ( ( ( 
get_user_flagsid ) & iFlags ) == iFlags ) && ( cs_get_user_teamid ) == CS_TEAM_CT ) )
    {
        if ( 
g_NumRevivesid ] < iTotalRevives )
        {
            if ( !
is_user_aliveid ) )
            {
                
ExecuteHamBHam_CS_RoundRespawn id );
                
g_NumRevivesid ]++;
                
                
client_printid print_chat "* You have now used %d of %d allowed revives" g_NumRevivesid ] , iTotalRevives );
            }
        }
        else
        {
            
client_printid print_chat "* You have already used %d of %d revives" iTotalRevives iTotalRevives );
        }
    }
    
    return 
PLUGIN_HANDLED;

__________________

Last edited by Bugsy; 04-05-2020 at 16:35.
Bugsy is offline