I have this plugin of snow and didn't work, not just for me.
Code:
/* AMX Mod X Script
*
* eXtreamCS Dev Team
*
* ======---===========
* © 2012 by CryWolf
* www.eXtreamCS.com
* ======---===========
*
* This file is intended to be used with AMX Mod X.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#pragma semicolon 1
#define gz_VERSION "0.0.3"
new snowoffon, snowmode, msjshow;
new g_snow [ 33 ];
new skyadd;
new g_weather [ 33 ];
new names [ 33 ];
public plugin_init ( )
{
register_plugin ( "AMXX Advanced Snow", gz_VERSION, "CryWolf" );
snowmode = register_cvar ( "amx_snow_density", "1", ADMIN_BAN );
msjshow = register_cvar ( "amx_snow_msj", "1", ADMIN_BAN );
register_clcmd ( "say /snowmenu", "snowmenu" );
register_clcmd ( "say_team /snowmenu", "snowmenu" );
register_event ( "HLTV", "event_round_start", "a", "1=0", "2=0" );
}
public client_putinserver ( id )
{
set_task ( 3.0, "p_snow" );
}
public p_snow ( id )
{
if ( get_pcvar_num ( snowmode ) == 1 )
{
client_cmd ( id, "cl_weather 1" );
}
else
{
client_cmd ( id, "cl_weather 2" );
}
if ( get_pcvar_num ( snowmode ) == 0 )
{
client_cmd ( id, "cl_weather 0" );
}
}
public snowmenu ( id )
{
static menu, string [ 128 ], on_off [ 10 ];
formatex ( string, sizeof ( string ), "\y [AMXX] Snow Menu" );
menu = menu_create ( string, "s_menu_handle" );
// Snow Off / On
if ( g_snow [ id ] )
{
formatex ( on_off, sizeof ( on_off ) -1, "\yYes" );
}
else
{
formatex ( on_off, sizeof ( on_off )-1, "\dNo" );
}
formatex ( string, sizeof ( string ) -1, "Snow: %s", on_off );
menu_additem ( menu, string, "1", 0 );
// Weather 1 / 2
if ( g_weather [ id ] )
{
formatex ( on_off, sizeof ( on_off ) -1, "\y1" );
}
else
{
formatex ( on_off, sizeof ( on_off ) -1, "\r2" );
}
formatex ( string, sizeof ( string ) -1, "Weather: %s", on_off );
menu_additem ( menu, string, "2", 0 );
menu_setprop ( menu, MPROP_NUMBER_COLOR, "\r" );
menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
menu_display ( id, menu, 0 );
}
public s_menu_handle ( id, menu, item )
{
if ( !is_user_connected ( id ) )
return PLUGIN_HANDLED;
if ( item == MENU_EXIT )
{
menu_destroy ( menu );
return PLUGIN_HANDLED;
}
new data [ 6 ], szName [ 64 ];
new access, callback;
menu_item_getinfo ( menu, item, access, data, charsmax ( data ), szName, charsmax ( szName ), callback );
new key = str_to_num ( data );
switch ( key )
{
case 1: // Snow Off / On
{
if ( g_snow [ id ] )
{
g_snow [ id ] = 0;
client_cmd ( id, "cl_weather 0" );
get_user_name ( id, names, charsmax ( names ) );
client_print ( id, print_chat, "[SNOW] %s Snow has been turned off for you!", names );
}
else
{
g_snow [ id ] = 1;
client_cmd ( id, "cl_weather 1" );
get_user_name ( id, names, charsmax ( names ) );
client_print ( id, print_chat, "[SNOW] %s Snow has been turned on for You!", names );
}
}
case 2: // Weather 1 / 2
{
if ( g_weather [ id ] )
{
g_weather [ id ] = 0;
client_cmd ( id, "cl_weather 2" );
get_user_name ( id, names, charsmax ( names ) );
client_print ( id, print_chat, "[SNOW] %s I will snow more for you!", names );
}
else
{
g_weather [ id ] = 1;
client_cmd ( id, "cl_weather 1" );
get_user_name ( id, names, charsmax ( names ) );
client_print ( id, print_chat, "[SNOW] %s I will snow a little for you!", names );
}
}
}
snowmenu ( id );
return PLUGIN_CONTINUE;
}
public plugin_precache ( )
{
skyadd = register_cvar ( "amx_sky", "1", ADMIN_RCON );
snowoffon = register_cvar ( "amx_snow", "1", ADMIN_KICK );
precache_generic ( "sprites/snow.spr" );
if ( get_pcvar_num ( skyadd ) == 1 )
{
precache_generic ( "gfx/env/spaceup.tga" );
precache_generic ( "gfx/env/spacedn.tga" );
precache_generic ( "gfx/env/spaceft.tga" );
precache_generic ( "gfx/env/spacelf.tga" );
precache_generic ( "gfx/env/spacert.tga" );
precache_generic ( "gfx/env/spacebk.tga" );
server_cmd ( "sv_skyname space" );
}
if ( get_pcvar_num ( skyadd ) == 2 )
{
precache_generic ( "gfx/env/nightup.tga" );
precache_generic ( "gfx/env/nightdn.tga" );
precache_generic ( "gfx/env/nightft.tga" );
precache_generic ( "gfx/env/nightlf.tga" );
precache_generic ( "gfx/env/nightrt.tga" );
precache_generic ( "gfx/env/nightbk.tga" );
server_cmd ( "sv_skyname night" );
}
else
{
return 1;
}
if ( get_pcvar_num ( snowoffon ) == 1 )
{
// Snow using Engine
// create_entity ( "env_snow" );
// Snow using Fakemeta
engfunc ( EngFunc_CreateNamedEntity, engfunc ( EngFunc_AllocString, "env_snow" ) );
}
else
{
return 1;
}
return -1;
}
public event_round_start ( )
{
if ( get_pcvar_num ( snowmode ) == 1 )
{
client_cmd ( 0, "cl_weather 1" );
}
if ( get_pcvar_num ( snowmode ) == 2 )
{
client_cmd ( 0, "cl_weather 2" );
}
if ( get_pcvar_num ( snowoffon ) == 0 )
{
client_cmd ( 0, "cl_weather 0" );
}
if ( get_pcvar_num ( snowoffon ) == 1 )
{
client_cmd ( 0, "cl_weather 1" );
}
if ( get_pcvar_num ( msjshow ) == 1 )
{
client_print ( 0, print_chat, "[SNOW] Type /snowmenu to start/stop the snow or to select weather!" );
}
if ( get_pcvar_num ( msjshow ) == 0 )
{
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}