tmp_in.x += (panel_size.x - newsize.x) / 2; // center medal icon
- if(centerprint_medal_times <= MSG_MEDAL_SCREEN) {
+ if(centerprint_medal_times < MSG_MEDAL_SCREEN) {
tmp_in.x -= ((newsize.x * 1.1) * (centerprint_medal_times - 1) / 2);
for(int t = 0; t < centerprint_medal_times; t++) {
drawpic(tmp_in, centerprint_medal_icon, newsize, '1 1 1', a, DRAWFLAG_NORMAL);
return = true;
}
+NET_HANDLE(TE_CSQC_CHATSOUND, bool isNew)
+{
+ string snd = ReadString();
+ snd = strcat("chat/", snd, ".ogg");
+
+ precache_sound(snd);
+ _sound(NULL, CH_INFO, snd, VOL_BASE, ATTN_NONE);
+
+ return = true;
+}
+
float GetSpeedUnitFactor(int speed_unit)
{
switch(speed_unit)
REGISTER_NET_TEMP(TE_CSQC_VEHICLESETUP)
REGISTER_NET_TEMP(TE_CSQC_TEAMNAMES)
+REGISTER_NET_TEMP(TE_CSQC_CHATSOUND)
const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const int RACE_NET_CHECKPOINT_CLEAR = 1;
bool play_chatsound(entity source, string msgin)
{
- //bprintf("Source (%s) has cl_chat_sounds = %d\n", source.netname, CS(source).cvar_cl_chat_sounds);
- //if(autocvar_sv_chat_sounds && CS(source).cvar_cl_chat_sounds) {
- if(autocvar_sv_chat_sounds) {
+ if(autocvar_sv_chat_sounds && CS(source).cvar_cl_chat_sounds) {
var .float flood_sound = floodcontrol_chatsound;
if (source.(flood_sound) < time - autocvar_sv_chat_sounds_flood) {
rawmsg = strreplace("\n", " ", msgin);
if (findinlist_abbrev(rawmsg, autocvar_sv_chat_sounds_list)) {
- string sndname = strcat("sound/chat/", rawmsg, ".ogg");
-
- /*FOREACH_CLIENT(true, {
- if(IS_REAL_CLIENT(it)) {
- bprintf("Destination (%s) has cl_chat_sounds = %d\n", it.netname, CS(it).cvar_cl_chat_sounds);
- if(CS(it).cvar_cl_chat_sounds) {
- precache_sound(sndname);
- play2(it, sndname);
- }
- } else {
- bprintf("Destination (%s) has cl_chat_sounds = %d but it's not a real client\n", it.netname, CS(it).cvar_cl_chat_sounds);
- }
- });*/
- play2all(sndname);
-
+ FOREACH_CLIENT(IS_REAL_CLIENT(it) && CS(it).cvar_cl_chat_sounds, {
+ msg_entity = it;
+ WriteHeader(MSG_ONE, TE_CSQC_CHATSOUND);
+ WriteString(MSG_ONE, rawmsg);
+ });
source.(flood_sound) = time;
return true;
}
if(round_handler && round_handler_GetEndTime() > 0)
round_handler.round_endtime += total_time;
- LOG_INFOF("timeout lasted %d secs", total_time);
+ LOG_INFOF("Timeout lasted %d secs", total_time);
// unlock the view for players so they can move around again
FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {