Raised This Month: $51 Target: $400
 12% 

exec hud msg and sound via cmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BackStats
Senior Member
Join Date: Oct 2008
Old 01-05-2011 , 12:38   exec hud msg and sound via cmd
Reply With Quote #1

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.
BackStats is offline
Elusive138
Senior Member
Join Date: Dec 2010
Old 01-05-2011 , 13:05   Re: exec hud msg and sound via cmd
Reply With Quote #2

What is this sound? Is it a custom sound file (wave format), HL Voice Synthesiser or something else?
Elusive138 is offline
MyDooMJr
Member
Join Date: Jun 2009
Location: Portugal
Old 01-05-2011 , 13:12   Re: exec hud msg and sound via cmd
Reply With Quote #3

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.

Last edited by MyDooMJr; 01-05-2011 at 13:20.
MyDooMJr is offline
MyDooMJr
Member
Join Date: Jun 2009
Location: Portugal
Old 01-05-2011 , 13:16   Re: exec hud msg and sound via cmd
Reply With Quote #4

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
MyDooMJr is offline
BackStats
Senior Member
Join Date: Oct 2008
Old 01-05-2011 , 13:46   Re: exec hud msg and sound via cmd
Reply With Quote #5

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")

BackStats is offline
MyDooMJr
Member
Join Date: Jun 2009
Location: Portugal
Old 01-05-2011 , 13:55   Re: exec hud msg and sound via cmd
Reply With Quote #6

[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

Last edited by MyDooMJr; 01-05-2011 at 13:57.
MyDooMJr is offline
BackStats
Senior Member
Join Date: Oct 2008
Old 01-05-2011 , 13:58   Re: exec hud msg and sound via cmd
Reply With Quote #7

I just need it to appear on the screen when the command is executed, and not automatic.
BackStats is offline
BackStats
Senior Member
Join Date: Oct 2008
Old 01-05-2011 , 14:01   Re: exec hud msg and sound via cmd
Reply With Quote #8

was only the remove:
PHP Code:
#include <amxmodx>  
#include <amxmisc> 
I will test it here a few hours.
great.
BackStats is offline
MyDooMJr
Member
Join Date: Jun 2009
Location: Portugal
Old 01-05-2011 , 14:06   Re: exec hud msg and sound via cmd
Reply With Quote #9

U need include <amxmodx>.

for all this works...
MyDooMJr is offline
BackStats
Senior Member
Join Date: Oct 2008
Old 01-05-2011 , 18:35   Re: exec hud msg and sound via cmd
Reply With Quote #10

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
BackStats is offline
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 17:57.


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