|
|
1. 获取附件坐标|Get Attachment Origin
说明|Description:
[CN]由于客户端与服务端的延迟,这个方法不适合玩家实体
[EN]This way is not for "Player Entity" because of the lag between ClientSide and ServerSide
- new Float: __float_Org[ 3 ], Float: __float_Ang[ 3 ];
- engfunc( EngFunc_GetAttachment, __int_Client, 0, __float_Org, __float_Ang );
复制代码
2.实体附件索引|Entity Attachment Index
说明|Description:
[CN]此方法对玩家实体和模型实体通用
[EN]This way is for both "Player Entity" and "Model Entity"
- /*
- Attachment 0( Client|0x1000 ) = Right Hand( Usually )
- Attachment 1( Client|0x2000 ) = Left Hand( Usually )
- Attachment 2( Client|0x3000 ) = Extra
- Attachment 3( Client|0x4000 ) = Extra
- */
- message_begin( MSG_ALL, SVC_TEMPENTITY );
- write_byte(TE_BEAMENTPOINT);
- write_short( __int_Client|0x1000 );// Right Hand ( Usually )
- engfunc( EngFunc_WriteCoord, __float_Org[ 0 ] + random_float( -10.000_000, 10.000_000 ) );
- engfunc( EngFunc_WriteCoord, __float_Org[ 1 ] + random_float( -10.000_000, 10.000_000 ) );
- engfunc( EngFunc_WriteCoord, __float_Org[ 2 ] + random_float( -10.000_000, 10.000_000 ) );
- write_short( 101 );
- write_byte( 10 );
- write_byte( 10 );
- write_byte( 5 );
- write_byte( 2 );
- write_byte( 3 );
- write_byte( 255 );
- write_byte( 255 );
- write_byte( 255 );
- write_byte( 255 );
- write_byte( 50 );
- message_end();
- message_begin( MSG_ALL, SVC_TEMPENTITY );
- write_byte(TE_BEAMENTPOINT);
- write_short( __int_Client|0x2000 );// Left Hand ( Usually )
- engfunc( EngFunc_WriteCoord, __float_Org[ 0 ] + random_float( -10.000_000, 10.000_000 ) );
- engfunc( EngFunc_WriteCoord, __float_Org[ 1 ] + random_float( -10.000_000, 10.000_000 ) );
- engfunc( EngFunc_WriteCoord, __float_Org[ 2 ] + random_float( -10.000_000, 10.000_000 ) );
- write_short( 101 );
- write_byte( 10 );
- write_byte( 10 );
- write_byte( 5 );
- write_byte( 2 );
- write_byte( 3 );
- write_byte( 255 );
- write_byte( 255 );
- write_byte( 255 );
- write_byte( 255 );
- write_byte( 50 );
- message_end();
复制代码

Q: 怎么为模型添加附件?|How to add attachment for a model?
A: 在QC文件里面使用$attachment语句|Use the function "$attachment" in the QC file
- //$attachment Index "Joint Name" X Y Z
- $attachment 0 "Bip01 R Hand" 2.000000 2.000000 0.300000
- $attachment 1 "Bip01 R Hand" 2.000000 2.000000 0.000000
- $attachment 2 "Bip01 L Hand" 0.000000 0.000000 0.000000
- $attachment 3 "Bip01 R Leg" 0.000000 0.000000 0.000000
复制代码
|
|