AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   exec hud msg and sound via cmd (https://forums.alliedmods.net/showthread.php?t=147110)

BackStats 01-05-2011 12:38

exec hud msg and sound via cmd
 
the message should be displayed along with the sound after a command to be executed by the server.

to display the message is easy, just do not know how to run the sound and call the plugin via a command on the server

Ex:
Hello, good game!
exec sound: hello.

Elusive138 01-05-2011 13:05

Re: exec hud msg and sound via cmd
 
What is this sound? Is it a custom sound file (wave format), HL Voice Synthesiser or something else?

MyDooMJr 01-05-2011 13:12

Re: exec hud msg and sound via cmd
 
Well there are two ways :

client_cmd(id,"speak hello") which will just use CS SOUNDS "http://www.adminmod.org/help/online/...ife_Sounds.htm" A list of all sounds default of cs.
or
Precache the sound, add the :
client_cmd(id,"mp3 play sound\backstats\song1.mp3" -> .mp3 format :)

Do not forget to upload the song to server :)

To run an plugin well, i just know one thing, you can an register command, on the plugin you want to run, than on other plugin just use client_cmd(id,"backstats") but u have to add this on the plugin u want to run :register_clcmd("backstats","Function")

Hope i didn't confused you and helped you much :)

Regards

EDITED : ALSO THERE'S ANOTHER WAY !! You can reproduce the song without using mp3 play, i don't know how, but is possible i saw that, maybe someone can answer you about this i said on this little 2 lines.

MyDooMJr 01-05-2011 13:16

Re: exec hud msg and sound via cmd
 
Plugin you want to run :

register_clcmd("something","goFuNCtion")
register_clcmd("blackstats","goFuNCtion")

Plugin which do u want call the "First one" :

client_cmd(id,"something")
or
client_cmd(id,"backstats")

Sorry for double post :P

BackStats 01-05-2011 13:46

Re: exec hud msg and sound via cmd
 
would look like?
PHP Code:

#include <amxmodx> 
#include <amxmisc>

#define CVAR1 ADMIN_CVAR

public plugin_init() 

   
register_plugin ("Hello Server""1.0""BackStats"
   
register_concmd ("amx_hellosv""hello_setup",CVAR1"Hello Server"
}

public 
hello_setup()
{
   
set_hudmessage(2552552550.2750.302.06.00.80.82)
   
show_hudmessage(0"Hello, good game!")
   
client_cmd(id,"speak hello")



MyDooMJr 01-05-2011 13:55

Re: exec hud msg and sound via cmd
 
[Automatic Hello :]


Code:

public client_putinserver(id)
{
    set_task(5.0, "welcome", id)
}
public welcome(id)
{
    if(is_user_connected(id))
    {
        set_hudmessage(255, 255, 255, 0.275, 0.3, 0, 2.0, 6.0, 0.8, 0.8, 2)
        show_hudmessage(0, "Hello, good game!")
        client_cmd(id,"speak hello")
    }
}

[Manual Hello:]

Code:

#define CVAR1 ADMIN_CVAR

public plugin_init()
{
    register_plugin ("Hello Server", "1.0", "BackStats")
    register_concmd ("amx_hellosv", "hello_setup",CVAR1, "Hello Server")
}

public hello_setup()
{
    set_hudmessage(255, 255, 255, 0.275, 0.3, 0, 2.0, 6.0, 0.8, 0.8, 2)
    show_hudmessage(0, "Hello, good game!")
    client_cmd(id,"speak hello")
}

Regards

BackStats 01-05-2011 13:58

Re: exec hud msg and sound via cmd
 
I just need it to appear on the screen when the command is executed, and not automatic.

BackStats 01-05-2011 14:01

Re: exec hud msg and sound via cmd
 
was only the remove:
PHP Code:

#include <amxmodx>  
#include <amxmisc> 

I will test it here a few hours.
great.

MyDooMJr 01-05-2011 14:06

Re: exec hud msg and sound via cmd
 
U need include <amxmodx>.

for all this works...

BackStats 01-05-2011 18:35

Re: exec hud msg and sound via cmd
 
i have the errors:

Code:

hellosv.sma(15) : error 017: undefined symbol "id"
hellosv.sma(15) : warning 215: expression has no effect
hellosv.sma(15) : error 001: expected token: ";", but found ">"
hellosv.sma(15) : error 029: invalid expression, assumed zero
hellosv.sma(15) : fatal error 107: too many error messages on one line



All times are GMT -4. The time now is 02:13.

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