This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

CS:GO Give music kit to players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Minoost
SourceMod Donor
Join Date: Aug 2011
Old 12-03-2014 , 03:03   CS:GO Give music kit to players
Reply With Quote #1

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

Last edited by Minoost; 12-03-2014 at 09:17.
Minoost is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 12-03-2014 , 03:31   Re: CS:GO Give music kit to players
Reply With Quote #2

Nice
__________________
Neuro Toxin is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-03-2014 , 06:48   Re: CS:GO Give music kit to players
Reply With Quote #3

Quote:
Originally Posted by Minoost View Post
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.
psychonic is offline
Minoost
SourceMod Donor
Join Date: Aug 2011
Old 12-03-2014 , 09:03   Re: CS:GO Give music kit to players
Reply With Quote #4

Quote:
Originally Posted by psychonic View Post
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.
Minoost is offline
Reply



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 15:19.


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