AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Random C4 Timer (https://forums.alliedmods.net/showthread.php?t=42320)

SweatyBanana 07-31-2006 01:49

Random C4 Timer
 
15 Attachment(s)
Random C4 Timer by SweatyBanana.

I made this plugin from scratch from one in the unapproved section. The one in the unapproved section did not work in an efficient way and I decided to change it up a bit.

This plugin randomly changes the c4 timer at roundstart. There are 2 cvars to limit how long the random timers limits go. There is also a cvar for anouncements.

It is not mod specific restricted by a module needed, but as far as I know, CounterStrike is the only mod with mp_c4timer.

This plugin has been tested and is fully functional.

CVARS:
  • rc4_announce [DEFAULT: 4] - You can add the below numbers up.
    • 0: Do not anounce anything.
    • 1: Announce a personal CT message.
    • 2: Announce a personal T message.
    • 4: Announce a general change with value.
    • 8: Announce a general change with no value.
  • rc4_mintime [DEFAULT: 20] (minimum random time the c4 can be)
  • rc4_maxtime [DEFAULT: 35] (maximum random time the c4 can be)
MODULES:
  • FakeMeta
The reason I used fakemeta is because it is one of the only ways that you can really find out if the map is a de_ map..Since there is no way to tell from the name of a map, I used the fakemeta function to find out if there was a bombsite entity.

Installation:
  1. Click get plugin.
  2. Put RC4.amxx in your addons/amxmodx/plugins/ folder.
  3. put rc4dict.txt in the addons/amxmodx/data/lang/ folder.
  4. Add a line to addons/amxmodx/configs/plugins.ini like so:
RC4.amxx


Currently Supported Languages with Credits:
English - SweatyBanana
Spanish - KylixMynxAltoLAG
Hungarian -
Dav3
Swedish - Fr3ak0ut / Obbin
German - Edgar
Polish - trawiator
1337 §þ3Ä|< - Twilight Suzuka
VERSIONS:
v1.0 - Original version
v2.0 - Updated anouncements
v3.0 - pCvars and optimization
v4.0 - fixed displaying message
v5.0 - Added multilingual support and changed to after freezetime
Code:

v6.0
-Fixed a bug that made the server crash
-reset c4 on mapchange
-blocked console output
-Fixed displaying to teams

If you want to see this plugin in action 24/7, check it out!
http://www.game-monitor.com/server-s....215:27015.png

k007 07-31-2006 03:09

Re: Random C4 Timer
 
lolz nice plugin sweaty keep it up

SweatyBanana 07-31-2006 11:51

Re: Random C4 Timer
 
Thank you..I just updated it with new anouncements..

Check the original post for details.

Deviance 07-31-2006 13:02

Re: Random C4 Timer
 
yah, nice plugin Sweaty :)

Xanimos 08-01-2006 00:51

Re: Random C4 Timer
 
Not being mean but:
1) Why the cvar flags...I don't see why you need them...maybe the unlogged one
2) Why not use pcvars?

SweatyBanana 08-01-2006 01:01

Re: Random C4 Timer
 
PCVARS added, cvar flags removed except unlogged.

Brad 08-01-2006 09:12

Re: Random C4 Timer
 
I strongly suggest you change the name of your CVARS.
Code:
    maxTime = register_cvar("amx_maxtime","35",FCVAR_UNLOGGED);     minTime = register_cvar("amx_mintime","15",FCVAR_UNLOGGED);     anoun = register_cvar("amx_anouncec4","1",FCVAR_UNLOGGED);
Generally speaking, your CVARS should not be prefaced with "amx". They should be prefaced with the short name for your plugin. In your case, I guess that might be "rc4". You might also want to spell "announce" correctly unless you're misspelling it on purpose.

You should also store the original mp_c4timer value and then restore it when your plugin ends. Let me know if I need to explain why.

Brad 08-01-2006 10:20

Re: Random C4 Timer
 
An additional feature that might be nice is having an option to specify who gets what message. For instance, the terrorists might radio to one another what the specific timer is but not share any info with the CTs.

SweatyBanana 08-01-2006 11:08

Re: Random C4 Timer
 
Thank you for your feedback..

Do you think that if I simply specified another cvar to reset the C4 to, it would be ok?

Brad 08-01-2006 13:17

Re: Random C4 Timer
 
You mean to optionally reset the C4 timer at the end of the plugin? I would think that it should be hardcoded. Rule of thumb when programming, if you change a global variable make sure to reset it to it's original value when you're done with it. Rationale being that you don't know that the user will have done something to make it reset.


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

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