Code: Select all
Event::Attach(eventFlagTaken, FlagSound::FlagTaken);
Event::Attach(eventFlagDropped, FlagSound::FlagDropped);
Event::Attach(eventFlagReturned, FlagSound::FlagReturned);
Event::Attach(eventFlagCaptured, FlagSound::FlagCaptured);
function FlagSound::FlagTaken(%team, %client)
{
if(%team == Team::Enemy() && %client != getManagerId())
sound("sound.wav");
else if(%team == Team::Friendly())
sound("sound.wav");
}
function FlagSound::FlagDropped(%team, %client)
{
if(%team == Team::Enemy() && %client != getManagerId())
sound("sound.wav");
else if(%team == Team::Friendly())
sound("sound.wav");
}
function FlagSound::FlagReturned(%team, %client)
{
if(%team == Team::Friendly() && %client != getManagerId())
sound("sound.wav");
else if(%team == Team::Enemy())
sound("sound.wav");
}
function FlagSound::FlagCaptured(%team, %client)
{
if(%team == Team::Enemy() && %client != getManagerId())
sound("sound.wav");
else if(%team == Team::Friendly())
sound("sound.wav");
}
I dont really care or want to know who dropped what, just what team did it.
for example diamondsword flag dropped (blue flag dropped) blood eagle flag returned (red flag returned).
I'll try messing with it tonight see if i can get it to work this way.