Raised This Month: $ Target: $400
 0% 

StatusValue player is not looks at players.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fl0werD
Senior Member
Join Date: May 2011
Old 01-22-2013 , 14:09   StatusValue player is not looks at players.
Reply With Quote #1

As one hook call StatusValue, when the player is not looks at the players?

Test plugin:
PHP Code:
#include <amxmodx>

public plugin_init() register_event("StatusValue""EventStatsValue""be")

public 
EventStatsValue(iPlayerclient_print(iPlayerprint_chat"Data1: %d, Data 2: %d"read_data(1), read_data(2)) 
Result:
HTML Code:
Friend:

Data1: 1, Data 2: 1
Data1: 2, Data 2: 4
Data1: 3, Data 2: 100

Data1: 1, Data 2: 0
Data1: 2, Data 2: 0
Data1: 3, Data 2: 0



Enemy:

Data1: 1, Data 2: 2
Data1: 2, Data 2: 2

Data1: 1, Data 2: 0
Data1: 2, Data 2: 0
fl0werD is offline
Send a message via ICQ to fl0werD
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-22-2013 , 14:18   Re: StatusValue player is not looks at players.
Reply With Quote #2

When the first data (read_data(1) == 1) is sent with the value of 0 (read_data(2) == 0), then the player is not looking at a player/hostage.

Code:
register_event( "StatusValue", "EventHideStatus", "be", "1=1", "2=0" );
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
fl0werD
Senior Member
Join Date: May 2011
Old 01-22-2013 , 14:24   Re: StatusValue player is not looks at players.
Reply With Quote #3

Quote:
Originally Posted by Emp` View Post
When the first data (read_data(1) == 1) is sent with the value of 0 (read_data(2) == 0), then the player is not looking at a player/hostage.

Code:
register_event( "StatusValue", "EventHideStatus", "be", "1=1", "2=0" );
Yes, but call StatusValue every seconds.

PHP Code:
public EventStatsValue(iPlayer)
{
    if(
read_data(1) != || read_data(2) != 0)
        return;

    new 
szText[128];
    static 
a;

    
formatex(szTextcharsmax(szText), "Test: %d"a++)

    
message_begin(MSG_ONE_UNRELIABLEg_msgStatusText_iPlayer)
    
write_byte(0)
    
write_string(szText)
    
message_end()

fl0werD is offline
Send a message via ICQ to fl0werD
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-22-2013 , 16:36   Re: StatusValue player is not looks at players.
Reply With Quote #4

The StatusValue message is sent after a Traceline that happens for the client (I assume every "think").

Explain what you are trying to achieve and it will be much easier to help you with your problem.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-23-2013 , 01:11   Re: StatusValue player is not looks at players.
Reply With Quote #5

Quote:
Originally Posted by Emp` View Post
The StatusValue message is sent after a Traceline that happens for the client (I assume every "think").
In CBasePlayer::UpdateClientData, pdata m_flNextSBarUpdateTime is checked, if time is passed, CBasePlayer::UpdateStatusBar is called and m_flNextSBarUpdateTime is set to gametime + 0.2.
( m_flNextSBarUpdateTime is 449 on windows, +5 on linux ).

hlsdk UpdateStatusBar code for reference :
Spoiler


cs UpdateStatusBar code from ida (gonna hurt eyes !!), quite similar with HL one.
Spoiler



CS Pdatas are :
Code:
enum sbar_data
{
	SBAR_ID_TARGETCLASS = 1,
	SBAR_ID_TARGEINDEX,
	SBAR_ID_TARGETHEALTH,
	SBAR_END,
};
stock const m_izSBarState[SBAR_END] = {446,447,448}
stock const m_flNextSBarUpdateTime = 449;
stock const m_flStatusBarDisappearDelay = 450;
stock const m_SbarString0 = 1804; // 451*4   //    [SBAR_STRING_SIZE]    //    128 char // 32
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fl0werD
Senior Member
Join Date: May 2011
Old 01-23-2013 , 04:55   Re: StatusValue player is not looks at players.
Reply With Quote #6

Quote:
Originally Posted by Emp` View Post
The StatusValue message is sent after a Traceline that happens for the client (I assume every "think").

Explain what you are trying to achieve and it will be much easier to help you with your problem.
Need show the player stats, if not looks at the players. For example frags.
fl0werD is offline
Send a message via ICQ to fl0werD
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-23-2013 , 12:28   Re: StatusValue player is not looks at players.
Reply With Quote #7

Try something like this :

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

#define PLUGIN "StatusValue Stats"
#define VERSION "0.0.1"

new gmsgStatusText

new bool:g_bStatusTextFree[33]

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" )
    
gmsgStatusText get_user_msgid("StatusText")

    
register_event("StatusValue""Event_StatusValue_Used""b""1!0")
    
register_event("StatusValue""Event_StatusValue_NotUsed""b""1=0")
    
register_event("ScoreInfo""Event_ScoreInfo""a")
}

public 
Event_ScoreInfo()
{
    new 
id read_data(1)
    if( 
g_bStatusTextFree[id] )
    {
        
UpdateStatusText(id)
    }
}

public 
Event_StatusValue_Usedid )
{
    
g_bStatusTextFree[id] = false
}

public 
Event_StatusValue_NotUsedid )
{
    
g_bStatusTextFree[id] = true
    UpdateStatusText
(id)
}

UpdateStatusText(id)
{
    new 
szMessage[128]
    
formatex(szMessagecharsmax(szMessage), "Frags %d | Deaths %d"get_user_frags(id), cs_get_user_deaths(id))

    
message_begin(MSG_ONEgmsgStatusText_id)
    
write_byte(0)
    
write_string(szMessage)
    
message_end()

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-23-2013 at 12:29.
ConnorMcLeod is offline
fl0werD
Senior Member
Join Date: May 2011
Old 01-23-2013 , 13:12   Re: StatusValue player is not looks at players.
Reply With Quote #8

Does not work.
fl0werD is offline
Send a message via ICQ to fl0werD
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-23-2013 , 13:22   Re: StatusValue player is not looks at players.
Reply With Quote #9

what exactly? error logs? ..more info
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
fl0werD
Senior Member
Join Date: May 2011
Old 01-23-2013 , 14:10   Re: StatusValue player is not looks at players.
Reply With Quote #10

Quote:
Originally Posted by AngeIII View Post
what exactly? error logs? ..more info
Plugin.
fl0werD is offline
Send a message via ICQ to fl0werD
Reply


Thread Tools
Display Modes

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 20:31.


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