Raised This Month: $ Target: $400
 0% 

ShortFuse


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
hellmonja
Senior Member
Join Date: Oct 2015
Old 08-19-2016 , 10:37   ShortFuse
Reply With Quote #1

SHORTFUSE v0.2 beta
TEAM PERFORMANCE-BASED C4 TIMER


Description:
This is a simple plugin that changes the c4 timer each round based on each team's performance. If the Terrorists do well, the c4 timer is set lower. If the Counter-Terrorists do well, c4 timer is set higher.

Requires:
cstrike
engine

CVAR:
sfuse_hud [default 0] - Sets ShortFuse hud messages on or off.

Point System:
In every round, each team start with 0 points and they can earn points in a number of ways:
Code:
Kill = 1 point
Headshot = 2 points
Bomb Planted = 2 points for T
Bomb Exploded = 3 points for T
Bomb Defused = 5 points for CT
It also gives bonuses for how much time it took to secure the win:
Code:
20 seconds = +10
40 seconds = +8
60 seconds = +6
80 seconds = +4
100 seconds = +2
The points are summed up at the end of each round for both teams. Then the deficit it calculated. Depending on how big the deficit is and the default c4 time, the C4 Timer is set for the next round:
Code:
DefC4 = Default C4 Timer
Intv = Interval

C4 Time >= 45: Interval = 10 seconds
C4 Time >= 30: Interval = 7 seconds
C4 Time < 30: Interval = 5 seconds

>5 & <10 for T = DefC4 - Intv
>10 & <15 for T = DefC4 - (Intv * 2)
>15 for T = DefC4 - (Intv * 3)
>5 & <10 for CT = DefC4 + Intv
>10 & <15 for CT = DefC4 + (Intv * 2)
>15 for CT = DefC4 + (Intv * 3)
With less than 5 points deficit for either team set back to the default C4 time.

Change Log:
v0.2
  • Removed unused constant 'LASTMAN_X'.
  • Default C4 time is now based on 'mp_c4timer' and not hardcoded.
  • New calculations for C4 timers with various point intervals.
  • New CVAR to turn HUD messages on or off.
  • Minimum C4 time set to 15 seconds.
Attached Files
File Type: sma Get Plugin or Get Source (shortfuse.sma - 686 views - 4.4 KB)
__________________

Last edited by hellmonja; 08-30-2016 at 19:47. Reason: Update v0.2
hellmonja is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-20-2016 , 04:51   Re: ShortFuse
Reply With Quote #2

PHP Code:
#define PTS_KILL    1
#define PTS_HEADSHOT    2
#define PTS_PLANT    2
#define PTS_BOMBED    3
#define PTS_DEFUSED    5 
Cvars please.

PHP Code:
#define LASTMAN_X    2 
It's not used.

Instead of always checking if g_bomb_site is non 0, pause the plugin in case no bombsite is found:
PHP Code:
if (!find_ent_by_class(-1"func_bomb_target") && !find_ent_by_class(-1"info_bomb_target")) 
    
pause("d"
I am not sure to like that you force the default value as being 45. You should let the owner define his preferred default time. What do you think about that? Basically, instead of doing g_c4time = 45, retrieve the value from mp_c4timer cvar.
Then, on new round, restore this value. You would also need to change the way in which you calculate the new time, but that's not hard. Anyway. something to see later.

Also, as I told you already, stop using cvars, switch to pcvars. Since mp_c4timer is no registered by you, in init or so retrieve it's pointer with get_cvar_pointer("name"). Now use get_pcvar_num native with the pointer.
__________________

Last edited by HamletEagle; 08-20-2016 at 04:52.
HamletEagle is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 08-30-2016 , 08:49   Re: ShortFuse
Reply With Quote #3

Sorry I wasn't able to update for so long. We had a busy work week. I needed the weekends to work on this. I did the things you told me and added a couple of features...
__________________
hellmonja is offline
KleinMarquez
Senior Member
Join Date: Jun 2016
Location: Calapan City, Philippine
Old 09-16-2016 , 04:57   Re: ShortFuse
Reply With Quote #4

Modification is Counter Strike only, not ALL.
KleinMarquez is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-18-2016 , 11:10   Re: ShortFuse
Reply With Quote #5

The plugin as an idea is very nice, keep working!

Hamlet:
Quote:
Instead of always checking if g_bomb_site is non 0, pause the plugin in case no bombsite is found:
Not better to check in plugin_init and Not register at all nothing if the bomb isn't finded? Maybe just register_plugin( "ShortFuse: This map don't have a bomb", "_", "_" ); ...
__________________
Project: Among Us

Last edited by Craxor; 09-18-2016 at 11:12.
Craxor is offline
Send a message via ICQ to Craxor
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 09-18-2016 , 13:06   Re: ShortFuse
Reply With Quote #6

No, register plugin and if no bomb is found then use
set_fail_state("No bmb on this map")

IT will stop the plugin for current map.
siriusmd99 is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-18-2016 , 13:45   Re: ShortFuse
Reply With Quote #7

Quote:
Originally Posted by siriusmd99 View Post
No, register plugin and if no bomb is found then use
set_fail_state("No bmb on this map")

IT will stop the plugin for current map.
Yes, set_fail_state should be more fine
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-18-2016 , 14:13   Re: ShortFuse
Reply With Quote #8

Quote:
Originally Posted by Craxor View Post
Yes, set_fail_state should be more fine
Well, it isn't and after all, doesn't matter.
__________________
HamletEagle is offline
Reply



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 05:54.


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