Author Topic: Power Limiter  (Read 1935 times)

0 Members and 1 Guest are viewing this topic.

Offline freestyler

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 326
Power Limiter
« on: November 05, 2011, 07:51:52 am »
script name: Power Limiter
short description: the more people use the same gun, the smaller damage it deals
original author: fri
core version: 2.7.2



longer description:
Are you tired of seeing whole Alpha team raping Bravos with shotguns? Annoyed by ubiquitous MP5 sprayers? Power Limiter can change any weapon's output depending on how many team players use it. You can make it deal 100% if there is only one "copy" of a particular gun in a team, 90% if two, etc. - up to five "copies" per team.

Weapons aren't removed from player's menu - the script is invisible to mere mortals. Unless you make their gun deal 0% of original damage, of course - everyone will notice that something's wrong.

By default, weapons deal 100% for 1 user, 95 for two, 85, 70 and 50 for five or more users. Values can vary from 0 through 255. There's nothing that stops you from making a gun stronger with more users.

code snippet: (not the whole script)
Code: [Select]
function onplayerdamage(victim, shooter: byte; damage: integer): integer;
begin
if (pl[shooter].weapon < 17) then
result := round(damage * dmg[count[pl[shooter].weapon][pl[shooter].team]] / 100)
else
result := damage;
end;

If used with bots then it won't count their weapon until you use /setteam on them or recompile the script after adding them. This is the scriptcore's fault for not triggering some events for bots (#0000126). I'm not sure if any of you need it to work with bots; just post here if you do.



« Last Edit: April 01, 2014, 06:54:48 am by freestyler »

Offline pavliko

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 397
  • >‿‿◕
    • Offical TTW Community
Re: Power Limiter
« Reply #1 on: November 05, 2011, 10:17:36 am »
I will use the minigun then....
 Nice script, hoping too see it on pubs
The safest thing to do is jumping out of a plane!

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Power Limiter
« Reply #2 on: November 05, 2011, 02:03:31 pm »
That's just stupid. Why would anyone want prevent whole team of using  same weapon at same time? If enemy uses short range weapons - spray them. If they spray, - snipe them. If they snipe then either spray at them or snipe them back.
Would make a bit more sense if you prevent one person to carry one weapon for too long. Though still, only a bit.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline pavliko

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 397
  • >‿‿◕
    • Offical TTW Community
Re: Power Limiter
« Reply #3 on: November 05, 2011, 02:29:32 pm »
"If enemy uses short range weapons - spray them. If they spray, - snipe them. If they snipe then either spray at them or snipe them back."

And in the end no one even uses short ranged weapons.

The safest thing to do is jumping out of a plane!

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Power Limiter
« Reply #4 on: November 06, 2011, 04:26:47 am »
It's kind of obvious that usage of short weapons depend mostly on the terrain (tunnels).
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.