Im trying to get a phone ring in a specific coordinate, im not sure if im creating the entity right, if I am though im not sure if im trying to activate it right..
The phonesound and privateone[3] are already declared globally
Code:
public create_entities()
{
phonesound = create_entity("ambient_generic")
if(!phonesound) return PLUGIN_HANDLED
entity_set_int(phonesound,EV_INT_spawnflags,2)
entity_set_float(phonesound,EV_FL_health,10.0)
entity_set_string(phonesound,EV_SZ_targetname,"phone_ring")
entity_set_string(phonesound,EV_SZ_message,"phone/call.wav")
DispatchKeyValue(phonesound,"pitch","100")
DispatchKeyValue(phonesound,"pitchstart","100")
DispatchSpawn(phonesound)
new Float:origin[3]
origin[0] = float(privateone[0])
origin[1] = float(privateone[1])
origin[2] = float(privateone[2])
entity_set_origin(phonesound,origin)
return PLUGIN_HANDLED
}
And im trying to activate this sound with
Code:
force_use(id,phonesound)