Raised This Month: $32 Target: $400
 8% 

Random C4 Timer [Last Upadate: 3/19/11]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
Magic_Carpet
Junior Member
Join Date: Nov 2011
Old 01-23-2012 , 00:09   Random C4 Timer [Last Upadate: 3/19/11]
Reply With Quote #1

Description:
On start round, this plugin set random c4 timer.

Cvars:
amx_max_c4_timer - Define a Max C4 Timer (Default: 45)
amx_min_c4_timer - Define a Min C4 Timer (Default: 20)
amx_random_c4_announce - Enable or disable the announce of the C4 Time (Default: Enabled)

Changelog:
v0.1 - Initial Public Release
v0.2 - Some optmizations. Thanks to K.K.Lv

Ps.: All plugins of Random C4 Timer, the authors are banned

Thanks.
Attached Files
File Type: sma Get Plugin or Get Source (RC4Timer.sma - 970 views - 1.9 KB)

Last edited by Magic_Carpet; 03-19-2012 at 11:58.
Magic_Carpet is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-23-2012 , 01:28   Re: Random C4 Timer
Reply With Quote #2

Check for func_bomb_target only once in plugin_init.
Check also for info_bomb_target.

If no entity, just don't register HLTV event.

Use mp_c4timer cvar pointer.


Released plugins offer more features than your plugin.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-23-2012 at 01:31.
ConnorMcLeod is offline
Magic_Carpet
Junior Member
Join Date: Nov 2011
Old 01-23-2012 , 11:49   Re: Random C4 Timer
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Check for func_bomb_target only once in plugin_init.
Check also for info_bomb_target.

If no entity, just don't register HLTV event.

Use mp_c4timer cvar pointer.


Released plugins offer more features than your plugin.
Updated sir.
Magic_Carpet is offline
Old 01-24-2012, 15:38
kramesa
This message has been deleted by ConnorMcLeod. Reason: cool, nice, UBER USEFULL POSTS + rules !!
Old 01-27-2012, 12:09
kramesa
This message has been deleted by kramesa.
Old 01-28-2012, 22:39
kramesa
This message has been deleted by ConnorMcLeod. Reason: cool, nice, UBER USEFULL POSTS + rules !!
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 03-17-2012 , 23:02   Re: Random C4 Timer
Reply With Quote #4

Code:
new OriginalTIME = get_pcvar_num( OriginalTIMER );

Why you need get_pcvar_num here?
__________________
kramesa is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-18-2012 , 00:51   Re: Random C4 Timer
Reply With Quote #5

I think check the both entity in FM_Spawn will be better.
and I have add the code when the map have not had the bomb entity the plugin will be pause.
a part of the code here
Code:
new gIdSpawn; new gbBombMap = false;//whether the map has bomb or not ?   public plugin_precache() {     gIdSpawn = register_forward(FM_Spawn, "fw_Spawn"); }   public fw_Spawn(ent)//loading the map entity and check the bomb {     if (!pev_valid(ent))         return ;       new szClassName[32], i;     pev(ent, pev_classname, szClassName, charsmax(szClassName));       new const szC4EntClassName[][] = {         "info_bomb_target",         "func_bomb_target "     };       for (i = 0, i < sizeof (szC4EntClassName); i++)     {         if (equal(szClassName, szC4EntClassName[i]))         {             gbBombMap = true;             break;         }     } }   public plugin_init( ) {     register_plugin( PLUGIN , VERSION , AUTHOR )       unregister_forward(FM_Spawn, gIdSpawn);       if (!gbBombMap)     {         //pause("a");//or pause the plugin.         return;     }     //your code here }
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Magic_Carpet
Junior Member
Join Date: Nov 2011
Old 03-18-2012 , 13:52   Re: Random C4 Timer
Reply With Quote #6

Quote:
Originally Posted by K.K.Lv View Post
I think check the both entity in FM_Spawn will be better.
and I have add the code when the map have not had the bomb entity the plugin will be pause.
a part of the code here
Code:
new gIdSpawn; new gbBombMap = false;//whether the map has bomb or not ?   public plugin_precache() {     gIdSpawn = register_forward(FM_Spawn, "fw_Spawn"); }   public fw_Spawn(ent)//loading the map entity and check the bomb {     if (!pev_valid(ent))         return ;       new szClassName[32], i;     pev(ent, pev_classname, szClassName, charsmax(szClassName));       new const szC4EntClassName[][] = {         "info_bomb_target",         "func_bomb_target "     };       for (i = 0, i < sizeof (szC4EntClassName); i++)     {         if (equal(szClassName, szC4EntClassName[i]))         {             gbBombMap = true;             break;         }     } }   public plugin_init( ) {     register_plugin( PLUGIN , VERSION , AUTHOR )       unregister_forward(FM_Spawn, gIdSpawn);       if (!gbBombMap)     {         //pause("a");//or pause the plugin.         return;     }     //your code here }
Done.

Updated.
Magic_Carpet is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 03-18-2012 , 13:58   Re: Random C4 Timer
Reply With Quote #7

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team /home/groups/alliedmodders/forums/files/1/6/1/9/8/4/100770.attach(35) : warning 215: expression has no effect /home/groups/alliedmodders/forums/files/1/6/1/9/8/4/100770.attach(35) : error 001: expected token: ";", but found ")" 1 Error. Could not locate output file /home/groups/amxmodx/public_html/compiled3/100770.amx (compile failed).
__________________
kramesa is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-19-2012 , 05:23   Re: Random C4 Timer
Reply With Quote #8

line 35
Code:
for ( i = 0 , i < sizeof ( szC4EntClassName ); i++ )
===>
Code:
for ( i = 0 ; i < sizeof ( szC4EntClassName ); i++ )
__________________
QQ:116268742

Last edited by K.K.Lv; 03-19-2012 at 05:24.
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Magic_Carpet
Junior Member
Join Date: Nov 2011
Old 03-19-2012 , 11:26   Re: Random C4 Timer
Reply With Quote #9

Quote:
Originally Posted by K.K.Lv View Post
line 35
Code:
for ( i = 0 , i < sizeof ( szC4EntClassName ); i++ )
===>
Code:
for ( i = 0 ; i < sizeof ( szC4EntClassName ); i++ )
Oops. Updated.
Magic_Carpet is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 03-19-2012 , 20:52   Re: Random C4 Timer [Last Upadate: 3/19/11]
Reply With Quote #10

Crashing my server =x
__________________
kramesa 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 02:11.


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