Raised This Month: $ Target: $400
 0% 

loading sound with timelimit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-03-2005 , 19:06  
Reply With Quote #1

Np
__________________
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:26  
Reply With Quote #2

Little problem... The sound comes every seconds in the last 60sec. I hear the voice multiple.
Mulan is offline
Send a message via ICQ to Mulan
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-03-2005 , 19:38  
Reply With Quote #3

Sorry, I didn't think of that, try this:

Code:
#include <amxmodx> new sound[] = "misc/change.wav" new bool:sound_switch = false; 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");     return PLUGIN_CONTINUE } public plugin_precache() {     precache_sound(sound); } public time_sound() {     client_cmd(0,"spk %s",sound);     return PLUGIN_CONTINUE; } public check_tl() {     if(!sound_switch)         return 0;         new timeleft = get_timeleft()     if(timeleft <= get_cvar_num("amx_time_sound"))     {         time_sound()         sound_switch = true;     }         set_task(get_cvar_float("amx_time_checkfreq"),"check_tl");         return 0; }
__________________
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:51  
Reply With Quote #4

sorry
dont work, i cant hear the sound by ur last script
Mulan is offline
Send a message via ICQ to Mulan
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 11-03-2005 , 20:12  
Reply With Quote #5

try this one.

Code:
#include <amxmodx> new sound[] = "misc/change.wav" new bool:sound_switch = false; 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");     return PLUGIN_CONTINUE } public plugin_precache() {     precache_sound(sound); } public time_sound() {     client_cmd(0,"spk %s",sound);     return PLUGIN_CONTINUE; } public check_tl() {     if(sound_switch)         return 0;         new timeleft = get_timeleft()     if(timeleft <= get_cvar_num("amx_time_sound"))     {         time_sound()         sound_switch = true;     }         set_task(get_cvar_float("amx_time_checkfreq"),"check_tl");         return 0; }
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Mulan
Senior Member
Join Date: Jul 2005
Location: [GER]Worbis
Old 11-03-2005 , 20:17  
Reply With Quote #6

lol its the same was Hawk posted
Mulan is offline
Send a message via ICQ to Mulan
Mulan
Senior Member
Join Date: Jul 2005
Location: [GER]Worbis
Old 11-03-2005 , 20:29  
Reply With Quote #7

oh sorry i see... u have deleted a little "!"
very sorry... this script works fine

VERY BIG THX
Mulan is offline
Send a message via ICQ to Mulan
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-03-2005 , 20:45  
Reply With Quote #8

Quote:
Originally Posted by Suicid3
try this one.

Code:
#include <amxmodx> new sound[] = "misc/change.wav" new bool:sound_switch = false; 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");     return PLUGIN_CONTINUE } public plugin_precache() {     precache_sound(sound); } public time_sound() {     client_cmd(0,"spk %s",sound);     return PLUGIN_CONTINUE; } public check_tl() {     if(sound_switch)         return 0;         new timeleft = get_timeleft()     if(timeleft <= get_cvar_num("amx_time_sound"))     {         time_sound()         sound_switch = true;     }         set_task(get_cvar_float("amx_time_checkfreq"),"check_tl");         return 0; }
Yeah sorry, thanks.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 11-03-2005 , 21:00  
Reply With Quote #9

np. just fixing one little thing. At first i was going to change it to true at start then change it to false. but it was easier to remove the '!'
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Mulan
Senior Member
Join Date: Jul 2005
Location: [GER]Worbis
Old 11-04-2005 , 14:51  
Reply With Quote #10

very nice script.
I changed this:
Code:
public plugin_init() {     register_plugin("TimeSound","1.0","Hawk552 & Suicid3");     register_cvar("amx_time_sound", "60.0");     register_cvar("amx_time_freqcheck","5.0");     set_task(get_cvar_float("amx_time_checkfreq"),"check_tl");     return PLUGIN_CONTINUE }


One Question:
Can rewritten the script to max 5Commands for sounds to variably times?
This is cool for timer. My Timer says 60sec befor maps end the "change.wav".

Then say the last 3 sec befor maps ends 3, 2, 1 (with 3.wav, 2.wav and 1.wav). I have not the standard man-voice. I have a female voice ^^
Thats why the question
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