Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version "4.11"
- class TestHandler : EventHandler
- {
- override void WorldTick()
- {
- foreach (p : players)
- {
- if (!p.mo)
- {
- continue;
- }
- int num = p.mo.PlayerNumber();
- // [Ace] Need to make sure it's playing a sound on the channel but it's not YOUR sound. Only replace once until either the sound changes or stops.
- if (p.mo.Player.ReadyWeapon is 'Pistol' && p.mo.IsActorPlayingSound(CHAN_WEAPON) && !p.mo.IsActorPlayingSound(CHAN_WEAPON, "TestSoundLmao") && !ReplacedSound[num] && Level.MapName ~== "MAP15")
- {
- p.mo.A_StopSound(CHAN_WEAPON);
- p.mo.A_StartSound("TestSoundLmao", CHAN_WEAPON);
- ReplacedSound[num] = true;
- }
- else
- {
- ReplacedSound[num] = false;
- }
- }
- }
- bool ReplacedSound[MAXPLAYERS];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement