Descriere: Acest plugin compara
vectorii flashbang-ului cu vectori incarcati de configurare de la
dosar, si daca flashbang este în apropierea acestor vectori, acestea
vor fi anulate pentru a preveni infamantul flashbang de bug-uri.
Descarcare:
Link.Code:
Code:
#include
#include
#include
//#define DEBUG
#define MAX_FLASHZONES 40
new configsDir[64]
new fz[MAX_FLASHZONES+1][4]
new cntVectors
new g_fb_model[] = "models/w_flashbang.mdl"
public plugin_init() {
new mapname[32]
register_plugin("Flashbug-fix", "1.0.5", "Darkdreams Studios")
get_mapname(mapname,31)
get_configsdir(configsDir, 63)
format(configsDir, 63, "%s/flashconf/%s.ini", configsDir, mapname)
if (!file_exists(configsDir))
{
server_print("[FLASHBUG] Config ^"%s^" doesn't exist.", configsDir)
return PLUGIN_HANDLED_MAIN
}
load_config()
register_think("grenade","think_grenade");
return PLUGIN_CONTINUE
}
public think_grenade(ent)
{
new Float:org1[3]
new org2[3]
new hackzone[3]
new model[32];
entity_get_string(ent,EV_SZ_model,model,31);
if (equal(model, g_fb_model))
{
entity_get_vector(ent,EV_VEC_origin,org1)
org2[0] = floatround( org1[0] )
org2[1] = floatround( org1[1] )
org2[2] = floatround( org1[2] )
#if defined DEBUG //use to determine flashbug zones
client_print(0,print_chat, "%ix %iy %iz", org2[0],org2[1],org2[2])
#endif
for (new i=0;i {
hackzone[0] = fz[i][0]
hackzone[1] = fz[i][1]
hackzone[2] = fz[i][2]
if (get_distance(org2, hackzone) < fz[i][3])
{
client_print(0, print_chat, "[FLASHFIX] Removed a flashbang (%ix %iy %iz)", org2[0],org2[1],org2[2])
remove_entity( ent )
//new id = entity_get_edict(ent, EV_ENT_owner) //to kick/ban client
break
}
}
}
}
public load_config()
{
new line = 0, textline[256], len, i=0
const SIZE = 63
new line_x[SIZE + 1], line_y[SIZE + 1], line_z[SIZE + 1], line_proximity[SIZE + 1], parsedParams
while ((line = read_file(configsDir, line, textline, 255, len)))
{
if (len == 0 || textline[0] == ';')
continue // comment line
parsedParams = parse(textline, line_x, SIZE, line_y, SIZE, line_z, SIZE, line_proximity, SIZE)
if (parsedParams != 4)
{
server_print("[FLASHBUG] Error/warning in config (%s)", configsDir)
continue
}
fz[i][0] = str_to_num(line_x)
fz[i][1] = str_to_num(line_y)
fz[i][2] = str_to_num(line_z)
fz[i][3] = str_to_num(line_proximity)
i++
}
cntVectors = i
server_print("[FLASHBUG] Loaded %i vector(s) for this map", cntVectors)
}
Instalare:
1. flashfix.amxx se pune in addons\amxmodx\plugins.
2. flashfix.sma se pune in addons\amxmodx\scripting.
3. Fisierele din folderul arhivei flashconf se pun in addons\amxmodx\configs.
4. In plugins.ini se adauga linia:
Code:
- Cod:
-
flashfix.amxx