View Single Post
foxhound27
AlliedModders Donor
Join Date: Sep 2019
Location: Argentina
Old 12-19-2019 , 09:54   Re: [CS:GO] AddNormalSoundHook is getting as native error
Reply With Quote #9

try with

PHP Code:
AddAmbientSoundHook(view_as<AmbientSHook>(OnNormalSoundPlayed));


public 
Action OnNormalSoundPlayed(int clients[64], int &numClientschar sample[PLATFORM_MAX_PATH], int &entityint &channelfloat &volumeint &levelint &pitchint &flags)
{    
    if (
entity <= MaxClients)
    {
        if(
StrContains(sample"weapons/knife/knife_hit") != -1)
        {
                
StopSound(entitySNDCHAN_STATICsample);
                
EmitSoundToAll("weapons/ak47/ak47_01.wav");            
                return 
Plugin_Stop;
        }
    }
    return 
Plugin_Continue;

foxhound27 is offline