AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Crowbar Frag Announcer (https://forums.alliedmods.net/showthread.php?t=175641)

Miley Demasturbot 01-06-2012 17:04

Crowbar Frag Announcer
 
1 Attachment(s)
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.

Arkshine 01-06-2012 17:10

Re: Crowbar Frag Announcer
 
Removed AMXX file. You are not allowed to upload compiled plugins.

Miley Demasturbot 01-06-2012 17:12

Re: Crowbar Frag Announcer
 
Ok, then check it to see that it has no secrets or viruses :)

Arkshine 01-06-2012 17:14

Re: Crowbar Frag Announcer
 
And you don't need to attach it since by clicking on "Get Plugin" will give you the compiled plugin.

Miley Demasturbot 01-06-2012 17:15

Re: Crowbar Frag Announcer
 
Wow, that's nice! Didn't know.

bibu 01-06-2012 17:38

Re: Crowbar Frag Announcer
 
You don't need to return anything in client_disconnect.

Miley Demasturbot 01-06-2012 17:41

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

bibu 01-06-2012 19:06

Re: Crowbar Frag Announcer
 
- 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.

xPaw 01-07-2012 06:56

Re: Crowbar Frag Announcer
 
  • 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, ... );

Miley Demasturbot 01-07-2012 11:48

Re: Crowbar Frag Announcer
 
Quote:

Originally Posted by bibu (Post 1626982)
- Cache msgid (ScreenFade)

Simply save msg handler?

Quote:

Originally Posted by xPaw (Post 1627238)
  • 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 (Post 1627238)
  • Use get_user_name() instead of pev_netname, you won't need to use fakemeta then.

Ok! Thanks!

Quote:

Originally Posted by bibu (Post 1626982)
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 (Post 1627238)
  • 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 (Post 1627238)
  • 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! :)


All times are GMT -4. The time now is 09:38.

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