Raised This Month: $ Target: $400
 0% 

command question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rex
Senior Member
Join Date: Mar 2004
Location: Australia
Old 04-15-2004 , 22:22   command question
Reply With Quote #1

okay just a simple question (i hope)
first i better tell you want i am trying to do.
got a plugin (easyspeech by Eric Lidman aka Ludwig van)
and it say that you can use the commands in the console or by just saying them.
eg: to say hello with vox the comand is "yy", so to say something you would press "y"(chat) and type "yy hello" and the vox should say hello. However this isn't working.
i have to bring down the console and type it "yy hello" and then it works.

have being trying to work out what is wrong with the comands but after three nights trying i have got nowhere.
anyway i think i have to change something in here.
Code:
public plugin_init() { register_plugin("Easy Speech Plugin","1.4c","EJL") register_concmd("yy","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <vox>") register_concmd("uu","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <fvox>") register_concmd("ii","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <scientist>") register_concmd("rr","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <barney>") register_concmd("tt","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <hgrunt>") register_concmd("amx_speakall","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone.") register_concmd("amx_speakteam","sp_shrtcut",ADMIN_MAP,"<team> <msg>: Speak words on a whole team.") register_concmd("amx_speak","sp_shrtcut",ADMIN_MAP,"<part of nick> <msg>: Speak words on a player.") register_concmd("amx_stopallsounds","admin_stopallsounds",ADMIN_MAP,"executes stopsound on all clients -- useful for ending looped sounds.") register_clcmd("yy_help","admin_ssearch",ADMIN_MAP,"yy_help <search target>: Find words to speak from <vox>") register_clcmd("uu_help","admin_ssearch",ADMIN_MAP,"uu_help <search target>: Find words to speak from <fvox>") register_clcmd("tt_help","admin_ssearch",ADMIN_MAP,"tt_help <search target>: Find words to speak from <hgrunt>") register_clcmd("rr_help","admin_ssearch",ADMIN_MAP,"rr_help <search target>: Find words to speak from <barney>") register_clcmd("ii_help","admin_ssearch",ADMIN_MAP,"ii_help <search target>: Find words to speak from <scientist>") register_clcmd("say","handle_say")

not sure what to change those.
try adding /say in frunt of the comands that don't work(don't think you need it with "register_clcmd("say","handle_say") )
sure it is something simple just i can't work it out.
hope you can help
thanks
rex is offline
Send a message via MSN to rex
decemberx
Junior Member
Join Date: Apr 2004
Location: CT
Old 04-22-2004 , 09:50   uh.,.....
Reply With Quote #2

why not jsut have your script bind those keys.....like


bind v say hello peeps

bind c sv_gravity 200

bind x sv_______________________________

i mean just get it to automatically bind what ever you want...so you can jsut press a key...

when you press "y", its telling the console : SAY
and when you type its telling the console : type something...
__________________
DecemberX - "Fckin Sknks"
decemberx is offline
Send a message via AIM to decemberx
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-22-2004 , 13:01  
Reply With Quote #3

All of the Say version of those commands are in the function "handle_say" which is registered like:
register_clcmd("say","handle_say")

So, if the commands work from console, but not from Say, then there must be an error in the "handle_say" function...

Please post that function!!
xeroblood is offline
Send a message via MSN to xeroblood
rex
Senior Member
Join Date: Mar 2004
Location: Australia
Old 04-23-2004 , 20:02  
Reply With Quote #4

Quote:
Originally Posted by xeroblood
All of the Say version of those commands are in the function "handle_say" which is registered like:
register_clcmd("say","handle_say")

So, if the commands work from console, but not from Say, then there must be an error in the "handle_say" function...

Please post that function!!
Think this is what you mean by function mate, let me know if you want more info.
thanks for your help
Code:
public handle_say(id) {         if ((get_user_flags(id)&ADMIN_MAP)){         new name[32]         new Speech[192]         new voicedir[32]         new arg[100]         new cmd[10]         new argx[32]         read_argv(1,arg,99)         parse(arg,cmd,9,argx,31)         if(equal(arg,"yy_help",7)){             search_engine(id,0,argx)             return PLUGIN_HANDLED               }         else if(equal(arg,"uu_help",7)){             search_engine(id,1,argx)             return PLUGIN_HANDLED               }         else if(equal(arg,"tt_help",7)){             search_engine(id,2,argx)             return PLUGIN_HANDLED               }         else if(equal(arg,"rr_help",7)){             search_engine(id,3,argx)             return PLUGIN_HANDLED               }         else if(equal(arg,"ii_help",7)){             search_engine(id,4,argx)             return PLUGIN_HANDLED               }         else if(equal(arg,"uu",2))             copy(voicedir,32,"fvox/")         else if(equal(arg,"tt",2))             copy(voicedir,32,"hgrunt/")         else if(equal(arg,"rr",2))             copy(voicedir,32,"barney/")         else if(equal(arg,"ii",2))             copy(voicedir,32,"scientist/")         else if(equal(arg,"yy",2))             copy(voicedir,32,"")         else             return PLUGIN_CONTINUE             read_args(Speech,191)         remove_quotes(Speech)         get_user_name(id,name,31)         if(safety_check(Speech)){             client_print(id,print_chat,"[AMX] Illegal input.  Speech command aborted.")             return PLUGIN_HANDLED         }         if(strlen(voicedir) > 0){             client_cmd(0,"spk ^"%s%s^"",voicedir,Speech[3])         }else{             client_cmd(0,"spk ^"%s^"",Speech[3])         }         client_print(0,print_console,"%s  SPOKE  %s",name,Speech[3])         server_print("%s  SPOKE  %s",name,Speech[3])         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }

@decemberx
yes decemberx i can try that, i might work for some, but it would be better to be able to type diff things.
also i am running out of spare keys got that many bound already.

Thanks for all your help
rex is offline
Send a message via MSN to rex
GanJa
Member
Join Date: Mar 2004
Location: Salem, OR
Old 04-23-2004 , 20:24  
Reply With Quote #5

I see no reason why it would not work but an easy way to get around it is to do this:
Code:
register_concmd("say yy","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <vox>") register_concmd("say uu","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <fvox>") register_concmd("say ii","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <scientist>") register_concmd("say rr","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <barney>") register_concmd("say tt","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <hgrunt>") register_concmd("yy","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <vox>") register_concmd("uu","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <fvox>") register_concmd("ii","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <scientist>") register_concmd("rr","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <barney>") register_concmd("tt","sp_shrtcut",ADMIN_MAP,"<msg>: Speak words on system of everyone. <hgrunt>")
This also creates less lag (not real noticable) cuz your only looking for the says, which fit exactly.
GanJa is offline
rex
Senior Member
Join Date: Mar 2004
Location: Australia
Old 04-23-2004 , 23:04  
Reply With Quote #6

Thanks
i will try that and see how it goes.
rex is offline
Send a message via MSN to rex
rex
Senior Member
Join Date: Mar 2004
Location: Australia
Old 04-24-2004 , 19:37  
Reply With Quote #7

thats works well GanJa
thank
rex is offline
Send a message via MSN to rex
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 09:19.


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