Raised This Month: $ Target: $400
 0% 

how to make the TE_PLAYERATTACHMENT...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 02-07-2009 , 12:53   how to make the TE_PLAYERATTACHMENT...
Reply With Quote #1

Hi, i have a question:

Who to make the TE_PLAYERATTACHMENT (sprite up on head) to see only his team?

Example: i have a gun up on my head.. and i want to see only my team.

+karma if you can help me
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-07-2009 , 13:11   Re: how to make the TE_PLAYERATTACHMENT...
Reply With Quote #2

Use MSG_ONE_UNERELIABLE. I mean, just send the message to players you want they can see the sprite on the provided player ( arg2 ; second write_byte )

Last edited by Arkshine; 02-07-2009 at 13:19.
Arkshine is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 02-07-2009 , 13:24   Re: how to make the TE_PLAYERATTACHMENT...
Reply With Quote #3

Can you show an example, arkshine?
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-07-2009 , 13:36   Re: how to make the TE_PLAYERATTACHMENT...
Reply With Quote #4

In this example, we want to show a sprite on 'id'. It should send the message only to all its teammates.

Code:
MyFunction ( id ) {     for ( new i = 1; i <= MaxClients; i++ )     {         if ( i != id && get_user_team( id ) == get_user_team( i ) )         {             message_begin( MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, i );             write_byte( TE_PLAYERATTACHMENT );             write_byte( id );             write_coord( 45 );             write_short( ModelIndex );             write_short( 100 );         }     } }
Arkshine is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 02-07-2009 , 13:46   Re: how to make the TE_PLAYERATTACHMENT...
Reply With Quote #5

Shouldn't you use is_user_alive(i)?
Thanks.

Can't give you +Karma yet.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-07-2009 , 14:20   Re: how to make the TE_PLAYERATTACHMENT...
Reply With Quote #6

Well, yeah
PHP Code:
MyFunction id )
{
    for ( new 
1<= MaxClientsi++ )
    {
        if ( 
!= id && get_user_teamid ) == get_user_team) )
        {
            if( !
is_user_alive) )
                    continue;

            
message_beginMSG_ONE_UNRELIABLESVC_TEMPENTITY_);
            
write_byteTE_PLAYERATTACHMENT );
            
write_byteid );
            
write_coord45 );
            
write_shortModelIndex );
            
write_short100 );
        }
    }

But i think it won't attach anything if the player's not alive, and no errors will show up.
__________________

anakin_cstrike is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 02-07-2009 , 14:27   Re: how to make the TE_PLAYERATTACHMENT...
Reply With Quote #7

thank you all for the suggestions and help ^^
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
p4rp4d30
Veteran Member
Join Date: Mar 2007
Old 03-14-2010 , 16:29   Re: how to make the TE_PLAYERATTACHMENT...
Reply With Quote #8

sorry to revive thread. But as could do so only the team can see the sprite. Only the team, terrorist can see the Sprite those who are the team terrorist.

Thanks

Sorry for my bad english xD
p4rp4d30 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-15-2010 , 02:02   Re: how to make the TE_PLAYERATTACHMENT...
Reply With Quote #9

Use get_players with flags "aeh" + teamname so you will retrieve only alive teamates.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 17:06.


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