Raised This Month: $319 Target: $400
 79%   Almost there!

csgo plugin music join for users


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dreamie
New Member
Join Date: Jul 2021
Old 07-30-2021 , 21:59   csgo plugin music join for users
Reply With Quote #1

i tried to search for a plugin like this but i couln't find one.
So my question is, is there or anyone knows of a plugin that can play music for about 8 seconds so u can set it up for each user and stuff?
thanks.
dreamie is offline
tair
Junior Member
Join Date: Apr 2015
Location: OnGameFrame()
Old 07-31-2021 , 11:43   Re: csgo plugin music join for users
Reply With Quote #2

Not Tested.

You need to change the sound path on JOIN_SOUND define.

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

#pragma semicolon 1
#pragma newdecls required

#define JOIN_SOUND    "example/sound1.wav"

ConVar g_cPlayTime;
Handle JoinTimer[MAXPLAYERS+1];

public 
Plugin myinfo =
{
    
name "[ANY] Join Music",
    
description "Plays music to a player on connect.",
    
author "Tair",
    
version "1.0",
    
url ""
};

public 
void OnPluginStart()
{
    
g_cPlayTime CreateConVar("sm_music_time""5.0""The time it takes until the timer plays the music"0false0.0false0.0);
}

public 
void OnMapStart()
{
    
PrecacheSound(JOIN_SOUND);
    
AddFileToDownloadsTable("sound/" ... JOIN_SOUND);
}

public 
void OnClientPutInServer(int client)
{
    
JoinTimer[client] = CreateTimer(g_cPlayTime.FloatValueMusicTimerclient0);
}

public 
void OnClientDisconnect(int client)
{
    if (
JoinTimer[client] != null)
    {
        
delete JoinTimer[client];
    }
}

public 
Action MusicTimer(Handle timerany client)
{
    
EmitSoundToClient(clientJOIN_SOUND, -207501.0100, -1NULL_VECTORNULL_VECTORtrue0.0);
    
delete JoinTimer[client];
    return 
Plugin_Handled;

__________________
Taking Private Requests! | Discord: Tair#7540.
tair is offline
Reply


Thread Tools
Display Modes

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 20:58.


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