public CreateEnt(i)
{
new Float:fOrigin[3];
if (!SsGetOrigin(fOrigin))
return;
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
if (!pev_valid(ent)) return
set_pev(ent, pev_classname, "WeatherBox");
set_pev(ent, pev_solid, SOLID_TRIGGER);
engfunc(EngFunc_SetModel, ent, MODEL_WEATHER);
engfunc(EngFunc_SetOrigin, ent, fOrigin);
set_pev(ent, pev_body, (g_iWeatherSound == WeatherSound_Snow) ? BODY_SNOW : BODY_RAIN_TORNADO);
if(pev(ent, pev_body) != 13)
{
set_pev(ent, pev_rendercolor, Float:{0.0, 0.0, 0.0});
set_pev(ent, pev_rendermode, kRenderTransAlpha);
set_pev(ent, pev_renderamt, 0.0);
}
set_pev(ent, pev_sequence, 2);
set_pev(ent, pev_framerate, 1.0);
if(pev(ent, pev_body) == 13)
{
emit_sound(ent, CHAN_STATIC, weather_sound[6], 1.0, ATTN_NORM, 0, PITCH_NORM);
}
drop_to_floor(ent);
set_pev(ent, pev_impulse, CREATE);
set_pev(ent, pev_nextthink, get_gametime() + 0.2);
}