stock get_velocity_from_origin( ent, Float:fOrigin[3], Float:fSpeed, Float:fVelocity[3] )
{
new Float:fEntOrigin[3];
entity_get_vector( ent, EV_VEC_origin, fEntOrigin );
// Velocity = Distance / Time
new Float:fDistance[3];
fDistance[0] = fEntOrigin[0] - fOrigin[0];
fDistance[1] = fEntOrigin[1] - fOrigin[1];
fDistance[2] = fEntOrigin[2] - fOrigin[2];
new Float:fTime = ( vector_distance( fEntOrigin,fOrigin ) / fSpeed );
fVelocity[0] = fDistance[0] / fTime;
fVelocity[1] = fDistance[1] / fTime;
fVelocity[2] = fDistance[2] / fTime;
return ( fVelocity[0] && fVelocity[1] && fVelocity[2] );
}
// Sets velocity of an entity (ent) away from origin with speed (speed)
stock set_velocity_from_origin( ent, Float:fOrigin[3], Float:fSpeed )
{
new Float:fVelocity[3];
get_velocity_from_origin( ent, fOrigin, fSpeed, fVelocity )
entity_set_vector( ent, EV_VEC_velocity, fVelocity );
return ( 1 );
}
new damagerept = read_data(2)
set_velocity_from_origin(id, upVector, get_cvar_float("he_push")*damagerept)
有沒有抽錯
我想用來做個CXO的爆彈
是一個手雷擊退的插件抽出的