AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   CS:GO Give music kit to players (https://forums.alliedmods.net/showthread.php?t=252457)

Minoost 12-03-2014 03:03

CS:GO Give music kit to players
 
By forcing m_nMusicID to certain value, you can give a music kit to players!
Note: I don't know why, but m_nMusicID is being reset every frame by game and very glitch.

Code:

MUSIC ID:
1,2 - CS:GO Default 1, 2
3 - Daniel Sadowski, Crimson Assault
4 - Noisia, Sharpened
5 - Robert Allaire, Insurgency
6 - Sean Murray, AD8
7 - Feed Me, High Noon
8 - Dren, Death’s Head Demolition
9 - Austin Wintory, Desert Fire
10 - Sasha, LNOE
11 - Skog, Metal

Example (Youtube)
Example 2 (Youtube)

EDIT:
Quote:

Originally Posted by psychonic (Post 2230733)
It is likely being recopied to the player resource object on every think, like many other values on it. It is largely just a clone of values existing on the player class, but instead networked to all players, rather than just self or players in PVS.

Thanks to psychonic, I just found better way to handle it.
In this way, you don't need to change m_nMusicId on every frame.

Code:

public OnPluginStart()
{
    RegConsoleCmd("sm_setmusic", Command_Music);
}

public Action:Command_Music(client, args)
{
    new String:command[8];
    GetCmdArg(1, command, sizeof(command));
    new id = StringToInt(command);
   
    SetEntProp(client, Prop_Send, "m_unMusicID", id);
    return Plugin_Handled;
}


Neuro Toxin 12-03-2014 03:31

Re: CS:GO Give music kit to players
 
Nice :)

psychonic 12-03-2014 06:48

Re: CS:GO Give music kit to players
 
Quote:

Originally Posted by Minoost (Post 2230666)
Note: I don't know why, but m_nMusicID is being reset every frame by game and very glitch.

It is likely being recopied to the player resource object on every think, like many other values on it. It is largely just a clone of values existing on the player class, but instead networked to all players, rather than just self or players in PVS.

Minoost 12-03-2014 09:03

Re: CS:GO Give music kit to players
 
Quote:

Originally Posted by psychonic (Post 2230733)
It is likely being recopied to the player resource object on every think, like many other values on it. It is largely just a clone of values existing on the player class, but instead networked to all players, rather than just self or players in PVS.

Ah, that explains a problem. Thanks.


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

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.