[TF2] Player-Following Annotations Snippet
So I started working on something I was calling Admin Anno-tags (combination of Annotation and Tags). Then I ran into an issue where the annotations were visible through walls, and at any distance, so I gave up on it.
I also originally had some code in there to hide the annotations when a player died, but I didn't do it properly, so if a player died, all annotations would disappear for them. Once an admin respawned, the annotations would re-appear to that player. It was incredibly glitchy. So I commented it out. Luckily, I was smart enough to keep the code, so I've decided to post it here. I know that Geit's Annotations plugin was unapproved, and people are wanting that to be fixed, so hopefully my code can be of some use. NOTE 1: Some code was taken from that excellent Gravestone Markers plugin made by Friagram, in regards to the Bitstring stuff, that I was having trouble with. NOTE 2: If you do make a plugin using any of this code, you do NOT have to give me credit. You can if you want to, but I don't find it necessary. Do give credit to Friagram though, he deserves it! PHP Code:
|
Re: [TF2] Player-Following Annotations Snippet
...
You need to do something like what I did here to make these work properly: https://forums.alliedmods.net/showthread.php?p=1946768 |
Re: [TF2] Player-Following Annotations Snippet
Quote:
But hey, it's not my problem anymore. Hooray for public access! |
Re: [TF2] Player-Following Annotations Snippet
Mind explaining how the visibility Field works?
|
Re: [TF2] Player-Following Annotations Snippet
Quote:
The original visibility bitstring code that is commented out at the bottom, I believe that worked. I'm no expert in this annotation and bitstring stuff, but I just love the idea of it. I mean, it could be used in plugins like VS Saxton Hale/Freak Fortress 2 (i.e. when the boss is visible to a player, have an annotation follow the boss that says the bosses name, such as "Saxton Hale!" or "Horsemann Jr!") EDIT: Oh, and as mentioned in the main post, my code is a tad wonky, so if an admin spawns, the tag becomes visible to people. But if an admin dies (with the player_death code uncommented) all the annotations on every admin disappear. From there, an admin has to respawn for the tag to become visible. I have no clue how to make annotations with differential IDs so that if Admin A dies, the annotations on Admin B/C/etc don't disappear from everyone's view. |
Re: [TF2] Player-Following Annotations Snippet
I was asking because i want to make an annotation that only certain players can see over another player's head.
|
Re: [TF2] Player-Following Annotations Snippet
Quote:
EDIT: Actually, I think I may have an idea. Gimme a mo! PHP Code:
|
Re: [TF2] Player-Following Annotations Snippet
Just making sure, ill have to test this at a later moment but say if i want to show it to only one player i would just make the bitstring: "2^(clientindex)" correct?
|
Re: [TF2] Player-Following Annotations Snippet
Quote:
|
Re: [TF2] Player-Following Annotations Snippet
Quote:
The only catch is that I'm not sure if it counts from 0 or not. So, here's both versions... try both and see if they work. PHP Code:
Edit: For those of you who don't know what bitshifting does, I'll give a quick example. Pretend this is a series of 8 bits: 0b00000000 (0b is used to denote it's binary... it's a GCC thing) Like a standard decimal, the lowest number is the one at the far right. What (1 << client) does is tell it to take the number 1 and move it to the left client bits. So: Code:
(1 << 0) = 0b00000001 It's a cheap way of storing a bunch of bools as a single value. |
All times are GMT -4. The time now is 23:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.