View Single Post
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 01-06-2022 , 17:26   Re: [CSGO]Block weapon reload event transmit ?
Reply With Quote #4

Block reload sounds
PHP Code:

public void OnPluginStart()
{
    
UserMsg msg GetUserMessageId("WeaponSound");

    if(
msg != INVALID_MESSAGE_ID)
        
HookUserMessage(msgusermsg_hooktrue);

}

public 
Action usermsg_hook(UserMsg msg_idProtobuf msg, const int[] playersint playersNumbool reliablebool init)
{
    
char buffer[60];
    
//GetUserMessageName(msg_id, buffer, sizeof(buffer));
    //PrintToServer("msg_id %s", buffer);

    
msg.ReadInt("entidx");
    
msg.ReadFloat("origin_x");
    
msg.ReadFloat("origin_y");
    
msg.ReadFloat("origin_z");
    
msg.ReadString("sound"buffersizeof(buffer));
    
msg.ReadFloat("timestamp");
    
    
//PrintToServer("-WeaponSound %s", buffer);
    
return Plugin_Handled;

*edit
Maybe I am wrong, I assume now, blocking weapon reload animation work in Counter-Strike: Source game,
CS:GO again seems not use that reload usermessage.

One of reasons why people need mention in they forum topic, what a game it is.
__________________
Do not Private Message @me

Last edited by Bacardi; 01-06-2022 at 17:33.
Bacardi is offline