Raised This Month: $ Target: $400
 0% 

StatusText


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cronck
Member
Join Date: Apr 2005
Old 04-24-2005 , 13:14   StatusText
Reply With Quote #1

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 }
Cronck is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-24-2005 , 13:14  
Reply With Quote #2

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.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Cronck
Member
Join Date: Apr 2005
Old 04-24-2005 , 13:17  
Reply With Quote #3

So how am i supposed to catch this event?
Cronck is offline
Cronck
Member
Join Date: Apr 2005
Old 04-24-2005 , 13:50  
Reply With Quote #4

I DID IT!

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

Thank you for helping :-)
Cronck is offline
Reply



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 16:48.


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