void ka_RespawnBall(void);
void ka_DropEvent(entity);
void ka_TimeScoring(void);
+void ka_EventLog(string, entity);
entity ka_ball;
WaypointSprite_Spawn("ka-ball", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAGCARRIER, '0 1 1');
WaypointSprite_Ping(self.waypointsprite_attachedforcarrier);
- sound(self, CH_TRIGGERS_SINGLE, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
}
else
{
if(other.classname != "player")
{ // The ball just touched an object, most likely the world
pointparticles(particleeffectnum("kaball_sparks"), self.origin, '0 0 0', 1);
- sound(self, CH_TRIGGERS_SINGLE, "keepaway/touch.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_TRIGGER, "keepaway/touch.wav", VOL_BASE, ATTN_NORM);
return;
}
else if(self.wait > time) { return; }
other.effects |= autocvar_g_keepaway_ballcarrier_effects;
// messages and sounds
+ ka_EventLog("pickup", other);
Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
- WriteString(MSG_BROADCAST, strcat("\n\n", other.netname, "^7 has picked up the ball!\n"));
- sound(self.owner, CH_ITEMS, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ WriteString(MSG_BROADCAST, strcat(other.netname, "^7 has picked up the ball!"));
+ sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
// scoring
PlayerScore_Add(other, SP_KEEPAWAY_PICKUPS, 1);
plyr.effects &~= autocvar_g_keepaway_ballcarrier_effects;
// messages and sounds
+ ka_EventLog("dropped", plyr);
Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA);
WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
- WriteString(MSG_BROADCAST, strcat("\n\n", plyr.netname, "^7 has dropped the ball!\n"));
- sound(plyr, CH_ITEMS, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
+ WriteString(MSG_BROADCAST, strcat(plyr.netname, "^7 has dropped the ball!"));
+ sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
// scoring
// PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
}
}
+void ka_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
+{
+ if(autocvar_sv_eventlog)
+ GameLogEcho(strcat(":ka:", mode, ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
+}
+
MUTATOR_HOOKFUNCTION(ka_Scoring)
{
if((frag_attacker != frag_target) && (frag_attacker.classname == "player"))
}
else if(!frag_attacker.ballcarried)
if(autocvar_g_keepaway_noncarrier_warn)
- centerprint_atprio(frag_attacker, (CENTERPRIO_SPAM + 5), "Killing people while you don't have the ball gives no points!");
+ centerprint(frag_attacker, "Killing people while you don't have the ball gives no points!");
if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);