Hey!
Today I tried to do something different...
PHP Code:
#pragma semicolon 1
#define DEBUG
#define PLUGIN_AUTHOR "SpirT"
#define PLUGIN_VERSION "1.0"
char firesound[] = "sound/weapon/knife/knife_slash1.wav"
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#pragma newdecls required
public Plugin myinfo =
{
name = "[SpirT] Custom Weapon Fire Sounds",
author = PLUGIN_AUTHOR,
description = "This plugin allows a client to change his weapon fire sound WARNING: For client, it would play the sound that he choosed and the client sided sound, because that cannot be changed (i think)...",
version = PLUGIN_VERSION,
url = "https://paypal.me/spirtcfg"
};
public void OnPluginStart()
{
HookEvent("weapon_fire", OnWeaponFire);
}
public Action OnWeaponFire(Event event, char[] name, bool dontBroadCast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
if(CheckCommandAccess(client, "weapon_vip_firesound", ADMFLAG_ROOT))
{
char weapon[64];
GetClientWeapon(client, weapon, sizeof(weapon));
if(StrEqual(weapon, "weapon_ak47"))
{
SetWeaponFireSound();
}
}
}
void SetWeaponFireSound()
{
AddNormalSoundHook(SoundHook);
}
public Action SoundHook(int clients[64], int &numClients, char sound[PLATFORM_MAX_PATH], int &entity, int &channel, float &volume, int &level, int &pitch, int &flags)
{
if(StrContains(sound, "weapons/ak47/ak47_01"))
{
EmitSoundToAll(firesound, entity, channel, level, flags, volume, pitch);
}
}
As u can see above, there is the code for changing the sound to others...
But when compiling I got this error:
http://prntscr.com/q7v0uv
What's the solution for it?
Thanks for helping and best regards,
SpirT.
__________________