Raised This Month: $ Target: $400
 0% 

lol


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BodyBuilder
BANNED
Join Date: Jun 2011
Location: Europa-USA-Moon
Old 08-06-2011 , 04:07   lol
Reply With Quote #1

lol

Last edited by BodyBuilder; 12-23-2012 at 12:39.
BodyBuilder is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-06-2011 , 04:10   Re: not showing weapon name !
Reply With Quote #2

That's wrong.

PHP Code:
register_event("StatusValue","ShowSPlayerName","be","2=2","2!0"
Where did you get that line?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Old 08-06-2011, 04:11
BodyBuilder
This message has been deleted by BodyBuilder.
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-06-2011 , 04:16   Re: not showing weapon name !
Reply With Quote #4

http://wiki.amxmodx.org/Half-Life_1_Game_Events
It says HL1 game events, not CS game events.
Even though there are specific events in there for CS.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
BodyBuilder
BANNED
Join Date: Jun 2011
Location: Europa-USA-Moon
Old 08-06-2011 , 04:23   Re: not showing weapon name !
Reply With Quote #5

not showing !
BodyBuilder is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-06-2011 , 05:01   Re: not showing weapon name !
Reply With Quote #6

Quote:
Originally Posted by BodyBuilder View Post
not showing !
I got that when you said it wasn't showing in your first post...
Is the event even hooking?
Did you try adding some testing messages to make sure functions and such are being called proeprly?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-06-2011 , 05:01   Re: not showing weapon name !
Reply With Quote #7

Code:
enum sbar_data
{
	SBAR_ID_TARGETNAME = 1,
	SBAR_ID_TARGETHEALTH,
	SBAR_ID_TARGETARMOR,
	SBAR_END,
};

void CBasePlayer :: UpdateClientData( void )
{
    /* [ ... ] */


	// Update Status Bar
	if ( m_flNextSBarUpdateTime < gpGlobals->time )
	{
		UpdateStatusBar();
		m_flNextSBarUpdateTime = gpGlobals->time + 0.2;
	}
}

void CBasePlayer::UpdateStatusBar()
{
	int newSBarState[ SBAR_END ];
	char sbuf0[ SBAR_STRING_SIZE ];
	char sbuf1[ SBAR_STRING_SIZE ];

	memset( newSBarState, 0, sizeof(newSBarState) );
	strcpy( sbuf0, m_SbarString0 );
	strcpy( sbuf1, m_SbarString1 );

	// Find an ID Target
	TraceResult tr;
	UTIL_MakeVectors( pev->v_angle + pev->punchangle );
	Vector vecSrc = EyePosition();
	Vector vecEnd = vecSrc + (gpGlobals->v_forward * MAX_ID_RANGE);
	UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, edict(), &tr);

	if (tr.flFraction != 1.0)
	{
		if ( !FNullEnt( tr.pHit ) )
		{
			CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit );

			if (pEntity->Classify() == CLASS_PLAYER )
			{
				newSBarState[ SBAR_ID_TARGETNAME ] = ENTINDEX( pEntity->edict() );
				strcpy( sbuf1, "1 %p1\n2 Health: %i2%%\n3 Armor: %i3%%" );

				// allies and medics get to see the targets health
				if ( g_pGameRules->PlayerRelationship( this, pEntity ) == GR_TEAMMATE )
				{
					newSBarState[ SBAR_ID_TARGETHEALTH ] = 100 * (pEntity->pev->health / pEntity->pev->max_health);
					newSBarState[ SBAR_ID_TARGETARMOR ] = pEntity->pev->armorvalue; //No need to get it % based since 100 it's the max.
				}

				m_flStatusBarDisappearDelay = gpGlobals->time + 1.0;
			}
		}
		else if ( m_flStatusBarDisappearDelay > gpGlobals->time )
		{
			// hold the values for a short amount of time after viewing the object
			newSBarState[ SBAR_ID_TARGETNAME ] = m_izSBarState[ SBAR_ID_TARGETNAME ];
			newSBarState[ SBAR_ID_TARGETHEALTH ] = m_izSBarState[ SBAR_ID_TARGETHEALTH ];
			newSBarState[ SBAR_ID_TARGETARMOR ] = m_izSBarState[ SBAR_ID_TARGETARMOR ];
		}
	}

	BOOL bForceResend = FALSE;

	if ( strcmp( sbuf0, m_SbarString0 ) )
	{
		MESSAGE_BEGIN( MSG_ONE, gmsgStatusText, NULL, pev );
			WRITE_BYTE( 0 );
			WRITE_STRING( sbuf0 );
		MESSAGE_END();

		strcpy( m_SbarString0, sbuf0 );

		// make sure everything's resent
		bForceResend = TRUE;
	}

	if ( strcmp( sbuf1, m_SbarString1 ) )
	{
		MESSAGE_BEGIN( MSG_ONE, gmsgStatusText, NULL, pev );
			WRITE_BYTE( 1 );
			WRITE_STRING( sbuf1 );
		MESSAGE_END();

		strcpy( m_SbarString1, sbuf1 );

		// make sure everything's resent
		bForceResend = TRUE;
	}

	// Check values and send if they don't match
	for (int i = 1; i < SBAR_END; i++)
	{
		if ( newSBarState[i] != m_izSBarState[i] || bForceResend )
		{
			MESSAGE_BEGIN( MSG_ONE, gmsgStatusValue, NULL, pev );
				WRITE_BYTE( i );
				WRITE_SHORT( newSBarState[i] );
			MESSAGE_END();

			m_izSBarState[i] = newSBarState[i];
		}
	}
}

Code:
register_event("StatusValue","ShowSPlayerName","be","2=2","2!0")

->

Code:
register_event("StatusValue", "ShowSPlayerName", "be", "1=1")
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-06-2011 at 05:04.
ConnorMcLeod is offline
Old 08-06-2011, 06:11
BodyBuilder
This message has been deleted by BodyBuilder.
2reason2kill
Senior Member
Join Date: Feb 2011
Old 08-06-2011 , 06:31   Re: not showing weapon name !
Reply With Quote #9

Quote:
Originally Posted by BodyBuilder View Post
how update showing if end ?
PHP Code:
#include amxmodx
#include geoip

new 
Show_Cvars[5],
HudMessage[1024]

public 
plugin_init() 
{
    
register_event("StatusValue","ShowSPlayerName","be","1=1")
    
Show_Cvars[0] = register_cvar("hldm_show_name","1")
    
Show_Cvars[1] = register_cvar("hldm_show_ip","0")
    
Show_Cvars[2] = register_cvar("hldm_show_health","1")
    
Show_Cvars[3] = register_cvar("hldm_show_armor","1")
}

public 
ShowSPlayerName(id
{
    if(!
is_user_bot(id) && is_user_connected(id)) 
{
    static 
name[32], ip[32], WeaponName[32], SHOWvictim

    victim 
read_data(2)

    
get_user_name(victim,name,31)

    
get_user_ip(victim,ip,31,1)

    if(
get_pcvar_num(Show_Cvars[0]))
    
SHOW += format(HudMessage[SHOW],sizeof HudMessage SHOW,"%s^n^n",name)
        
    if(
get_pcvar_num(Show_Cvars[1]))
    
SHOW += format(HudMessage[SHOW],sizeof HudMessage SHOW,"IP: %s",ip)
        
    if(
get_pcvar_num(Show_Cvars[2]))
    
SHOW += format(HudMessage[SHOW],sizeof HudMessage SHOW,"^nHealth: %d",get_user_health(victim))
        
    if(
get_pcvar_num(Show_Cvars[3]))
    
SHOW += format(HudMessage[SHOW],sizeof HudMessage SHOW,"^n%Armor: %d",get_user_armor(victim))

    
set_hudmessage(255,255,0,-1.0,0.60,1,0.01,2.0,0.01,0.01,4
    
ShowSyncHudMsg(id,CreateHudSyncObj(),"%s",HudMessage)

    
SHOW 0

    HudMessage
[0] = 0
}
    return 
PLUGIN_HANDLED 

Its as far iknow
PHP Code:
#include <amxmodx>
#include <geoip> 
2reason2kill is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-06-2011 , 06:35   Re: not showing weapon name !
Reply With Quote #10

Quote:
Originally Posted by BodyBuilder View Post
how update showing if end ?
PHP Code:
#include amxmodx
#include geoip

new 
Show_Cvars[5],
HudMessage[1024]

public 
plugin_init() 
{
    
register_event("StatusValue","ShowSPlayerName","be","1=1")
    
Show_Cvars[0] = register_cvar("hldm_show_name","1")
    
Show_Cvars[1] = register_cvar("hldm_show_ip","0")
    
Show_Cvars[2] = register_cvar("hldm_show_health","1")
    
Show_Cvars[3] = register_cvar("hldm_show_armor","1")
}

public 
ShowSPlayerName(id
{
    if(!
is_user_bot(id) && is_user_connected(id)) 
{
    static 
name[32], ip[32], WeaponName[32], SHOWvictim

    victim 
read_data(2)

    
get_user_name(victim,name,31)

    
get_user_ip(victim,ip,31,1)

    if(
get_pcvar_num(Show_Cvars[0]))
    
SHOW += format(HudMessage[SHOW],sizeof HudMessage SHOW,"%s^n^n",name)
        
    if(
get_pcvar_num(Show_Cvars[1]))
    
SHOW += format(HudMessage[SHOW],sizeof HudMessage SHOW,"IP: %s",ip)
        
    if(
get_pcvar_num(Show_Cvars[2]))
    
SHOW += format(HudMessage[SHOW],sizeof HudMessage SHOW,"^nHealth: %d",get_user_health(victim))
        
    if(
get_pcvar_num(Show_Cvars[3]))
    
SHOW += format(HudMessage[SHOW],sizeof HudMessage SHOW,"^n%Armor: %d",get_user_armor(victim))

    
set_hudmessage(255,255,0,-1.0,0.60,1,0.01,2.0,0.01,0.01,4
    
ShowSyncHudMsg(id,CreateHudSyncObj(),"%s",HudMessage)

    
SHOW 0

    HudMessage
[0] = 0
}
    return 
PLUGIN_HANDLED 

Re-state what you mean, BTW Why isnt your code indented ?!, Which Software are u using for making plugins !!
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Reply



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 03:25.


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