Quote:
Originally Posted by didoWEE
Have you tried any of these ways:
1. register_touch("player", "func_water", "func");
2.
PHP Code:
#include <amxmodx>
#include <engine>
public client_PreThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE;
if(entity_get_int(id, EV_INT_flags) & FL_INWATER)
{
new Float:FlVecOrigin[3];
entity_get_vector(id, EV_VEC_origin, FlVecOrigin);
new ent = -1;
while((ent = find_ent_in_sphere(ent, FlVecOrigin, 36.0)) != 0)
{
new szClassname[15];
entity_get_string(ent, EV_SZ_classname, szClassname, charsmax(szClassname));
if(equal(szClassname, "func_water"))
{
// do what you want, the index is ent ^^ :D
}
}
}
return PLUGIN_CONTINUE;
}
|
register_touch is not working even when i set to water entity entity_set_int(ent, EV_INT_solid, SOLID_TRIGGER)
2. way is working i think but its bad, i see more ways to do that but they are ...
one way is to create solid entity for valve hammer and place it where water is.
water have a name
and that solid ent have water name in targename.
it will give me more work but it is better to cpu i think.
traceline is also one way but i dont remember that can traceline catch water entity.