Code:
...
public plugin_init() {
.....
register_clcmd("say /snowon", "snowon")
register_clcmd("say /snowoff", "snowoff")
.....
}
....
public snowon(index)
{
query_client_cvar ( index, "cl_weather", "check_cvar_valueon" )
}
public check_cvar_valueon ( index, cvar, value )
{
if ((value == 1) || (value == 2) || (value == 3))
{
client_print ( index, print_chat, "You have already started snowing :))" )
return PLUGIN_HANDLED;
}
else {
client_cmd(index, "cl_weather 3");
client_print ( index, print_chat, "You have started snowing :))" )
}
return PLUGIN_HANDLED;
}
public snowoff(index)
{
query_client_cvar ( index, "cl_weather", "check_cvar_valueoff" )
}
public check_cvar_valueoff ( index, cvar, value )
{
if (value == 0)
{
client_print ( index, print_chat, "You have already stopped snowing =/" )
return PLUGIN_HANDLED;
}
else {
client_cmd(index, "cl_weather 0");
client_print ( index, print_chat, "You have stopped snowing =/" )
}
return PLUGIN_HANDLED;
}
It doesnt prints
Code:
client_print ( index, print_chat, "You have already started snowing :))" )
and
Code:
client_print ( index, print_chat, "You have already stopped snowing =/" )
Why?
No matters how many times i write /snowon or /snowoff these two lines never shows