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

Crowbar Frag Announcer


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Half-Life        Category:   Statistical       
Miley Demasturbot
Junior Member
Join Date: Feb 2011
Location: Kiev, Ukraine
Old 01-06-2012 , 17:04   Crowbar Frag Announcer
Reply With Quote #1

Crowbar Frag Announcer

Description
Voice and/or text announcement of the global number of crowbar frags made (or the number of frags made by a particular player).
Let everybody know who the most humiliating player is!

Cvars (copy to the server config file)
Code:
amx_crowbar_announcer "1"
// 0 - off
// 1 - HUD/chat + voice announcement (default)
// 2 - HUD/chat announcement
// 3 - voice announcement

amx_crowbar_announcer_spk "1"
// 0 - killer frag counter speaker
// 1 - global counter speaker (default)

amx_crowbar_announcer_hud "1"
// 0 - chat print
// 1 - color HUD (default)
Notes
Voice counts up to 199.
Attached Files
File Type: sma Get Plugin or Get Source (crowbar_frag_announcer.sma - 1202 views - 4.9 KB)

Last edited by Miley Demasturbot; 01-07-2012 at 14:19.
Miley Demasturbot is offline
Send a message via ICQ to Miley Demasturbot
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-06-2012 , 17:10   Re: Crowbar Frag Announcer
Reply With Quote #2

Removed AMXX file. You are not allowed to upload compiled plugins.
__________________
Arkshine is offline
Miley Demasturbot
Junior Member
Join Date: Feb 2011
Location: Kiev, Ukraine
Old 01-06-2012 , 17:12   Re: Crowbar Frag Announcer
Reply With Quote #3

Ok, then check it to see that it has no secrets or viruses
Miley Demasturbot is offline
Send a message via ICQ to Miley Demasturbot
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-06-2012 , 17:14   Re: Crowbar Frag Announcer
Reply With Quote #4

And you don't need to attach it since by clicking on "Get Plugin" will give you the compiled plugin.
__________________
Arkshine is offline
Miley Demasturbot
Junior Member
Join Date: Feb 2011
Location: Kiev, Ukraine
Old 01-06-2012 , 17:15   Re: Crowbar Frag Announcer
Reply With Quote #5

Wow, that's nice! Didn't know.
Miley Demasturbot is offline
Send a message via ICQ to Miley Demasturbot
bibu
Veteran Member
Join Date: Sep 2010
Old 01-06-2012 , 17:38   Re: Crowbar Frag Announcer
Reply With Quote #6

You don't need to return anything in client_disconnect.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Miley Demasturbot
Junior Member
Join Date: Feb 2011
Location: Kiev, Ukraine
Old 01-06-2012 , 17:41   Re: Crowbar Frag Announcer
Reply With Quote #7

Thank you, I'll fix it in a second. Are there any other scripting problems? I'm pretty much new to AMX.

Last edited by Miley Demasturbot; 01-06-2012 at 17:42.
Miley Demasturbot is offline
Send a message via ICQ to Miley Demasturbot
bibu
Veteran Member
Join Date: Sep 2010
Old 01-06-2012 , 19:06   Re: Crowbar Frag Announcer
Reply With Quote #8

- You also don't need to return anything in your code right now.
- Cache msgid (ScreenFade)

Don't know though if the cvars are registered fine. However I would do it like other plugins. With your way, you can change the cvar in-game but it will have effect after a mapchange.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-07-2012 , 06:56   Re: Crowbar Frag Announcer
Reply With Quote #9

  • You're checking weapon wrongly. Instead of doing that check, just do "3=1" param in register_event, which will check if weapon is crowbar.
  • Use get_user_name() instead of pev_netname, you won't need to use fakemeta then.
  • Why you cache cvars in plugin_init, it would be perfectly fine to check the cvars on the go; otherwise it would require to restart the server in order to get the changes.
  • Your speak_num looks very strange. Why not just use num_to_word( counter, ... );
__________________
xPaw is offline
Miley Demasturbot
Junior Member
Join Date: Feb 2011
Location: Kiev, Ukraine
Old 01-07-2012 , 11:48   Re: Crowbar Frag Announcer
Reply With Quote #10

Quote:
Originally Posted by bibu View Post
- Cache msgid (ScreenFade)
Simply save msg handler?

Quote:
Originally Posted by xPaw View Post
  • You're checking weapon wrongly. Instead of doing that check, just do "3=1" param in register_event, which will check if weapon is crowbar.
The third parameter is string TruncatedWeaponName, so "3=crowbar" works just fine! Thank you!

Quote:
Originally Posted by xPaw View Post
  • Use get_user_name() instead of pev_netname, you won't need to use fakemeta then.
Ok! Thanks!

Quote:
Originally Posted by bibu View Post
Don't know though if the cvars are registered fine. However I would do it like other plugins. With your way, you can change the cvar in-game but it will have effect after a mapchange.
Quote:
Originally Posted by xPaw View Post
  • Why you cache cvars in plugin_init, it would be perfectly fine to check the cvars on the go; otherwise it would require to restart the server in order to get the changes.
It's just that I believe it takes some time to check the cvars via get_pcvar_num() on every death event. And I want it to work fast, so I tried to check them only once. There's no need to be able to change those settings in-game, anyway. Still, I will fix it as you guys say.

Quote:
Originally Posted by xPaw View Post
  • Your speak_num looks very strange. Why not just use num_to_word( counter, ... );
Again, thank you! Didn't know the num_to_word() is that smart!
Miley Demasturbot is offline
Send a message via ICQ to Miley Demasturbot
Old 01-17-2012, 04:42
reko_o
This message has been deleted by xPaw. Reason: Flooding "thanks" posts
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 09:31.


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