Raised This Month: $12 Target: $400
 3% 

[L4D2] Charger mid-charge buff


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Geel9
Senior Member
Join Date: Mar 2009
Plugin ID:
1567
Plugin Version:
1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Let chargers have a higher chance of survival during a charge
    Old 03-28-2010 , 05:31   [L4D2] Charger mid-charge buff
    Reply With Quote #1

    L4D2 Charge Protection

    This plugin basically adds health to a charger during a charge, then removes it when the charge ends. This lets him have a higher chance of survival DURING the charge, but afterwards he's no better off. It will not remove the health if he has less than the health it was going to remove.

    Cvar:
    sm_charger_health: The amount of health to give/take away from a charger during a charge. (default 300)
    Attached Files
    File Type: sp Get Plugin or Get Source (chargeassurance.sp - 3944 views - 1.8 KB)

    Last edited by Geel9; 04-01-2010 at 01:25.
    Geel9 is offline
    berni
    SourceMod Plugin Approver
    Join Date: May 2007
    Location: Austria
    Old 03-28-2010 , 06:06   Re: [L4D2] Charge Assurance
    Reply With Quote #2

    Quote:
    Originally Posted by Geel9 View Post
    It will not remove the health if he has less than the health it was going to remove.
    That's weird and will confuse allot of people I think, I would set him to 1hp or something.

    Also
    • Fix the intentation warnings
    • Fix the tag mismatch warnings
    • cleaner code formatting
    • You are using the variable "done" globally, but it's possible that two chargers charge at same time, you should think of that.
    • Rename some of your variables, what's "charer" ?
    __________________
    Why reinvent the wheel ? Download smlib with over 350 useful functions.

    When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
    powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

    Last edited by berni; 03-28-2010 at 06:11.
    berni is offline
    Geel9
    Senior Member
    Join Date: Mar 2009
    Old 03-28-2010 , 06:13   Re: [L4D2] Charge Assurance
    Reply With Quote #3

    Quote:
    Originally Posted by berni View Post
    That's weird and will confuse allot of people I think, I would set him to 1hp or something.

    Also
    • Fix the intentation warnings
    • Fix the tag mismatch warnings
    • cleaner code formatting
    • You are using the variable "done" globally, but it's possible that two chargers charge at same time, you should think of that.
    • Rename some of your variables, what's "charer" ?

    Thanks for the feedback. I'll do that but...

    ...


    There can only be one charger at a time.

    It's funny though, because I thought "I don't think I should make it global...oh wait"
    Geel9 is offline
    Geel9
    Senior Member
    Join Date: Mar 2009
    Old 03-28-2010 , 06:37   Re: [L4D2] Charge Assurance
    Reply With Quote #4

    Alright, fixed.
    Geel9 is offline
    IronWarrior
    Veteran Member
    Join Date: Jan 2010
    Old 03-28-2010 , 11:56   Re: [L4D2] Charge Assurance
    Reply With Quote #5

    Very nice plugin, but can this support more then one charger at a time?

    If not, can you make it support 10vs10 please?
    IronWarrior is offline
    Geel9
    Senior Member
    Join Date: Mar 2009
    Old 03-28-2010 , 12:07   Re: [L4D2] Charge Assurance
    Reply With Quote #6

    Quote:
    Originally Posted by IronWarrior View Post
    Very nice plugin, but can this support more then one charger at a time?

    If not, can you make it support 10vs10 please?
    It can only support one charger.
    Geel9 is offline
    berni
    SourceMod Plugin Approver
    Join Date: May 2007
    Location: Austria
    Old 03-28-2010 , 15:58   Re: [L4D2] Charge Assurance
    Reply With Quote #7

    I've seen that when you have bots in your team, they sometime spawn with the same characters, 2 hunters, or 2 chargers at same time, this only seems to happen with bots, and it's also incompatible with other sourcemod plugins that enable you to have multiple chargers at a time.

    You can make a global variable for each player:

    new bool:done[MAXPLAYERS] = { false, ... };

    public OnClientPutInServer(client) {

    done[client] = false;
    }
    __________________
    Why reinvent the wheel ? Download smlib with over 350 useful functions.

    When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
    powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
    berni is offline
    ne0cha0s
    Senior Member
    Join Date: Mar 2010
    Old 03-28-2010 , 15:59   Re: [L4D2] Charge Assurance
    Reply With Quote #8

    Quote:
    Originally Posted by berni View Post
    I've seen that when you have bots in your team, they sometime spawn with the same characters, 2 hunters, or 2 chargers at same time, this only seems to happen with bots, and it's also incompatible with other sourcemod plugins that enable you to have multiple chargers at a time.

    You can make a global variable for each player:

    new bool:done[MAXPLAYERS] = { false, ... };

    public OnClientPutInServer(client) {

    done[client] = false;
    }
    - beat me to the suggestion, lol
    __________________


    ne0cha0s is offline
    Geel9
    Senior Member
    Join Date: Mar 2009
    Old 03-28-2010 , 16:24   Re: [L4D2] Charge Assurance
    Reply With Quote #9

    Done.
    Geel9 is offline
    berni
    SourceMod Plugin Approver
    Join Date: May 2007
    Location: Austria
    Old 03-28-2010 , 17:11   Re: [L4D2] Charge Assurance
    Reply With Quote #10

    Quote:
    Originally Posted by Geel9 View Post
    Done.
    Are you ever checking your compiler output ?

    Tag mismatch & lose indentation warnings again. use false/true for bool variables, not 1/0.

    Please fix (approved for now).
    __________________
    Why reinvent the wheel ? Download smlib with over 350 useful functions.

    When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
    powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
    berni 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 08:42.


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