#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <WPMGPrintChatColor>
new const VERSION[] = "1.1"
new g_sr, g_type
public plugin_precache()
{
register_plugin("Snow or rain", VERSION, "unknown")
register_clcmd("say /snegon", "clcmd_snowon")
register_clcmd("say /snegoff", "clcmd_snowoff")
g_sr = register_cvar("amx_sr_type", "snow")
g_type = register_cvar("amx_sr_inc", "engine")
new cg_sr[5], cg_type[9]
get_pcvar_string(g_sr, cg_sr, charsmax(cg_sr))
get_pcvar_string(g_type, cg_type, charsmax(cg_type))
if(equal(cg_sr, "rain"))
{
if(equal(cg_type, "fakemeta"))
engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_rain"))
if(equal(cg_type, "engine"))
create_entity("env_rain")
}
else if(equal(cg_sr, "snow"))
{
if(equal(cg_type, "fakemeta"))
engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_snow"))
if(equal(cg_type, "engine"))
create_entity("env_snow")
}
}
public clcmd_snowon(id)
{
client_cmd(id, "cl_weather 3")
PrintChatColor(id, PRINT_COLOR_RED, "^3[Snow*] ^1Включено. Введи ^3/snegoff ^1чтобы выключить Снег")
}
public clcmd_snowoff(id)
{
client_cmd(id, "cl_weather 0")
PrintChatColor(id, PRINT_COLOR_RED, "^3[Snow*] ^1Отключено. Введи ^3/snegon ^1чтобы включить Снег")
}