龙珠cs吧 关注:4,226贴子:73,831

回复:【随笔福利?】CCI代码伸手、答疑及提供(外加教程??)

只看楼主收藏回复

绝对领域??这个代码会把靠近自己的敌人全部吹飞
new StruggleValue[ 33 ], Float: StrugDelay[ 33 ];
public client_PostThink( Client )
{
for( new i = 1; i < 33; i++ )
{
if( i == Client || !is_user_alive( i ) || is_user_bot( Client ) ) continue;
// 判断与其他玩家间距离
if( entity_range( Client, i ) < 300.0 )
AutoKick( Client, i );
}
if( StruggleValue[ Client ] == 0 )
{
StruggleValue[ Client ] = 127;
setClientFLY( Client, true );
message_begin( MSG_ONE, get_user_msgid( "PowerStrug" ), _, Client );
write_char( StruggleValue[ Client ] );
message_end();
}
if( StruggleValue[ Client ] > 0 )
{
// 设回默认玩家速度
if( is_user_bot( Client ) ) setClientSPEED( Client, 400 );
elsesetClientSPEED( Client, getClientLEVELDATAc( Client, cxlSpeed ) );
setClientANIMATION( Client, -1 );
setClientDATAc( Client, cliAllowTeleport, true ); // 允许玩家瞬移
set_pdata_int( Client, 230, false ); // Throw away
return;
}
else if( get_gametime() - StrugDelay[ Client ] > 0.01 )
{
StruggleValue[ Client ]++;
StrugDelay[ Client ] = get_gametime();
message_begin( MSG_ONE, get_user_msgid( "PowerStrug" ), _, Client );
write_char( StruggleValue[ Client ] );
message_end();
}
}
public AutoKick( Client, Victim )
{
new Float: ang[ 3 ], org[ 3 ];
pev( Victim, pev_v_angle, ang) // 获取玩家第一人称角度
pev( Victim, pev_origin, org ); // 获取玩家坐标
ang[0] *= -1.0; // 上下角度反转(游戏中默认平视角度为0、最大仰视-90度、最大俯视90度)
ang[1] += 180.0; // 前后角度反转(用于取身后角度)
new Float:vec[3]
angle_vector(ang, 1, vec); // 从角度计算移动方向和速度
xs_vec_mul_scalar(vec, 3000.0, vec); // 设置实体移动速度
set_pev(Victim, pev_movetype, MOVETYPE_FLY); //设置实体移动方式
set_pev(Victim, pev_velocity, vec); // 让实体以指定向量做移动
setClientSPEED( Victim, 0 ); // 禁止玩家操作移动方向
setClientFLY(Victim, false); // 取消飞行状态
setClientANIMATION( Victim, 53 ); // 设置玩家动作
setClientDATAc( Client, cliAllowTeleport, false ); // 禁止玩家瞬移
set_pdata_int( Victim, 230, true ); // Throw away
StruggleValue[ Victim ] = -100; // 设置耐力条位置
/* 以下需要自行设置计时器(Delay)来确保达到最大优化 */
// 播放SPR
message_begin( MSG_PVS, SVC_TEMPENTITY );
write_byte( TE_SPRITE );
engfunc( EngFunc_WriteCoord, org[ 0 ] );
engfunc( EngFunc_WriteCoord, org[ 1 ] );
engfunc( EngFunc_WriteCoord, org[ 2 ] );
write_short( engfunc( EngFunc_ModelIndex, "sprites/xflare1.spr" ) );
write_byte( 20 );
write_byte( 255 );
message_end();
// client_cmd( Client, "spk sound/weapons/meleeflash.wav" );
}


IP属地:日本21楼2018-07-26 11:50
回复
    坏哥怎么判断动作


    来自手机贴吧22楼2018-11-09 00:08
    回复(4)
      2026-01-20 08:39:02
      广告
      不感兴趣
      开通SVIP免广告
      坏哥又要打扰你一下了抱歉了别嫌我麻烦。
      if( get_user_weapon( Client ) <= 0 ) 技能为0号技能
      if( pev( Client, pev_sequence ) == 143 )动作为143动作然后就可以设置143动作发出来的特效了吧


      来自手机贴吧23楼2018-11-09 19:51
      回复(3)
        舞空斗剧


        IP属地:日本来自Android客户端24楼2018-11-29 02:37
        收起回复
          666


          IP属地:广东来自手机贴吧25楼2018-12-07 16:29
          回复