Raised This Month: $ Target: $400
 0% 

[BUG] - Welcome Sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SHIFT0
Senior Member
Join Date: Apr 2021
Location: Palestine
Old 12-08-2021 , 16:45   Re: [BUG] - Welcome Sound
Reply With Quote #1

Quote:
Originally Posted by Yusochan View Post
Hello !

When i join the server the sound doesn't play..

Code:
#include <amxmodx>

new const szPLUGIN[] = "Welcome kho", szVERSION[] = "2.0", szAUTHOR[] = "YusoChan-";

new const szWelcome[] = "sound/misc/welcome.wav";

public plugin_init() {
	
	register_plugin(szPLUGIN, szVERSION, szAUTHOR);
}

public client_connect(id) {
	set_task(3.0, "Welcome", id);
}

public plugin_precache()
{
	precache_sound(szWelcome);
}

public Welcome(id)
{
	if(is_user_connected(id)) {
		client_cmd(id, "spk welcome.wav", szWelcome);
	}
}

PHP Code:
#include <amxmodx>

// change this number to the amount of sounds u have
#define Maxsounds 2

// add here your sounds, sounds must be somewhere in <ModDir>/sound
// format must be like: {"misc/sound1","ambience/sound2"}
new soundlist[Maxsounds][] = {"misc/welcome""misc/prepare"}

new 
plugin_author[] = "White Panther"
new plugin_version[] = "1.2.3"

public plugin_init( )
{
    
register_plugin("Connect Sound"plugin_versionplugin_author)
    
register_cvar("connectsound_version"plugin_versionFCVAR_SERVER)
}

public 
plugin_precache( )
{
    new 
temp[128], soundfile[128]
    for ( new 
0Maxsoundsa++ )
    {
        
format(temp127"sound/%s.wav"soundlist[a])
        if ( 
file_exists(temp) )
        {
            
format(soundfile127"%s.wav"soundlist[a])
            
precache_sound(soundfile)
        }
    }
}

public 
client_putinserverid )
{
    
set_task(1.0"consound"100 id)
}

public 
consoundtimerid_id )
{
    new 
id timerid_id 100
    
new Usertime
    Usertime 
get_user_time(id0)
    if ( 
Usertime <= )
    {
        
set_task(1.0"consound"timerid_id)
    }else
    {
        new 
random(Maxsounds)
        
client_cmd(id"spk ^"%s^""soundlist[i])
    }
    
    return 
PLUGIN_CONTINUE

SHIFT0 is offline
Yusochan
Member
Join Date: Sep 2021
Location: Algeria
Old 12-08-2021 , 17:56   Re: [BUG] - Welcome Sound
Reply With Quote #2

Mate :/ are u okay ?
__________________
<b>IP : <font color=Red>93.115.53.168:27017</font></b>
<b>Founder : <font color=Cyan>YusoChan-</font></b>
Yusochan 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 11:36.


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