AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to make the TE_PLAYERATTACHMENT... (https://forums.alliedmods.net/showthread.php?t=85220)

tuty 02-07-2009 12:53

how to make the TE_PLAYERATTACHMENT...
 
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.

:crab: +karma if you can help me :)

Arkshine 02-07-2009 13:11

Re: how to make the TE_PLAYERATTACHMENT...
 
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 )

Dores 02-07-2009 13:24

Re: how to make the TE_PLAYERATTACHMENT...
 
Can you show an example, arkshine?

Arkshine 02-07-2009 13:36

Re: how to make the TE_PLAYERATTACHMENT...
 
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 );         }     } }

Dores 02-07-2009 13:46

Re: how to make the TE_PLAYERATTACHMENT...
 
Shouldn't you use is_user_alive(i)?
Thanks.

Can't give you +Karma yet.

anakin_cstrike 02-07-2009 14:20

Re: how to make the TE_PLAYERATTACHMENT...
 
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.

tuty 02-07-2009 14:27

Re: how to make the TE_PLAYERATTACHMENT...
 
thank you all for the suggestions and help ^^

p4rp4d30 03-14-2010 16:29

Re: how to make the TE_PLAYERATTACHMENT...
 
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

ConnorMcLeod 03-15-2010 02:02

Re: how to make the TE_PLAYERATTACHMENT...
 
Use get_players with flags "aeh" + teamname so you will retrieve only alive teamates.


All times are GMT -4. The time now is 17:06.

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