AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to replace some words in Status text? (https://forums.alliedmods.net/showthread.php?t=82696)

hzqst 12-28-2008 09:53

How to replace some words in Status text?
 
register_message(get_user_msgid("StatusValue" ), "message_Status")
register_message(get_user_msgid("StatusText") , "message_Status")
I can only block these messages
---When someone see another player:
Enemy: XXX Health:100%
change to :
Friend:my string Health:my int %
and custom color

Exolent[jNr] 12-28-2008 14:33

Re: How to replace some words in Status text?
 
If you make a StatusText message, it will be yellow.
You cannot change the color.

ConnorMcLeod 12-28-2008 14:49

Re: How to replace some words in Status text?
 
Quote:

Originally Posted by Exolent[jNr] (Post 734545)
You can change the color.


Exolent[jNr] 12-28-2008 14:59

Re: How to replace some words in Status text?
 
LIES!

AntiBots 12-28-2008 16:20

Re: How to replace some words in Status text?
 
See how I do in my Kz Mod I change the color with new msg.

IneedHelp 12-28-2008 17:07

Re: How to replace some words in Status text?
 
I use this,

PHP Code:

new Msg_StatusTextMsg_StatusValue;

// [...]

Msg_StatusText get_user_msgid("StatusText")
Msg_StatusValue get_user_msgid("StatusValue")

// [...]

// Write a text on the bottom left of the screen
// See statusbar.cpp (hlsdk) for more info about this Messages
// Make_StatusText(id_to_show_msg, target_to_get_name, msg)
// target_to_get_name -> %%p2, name of this index
stock Make_StatusText(idtarget, const message[64])
{
    if (!
is_user_connected(id) || !is_user_connected(target))
        return

    
message_begin(MSG_ONE_UNRELIABLEMsg_StatusText_id)
    
write_byte(0)
    
write_string(message)
    
message_end()
    
    
message_begin(MSG_ONE_UNRELIABLEMsg_StatusValue_id); 
    
write_byte(2); 
    
write_short(target); 
    
message_end();  


If you want to get the player name, you can make something like this:

PHP Code:


// Idk if %i2 get the target health..
Make_StatusText(id_to_show_msgid_to_get_name"Friend: %%p2 - Health: %i2")

// Other way to show the health
new Msg[64]
format(Msg63"Friend: %%p2 - Health: %d"get_user_health(id_to_get_name))
Make_StatusText(id_to_show_msgid_to_get_nameMsg

Is necessary to block the statustext and statusvalue msgs to show my statustext msgs? I always block statustext but I don't know really if I must block both messages, only one, or what

ConnorMcLeod 12-29-2008 00:21

Re: How to replace some words in Status text?
 
Quote:

Originally Posted by Exolent[jNr] (Post 734553)
LIES!

You can but you have to alter players names and teaminfo, and it's a bit tricky.

IneedHelp 12-29-2008 01:12

Re: How to replace some words in Status text?
 
Quote:

Originally Posted by ConnorMcLeod (Post 734745)
You can but you have to alter players names and teaminfo, and it's a bit tricky.

See my post, I always used that statustext stock and I get the target name with '%%p2' ...the name return the color too ^.^

Owyn 01-29-2009 04:05

Re: How to replace some words in Status text?
 
Quote:

You can but you have to alter players names and teaminfo, and it's a bit tricky.
how?
so i just can't write custom colored line there? =0

Exolent[jNr] 01-29-2009 17:57

Re: How to replace some words in Status text?
 
Quote:

Originally Posted by IneedHelp (Post 734756)
See my post, I always used that statustext stock and I get the target name with '%%p2' ...the name return the color too ^.^



All times are GMT -4. The time now is 09:16.

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