Raised This Month: $ Target: $400
 0% 

Showing the sprite just for the own team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 07-28-2011 , 14:54   Showing the sprite just for the own team
Reply With Quote #1

PHP Code:
                 message_begin(MSG_ALLSVC_TEMPENTITY)
                        
write_byte(TE_PLAYERATTACHMENT)
                        
write_byte(id)
                        
write_coord(45)
                        
write_short(sprite)
                        
write_short(20)
                        
message_end() 
Everyone can see this, how todo this without that the other team sees this?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 07-28-2011 , 15:18   Re: Showing the sprite just for the own team
Reply With Quote #2

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
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
bibu
Veteran Member
Join Date: Sep 2010
Old 07-28-2011 , 15:41   Re: Showing the sprite just for the own team
Reply With Quote #3

Won't that attach it to every one in the team then?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 07-28-2011 , 15:52   Re: Showing the sprite just for the own team
Reply With Quote #4

Oh sorry didnt understand ur question, Sorry
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.
__________________

My Plugins For ZP

Inactive due to College and Studies

Last edited by abdul-rehman; 07-28-2011 at 15:55.
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
bibu
Veteran Member
Join Date: Sep 2010
Old 07-28-2011 , 16:13   Re: Showing the sprite just for the own team
Reply With Quote #5

Oh wow... Kind of complicated for something like this. Hope someone other will maybe find another solution.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 07-28-2011 , 16:21   Re: Showing the sprite just for the own team
Reply With Quote #6

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

Btw there r pro's here who can find a better solution then this.
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 07-29-2011 , 03:09   Re: Showing the sprite just for the own team
Reply With Quote #7

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.
__________________
Hunter-Digital is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 01-27-2012 , 18:47   Re: Showing the sprite just for the own team
Reply With Quote #8

Quote:
Originally Posted by Hunter-Digital View Post
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.
So I tried todo that again, but I failed.

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:
    message_beginMSG_ALLSVC_TEMPENTITY );
        
write_byteTE_PLAYERATTACHMENT );
        
write_bytetarget );
        
write_coord45 );
        
write_short(g_szSprite); 
        
write_short(20);
        
message_end(); 
With
PHP Code:
MSG_ONE_UNRELIABLE 
it crashes.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.

Last edited by bibu; 01-27-2012 at 18:47.
bibu is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-28-2012 , 09:11   Re: Showing the sprite just for the own team
Reply With Quote #9

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)
__________________
Hunter-Digital is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 01-28-2012 , 10:13   Re: Showing the sprite just for the own team
Reply With Quote #10

Thanks.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Reply


Thread Tools
Display Modes

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 00:47.


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