Quote:
Originally Posted by alasfourom
Why don't you use "EmitSoundToAll" instead
PHP Code:
#include <sourcemod>
#include <sdktools>
#define DEATH_SOUND "weapons/awp/gunfire/awp1.wav"
public Plugin myinfo =
{
name = "[L4D] Kill",
author = "Danny & FlamFlam",
description = "use the !kill command in chat",
version = "1.0",
url = "https://forums.alliedmods.net/showthread.php?t=338876"
}
public void OnPluginStart()
{
RegConsoleCmd("sm_zs", Kill_Me);
RegConsoleCmd("sm_kill", Kill_Me);
PrecacheSound(DEATH_SOUND);
}
public Action Kill_Me(int client, int args)
{
ForcePlayerSuicide(client);
EmitSoundToAll(DEATH_SOUND);
}
For the "EmitAmbientSound", I think it may work
PHP Code:
#include <sourcemod>
#include <sdktools>
#define DEATH_SOUND "weapons/awp/gunfire/awp1.wav"
public Plugin myinfo =
{
name = "[L4D] Kill",
author = "Danny & FlamFlam",
description = "use the !kill command in chat",
version = "1.0",
url = "https://forums.alliedmods.net/showthread.php?t=338876"
}
public void OnPluginStart()
{
RegConsoleCmd("sm_zs", Kill_Me);
RegConsoleCmd("sm_kill", Kill_Me);
PrecacheSound(DEATH_SOUND);
}
public Action Kill_Me(int client, int args)
{
float pos[3];
GetClientAbsOrigin(client, pos);
EmitAmbientSound(DEATH_SOUND, pos);
ForcePlayerSuicide(client);
}
Both Untested
|
Neither works but thanks for help lol.
Decompiled a chinese version to take a peek, then i just copied it and translated to english instead and it works.
Code:
#include <sourcemod>
#include <sdktools>
public Plugin myinfo =
{
name = "[L4D2] Kill",
author = "",
description = "use the /kill or /zs command in chat",
version = "1.0",
url = ""
}
public void OnPluginStart()
{
RegConsoleCmd("sm_zs", Kill_Me);
RegConsoleCmd("sm_kill", Kill_Me);
}
public void OnMapStart()
{
PrecacheSound("weapons/awp/gunfire/awp1.wav", true);
}
public Action Kill_Me(int client, int args)
{
PrintToChatAll("\x03F in the chat for \x04%N", client);
EmitSoundToAll("weapons/awp/gunfire/awp1.wav", client, 0, 75, 0, 1.0, 100, -1, NULL_VECTOR, NULL_VECTOR, true, 0.0);
ForcePlayerSuicide(client);
}