That's how it works.
PHP Code:
public Action:DeathSound(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags)
{
if (StrContains(sample, "death", false) != -1)
{
decl String:file[MAX_PATH_LENGTH];
Format(file, sizeof(file), "death%d.wav", GetRandomInt(1, 5));
EmitSoundToAll(file);
return Plugin_Handled;
}
return Plugin_Continue;
}
Can you tell me how to get a specific player in "public Action
eathSound" to play a sound for him?
PHP Code:
new client = GetClientOfUserId(GetEventInt(event, "userid"));
doesn't work because of missing event.