Quote:
Originally Posted by JusTGo
Something like this should work for players:
|
I thought there should be a special event for such cases but I guess not, your code should work fine in emiting sounds, but not spawning something precisely on the surface. I'll try something familiar.
Quote:
Originally Posted by Natsheh
pev_waterlevel
// waterlevel 0 - not in water
// waterlevel 1 - feet in water
// waterlevel 2 - waist in water
// waterlevel 3 - head in water
About checking if a bullet hit the water surface you need to check if the weapon trace line penetrated the water box.
|
Something like?
PHP Code:
public plugin_init()
{
RegisterHam(Ham_TraceAttack, "func_water", "Fw_TraceAttack") // We use "func_water" for more precising.
}
public Fw_TraceAttack(Entity, Attacker, Float:Damage, Float:Direction[3], Ptr, Damagetype)
{
if(!is_user_connected(Attacker))
return FMRES_IGNORED
new Float:fEnd[3]
get_tr2(Ptr, TR_vecEndPos, fEnd)
if(engfunc(EngFunc_PointContents, fEnd) == CONTENTS_WATER) {
// etc
}
}
Quote:
Originally Posted by +ARUKARI-
There's also this water check.
|
Check the mini code above if it is correct?