/* Plugin generated by AMXX-Studio */ #include #include #include #include #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" static const mrocket[] = "models/rpgrocket.mdl"; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("stozek", "test"); } public plugin_precache() { precache_model(mrocket); } public test(id){ const Float:fSpeed = 700.0; new Float:fAngles[3]; pev(id,pev_angles,fAngles) new Float:fVeloc[3][3],Float:fTmp[3],Float:fForward[3]; angle_vector(fAngles,ANGLEVECTOR_FORWARD,fForward); xs_vec_normalize(fForward,fForward); xs_vec_mul_scalar(fForward,fSpeed,fForward); xs_vec_copy(fVeloc[1],fForward); xs_vec_normalize(fForward,fForward); angle_vector(fAngles,ANGLEVECTOR_RIGHT,fTmp); xs_vec_normalize(fTmp,fTmp) for(new i = 0;i<3;i++){ fTmp[i] = fForward[i] + ( fTmp[i] * floatsin(30.0,degrees) ) } xs_vec_normalize(fTmp,fTmp); xs_vec_mul_scalar(fTmp,fSpeed,fTmp) xs_vec_copy(fVeloc[0],fTmp); angle_vector(fAngles,ANGLEVECTOR_RIGHT,fTmp); xs_vec_neg(fTmp,fTmp); xs_vec_normalize(fTmp,fTmp) for(new i = 0;i<3;i++){ fTmp[i] = fForward[i] + ( fTmp[i] * floatsin(30.0,degrees) ) } xs_vec_normalize(fTmp,fTmp); xs_vec_mul_scalar(fTmp,fSpeed,fTmp) xs_vec_copy(fVeloc[2],fTmp); for(new i = 0; i < 3; i++) MakeEnt(id, fVeloc[i]); } public MakeEnt(id, Float:fVeloc[3]) { if(is_user_alive(id)) { new Float: Origin[3], Float: vAngle[3], Float:vAngles[3]; entity_get_vector(id, EV_VEC_v_angle, vAngle); entity_get_vector(id, EV_VEC_origin , Origin); entity_get_vector(id, EV_VEC_angles , vAngles); new Ent = create_entity("info_target"); entity_set_string(Ent, EV_SZ_classname, "zielonek"); entity_set_model(Ent, mrocket); entity_set_origin(Ent, Origin); entity_set_vector(Ent, EV_VEC_angles, vAngle); Origin[2] += 8.0 vAngle[0] *= -1.0; entity_set_origin(Ent, Origin); entity_set_vector(Ent, EV_VEC_v_angle, vAngle); entity_set_vector(Ent, EV_VEC_angles , vAngles); entity_set_int(Ent, EV_INT_solid, SOLID_BBOX); entity_set_int(Ent, EV_INT_movetype, MOVETYPE_FLY); entity_set_int(Ent, EV_INT_rendermode, kRenderTransAdd); entity_set_float(Ent, EV_FL_scale, 1.20); entity_set_float(Ent, EV_FL_renderamt, 255.0); entity_set_int(Ent, EV_INT_effects, 64); entity_set_edict(Ent, EV_ENT_owner, id); new Float:maxs[3] = {-15.0, -15.0, -15.0} new Float:mins[3] = {15.0, 15.0, 15.0} entity_set_size(Ent,maxs, mins) VelocityByAim(id, 1000 , fVeloc); entity_set_vector(Ent, EV_VEC_velocity , fVeloc); } }