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
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;
}