Raised This Month: $ Target: $400
 0% 

About show HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kevin14144
Member
Join Date: Jul 2007
Old 02-07-2009 , 04:02   About show HUD
Reply With Quote #1

I want to always show the song name
How can i do ?

Eevey round show it.

I try to write , but it doesn't work.
Attached Files
File Type: sma Get Plugin or Get Source (mp3-wav_player.sma - 531 views - 2.9 KB)

Last edited by kevin14144; 02-07-2009 at 04:10.
kevin14144 is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-07-2009 , 04:56   Re: About show HUD
Reply With Quote #2

ResetHUD isn't called at a new round, but multiple times during the round.
http://forums.alliedmods.net/showthread.php?t=42159

And i don't understand what you want to show.
__________________

anakin_cstrike is offline
kevin14144
Member
Join Date: Jul 2007
Old 02-07-2009 , 05:08   Re: About show HUD
Reply With Quote #3

Quote:
Originally Posted by anakin_cstrike View Post
ResetHUD isn't called at a new round, but multiple times during the round.
http://forums.alliedmods.net/showthread.php?t=42159

And i don't understand what you want to show.

I play music and show what i play.
kevin14144 is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-07-2009 , 05:17   Re: About show HUD
Reply With Quote #4

I didn't look ro the rest of the code, but here it is
PHP Code:
/* This is an AMXMODX Script
*
*
*   Thanks to Kensai for testing this with me and helping me figure some stuff out.
*   Thanks to GHW_Chronic for adding a large chunk for me.
*
*   version 1.3 - GHW_Chronic added a music.ini file where you put song names in to precache them.
*
*   Version 1.2 - Script works due to GHW_Chronic, added stopplay & say /stop commands as well as making the 2 amx_play commands into one.
*
*/

#include <amxmodx>
#include <amxmisc>

#define MAX_SONGS    10

new configsdir[200]
new 
configfile[200]
new 
song[MAX_SONGS][64]
new 
songdir[MAX_SONGS][64]
new 
bool:precached[MAX_SONGS]

new 
g_maxplayers;
public 
plugin_init()
{
register_plugin("MP3 + Wav Player W/ music.ini Precacher","1.3","GHW_Chronic + bizzybone")
register_concmd("amx_play","cmd_play",ADMIN_LEVEL_E," TEST WORD ")
register_concmd("amx_playlist","cmd_playlist",ADMIN_LEVEL_E," TEST WORD ")
register_concmd("amx_stopplay","cmd_Stop",ADMIN_LEVEL_E,"TEST WORD")
register_clcmd("say /stop","cl_cmd_stop")
g_maxplayers get_maxplayers();

}

public 
plugin_precache()
{
new 
songdir2[64]
get_configsdir(configsdir,199)
format(configfile,199,"%s/music.ini",configsdir)
new 
trash
for(new i=0;i<MAX_SONGS;i++)
{
precached[i]=false
read_file
(configfile,i,song[i],63,trash)
if(!
equali(song[i][4],""))
{
format(songdir[i],63,"zamusic/%s",song[i])
format(songdir2,63,"sound/zamusic/%s",song[i])
if(
file_exists(songdir2))
{
precached[i]=true
precache_sound
(songdir[i])
}
}
}
}

public 
cmd_playlist(id,level,cid)
{
console_print(id,"Songs in server playlist:")
for(new 
i=0;i<MAX_SONGS;i++)
{
if(
precached[i])
{
console_print(id,song[i])
}
}
return 
PLUGIN_HANDLED
}

public 
cmd_Stop(id,level,cid)
{
if (!
cmd_access(id,level,cid,1))
{
return 
PLUGIN_HANDLED
}
client_cmd(0,"mp3 stop;stopsound")
client_print(0,print_chat,"TEST WORD")
return 
PLUGIN_HANDLED
}

public 
cmd_play(id,level,cid)
{
if (!
cmd_access(id,level,cid,2))
{
return 
PLUGIN_HANDLED
}
new 
arg1[32]
read_argv(1,arg1,31)

new 
songnum MAX_SONGS
for(new i=0;i<MAX_SONGS;i++)
{
if(
precached[i] && containi(song[i],arg1)!=-1)
{

if(
songnum!=MAX_SONGS)
{
console_print(id,"TEST WORD")
return 
PLUGIN_HANDLED
}
songnum i
}
}
if(
songnum==MAX_SONGS)
{
console_print(id,"TEST WORD")
return 
PLUGIN_HANDLED
}
if(
containi(song[songnum],".mp3"))
{
client_cmd(0,"mp3 play ^"sound/%s^"",songdir[songnum])

}
if(
containi(song[songnum],".wav"))
{
client_cmd(0,"spk ^"%s^"",songdir[songnum])
}
client_print(0,print_chat,"TEST WORD",song[songnum])

for( new 
1;  <= g_maxplayersi++)
{
    if( !
is_user_connected) )
        continue;
    if( 
is_user_bot) )
        continue;
    
set_hudmessage(2002002000.160.0606.05.0)
    
show_hudmessage(isong[songnum]);
}
    
return 
PLUGIN_HANDLED
}

public 
cl_cmd_stop(id)
{
client_cmd(id,"mp3 stop;stopsound")
client_print(id,print_chat,"TEST WORD")
return 
PLUGIN_HANDLED

__________________

anakin_cstrike is offline
kevin14144
Member
Join Date: Jul 2007
Old 02-07-2009 , 06:53   Re: About show HUD
Reply With Quote #5

Quote:
Originally Posted by anakin_cstrike View Post
I didn't look ro the rest of the code, but here it is
Thanks.

It show now.

But how can it alway show before i change music ?

Last edited by kevin14144; 02-07-2009 at 07:14.
kevin14144 is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-07-2009 , 07:38   Re: About show HUD
Reply With Quote #6

Try this
PHP Code:
/* This is an AMXMODX Script
*
*
*   Thanks to Kensai for testing this with me and helping me figure some stuff out.
*   Thanks to GHW_Chronic for adding a large chunk for me.
*
*   version 1.3 - GHW_Chronic added a music.ini file where you put song names in to precache them.
*
*   Version 1.2 - Script works due to GHW_Chronic, added stopplay & say /stop commands as well as making the 2 amx_play commands into one.
*
*/

#include <amxmodx>
#include <amxmisc>

#define MAX_SONGS    10

new configsdir[200]
new 
configfile[200]
new 
song[MAX_SONGS][64]
new 
songdir[MAX_SONGS][64]
new 
bool:precached[MAX_SONGS]

new 
g_maxplayers;
new 
showmusic64 ];

public 
plugin_init()
{
register_plugin("MP3 + Wav Player W/ music.ini Precacher","1.3","GHW_Chronic + bizzybone")
register_concmd("amx_play","cmd_play",ADMIN_LEVEL_E," TEST WORD ")
register_concmd("amx_playlist","cmd_playlist",ADMIN_LEVEL_E," TEST WORD ")
register_concmd("amx_stopplay","cmd_Stop",ADMIN_LEVEL_E,"TEST WORD")
register_clcmd("say /stop","cl_cmd_stop")
g_maxplayers get_maxplayers();

}

public 
plugin_precache()
{
new 
songdir2[64]
get_configsdir(configsdir,199)
format(configfile,199,"%s/music.ini",configsdir)
new 
trash
for(new i=0;i<MAX_SONGS;i++)
{
precached[i]=false
read_file
(configfile,i,song[i],63,trash)
if(!
equali(song[i][4],""))
{
format(songdir[i],63,"zamusic/%s",song[i])
format(songdir2,63,"sound/zamusic/%s",song[i])
if(
file_exists(songdir2))
{
precached[i]=true
precache_sound
(songdir[i])
}
}
}
}

public 
cmd_playlist(id,level,cid)
{
console_print(id,"Songs in server playlist:")
for(new 
i=0;i<MAX_SONGS;i++)
{
if(
precached[i])
{
console_print(id,song[i])
}
}
return 
PLUGIN_HANDLED
}

public 
cmd_Stop(id,level,cid)
{
if (!
cmd_access(id,level,cid,1))
{
return 
PLUGIN_HANDLED
}
client_cmd(0,"mp3 stop;stopsound")
client_print(0,print_chat,"TEST WORD")
return 
PLUGIN_HANDLED
}

public 
cmd_play(id,level,cid)
{
if (!
cmd_access(id,level,cid,2))
{
return 
PLUGIN_HANDLED
}
new 
arg1[32]
read_argv(1,arg1,31)

new 
songnum MAX_SONGS
for(new i=0;i<MAX_SONGS;i++)
{
if(
precached[i] && containi(song[i],arg1)!=-1)
{

if(
songnum!=MAX_SONGS)
{
console_print(id,"TEST WORD")
return 
PLUGIN_HANDLED
}
songnum i
}
}
if(
songnum==MAX_SONGS)
{
console_print(id,"TEST WORD")
return 
PLUGIN_HANDLED
}
if(
containi(song[songnum],".mp3"))
{
client_cmd(0,"mp3 play ^"sound/%s^"",songdir[songnum])

}
if(
containi(song[songnum],".wav"))
{
client_cmd(0,"spk ^"%s^"",songdir[songnum])
}
client_print(0,print_chat,"TEST WORD",song[songnum])

copyshowmusic64song[songnum] );

if( 
task_exists(123) )
    
remove_task123 );
set_task2.0"show_music"123__"b" );
    
return 
PLUGIN_HANDLED
}

public 
cl_cmd_stop(id)
{
client_cmd(id,"mp3 stop;stopsound")
client_print(id,print_chat,"TEST WORD")
return 
PLUGIN_HANDLED
}

public 
show_music()
{
for( new 
1;  <= g_maxplayersi++)
{
    if( !
is_user_connected) )
        continue;
    if( 
is_user_bot) )
        continue;
    
set_hudmessage(2002002000.160.0606.05.0)
    
show_hudmessage(ishowmusic);
}

__________________

anakin_cstrike is offline
kevin14144
Member
Join Date: Jul 2007
Old 02-07-2009 , 07:54   Re: About show HUD
Reply With Quote #7

Quote:
Originally Posted by anakin_cstrike View Post
Try this
Thank you ! It work !!!!!!!

I know this code now .

copy( showmusic, 64, song[songnum] )
kevin14144 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 01:37.


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