Raised This Month: $ Target: $400
 0% 

Problem with PlayersRemaining.sma


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bladell
Senior Member
Join Date: Jun 2012
Old 11-15-2014 , 06:32   Re: Problem with PlayersRemaining.sma
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <engine>

#define DELAY_A 150
#define DELAY_W 0.5
#define HUD_STAY DELAY_W + 0.1

enum _:CVARS {
    
RED,
    
GREEN,
    
BLUE,
    
LOCATION
};

enum _:TEAMS {
    
TE,
    
CT
};

new 
g_pCvarsCVARS ];

public 
plugin_init( ) 
{
    
register_plugin"Players Remaining""1.0""xPaw" );
    
    
g_pCvarsRED      ] = register_cvar"amx_pr_red",        "0" );
    
g_pCvarsGREEN    ] = register_cvar"amx_pr_green",      "127" );
    
g_pCvarsBLUE     ] = register_cvar"amx_pr_blue",       "255" );
    
    
register_event"HLTV""Event_HLTV_New_Round""a""1=0""2=0" );
    
register_logevent"Logevent_Round_End"2"1=Round_End" )
}


public 
Event_HLTV_New_Round( ) 
{
    new 
iEntity create_entity"info_target" );
    
    if( 
is_valid_entiEntity ) ) 
    {
        
entity_set_stringiEntityEV_SZ_classname"PlayersRemainThinker" );
        
entity_set_floatiEntityEV_FL_nextthinkget_gametime( ) + DELAY_A );
        
        
register_think"PlayersRemainThinker""FwdThink" );
    } 
    else
    {
        
set_task1.5 "ShowMessage"___"b"1243798 );
    }
}

public 
FwdThinkiEntity 
{
    
set_task1.5"ShowMessage"___"b"2542462 );
    
    
entity_set_floatiEntityEV_FL_nextthinkget_gametime( ) + DELAY_W );
}

public 
Logevent_Round_End( )
{
    
remove_task1243798 ); 
    
remove_task2542462 ); 
}

public 
ShowMessage( ) 
{
    new 
iPlayers32 ], iNumTEAMS ];
    
get_playersiPlayersiNumTE ], "ae""TERRORIST" );
    
get_playersiPlayersiNumCT ], "ae""CT" );
    
    if( 
iNumTE ] > || iNumCT ] > 
    {
        new 
iCvarsCVARS ];
        
        
iCvarsRED      ] = get_pcvar_numg_pCvarsRED      ] );
        
iCvarsGREEN    ] = get_pcvar_numg_pCvarsGREEN    ] );
        
iCvarsBLUE     ] = get_pcvar_numg_pCvarsBLUE     ] );

        
set_hudmessageiCvarsRED ], iCvarsGREEN ], iCvarsBLUE ], 0.790.510HUD_STAYHUD_STAY0.00.0);
        
        
show_hudmessage0"Zombie Connectés : %i^nSurvivants Restants : %i"iNumTE ], iNumCT ] );
    }

Bladell 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:43.


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