View Single Post
Drimacus
Member
Join Date: Jun 2011
Old 02-18-2024 , 05:49   Re: Play my sound of death
Reply With Quote #4

That's how it works.
PHP Code:
public Action:DeathSound(clients[64], &numClientsString:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags)
{
    if (
StrContains(sample"death"false) != -1)
    {
        
decl String:file[MAX_PATH_LENGTH];
        
Format(filesizeof(file), "death%d.wav"GetRandomInt(15));
        
EmitSoundToAll(file);

        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;

Can you tell me how to get a specific player in "public ActioneathSound" to play a sound for him?
PHP Code:
new client GetClientOfUserId(GetEventInt(event"userid")); 
doesn't work because of missing event.
Drimacus is offline