AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How can i put hud/chat on player (https://forums.alliedmods.net/showthread.php?t=204367)

Jhob94 12-29-2012 15:37

How can i put hud/chat on player
 
Hi
Can someone tell me how i put something on player like health bar.
What i want is like:
Player have bool: Has_Speed so will say in him head Speed, or Has_gravity and people see Gravity
That isnt for Speed or gravity, but that's an example of what i need xD

Blizzard_87 12-29-2012 15:51

Re: How can i put hud/chat on player
 
why don't you tell us exactly what you would like?

ironskillz1 12-29-2012 16:05

Re: How can i put hud/chat on player
 
Quote:

Originally Posted by Jhob94 (Post 1862928)
Hi
Can someone tell me how i put something on player like health bar.
What i want is like:
Player have bool: Has_Speed so will say in him head Speed, or Has_gravity and people see Gravity
That isnt for Speed or gravity, but that's an example of what i need xD

Code:

#include <amxmodx>

#define VERSION "0.0.2"

#define FIRST_PLAYER_ID    1
#define MAX_PLAYERS        32

new
g_iMaxPlayers
#define IsPlayer(%1)    ( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )

new g_iAiming[MAX_PLAYERS+1
]

new
g_pCvarHoldTime
new
g_iSyncHud

public plugin_init
()
{
   
register_plugin("Aimed Player Name", VERSION, "ConnorMcLeod"
)

   
g_pCvarHoldTime = register_cvar("aim_msg_time", "5"
)

   
set_msg_block(get_user_msgid("StatusText"), BLOCK_SET
)

   
register_event("StatusValue", "Event_StatusValue", "be", "1<3"
)

   
g_iMaxPlayers = get_maxplayers
()
   
g_iSyncHud = CreateHudSyncObj
()
}

public
client_putinserver( id
)
{
   
g_iAiming[id] =
0
}

public
Event_StatusValue( id
)
{
    new
iPlayer = read_data(2
)
    if(
iPlayer != g_iAiming[id
] )
    {
       
g_iAiming[id] =
iPlayer
       
if( IsPlayer(iPlayer
) )
        {
            new
szName[32
]
           
get_user_name(iPlayer, szName, charsmax(szName
))
           
set_hudmessage(200, 100, 50, -1.0, 0.35, 0, 0.01, get_pcvar_float(g_pCvarHoldTime), 0.01, 0.01, -1
)
           
ShowSyncHudMsg(id, g_iSyncHud, szName
)
        }
    }
}



Jhob94 12-29-2012 17:15

Re: How can i put hud/chat on player
 
Quote:

Originally Posted by Blizzard_87 (Post 1862938)
why don't you tell us exactly what you would like?

It wouldnt make diference :P

ironskillz it isnt what iam really looking for....


All times are GMT -4. The time now is 13:45.

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