AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Creating this right? (https://forums.alliedmods.net/showthread.php?t=9748)

harbu 01-29-2005 12:51

Creating this right?
 
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)

TotalNoobScripter 01-29-2005 13:49

*completely ignores code written above but assumes what the plugin does.*

wow, couldn't you just use a function that would get the id's of everyone around the 'phone call/ring' then use a for loop to run client_cmd(something[i],"speak theringtone.wav") instead of making an entity?

harbu 01-29-2005 14:05

True, but i dont think its very realistic that it sounds everywhere the same.. I mean if u are 5m off the phone it probably wont be as loud..

TotalNoobScripter 01-29-2005 14:06

Yea, but must rp be truely that detailed :D

The reason why i posted the post that i did post (woot triple post) is because ambient_generic hates me!

harbu 01-29-2005 14:24

It must be EXACTLY like 'Asskickrs' lol if you ever been on my server, youve probably seen how much ive copied his plugins..

TotalNoobScripter 01-29-2005 14:36

he uses ambient_generics?

also

Everytime im on your server I'm tired of seeing my own name on my HUD :-p


All times are GMT -4. The time now is 19:24.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.