AlliedModders

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

Cronck 04-24-2005 13:14

StatusText
 
I have this function to tell a user about their level, and XP.
But when a user it aiming/pointing at another player the message gets resetted.
How can i prevent this message from disappear when users look at eachother?

Code:
public CreateStatusText(id) {     if (!armymod)         return PLUGIN_HANDLED             new Text[60]     format(Text, 60, "[Level: %i] [XP: %i] Next Level in %i XP", PlayerLevel[id], PlayerXP[id], Levels[PlayerLevel[id]] - PlayerXP[id]);     message_begin(MSG_ONE, get_user_msgid("StatusText"), {0, 0, 0}, id);     write_byte(0);     write_string(Text);     message_end();         return PLUGIN_CONTINUE }

XxAvalanchexX 04-24-2005 13:14

Use register_event to catch when the game sends out StatusText and then send out your own. Fortunately this won't create an infinite loop, as AMXx's register_event's don't get called from the messages sent by your plugin.

Cronck 04-24-2005 13:17

So how am i supposed to catch this event?

Cronck 04-24-2005 13:50

I DID IT!

register_event("StatusText", "CreateStatusText", "b")

Thank you for helping :-)


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

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