diff --git a/source/client/defs/custom.qc b/source/client/defs/custom.qc index 801def5..2b32ec0 100644 --- a/source/client/defs/custom.qc +++ b/source/client/defs/custom.qc @@ -94,6 +94,7 @@ float crosshair_spread_time; float zoom_2_time; float broadcast_time; float broadcast_type; +string broadcast_string; float weaponframetime; float weapon2frametime; diff --git a/source/client/hud.qc b/source/client/hud.qc index f3a6b86..534d562 100644 --- a/source/client/hud.qc +++ b/source/client/hud.qc @@ -1186,13 +1186,16 @@ void() HUD_Broadcast = { string broadcast_msg = ""; float health = getstatf(STAT_HEALTH); - switch(broadcast_type) { - case 2: broadcast_msg = "A Player needs to be revived"; break; - default: broadcast_msg = "benis"; break; - } + switch(broadcast_type) { + case 2: broadcast_msg = strcat(broadcast_string, " needs to be revived"); break; + case 3: broadcast_msg = strcat(broadcast_string, " is reviving you"); break; + default: break; + } + float print_width = stringwidth (broadcast_msg, 0, [0.015*g_width, 0.015*g_width, 0]); float x = (g_width - print_width)/2; - if (broadcast_type == 2 && health > 19) + + if (broadcast_msg != "") drawstring([x, g_height/2, 0], broadcast_msg, [0.015*g_width, 0.015*g_width, 0], [1, 1, 1], 1, 0); } diff --git a/source/client/main.qc b/source/client/main.qc index 8c82c27..91d3e02 100644 --- a/source/client/main.qc +++ b/source/client/main.qc @@ -1005,6 +1005,7 @@ noref void() CSQC_Parse_Event = case EVENT_BROADCAST: broadcast_time = readbyte(); broadcast_type = readbyte(); + broadcast_string = readstring(); break; case EVENT_POINTUPDATE: float playernum = readbyte(); diff --git a/source/server/clientfuncs.qc b/source/server/clientfuncs.qc index 9f79407..d98263d 100644 --- a/source/server/clientfuncs.qc +++ b/source/server/clientfuncs.qc @@ -177,7 +177,7 @@ void(string to, float skin) UpdateV2model = #endif } -void(float broadcast_time, float type) BroadcastMessage = +void(entity who, float broadcast_time, float type, string str) BroadcastMessageToClient = { #ifndef HANDHELD #ifndef NX @@ -185,6 +185,22 @@ void(float broadcast_time, float type) BroadcastMessage = WriteByte(MSG_MULTICAST, EVENT_BROADCAST); WriteByte(MSG_MULTICAST, broadcast_time); WriteByte(MSG_MULTICAST, type); + WriteString(MSG_MULTICAST, str); + msg_entity = who; + multicast('0 0 0', MULTICAST_ONE); + #endif + #endif +} + +void(float broadcast_time, float type, string str) BroadcastMessage = +{ + #ifndef HANDHELD + #ifndef NX + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, EVENT_BROADCAST); + WriteByte(MSG_MULTICAST, broadcast_time); + WriteByte(MSG_MULTICAST, type); + WriteString(MSG_MULTICAST, str); multicast('0 0 0', MULTICAST_ALL); #endif diff --git a/source/server/damage.qc b/source/server/damage.qc index 50f7f29..6b3c138 100644 --- a/source/server/damage.qc +++ b/source/server/damage.qc @@ -221,7 +221,7 @@ void() GetDown = self.requirespower = point_difference; // Broadcast that the player has downed. - BroadcastMessage(time + 3, 2); + BroadcastMessage(time + 3, 2, self.netname); // Reset state self.velocity = self.zoom = 0; diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index e62c141..3151b42 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -2304,7 +2304,10 @@ void() CheckPlayer = useprint (self, 13, 0, 0); if (self.button7 && !ent.invoke_revive) { - centerprint(ent, "Another player is reviving you..."); + + // Broadcast that they're being revived + BroadcastMessageToClient(ent, time + 0.1, 3, self.netname); + ent.beingrevived = true; if (!self.progress_bar_percent) {