Raised This Month: $ Target: $400
 0% 

loading sound with timelimit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mulan
Senior Member
Join Date: Jul 2005
Location: [GER]Worbis
Old 11-03-2005 , 17:58   loading sound with timelimit
Reply With Quote #1

okay... i have a problem. In the German Forum cant me help.

I have AMXX 1.50 an have written a mini-plugin.
This plugin must load a sound after the time i have definied in the amxx.cfg.

Problem: Plugin is loaded and running by AMXX. I cant hear the Sound in-Game after 60 seconds. Why? Plz help me

Code:
#include <amxmodx> 

new sound[] = "change.wav" 
public plugin_init() 
{ 
    register_plugin("TimeSound","1.0","Mulan") 
    register_cvar("amx_time_sound", "60") 
    return PLUGIN_CONTINUE 
} 

public time_sound(id)
{ 
	if(!is_user_connected(id))
		return PLUGIN_CONTINUE
	if(!get_cvar_float("mp_timelimit"))
		return PLUGIN_CONTINUE
   	new timeleft = (get_timeleft()+1)
   	if(timeleft == get_cvar_num("amx_time_sound")) {
   	client_cmd(id,"play sound/misc/%s",sound) 
   	return PLUGIN_CONTINUE 
   	}   
   	return PLUGIN_CONTINUE    	
}
Mulan is offline
Send a message via ICQ to Mulan
cTn
Senior Member
Join Date: Oct 2005
Old 11-03-2005 , 18:11  
Reply With Quote #2

Code:
client_cmd(id,"play sound/misc/%s",sound)
this parameter is right?
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-03-2005 , 18:12  
Reply With Quote #3

this doesn't call anything...
[ --<-@ ] Black Rose is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-03-2005 , 18:13  
Reply With Quote #4

I guess... not sure what you're trying to do:

Code:
#include <amxmodx> new sound[] = "misc/change.wav" public plugin_init() {     register_plugin("TimeSound","1.0","Mulan")     register_cvar("amx_time_sound", "60.0")     set_task(get_cvar_float("amx_time_sound"),"time_sound")     return PLUGIN_CONTINUE } public plugin_precache() {     precache_sound(sound) } public time_sound() {     client_cmd(0,"spk %s",sound)     return PLUGIN_CONTINUE     }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
cTn
Senior Member
Join Date: Oct 2005
Old 11-03-2005 , 18:14  
Reply With Quote #5

yes i think this too but for this need someone experiened to me like v3x ...
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-03-2005 , 18:16  
Reply With Quote #6

I'm not incapable, I just don't know what he wants.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
cTn
Senior Member
Join Date: Oct 2005
Old 11-03-2005 , 18:18  
Reply With Quote #7

Hawk552 i dont mean your post .. . u posted and i writing m post too... i mean with this m post not yours... sorry
__________________
cTn is offline
Send a message via ICQ to cTn Send a message via MSN to cTn
Mulan
Senior Member
Join Date: Jul 2005
Location: [GER]Worbis
Old 11-03-2005 , 18:56  
Reply With Quote #8

sorry... dont work Hawk552

The sound comes by mapchange on the new map after 60sec.
Not after timeleft 60sec before map ends
Mulan is offline
Send a message via ICQ to Mulan
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-03-2005 , 19:02  
Reply With Quote #9

Oh, that's what you want, ok. I'll edit this when I'm done it.

EDIT: try this

Code:
#include <amxmodx> new sound[] = "misc/change.wav" public plugin_init() {     register_plugin("TimeSound","1.0","Mulan");     register_cvar("amx_time_sound", "60.0");     register_cvar("amx_time_freqcheck","5.0");     set_task(get_cvar_float("amx_time_checkfreq"),"check_tl",_,_,_,"b");     return PLUGIN_CONTINUE; } public plugin_precache() {     precache_sound(sound); } public time_sound() {     client_cmd(0,"spk %s",sound);     return PLUGIN_CONTINUE; } public check_tl() {     new timeleft = get_timeleft();     if(timeleft <= get_cvar_num("amx_time_sound"))     {         time_sound();     } }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Mulan
Senior Member
Join Date: Jul 2005
Location: [GER]Worbis
Old 11-03-2005 , 19:05  
Reply With Quote #10

BIG Thx
Mulan is offline
Send a message via ICQ to Mulan
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 23:38.


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