Raised This Month: $66 Target: $400
 16% 

Random C4 Timer


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Event Related        Approver:   GHW_Chronic (70)
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 07-31-2006 , 02:49   Random C4 Timer
Reply With Quote #1

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!
Attached Files
File Type: txt rc4dict.txt (2.4 KB, 12233 views)
File Type: sma Get Plugin or Get Source (RC4.sma - 25134 views - 2.2 KB)

Last edited by SweatyBanana; 10-12-2006 at 18:19.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 07-31-2006 , 04:09   Re: Random C4 Timer
Reply With Quote #2

lolz nice plugin sweaty keep it up
k007 is offline
Send a message via MSN to k007
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 07-31-2006 , 12:51   Re: Random C4 Timer
Reply With Quote #3

Thank you..I just updated it with new anouncements..

Check the original post for details.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 07-31-2006 , 14:02   Re: Random C4 Timer
Reply With Quote #4

yah, nice plugin Sweaty
Deviance is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-01-2006 , 01:51   Re: Random C4 Timer
Reply With Quote #5

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?
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 08-01-2006 , 02:01   Re: Random C4 Timer
Reply With Quote #6

PCVARS added, cvar flags removed except unlogged.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 08-01-2006 , 10:12   Re: Random C4 Timer
Reply With Quote #7

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 is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 08-01-2006 , 11:20   Re: Random C4 Timer
Reply With Quote #8

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.
__________________
Brad is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 08-01-2006 , 12:08   Re: Random C4 Timer
Reply With Quote #9

Thank you for your feedback..

Do you think that if I simply specified another cvar to reset the C4 to, it would be ok?
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 08-01-2006 , 14:17   Re: Random C4 Timer
Reply With Quote #10

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.
__________________
Brad is offline
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 07:14.


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