Raised This Month: $ Target: $400
 0% 

Posible to spawn floating text above the entity?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-07-2015 , 11:16   Re: Posible to spawn floating text above the entity?
Reply With Quote #2

If you're talking about TF2, you can use the "show_annotation" event... just be aware that these ARE visible through walls and such.

In this event:
  • "follow_entindex" is the index of the entity it should follow. Alternately, use "worldPosX", "worldPosY", and "worldPosZ". Remember that client indexes are also entity indexes.
  • "id" should be something unique. If you need to hide an annotation early, you can use this id with the hide_annotation event.
  • "lifetime" is the number of seconds until it should go away. Since it's a float, you can set it to under 1 second.
  • "visibilityBitfield" is a bitfield that stores the players who should be able to see it. SourcePawn will have issues with this field on 32+ player servers as you can never add players 32 and above. new visibile = (1 << client) | (1 << otherclient); would make it visible to two clients.
  • "play_sound" has to be set to something, even if it's just "misc/null.wav" (which exists for purposes like these).

The code for the Gravestones plugin is a good reference on how to use this. It uses distance to determine if a player should be able to see the annotation when its created. Alternately, you can use tracerays to do it.

Be aware that if you're attaching an annotation to a moving entity, you should set the "lifetime" fairly short and recalculate who should be able to see it using a timer.

If this is a player, you will want to check if they go into one of the cloaking or cloaked conditions and remove the annotation if they do.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-07-2015 at 11:19.
Powerlord is offline
 



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 21:11.


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