AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Charger mid-charge buff (https://forums.alliedmods.net/showthread.php?t=122544)

Geel9 03-28-2010 05:31

[L4D2] Charger mid-charge buff
 
2 Attachment(s)
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)

berni 03-28-2010 06:06

Re: [L4D2] Charge Assurance
 
Quote:

Originally Posted by Geel9 (Post 1131052)
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" ?

Geel9 03-28-2010 06:13

Re: [L4D2] Charge Assurance
 
Quote:

Originally Posted by berni (Post 1131067)
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 03-28-2010 06:37

Re: [L4D2] Charge Assurance
 
Alright, fixed.

IronWarrior 03-28-2010 11:56

Re: [L4D2] Charge Assurance
 
Very nice plugin, but can this support more then one charger at a time?

If not, can you make it support 10vs10 please? :)

Geel9 03-28-2010 12:07

Re: [L4D2] Charge Assurance
 
Quote:

Originally Posted by IronWarrior (Post 1131348)
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.

berni 03-28-2010 15:58

Re: [L4D2] Charge Assurance
 
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;
}

ne0cha0s 03-28-2010 15:59

Re: [L4D2] Charge Assurance
 
Quote:

Originally Posted by berni (Post 1131683)
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

Geel9 03-28-2010 16:24

Re: [L4D2] Charge Assurance
 
Done.

berni 03-28-2010 17:11

Re: [L4D2] Charge Assurance
 
Quote:

Originally Posted by Geel9 (Post 1131697)
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).


All times are GMT -4. The time now is 21:19.

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