Raised This Month: $32 Target: $400
 8% 

Make a sound when a player spawns?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ahmed_Nakadi
Member
Join Date: Oct 2018
Old 04-26-2020 , 09:02   Make a sound when a player spawns?
Reply With Quote #1

Hello guys, can someone of you please make a small simple plugin that will make a sound when a player spawns? Like on official valve deathmatch servers. That little "pong" sound or whatever, so you know that someone just spawned close to you. I am sure that i am not the only one who got this idea.
Ahmed_Nakadi is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-26-2020 , 16:36   Re: Make a sound when a player spawns?
Reply With Quote #2

PHP Code:
char csgo_ingame_sounds[][] = {
    
"ambient/misc/brass_bell_c.wav",
    
"ambient/misc/brass_bell_d.wav",
    
"ambient/misc/brass_bell_e.wav",
    
"ambient/misc/brass_bell_f.wav",
    
"ambient/creatures/chicken_death_01.wav",
    
"ambient/creatures/chicken_death_02.wav",
    
"ambient/creatures/chicken_death_03.wav"
}

#include <sdktools>

public void OnPluginStart()
{
    
HookEventEx("player_spawn"player_spawn);
}

public 
void player_spawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));

    if(
GetClientTeam(client) >= 2)
    {
        
int random GetRandomInt(0sizeof(csgo_ingame_sounds)-1);
        
PrecacheSound(csgo_ingame_sounds[random]);
        
EmitSoundToAll(csgo_ingame_sounds[random], client);
    }

__________________
Do not Private Message @me
Bacardi is offline
Ahmed_Nakadi
Member
Join Date: Oct 2018
Old 04-26-2020 , 19:36   Re: Make a sound when a player spawns?
Reply With Quote #3

Nice man, thanks a lot
Ahmed_Nakadi is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode