Raised This Month: $ Target: $400
 0% 

announce frags and deaths with voice


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ezio_auditore
Senior Member
Join Date: May 2013
Old 11-20-2013 , 09:55   announce frags and deaths with voice
Reply With Quote #1

PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
// Add your code here...
 
register_clcmd("say /speakscroe" "playerinfo"
}
public 
playerinfo(id)
{
 new 
voice[3][33]
 new 
kills
 kills 
get_user_frags(id)
 new 
deaths
 deaths 
get_user_deaths(id)
 
 
num_to_word(killsvoice[1], 32)
 
num_to_word(deathsvoice[2] , 32)
 
 return 
format(voice[2],32,"spk ^"vox/%s kills and %s deaths^""killsdeaths);

In this plugin.... when a player says /showscore, a voice announces the score....
the .sma file compiled without error but the plugin "speaks" nothing.....
please can anyone debug it
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-20-2013 , 09:59   Re: announce frags and deaths with voice
Reply With Quote #2

kills and deaths are Integers, not Strings

Plus, you are telling it to speak anything
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 11-20-2013 at 09:59.
YamiKaitou is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 11-20-2013 , 10:03   Re: announce frags and deaths with voice
Reply With Quote #3

we can convert number to strung....(num_to_str)

and string to word (str_to_word) isn't possible
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-20-2013 , 10:10   Re: announce frags and deaths with voice
Reply With Quote #4

Quote:
Originally Posted by ezio_auditore View Post
we can convert number to strung....(num_to_str)

and string to word (str_to_word) isn't possible
You have already converted the numbers to words with num_to_word. You just don't use the word in your format string.


Also, please learn more about scripting before you actually try to script, your code just plain will not work and doesn't do anything
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 11-20-2013 , 10:31   Re: announce frags and deaths with voice
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
You have already converted the numbers to words with num_to_word. You just don't use the word in your format string.


Also, please learn more about scripting before you actually try to script, your code just plain will not work and doesn't do anything
thanks a lot...
but i used it as done in timeleft.sma
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-20-2013 , 10:36   Re: announce frags and deaths with voice
Reply With Quote #6

Quote:
Originally Posted by ezio_auditore View Post
thanks a lot...
but i used it as done in timeleft.sma
Maybe, but you didn't look at the big picture of how it is used in timeleft. The way you are using it, nothing will happen
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 11-20-2013 , 12:04   Re: announce frags and deaths with voice
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
Maybe, but you didn't look at the big picture of how it is used in timeleft. The way you are using it, nothing will happen
so....
how to do it
__________________

Last edited by ezio_auditore; 11-20-2013 at 12:05.
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 11-22-2013 , 11:27   Re: announce frags and deaths with voice
Reply With Quote #8

Also the not all sounds are there. But it's possible to improvise.
PHP Code:
#define SPK_YOUR_SCORE_IS "your(e75) screen(e35) before(s35) is"
#define SPK_KILLS "kill(e64) safe(e10)"
#define SPK_KILL "kill"
#define SPK_AND "and"
#define SPK_DEATH "delta(e30) f(s60)"
#define SPK_DEATHS "delta(e30) f(s65) safe(e10)" 

speak_score(iPlrIdiKillsNumiDeathsNum)
{
    new 
iKills[64], iDeaths[64];
    
num_to_word(iKillsNumiKills63);
    
num_to_word(iDeathsNumiDeaths63);
    
    
client_cmd(iPlrId"spk ^"vox/%%%s _comma and %%s^""SPK_YOUR_SCORE_ISiKills, ((iKillsNum==1)?SPK_KILL:SPK_KILLS),
     
iDeaths, ((iDeathsNum==1)?SPK_DEATH:SPK_DEATHS));

That's the best I could get for words "death" and "deaths".
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 11-22-2013 at 11:28.
MPNumB is offline
Send a message via Skype™ to MPNumB
Reply


Thread Tools
Display Modes

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 23:12.


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