Fix My Plugin
PHP Code:
#include <amxmodx>
new p_MaxSongs
new p_SongName, p_SongName2, p_SongName3, p_SongName4, p_SongName5
public plugin_init()
{
register_plugin("Custom Mp3 Loading Sound Player", "1.0", "MiloS -.-")
p_MaxSongs = register_cvar("mp3_maxsongs", "1")
p_SongName = register_cvar("mp3_songname", "loading")
p_SongName2 = register_cvar("mp3_songname2", "loading2")
p_SongName3 = register_cvar("mp3_songname3", "loading3")
p_SongName4 = register_cvar("mp3_songname4", "loading4")
p_SongName5 = register_cvar("mp3_songname5", "loading5")
}
public plugin_cfg()
{< br /> server_cmd("exec cstrike/addons/amxmodx/configs/loading_sound.cfg")
}
public plugin_precache()
{
new songname[16], songname2[16], songname3[16], songname4[16], songname5[16]
format(songname, charsmax(songname), "media/%s.mp3", get_pcvar_num(p_SongName))
&n bsp; format(songname2, charsmax(songname2), "media/%s.mp3", get_pcvar_num(p_SongName2))
format(songname3, charsmax(songname3), "media/%s.mp3", get_pcvar_num(p_SongName3))
format(songname4, charsmax(songname4), "media/%s.mp3", get_pcvar_num(p_SongName4))
format( songname5, charsmax(songname5), "media/%s.mp3", get_pcvar_num(p_SongName5))
if(get_pcvar_num(p_MaxSongs) == 0)
{
return PLUGIN_HANDLED
}
if(get_pcvar_num(p_MaxSongs) == 1)
{
precache_generic(songname)
}
if(get_pcvar_num(p_MaxSongs) == 2)
{
precache_generic(songname)
precache_generic(songname2)
}
if(get_pcvar_num(p_MaxSongs) == 3)
{
precache_generic(songname)
precache_generic(songname2)
&n bsp; precache_generic(songname3)
}
if(get_pcvar_num(p_MaxSongs) == 4)
{
precache_generic(songname)
precache_generic(songname2)
precache_generic(songname3)
precache_generic(songname4)
}
if( get_pcvar_num(p_MaxSongs) == 5)
{
precache_generic(songname)
precache_generic(songname2)
precache_generic(songname3)
precache_generic(songname4)
precache_generic(songname5)
}
return PLUGIN_CONTINUE
}
public client_connect(id)
{
new play[62], play2[62], play3[62], play4[62], play5[62]
format(play, charsmax(play), "mp3 play media/%s", get_pcvar_num(p_SongName))
format(play2, charsmax(play2), "mp 3 play media/%s", get_pcvar_num(p_SongName2))
format(play3, charsmax(play3), "mp3 play media/%s", get_pcvar_num(p_SongName3))
format(play4, charsmax(play4), "mp3 play media/%s", get_pcvar_num(p_SongName4))
format(play5, charsmax(play5), "mp3 play media/%s",& nbsp;get_pcvar_num(p_SongName5))
switch(random(p_MaxSongs))
{
case 0:
{
client_cmd(id, play)
}
case 1:
{
client_cmd(id, play2)
}
case 2:
{
client_cmd(id, play3)
}
case 3:
{
client_cmd(id, play4)
}
case 4:
{
& nbsp; client_cmd(id, play5)
}
}
}
public client_putinserver(id)
{
client_cmd(id, "mp3 stop")
}
client_cmd(id, "mp3 play media/loading")
i would hear songClick post title for more details Something is wrong here and i don't know how to fix it, would you ? :)
Orignal From: Fix My Plugin
Post a Comment