Showing the sprite just for the own team
PHP Code:
|
Re: Showing the sprite just for the own team
You can get players of a specific team by using the get_players native, then you can loop through them and send the message individually to every one using MSG_ONE_UNRELIABLE/MSG_ONE
|
Re: Showing the sprite just for the own team
Won't that attach it to every one in the team then?
|
Re: Showing the sprite just for the own team
Oh sorry didnt understand ur question, Sorry :oops:
Another thing you can do is create an entity and set it to MOVETYPE_FOLLOW, this will kinda attach it to players, then you can filter the entity in FM_AddToFullPack forward and then limit its transmission to specific players (like displaying it to only player's teammate as you want) For eg: My Sprites on HUD plugin uses FM_AddToFullPack forward for showing the sprite to its owner only and not to other players, you can look at it for an eg. |
Re: Showing the sprite just for the own team
Oh wow... Kind of complicated for something like this. Hope someone other will maybe find another solution. :)
|
Re: Showing the sprite just for the own team
I also thought that FM_AddToFullPack was complicated but after a few tests with it, i got the hang of it, its really usefule in such stuff :up:
Btw there r pro's here who can find a better solution then this. |
Re: Showing the sprite just for the own team
Just use MSG_ONE/MSG_ONE_UNRELIABLE and send it to every player from that team, only they would see that attachment since it's a message, not an actual entity attachment.
For entitiy attachments you need to use addtofullpack to pick who can see them. |
Re: Showing the sprite just for the own team
Quote:
This should only be seeable for those who are in the team of the target (this shows it for everyone on the server): PHP Code:
PHP Code:
|
Re: Showing the sprite just for the own team
It crashes, but you didn't say why... I *assume* that it's because you don't tell the code who to send the message to.
Code:
message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, player) |
Re: Showing the sprite just for the own team
Thanks. :)
|
| All times are GMT -4. The time now is 00:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.