AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with TE_PLAYERATTACHMENT (https://forums.alliedmods.net/showthread.php?t=205022)

Kiske 01-05-2013 21:18

Problem with TE_PLAYERATTACHMENT
 
Hi,

Only works when the ID see FRIEND and FRIEND see ID.
If ID see to FRIEND but FRIEND not see ID, ID see sprite in FRIEND but FRIEND not see sprite in ID.

PHP Code:

if(is_user_alive(FRIEND))
{
    
message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITY_ID);
    
write_byte(TE_PLAYERATTACHMENT);
    
write_byte(FRIEND);
    
write_coord(25);
    
write_short(g_torc_sprite);
    
write_short(32767);
    
message_end();
}

if(
is_user_alive(ID))
{
    
message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITY_FRIEND);
    
write_byte(TE_PLAYERATTACHMENT);
    
write_byte(ID);
    
write_coord(25);
    
write_short(g_torc_sprite);
    
write_short(32767);
    
message_end();


I test with MSG_ONE and the result is the same.


Thanks in advanced!

AngeIII 01-06-2013 07:14

Re: Problem with TE_PLAYERATTACHMENT
 
PHP Code:

stock Create_TE_PLAYERATTACHMENT(identityvOffsetiSpritelife){

    
message_beginMSG_ONESVC_TEMPENTITY, { 00}, id );
    
write_byteTE_PLAYERATTACHMENT );
    
write_byteentity );            // entity
    
write_coordvOffset );            // vertical offset ( attachment origin.z = player origin.z + vertical offset )
    
write_shortiSprite );            // model index
    
write_shortlife );                // (life * 10 )
    
message_end();


but if you will use MSG_ALL everyone will see the attachment i think

dias 01-06-2013 07:47

Re: Problem with TE_PLAYERATTACHMENT
 
Msg_one -> msg_one_unreliable

Kiske 01-06-2013 11:01

Re: Problem with TE_PLAYERATTACHMENT
 
Quote:

Originally Posted by AngeIII (Post 1868106)
PHP Code:

stock Create_TE_PLAYERATTACHMENT(identityvOffsetiSpritelife){

    
message_beginMSG_ONESVC_TEMPENTITY, { 00}, id );
    
write_byteTE_PLAYERATTACHMENT );
    
write_byteentity );            // entity
    
write_coordvOffset );            // vertical offset ( attachment origin.z = player origin.z + vertical offset )
    
write_shortiSprite );            // model index
    
write_shortlife );                // (life * 10 )
    
message_end();


but if you will use MSG_ALL everyone will see the attachment i think

Is the same...

meTaLiCroSS 01-06-2013 16:23

Re: Problem with TE_PLAYERATTACHMENT
 
Quote:

Originally Posted by dias (Post 1868122)
Msg_one -> msg_one_unreliable

It's okay, with MSG_ONE there would be 99% probability for showing the message :) (the other 1% = overflow kick)

dias 01-06-2013 18:15

Re: Problem with TE_PLAYERATTACHMENT
 
^
My server used to kick all player in it :)

meTaLiCroSS 01-06-2013 19:59

Re: Problem with TE_PLAYERATTACHMENT
 
Quote:

Originally Posted by dias (Post 1868494)
^
My server used to kick all player in it :)

Well, it's yours, who knows how and when did you send messages to them. The MSG_ONE msgtype uses the reliable channel, so the player will receive the message "yes or yes", if no, will result in a kick

Kiske 01-17-2013 04:16

Re: Problem with TE_PLAYERATTACHMENT
 
Help me please :)

Kiske 02-09-2013 10:02

Re: Problem with TE_PLAYERATTACHMENT
 
Bump.


All times are GMT -4. The time now is 13:36.

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