Участник
Пользователь
- Сообщения
- 78
- Реакции
- 1
C++:
public CWeapon_Dragon_Create_Ball(const pItem, const pPlayer)
{
new pEntity = rg_create_entity(Weapon_EntityReference);
if (is_nullent(pEntity))
return NULLENT;
static Float: vecDirection[3]; UTIL_GetVectorAiming(pPlayer, vecDirection);
static Float: vecOrigin[3]; UTIL_GetEyePosition(pPlayer, vecOrigin);
xs_vec_add_scaled(vecOrigin, vecDirection, 20.0, vecOrigin);
xs_vec_mul_scalar(vecDirection, WeaponSetting_BallSpeed, vecDirection);
set_entvar(pEntity, var_velocity, vecDirection);
engfunc(EngFunc_VecToAngles, vecDirection, vecDirection);
set_entvar(pEntity, var_angles, vecDirection);
set_entvar(pEntity, var_classname, WeaponSprites_Ball_EntityName);
set_entvar(pEntity, var_owner, pPlayer);
set_entvar(pEntity, var_dmg_inflictor, pItem);
set_entvar(pEntity, var_movetype, MOVETYPE_FLYMISSILE);
set_entvar(pEntity, var_solid, SOLID_BBOX);
set_entvar(pEntity, var_rendermode, kRenderTransAdd);
set_entvar(pEntity, var_renderamt, 255.0);
set_entvar(pEntity, var_frame, 0.0);
set_entvar(pEntity, var_framerate, WeaponSprites_Ball_FrameRate);
set_entvar(pEntity, var_fuser1, WeaponSprites_Ball_MaxFrame);
set_entvar(pEntity, var_scale, WeaponSprites_Ball_Scale);
set_entvar(pEntity, var_iuser1, 1);
engfunc(EngFunc_SetOrigin, pEntity, vecOrigin);
engfunc(EngFunc_SetModel, pEntity, WeaponSprites[Ball]);
engfunc(EngFunc_SetSize, pEntity, Float: {-5.0, -5.0, -5.0}, Float: {5.0, 5.0, 5.0});
SetThink(pEntity, "CWeapon_Dragon_Create_Ball_Think");
SetTouch(pEntity, "CWeapon_Dragon_Create_Ball_Touch");
return pEntity;
}