Raised This Month: $37 Target: $400
 9% 

[CS:GO] Replace regular Scoreboard with Deathmatch Scoreboard


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Muhlex
Junior Member
Join Date: Mar 2019
Old 02-06-2020 , 13:07   [CS:GO] Replace regular Scoreboard with Deathmatch Scoreboard
Reply With Quote #1

I am creating a FFA deathmatch gamemode (where score actually somewhat matters) but I use Casual as a base mode. (Because I don't want to deal with dominations, chickens, respawn noises and chat clutter that Valve's DM mode adds.)

Does anyone know of a way to replace the usual 2-team casual scoreboard with the one used in deathmatch-type gamemodes? So that players can pull up the DM scoreboard when pressing TAB, even though it's actually a casual game. Not sure if this might be impossible.

Thanks for your time.
Muhlex is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 02-06-2020 , 16:10   Re: [CS:GO] Replace regular Scoreboard with Deathmatch Scoreboard
Reply With Quote #2

You can disable dominations: sv_nonemesis
You can disable weapon bonus: mp_dm_time_between_bonus_max 9999, mp_dm_time_between_bonus_min 9999

You can prevent chickens from being created and you can prevent sounds from being played.
__________________
Ilusion9 is offline
Muhlex
Junior Member
Join Date: Mar 2019
Old 02-06-2020 , 20:02   Re: [CS:GO] Replace regular Scoreboard with Deathmatch Scoreboard
Reply With Quote #3

That is indeed a sensible approach. Didn't know about the nemesis thing especially. Thanks for the heads up.
Muhlex is offline
Muhlex
Junior Member
Join Date: Mar 2019
Old 02-23-2020 , 19:14   Re: [CS:GO] Replace regular Scoreboard with Deathmatch Scoreboard
Reply With Quote #4

Finally got around to testing that. Seems like sv_nonemesis alongside with other similar convars like sv_nomvp were back in CSS but do not exist for CS:GO unfortunately. I would also be unsure on how to disable the annoying killsound that plays on for a client in DM, because it does not get sent by the server.
Muhlex is offline
die_man
Senior Member
Join Date: Jul 2017
Old 05-29-2020 , 17:00   Re: [CS:GO] Replace regular Scoreboard with Deathmatch Scoreboard
Reply With Quote #5

up
i want this too
die_man is offline
Muhlex
Junior Member
Join Date: Mar 2019
Old 05-30-2020 , 07:07   Re: [CS:GO] Replace regular Scoreboard with Deathmatch Scoreboard
Reply With Quote #6

I managed to get rid of all the annoying stuff about valve's DM and am now using that mode as a base. I'm away from home over the weekend, will try to remember to post my solution here next week.
Muhlex is offline
Muhlex
Junior Member
Join Date: Mar 2019
Old 06-04-2020 , 18:38   Re: [CS:GO] Replace regular Scoreboard with Deathmatch Scoreboard
Reply With Quote #7

I'll just paste in the code I threw together rather quickly. Might clean it up further and release it as a small helper plugin later.

This blocks the respawn sound that can be heard by everyone in the vicinity. (There does seem to be a small metal sound on respawn that can't be heard in the world. I didn't block this yet but it should be possible as well. It's barely noticable though.)

It also blocks dominations (maybe in an ugly way?); removes the ear-shattering killsound; blocks all of the 'you got X points for a kill' chat-messages; and prevents any chickens from spawning.

Additionally you can use the convars
Code:
mp_dm_time_between_bonus_max "99999"
mp_dm_time_between_bonus_min "99999"

mp_tdm_healthshot_killcount "0"
to get rid of bonus weapons and the healthshot on X kills.

PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>

public void OnPluginStart()
{
    
AddNormalSoundHook(SoundHook_Normal);
    
HookEvent("player_death"GameEvent_PlayerDeathEventHookMode_Pre);
    
HookUserMessage(GetUserMessageId("TextMsg"), Event_TextMsgtrue);
}

public 
Action SoundHook_Normal(int iClients[MAXPLAYERS], int &iNumClientschar szSample[PLATFORM_MAX_PATH], int &iEntityint &iChannelfloat &fVolumeint &iLevelint &iPitchint &iFlagschar szSoundEntry[PLATFORM_MAX_PATH], int &iSeed)
{
    
// Prevent player respawning sounds
    
if (StrContains(szSample"player/pl_respawn.wav") != -1) return Plugin_Stop;

    return 
Plugin_Continue;
}

public 
Action GameEvent_PlayerDeath(Event eEvent, const char[] szNamebool bDontBroadcast)
{
    
int iVictim GetClientOfUserId(GetEventInt(eEvent"userid"));
    
int iAttacker GetClientOfUserId(GetEventInt(eEvent"attacker"));

    if (
iVictim && IsClientInGame(iVictim))
        
// Remove being dominated from Victim
        
SetEntProp(iVictimProp_Send"m_bPlayerDominatingMe"false_iAttacker);

    if (
iAttacker && IsClientInGame(iAttacker))
    {
        
// Remove dominations from Attacker
        
SetEntProp(iAttackerProp_Send"m_bPlayerDominated"false_iVictim);
        
eEvent.SetBool("dominated"false);

        
// Prevent Killsound
        // seems to not work sometimes, so we do it again in the request frame
        
StopSound(iAttackerSNDCHAN_ITEM"buttons/bell1.wav");

        
RequestFrame(RequestFrame_PlayerGetKillGetClientUserId(iAttacker));
    }

    return 
Plugin_Continue;
}

void RequestFrame_PlayerGetKill(int iUserID)
{
    
int iClient GetClientOfUserId(iUserID);
    if (!
iClient || !IsClientInGame(iClient)) return;

    
// Prevent Killsound
    
StopSound(iClientSNDCHAN_ITEM"buttons/bell1.wav");
}

public 
Action Event_TextMsg(UserMsg msgIDHandle hPb, const int[] iPlayersint iPlayersNumbool bReliablebool bInit)
{
    if (
bReliable)
    {
        
// Block chat messages for DM-Points on Kill
        
char szText[64];
        
PbReadString(hPb"params"szTextsizeof(szText),0);
        if (
StrContains(szText"#Player_Point_Award_"false) != -1)
            return 
Plugin_Handled;
    }
    return 
Plugin_Continue;
}

// Block Chicken Spawning
public void OnEntityCreated(int iEntity, const char[] szClassName)
{
    if (
StrContains(szClassName"chicken"false) == -1) return;
    
SDKHook(iEntitySDKHook_SpawnHook_ChickenSpawned);
}

public 
Action Hook_ChickenSpawned(int iChicken) {
    if (
IsValidEntity(iChicken))
        
AcceptEntityInput(iChicken"Kill");

    return 
Plugin_Stop;


Last edited by Muhlex; 06-04-2020 at 18:39.
Muhlex is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:47.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode