AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   StatusText Message (https://forums.alliedmods.net/showthread.php?t=49941)

Cheap_Suit 01-16-2007 01:46

StatusText Message
 
Hello!

Alright, im using the StatusText Message to show a text message that is constantly being changed. So I was wondering where is the best place to hook it.

dutchmeat 01-16-2007 05:04

Re: StatusText Message
 
plugin_init, register_event

SweatyBanana 01-16-2007 16:08

Re: StatusText Message
 
I keep mine constantly updating on different events (client death, cleint spawn, kills, bomb plants, etc..)

Code:

point_hud(id)
{
    new PointHud[65]
    format(PointHud,64,"Points: %i",g_UserPoints[id])
    message_begin(MSG_ONE, get_user_msgid("StatusText"), {0,0,0}, id)
    write_byte(0)
    write_string(PointHud)
    message_end()
}


[ --<-@ ] Black Rose 01-16-2007 16:20

Re: StatusText Message
 
Quote:

Originally Posted by Cheap_Suit (Post 427838)
Hello!

Alright, im using the StatusText Message to show a text message that is constantly being changed. So I was wondering where is the best place to hook it.

Hook it when the info is changed.(?)

EDIT: Maby like so?
Code:
#include <amxmodx> new gmsg_StatusText; public plugin_init()     gmsg_StatusText = get_user_msgid("StatusText"); stock show_StatusText(id, str[], len, ...) {     format_args(str, len);     message_begin(MSG_ONE_UNRELIABLE, gmsg_StatusText, {0,0,0}, id);     write_byte(0);     write_string(str);     message_end(); }


All times are GMT -4. The time now is 22:27.

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