/* Sublime AMXX Editor v3.0.0-beta */
#include <amxmodx>
#include <engine>
#include <fakemeta>
new cvar_wmode;
public plugin_init()
{
register_plugin("Water Modes", "1.0", "amxmodx-es");
register_event("HLTV", "new_round", "a", "1=0", "2=0");
//MODO AUTOMATICO CADA RONDA, UTILIZA CUALQUIER OTRO NUMERO PARA DESACTIVAR; DESACTIVADO POR DEFAULT
cvar_wmode = register_cvar("amx_watermode", "0");//[WaterModes] 1: Agua invisible; 2: Remueve la entidad de agua;
register_clcmd("say /rw", "remove_water");
register_clcmd("say /invwater", "inv_water");
}
public new_round()
{
switch(get_pcvar_num(cvar_wmode))
{
case 1:
{
static iEnt;
while((iEnt = find_ent_by_class(iEnt, "func_water")) != 0)
{
set_pev(iEnt, pev_effects, EF_NODRAW);
}
client_print_color(0, print_team_default, "^4[WM]^1 El agua se ha vuelto invisible!");
return PLUGIN_HANDLED;
}
case 2:
{
static iEnt;
while((iEnt = find_ent_by_class(iEnt, "func_water")) != 0)
{
remove_entity(iEnt)
}
client_print_color(0, print_team_default, "^4[WM]^1 El agua ha sido removida del mapa!");
return PLUGIN_HANDLED;
}
}
static iEnt;
while((iEnt = find_ent_by_class(iEnt, "func_water")) != 0)
{
set_pev(iEnt, pev_effects, !~EF_NODRAW);
}
return PLUGIN_HANDLED;
}
public remove_water(id)
{
if(!(get_user_flags(id) & ADMIN_CVAR))
{
return PLUGIN_HANDLED;
}
static iEnt;
while((iEnt = find_ent_by_class(iEnt, "func_water")) != 0)
{
remove_entity(iEnt);
}
static szName[33];
get_user_name(id, szName, charsmax(szName));
client_print_color(0, print_team_default, "^4[WM]^1 El agua ha sido removida por ^4%s^1!", szName);
return PLUGIN_HANDLED;
}
public inv_water(id)
{
if(!(get_user_flags(id) & ADMIN_CVAR))
{
return PLUGIN_HANDLED;
}
static iEnt;
while((iEnt = find_ent_by_class(iEnt, "func_water")) != 0)
{
set_pev(iEnt, pev_effects, EF_NODRAW);
}
static szName[33];
get_user_name(id, szName, charsmax(szName));
client_print_color(0, print_team_default, "^4[WM] %s ha hecho el agua invisible!", szName);
return PLUGIN_HANDLED;
}