Quote:
Originally Posted by shine771
@Connor - Doesn't work
|
I'm using this in client_prethink and it works as expected (both StatusValue and StatusText are BLOCK_SET):
PHP Code:
static iPlayer, crap
get_user_aiming(id, iPlayer, crap)
if( Is_Player( iPlayer ) )
{
static iOldPlayer
iOldPlayer = g_iTarget[id]
if( !iOldPlayer )
{
message_begin(MSG_ONE_UNRELIABLE, gmsgStatusValue, _, id)
write_byte(1)
write_short(2)
message_end()
}
if( iOldPlayer != iPlayer )
{
g_iTarget[id] = iPlayer
message_begin(MSG_ONE_UNRELIABLE, gmsgStatusValue, _, id)
write_byte(2)
write_short(iPlayer)
message_end()
}
if( !iOldPlayer )
{
static const szStatusText[] = "1 %p2"
message_begin(MSG_ONE_UNRELIABLE, gmsgStatusText, _, id)
write_byte(0)
write_string(szStatusText)
message_end()
}
}
else
{
if( g_iTarget[id] )
{
g_iResetStatusText[id] = 100
g_iTarget[id] = 0
}
else if( --g_iResetStatusText[id] == 0 )
{
message_begin(MSG_ONE_UNRELIABLE, gmsgStatusValue, _, id)
write_byte(1)
write_short(0)
message_end()
}
}
__________________