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 );
}
}
}