View Single Post
beastedout
Member
Join Date: Aug 2018
Old 08-16-2018 , 05:42   Re: [ANY] Store by Zephyrus [1.1 - 03.01.2016]
Reply With Quote #1491

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <store>
#include <zephstocks>

#define STORE_MAX_ITEMS 2048


enum Sound
{
    
String:szSound[PLATFORM_MAX_PATH],
}

new 
g_eSounds[STORE_MAX_ITEMS][Sound];
new 
g_iSounds 0;


public 
OnPluginStart()
{
    new 
String:m_szGameDir[32];
    
GetGameFolderName(m_szGameDirsizeof(m_szGameDir));
    
    
Store_RegisterHandler("death_sound""path"Sounds_OnMapStartSounds_ResetSounds_ConfigSounds_EquipSounds_Removetrue);

    
HookEvent("player_death"onPlayerDeathEventHookMode_Pre);
}

public 
Sounds_OnMapStart()
{
    
decl String:tmp[PLATFORM_MAX_PATH];
    for(new 
i=0;i<g_iSounds;++i)
    {
        
strcopy(STRING(tmp), g_eSounds[i][szSound]);
        
PrecacheSound(tmp[6], true);
        
Downloader_AddFileToDownloadsTable(g_eSounds[i][szSound]);
    }
}

public 
Sounds_Reset()
{
    
g_iSounds 0;
}

public 
Sounds_Config(&Handle:kvitemid)
{
    
Store_SetDataIndex(itemidg_iSounds);
    
    
KvGetString(kv"path"g_eSounds[g_iSounds][szSound], PLATFORM_MAX_PATH);
    
    if(
FileExists(g_eSounds[g_iSounds][szSound], true))
    {
        ++
g_iSounds;
        return 
true;
    }
    
    return 
false;
}

public 
Sounds_Equip(clientid)
{
    new 
m_iData Store_GetDataIndex(id);
    return 
1;
}

public 
Sounds_Remove(clientid)
{
    return 
0;
}
public 
Action onPlayerDeath(Handle event, const char[] namebool dontBroadcast) {
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    
    if (
client == attacker)
        return;
    
    
float pos[3];
    
GetClientAbsOrigin(clientpos);
    
    
LoopIngamePlayers(i)
    {
        
ClientCommand(i"play %s"g_eSounds[m_iData][szSound]);
    }

Can someone help me complete this? Trying to make kill sound All Copied from store/sounds.sp

Last edited by beastedout; 08-16-2018 at 05:45. Reason: some stuff
beastedout is offline