|
代码是正确,可用的!不知道是这个 #include <amxmisc> 需要加载什么DLL吗?
求解答,谢谢大家
代码如下:
[php]#include <amxmodx>
#include <amxmisc>
#include <engine>
#define MAX_SONGS 50
public plugin_init(){
register_plugin("loading with music","2.0","eFrigid")
}
new configsdir[200]
new configfile[200]
new song[MAX_SONGS][64]
new songdir[MAX_SONGS][64]
new bool:precached[MAX_SONGS]
public plugin_precache(){
get_configsdir(configsdir,199)
format(configfile,199,"%s/loadingsongs.ini",configsdir)
new trash
for(new i=0;i<MAX_SONGS;i++)
{
precached=false
read_file(configfile,i,song,63,trash)
if(!equali(song[4],""))
{
precached=true
format(songdir,63,"sound/misc/%s",song)
precache_generic(songdir)
}
}
}
public client_connect(id){
set_task(0.2,"delay_play",id) // delay play, fixed saometime can't play problem
return PLUGIN_CONTINUE
}
public delay_play(id) {
new size = file_size(configfile,1)
new rsong = random_num(0,size-1)
new cursong[64], a
read_file(configfile,rsong,cursong,63,a)
//client_cmd(id,"mp3 play sound/misc/%s",cursong)
client_cmd(id,"mp3 loop sound/misc/%s",cursong) // loop play, fixed sometime load too long and sound stoped
}[/php]
谢谢大家。。。请解答:burn: |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|