View Full Version : help plz
How would you make a plugin where you say a word like hello or something and a wav plays?
Itryed but only got errors
DFA-Haplo
04-23-2004, 04:11
The people around here are great, but it really helps if you could post the code that you have and then allow people to point out mistakes or show you how, using your code. This helps you beome a better coder and it helps others like me learn in the process too :)
would it look something like this?
/*
say_sounds, v1.0
NicK
*/
#include <amxmodx>
#include <amxmisc>
public plugin_init() {
register_plugin("Say Sounds","1.0","NicK")
register_clcmd("say","say_event")
}
public plugin_precache()
{
precache_sound("misc/spank.wav")
}
new phrase[1][] = { "oneandonly" }
public say_event(id)
{
new sid[10]
num_to_str(id,sid,10)
new said[192]
read_args(said,191)
for(new i = 0 ;i < 1; i += 1)
if(containi(said,phrase[i]) != -1) {
set_hudmessage(225, 25, 25, -1.0, 0.32, 0, 2.0, 9.0, 0.8, 0.8, 2)
show_hudmessage(0,"I am the one and only!")
set_task(1.0,"client",0,sid,10)
break
}
}
public client(sid[])
{
new id = str_to_num(sid)
client_cmd(0,"spk misc/oneandonly")
}
QwertyAccess
04-23-2004, 23:00
"spk" isnt a command
"spk" isnt a command
Ur wrong..
"spk" is a clientside command to play sounds....
yea its right cuz I just got it to work thanks alot :)
FlyingMongoose
04-24-2004, 00:30
well, spk will only execute on the client side, not throughout the server unless you tell it to output to everyone
How would I do that? Whats the code?
I thought
client_cmd(0,"spk misc/oneandonly")
plays wav to all
and
client_cmd(ids[0], "spk misc/oneandonly")
played wav to only one client
client_cmd(IDOFFPLAYER,"command goes here")
IDOFPLAYER is a value between 1 and 32.... if you enter 0 it executes on everyone
So
client_cmd(IDOFFPLAYER,"0")
???
no...
like this
client_cmd(0,"command")
ok ty
thats what I had already :)
QwertyAccess
04-24-2004, 04:55
ah im used to using "speak" :x
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.