
-- 2013 Bal 06 21:26 --
pades kas nors?
Neveikia seni Csound'ai ant dabartinių serveriųUnkolix wrote:https://forums.alliedmods.net/showthread.php?t=2101
/*
* Plays a welcome sound to the player who connects
*
* by White Panther
*
* v1.0
*
* v1.1:
* - addition to add easily own sounds
*
* v1.2.1:
* - bug with not playing sounds to client fixed
* - added file exist check for soundfile
*
* v1.2.3:
* - fixed
* - docu bug
* - changes:
* - way of giving id to timer
*/
#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_version, plugin_author)
register_cvar("connectsound_version", plugin_version, FCVAR_SERVER)
}
public plugin_precache( )
{
new temp[128], soundfile[128]
for ( new a = 0; a < Maxsounds; a++ )
{
format(temp, 127, "sound/%s.wav", soundlist[a])
if ( file_exists(temp) )
{
format(soundfile, 127, "%s.wav", soundlist[a])
precache_sound(soundfile)
}
}
}
public client_putinserver( id )
{
set_task(1.0, "consound", 100 + id)
}
public consound( timerid_id )
{
new id = timerid_id - 100
new Usertime
Usertime = get_user_time(id, 0)
if ( Usertime <= 0 )
{
set_task(1.0, "consound", timerid_id)
}else
{
new i = random(Maxsounds)
client_cmd(id, "spk ^"%s^"", soundlist)
}
return PLUGIN_CONTINUE
}
Jesus wrote:/*
* Plays a welcome sound to the player who connects
*
* by White Panther
*
* v1.0
*
* v1.1:
* - addition to add easily own sounds
*
* v1.2.1:
* - bug with not playing sounds to client fixed
* - added file exist check for soundfile
*
* v1.2.3:
* - fixed
* - docu bug
* - changes:
* - way of giving id to timer
*/
#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_version, plugin_author)
register_cvar("connectsound_version", plugin_version, FCVAR_SERVER)
}
public plugin_precache( )
{
new temp[128], soundfile[128]
for ( new a = 0; a < Maxsounds; a++ )
{
format(temp, 127, "sound/%s.wav", soundlist[a])
if ( file_exists(temp) )
{
format(soundfile, 127, "%s.wav", soundlist[a])
precache_sound(soundfile)
}
}
}
public client_putinserver( id )
{
set_task(1.0, "consound", 100 + id)
}
public consound( timerid_id )
{
new id = timerid_id - 100
new Usertime
Usertime = get_user_time(id, 0)
if ( Usertime <= 0 )
{
set_task(1.0, "consound", timerid_id)
}else
{
new i = random(Maxsounds)
client_cmd(id, "spk ^"%s^"", soundlist)
}
return PLUGIN_CONTINUE
}
Štai pluginas šitas , bet aš nesuprantu kur ka rašyti mano pavadinimas grojamo failo yra pradzia ir ar sitas tikrai veiks kai prisijungi i serva, ta prasme prisijungi i serveri pasirenki norima komanda atsirandi ir tada grot pradeda taip?
Code: Select all
new soundlist[Maxsounds][] = {"misc/pradzia", "misc/pradzia"}
laimiukas3 wrote:Code: Select all
new soundlist[Maxsounds][] = {"misc/pradzia", "misc/pradzia"}
Code: Select all
new soundlist[Maxsounds][] = {"misc/pradzia"}
cia kaip pvz buvo duota, kad galima daugiau negu 1 daina talpinti constantoi ir aplamai konstatos dydi Maxsounds neverta nustatineti jei yra ciklas for, panasiai kaip sizeof siuo atveju...Unkolix wrote:laimiukas3 wrote:Code: Select all
new soundlist[Maxsounds][] = {"misc/pradzia", "misc/pradzia"}
Code: Select all
new soundlist[Maxsounds][] = {"misc/pradzia"}
Skaityt nemoki?Jesus wrote:O galas koks .wav ar .mp3?
Code: Select all
format(temp, 127, "sound/%s.wav", soundlist[a])
Users browsing this forum: No registered users and 5 guests