AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CSGO]Block weapon reload event transmit ? (https://forums.alliedmods.net/showthread.php?t=335824)

1254871688 01-06-2022 14:46

[CSGO]Block weapon reload event transmit ?
 
in a zombie mod server, if you have a lot of teammate def one place you will always hear their reload sound (clipin \clipout\ bolt) that was annoying
I tried sound hook but it did not work , after search for more infomation , i found that these sound are client side.
but one of my friend told me , when he played in a zombie server before ,he can not hear any reload sound from his teammate because he did not see any reloading animation on his teammate
so it means, when you reload your weapon, other player can not see your thirdperson reloading animation
I realized that if we block weapon reload event transmit to other player , no animation = no sound
but how to do that?
weapon_reload seems not work
any idea?

eyal282 01-06-2022 14:58

Re: [CSGO]Block weapon reload event transmit ?
 
https://forums.alliedmods.net/showthread.php?t=300730

1254871688 01-06-2022 15:29

Re: [CSGO]Block weapon reload event transmit ?
 
Quote:

Originally Posted by eyal282 (Post 2767801)

i see that post , that is for viewmodel reload speed , seems not work on thirdperson (other player still see your reload animation on your playermodel and hear the sound)

Bacardi 01-06-2022 17:26

Re: [CSGO]Block weapon reload event transmit ?
 
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.

1254871688 01-07-2022 04:27

Re: [CSGO]Block weapon reload event transmit ?
 
Quote:

Originally Posted by Bacardi (Post 2767814)
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.


tested ,works on CSGO :3


All times are GMT -4. The time now is 00:48.

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