Raised This Month: $ Target: $400
 0% 

[REQ] Hud Msg for alive players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
nikolov
Senior Member
Join Date: Feb 2011
Old 03-18-2011 , 08:01   Re: [REQ] Hud Msg for alive players
Reply With Quote #3

Quote:
Originally Posted by vato loco [GE-S] View Post
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>

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

#define TASK_GETPLAYER     37852
#define SetBits(%1,%2)       %1 |= 1<<(%2 & 31)
#define ClearBits(%1,%2)   %1 &= ~(1<<(%2 & 31))
#define GetBits(%1,%2)       %1 &  1<<(%2 & 31)

new g_bitAlive
new g_SyncTeamCount
new g_iMaxPlayers

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled"1)
    
    
g_SyncTeamCount CreateHudSyncObj()
    
g_iMaxPlayers get_maxplayers()
    
    
set_task(0.5"GetPlayer"TASK_GETPLAYER__"b")
}

public 
client_putinserver(id)
{
    
ClearBits(g_bitAliveid)
}

public 
client_disconnect(id)
{
    
ClearBits(g_bitAliveid)
}

public 
fw_PlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        
SetBits(g_bitAliveid)
    }
}

public 
fw_PlayerKilled(id)
{
    
ClearBits(g_bitAliveid)
}

public 
GetPlayer()
{
    static 
idiTeam
    
new iPlayerTrroNumiPlayerCtNum
    
    
for(id 1id <= g_iMaxPlayersid++)
    {
        if(
GetBits(g_bitAliveid))
        {
            
iTeam get_user_team(id)
            
            switch(
iTeam)
            {
                case 
1: ++iPlayerTrroNum
                    
                
case 2: ++iPlayerCtNum
                    
            
}
        }
    }
    
set_hudmessage(255500, -1.00.04__2.0_,  _1)
    
ShowSyncHudMsg(0g_SyncTeamCount"[Alive T: %d] - [Alive CT: %d]"iPlayerTrroNumiPlayerCtNum)

It works, but can you add 2 hud messages :
1. T - with red color in left
2. CT - with blue color in right

and only alive players can see it this...
nikolov 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:22.


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