PHP Code:
// Your function.
public snowon ( index )
{
query_client_cvar ( index, "cl_weather", "check_cvar_value" )
}
public check_cvar_value ( index, cvar [ ], value [ ] )
{
// If the value is different of '3', change it to '3'.
if ( value [ 0 ] != '3' )
{
client_cmd ( index, "cl_weather 3" )
}
// And show the message.
client_print ( index, print_chat, "You have turned on the snow." )
}