Raised This Month: $ Target: $400
 0% 

[REQ] Hud Msg for alive players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-20-2011 , 06:15   Re: [REQ] Hud Msg for alive players
Reply With Quote #13

Would be preferable to use get_players.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN  "Alive Player"
#define VERSION "1.0"
#define AUTHOR  "vato loco [GE-S]"

#define TASK_GETPLAYER    37852
#define TASK_LOOP_TIME    2.0

new g_SyncTeamCount

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
state OutOfRound

    g_SyncTeamCount 
CreateHudSyncObj()

    
register_logevent("LogEvent_Round_Start"2"1=Round_Start")
    
register_logevent("Logevent_Round_End"2"1=Round_End")

    
RegisterHam(Ham_Spawn"player""client_disconnect"true)
    
RegisterHam(Ham_Killed"player""client_disconnect"true)
}

public 
client_disconnect() <OutOfRound> {}
public 
client_disconnect() <InRound>
{
    
GetPlayers()
}

public 
LogEvent_Round_Start()
{
    
state InRound
    remove_task
TASK_GETPLAYER )
    
set_task(TASK_LOOP_TIME"GetPlayers"TASK_GETPLAYER, .flags="b")
}

public 
Logevent_Round_End()
{
    
state OutOfRound
    remove_task
TASK_GETPLAYER )
}

public 
GetPlayers()
{
    new 
iPlayers[32], iNumiTnumiCTnum
    get_players
(iPlayersiNum"a")
    for(--
iNumiNum>=0iNum--)
    {
        switch( 
cs_get_user_teamiPlayers[iNum] ) )
        {
            case 
CS_TEAM_T:++iTnum
            
case CS_TEAM_CT:++iCTnum
        
}
    }

    
set_hudmessage(255500, -1.00.04__TASK_LOOP_TIME+0.01_,  _1)
    
ShowSyncHudMsg(0g_SyncTeamCount"[Alive T: %d] - [Alive CT: %d]"iTnumiCTnum)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 10:23.


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