ok ive got this so far.. but its obviously wrong as its not working
Code:
public fwd_PlayerPreThink(id) {
if( !is_user_alive( id ) )
return FMRES_IGNORED;
if( pev(id, pev_flags) & FL_ONGROUND && is_user_outside(id) ) {
client_cmd( id, "speak ambience/rain.wav");
} else {
client_cmd( id, "speak NULL");
}
return FMRES_IGNORED;
}
stock Float:is_user_outside(id)
{
new Float:vOrigin[3], Float:fDist;
pev(id, pev_origin, vOrigin);
fDist = vOrigin[2];
while(engfunc(EngFunc_PointContents, vOrigin) == CONTENTS_EMPTY)
vOrigin[2] += 5.0;
if(engfunc(EngFunc_PointContents, vOrigin) == CONTENTS_SKY)
return (vOrigin[2] - fDist);
return 0.0;
}
EDIT: ok got it working to play sound but it executes the client_cmd like 1000X... which means the sound is all fuzzy instead of playing Once.
__________________