AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   loading sound with timelimit (https://forums.alliedmods.net/showthread.php?t=20208)

Mulan 11-03-2005 17:58

loading sound with timelimit
 
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           
}


cTn 11-03-2005 18:11

Code:

client_cmd(id,"play sound/misc/%s",sound)
this parameter is right?

[ --<-@ ] Black Rose 11-03-2005 18:12

this doesn't call anything...

Hawk552 11-03-2005 18:13

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     }

cTn 11-03-2005 18:14

yes i think this too but for this need someone experiened to me like v3x ...

Hawk552 11-03-2005 18:16

I'm not incapable, I just don't know what he wants.

cTn 11-03-2005 18:18

Hawk552 i dont mean your post .. . u posted and i writing m post too... i mean with this m post not yours... sorry

Mulan 11-03-2005 18:56

sorry... dont work Hawk552

The sound comes by mapchange on the new map after 60sec.
Not after timeleft 60sec before map ends

Hawk552 11-03-2005 19:02

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();     } }

Mulan 11-03-2005 19:05

BIG Thx :D


All times are GMT -4. The time now is 23:38.

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