VGUI Buy-Menu: Fix not being able to buy SG-550 as CT.

Set the skull icon next to the player names in the scoreboard.
This commit is contained in:
Marco Cawthorne 2024-03-02 00:46:12 -08:00
parent b6a4fb9fdb
commit 0f445d8e2b
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
12 changed files with 51 additions and 23 deletions

View File

@ -46,17 +46,15 @@ switch (fHeader) {
float fSender = readbyte();
float fTeam = readbyte();
string sMessage = readstring();
string strName = strcat(HUD_GetChatColorHEX(getplayerkeyfloat(fSender, "*team")), getplayerkeyvalue(fSender, "name"));
CSQC_Parse_Print(sprintf("%s^xF80: %s", strName, sMessage), PRINT_CHAT);
CSQC_Parse_Print(Util_ChatFormat(fSender, 0, sMessage), PRINT_CHAT);
break;
case EV_CHAT_TEAM:
float fSender2 = readbyte();
float fTeam2 = readbyte();
string sMessage2 = readstring();
string strName2 = strcat(HUD_GetChatColorHEX(getplayerkeyfloat(fSender2, "*team")), getplayerkeyvalue(fSender2, "name"));
CSQC_Parse_Print(sprintf("^xF80[TEAM] ^7%s^7^xF80: %s", strName2, sMessage2), PRINT_CHAT);
CSQC_Parse_Print(Util_ChatFormat(fSender2, fTeam2, sMessage2), PRINT_CHAT);
break;
case EV_VIEWMODEL:
View_PlayAnimation(readbyte());

View File

@ -14,6 +14,8 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void View_ForceChange(player pl, int targetWeapon);
vector g_vecHUDNums[6] =
{
[168 / 256, 72 / 256],
@ -35,9 +37,10 @@ HUD_DrawWeaponSelect_Forward(void)
if (pSeat->m_flHUDWeaponSelectTime < time) {
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
pl.StartSoundDef("Player.WeaponSelectionOpen", CHAN_ITEM, false);
} else {
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
pl.StartSoundDef("Player.WeaponSelectionMoveSlot", CHAN_ITEM, false);
pSeat->m_iHUDWeaponSelected--;
if (pSeat->m_iHUDWeaponSelected <= 0) {
pSeat->m_iHUDWeaponSelected = g_weapons.length - 1;
@ -62,9 +65,10 @@ HUD_DrawWeaponSelect_Back(void)
if (pSeat->m_flHUDWeaponSelectTime < time) {
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
pl.StartSoundDef("Player.WeaponSelectionOpen", CHAN_ITEM, false);
} else {
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
pl.StartSoundDef("Player.WeaponSelectionMoveSlot", CHAN_ITEM, false);
pSeat->m_iHUDWeaponSelected++;
if (pSeat->m_iHUDWeaponSelected >= g_weapons.length) {
pSeat->m_iHUDWeaponSelected = 1;
@ -84,11 +88,10 @@ HUD_DrawWeaponSelect_Trigger(void)
player pl = (player)pSeat->m_ePlayer;
if (pl.activeweapon != pSeat->m_iHUDWeaponSelected)
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iHUDWeaponSelected);
View_ForceChange(pl, pSeat->m_iHUDWeaponSelected);
pl.activeweapon = pSeat->m_iHUDWeaponSelected;
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
pl.StartSoundDef("Player.WeaponSelected", CHAN_ITEM, false);
pSeat->m_iHUDWeaponSelected = pSeat->m_flHUDWeaponSelectTime = 0;
}
@ -142,9 +145,9 @@ HUD_SlotSelect(int slot)
}
if (pSeat->m_flHUDWeaponSelectTime < time) {
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudon.wav", 0.5, ATTN_NONE);
pl.StartSoundDef("Player.WeaponSelectionOpen", CHAN_ITEM, false);
} else {
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_moveselect.wav", 0.5, ATTN_NONE);
pl.StartSoundDef("Player.WeaponSelectionMoveSlot", CHAN_ITEM, false);
}
/* weren't in that slot? select the first one then */
@ -187,7 +190,7 @@ HUD_DrawWeaponSelect(void)
}
if (pSeat->m_flHUDWeaponSelectTime < time) {
if (pSeat->m_iHUDWeaponSelected) {
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_hudoff.wav", 0.5, ATTN_NONE);
pl.StartSoundDef("Player.WeaponSelectionClose", CHAN_ITEM, false);
pSeat->m_iHUDWeaponSelected = 0;
}
return;

View File

@ -135,6 +135,7 @@ ClientGame_InitDone(void)
VGUI_ShowMOTD();
}
void HLSprite_Init(void);
void
ClientGame_RendererRestart(string rstr)
{
@ -167,6 +168,7 @@ ClientGame_RendererRestart(string rstr)
FX_Blood_Init();
FX_Smokenade_Init();
HLSprite_Init();
Radar_Init();
}

View File

@ -401,7 +401,7 @@ VGUI_BuyMenu_Page(int buyPage)
btnBuyItem7.SetTitle(Titles_GetTextBody("D3AU1"));
btnBuyItem7.SetTag(BUYITEM_G3SG1);
btnBuyItem8.SetTitle(Titles_GetTextBody("Krieg550"));
btnBuyItem8.SetTag(BUYITEM_G3SG1);
btnBuyItem8.SetTag(BUYITEM_SG550);
break;
case BUYPAGE_MGS:
lblBuyScreenTitle.SetTitle(Titles_GetTextBody("Title_machinegun_selection"));

View File

@ -400,7 +400,7 @@ csbot::WeaponThink(void)
/** @brief Get entity by class name and index **/
entity
csbot::GetEntityByNameAndIndex(const string name, int index)
csbot::GetEntityByNameAndIndex(string name, int index)
{
int curIndex = 0;
for (entity a = world; (a = find(a, ::classname, name));) {

View File

@ -128,7 +128,7 @@ CSDeathmatchRules::PlayerDeath(NSClientPlayer pl)
float gibStrength = g_dmg_iDamage * 2.0f;
BreakModel_Entity(pl, gibDir, gibStrength);
} else {
FX_Corpse_Spawn(pl, ANIM_DEATH1);
FX_Corpse_Spawn((player)pl, ANIM_DEATH1);
//FX_Corpse_Spawn((player)pl, ANIM_DIESIMPLE);
}

View File

@ -84,6 +84,14 @@ CSMultiplayerRules::PlayerDeath(NSClientPlayer pl)
}
}
/* scoreboard death icon */
if (g_dmg_eTarget.flags & FL_CLIENT) {
targ.SetInfoKey("*icon1", "d_skull");
targ.SetInfoKey("*icon1_r", "1");
targ.SetInfoKey("*icon1_g", "0");
targ.SetInfoKey("*icon1_b", "0");
}
Weapon_DropCurrentWeapon(targ);
/* if we're the bomb carrier, make sure we drop the bomb. */
@ -880,6 +888,11 @@ CSMultiplayerRules::PlayerRespawn(NSClientPlayer pp, int fTeam)
pl.SendFlags = UPDATE_ALL;
Client_FixAngle(pl, pl.angles);
pl.SetInfoKey("*icon1", "");
pl.SetInfoKey("*icon1_r", "1");
pl.SetInfoKey("*icon1_g", "1");
pl.SetInfoKey("*icon1_b", "1");
switch (pl.charmodel) {
case 1:
pl.model = "models/player/terror/terror.mdl";

View File

@ -151,7 +151,7 @@ item_c4::Logic(void)
if (dist < bestDist) {
bestDist = dist;
bestTarget = e;
bestTarget = (NSEntity)e;
}
}

View File

@ -145,7 +145,6 @@ w_awp_draw(player pl)
void
w_awp_release(player pl)
{
w_cstrike_weaponrelease();
/* auto-reload if need be */

View File

@ -143,7 +143,6 @@ w_deagle_draw(player pl)
void
w_deagle_primary(player pl)
{
if (pl.w_attack_next > 0.0)
return;
if (pl.gflags & GF_SEMI_TOGGLED)
@ -153,7 +152,6 @@ w_deagle_primary(player pl)
float accuracy = Cstrike_CalculateAccuracy(pl, 55,1.5)+0.005;
int dmg;
pl.deagle_mag--;
if (pl.deagle_mag <= 0) {
@ -179,7 +177,7 @@ w_deagle_primary(player pl)
View_SetMuzzleflash(MUZZLE_RIFLE);
View_AddEvent(w_pistol_ejectshell, 0.0f);
#else
dmg = Skill_GetValue("plr_deagle_dmg", 54);
int dmg = Skill_GetValue("plr_deagle_dmg", 54);
TraceAttack_SetRangeModifier(1.875); /* 14 but not 15 */
TraceAttack_SetPenetrationPower(1);
Cstrike_BulletRecoil_ApplyPre(pl,0.5);

View File

@ -111,7 +111,6 @@ w_scout_draw(player pl)
void
w_scout_release(player pl)
{
w_cstrike_weaponrelease();
/* auto-reload if need be */

View File

@ -118,4 +118,20 @@ Player.FlashLightOff
SprayCan.Paint
{
sample player/sprayer.wav
}
Player.Wade
{
sample player/pl_wade1.wav
sample player/pl_wade2.wav
sample player/pl_wade3.wav
sample player/pl_wade4.wav
}
Player.Swim
{
sample player/pl_swim1.wav
sample player/pl_swim2.wav
sample player/pl_swim3.wav
sample player/pl_swim4.wav
}