Author Topic: Punish Double Scoring  (Read 8323 times)

0 Members and 1 Guest are viewing this topic.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Punish Double Scoring
« on: February 05, 2007, 12:53:25 am »
Script Name: Punish Double Scoring
Script Description: Admin kills anyone who double scores in CTF Survival servers.
Original Author(s): Bmekim
Core Version: 2.5.2
Code:

Code: [Select]
var
score: integer;
last: ARRAY [1..2] of integer;
punish: byte;
delay: byte;

procedure AppOnIdle(Ticks: integer);
begin
  if (Ticks mod (60) = 0) and (delay = 1) then begin
    Command('/kill ' + inttostr(last[punish]));
    Command('/say ' + IDToName(last[punish]) + ' punished for double scoring');
    delay := 0;
    punish := 0;
  end;
end;

procedure OnFlagGrab(ID: integer;TeamFlag: byte;GrabbedInBase: boolean);
begin
  last[TeamFlag] := ID;
end;

procedure OnFlagScore(ID: integer;TeamFlag: byte);
begin
  if score+1 < AlphaScore+BravoScore then punish := TeamFlag;
  score := AlphaScore+BravoScore;
end;

procedure OnPlayerRespawn(ID: integer);
begin
  if (punish > 0) then delay := 1;
  score := AlphaScore+BravoScore;
end;

procedure OnLeaveGame(IP, Nickname: string;Team: byte);
begin
 if (last[1] = NameToID(Nickname)) or (last[2] = NameToID(Nickname)) then punish := 0;
end;
« Last Edit: February 07, 2007, 09:21:33 pm by mikembm »

Offline Quantifier

  • Major
  • *
  • Posts: 70
Re: Punish Double Scoring
« Reply #1 on: February 05, 2007, 08:36:14 am »
Interesting, I have script with identical goal running on my server for about month now. However, I only used Turbo Pascal before, and my skills with it are more than a bit rusty.

Anyway, here's my version:
Code: [Select]
//Script to punish double scoring on Survival CTF
//Author: Quantifier
var
  upTime: integer;
  flag_carrier: array[1..2] of integer;
  flag_carrier_name: array[1..2] of string;
  punishment_who_name: string;
  punishment_who: integer;
  punishment_when: integer;
  old_score: integer;
  time_last_scored: integer;
  time_last_captured: integer;
  captured_flag: integer;
  dscored : array[1..7] of integer; //make this array bigger if server has more slots

procedure ActivateServer();
var i:integer;
begin
  upTime:=0;
  punishment_who:=0;
  punishment_when:=0;
  old_score:=0;
  flag_carrier[1]:=0;
  flag_carrier[2]:=0;
  time_last_scored:=0;
  time_last_captured:=0;
  for i:=1 to 7 do begin
    dscored[i]:=0;
  end;
end;

procedure AppOnIdle(Ticks: integer);
begin
   if (punishment_who <> 0) and (Ticks = punishment_when*60) then begin
      if (idtoname(punishment_who)=punishment_who_name) then begin
         if dscored[punishment_who] = 0 then begin
            Command('/kill '+inttostr(punishment_who));
            dscored[punishment_who] := 1; //comment this to disable recidive kick
         end
         else begin
            BanPlayer(punishment_who, 15);
            dscored[punishment_who] := 0;
         end;
         Command('/say '+punishment_who_name+' has been punished for double scoring.');
         Writeln(punishment_who_name+' has been punished for double scoring.');
      end;
      punishment_who := 0;
   end;

   if (alphascore+bravoscore>old_score) then begin
      if (time_last_captured=uptime) and
         ((alphascore+bravoscore>old_score+1) or
          (uptime-time_last_scored<=6)) then begin
         punishment_who:=flag_carrier[captured_flag];
         punishment_who_name:=flag_carrier_name[captured_flag];
         flag_carrier[1]:=0; flag_carrier[2]:=0;
         if punishment_who<>0 then begin
            Writeln(punishment_who_name+' double scored.');
            saytoplayer(punishment_who,'Double scoring is forbidden.');
            saytoplayer(punishment_who,'You will be punished.');
         end;
      end;
   time_last_scored:=uptime;
   end;

   old_score:=bravoscore+alphascore;

   upTime:=upTime+1;
end;

procedure OnFlagGrab(ID: integer;TeamFlag: byte;GrabbedInBase: boolean);
begin
   flag_carrier[TeamFlag]:=id;
   flag_carrier_name[TeamFlag]:=idtoname(id);
end;

procedure OnFlagScore(ID: integer;TeamFlag: byte);
begin
   captured_flag:=TeamFlag;
   time_last_captured:=uptime;
end;

procedure OnPlayerRespawn(ID: integer);
begin
   if (punishment_who=id) then begin
      punishment_when:=uptime+1;
   end;
end;

procedure OnLeaveGame(IP, Nickname: string;Team: byte);
var id:integer;
begin
   id:=nametoid(nickname);
   dscored[id]:=0;
   if id=punishment_who then begin
      punishment_who:=0;
   end;
end;
« Last Edit: February 05, 2007, 11:02:00 am by Quantifier »

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Punish Double Scoring
« Reply #2 on: February 05, 2007, 10:30:31 am »
Wow. way longer than it needs to be. :P
But I did update mine to not use array for scores.

Offline Quantifier

  • Major
  • *
  • Posts: 70
Re: Punish Double Scoring
« Reply #3 on: February 05, 2007, 11:10:24 am »
I modified and cleaned mine a little too. OnPlayerRespawn is a better place to determine when to kill the offender.
I know my script is not the shortest possible, but I think it's pretty foolproof.

Offline FliesLikeABrick

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 6144
    • Ultimate 13 Soldat
Re: Punish Double Scoring
« Reply #4 on: February 05, 2007, 11:46:08 am »
Can someone enlighten me as to what "double scoring" is?

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Punish Double Scoring
« Reply #5 on: February 05, 2007, 11:50:33 am »
On CTF survival mode servers, when one team kills all of the other team that team gains one point and in 5 or so seconds the round ends. The problem is that in those 5 seconds it is possible for that team to score the flag also and get a second point. My script will /kill any player that does that in the following round.

EDIT: Added in OnLeaveGame procedure in case player leaves before being punished.
« Last Edit: February 05, 2007, 11:54:26 am by mikembm »

Offline Not Not Muldritch

  • Major
  • *
  • Posts: 77
Re: Punish Double Scoring
« Reply #6 on: February 05, 2007, 01:09:18 pm »
What exactly is the problem with double scoring?

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Punish Double Scoring
« Reply #7 on: February 05, 2007, 01:16:09 pm »
Some people just don't like it. How would you like to lose a map because some people using a glitch in the game? It's a matter of preference really.

Offline spike

  • Major(1)
  • Posts: 8
Re: Punish Double Scoring
« Reply #8 on: February 05, 2007, 02:58:46 pm »
Yeah i play R/S with Bmekimnub :P and i dislike double scoring. Its using a glitch in the game and your getting an extra point with almost no work when you should only get one.

Offline iPod

  • Major
  • *
  • Posts: 57
  • HA! HA! CARE FOR A MIXED NUT?
Re: Punish Double Scoring
« Reply #9 on: February 05, 2007, 10:45:12 pm »
Some people just don't like it. How would you like to lose a map because some people using a glitch in the game? It's a matter of preference really.
It's not a glitch. It's actually really hard to score in the five seconds you get anyway, and if you manage to make it you honestly deserve the second cap. This wouldn't even be possible if that crappy workaround to fix survivor camping wasn't introduced (forcing everyone to be killed once the other team is dead).
[MpS]P00pSmith

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Punish Double Scoring
« Reply #10 on: February 05, 2007, 11:26:02 pm »
It's actually easy to do and happens quite often. Only triple capping is really hard to do. :P

Offline Aquarius

  • Soldier
  • **
  • Posts: 234
Re: Punish Double Scoring
« Reply #11 on: February 05, 2007, 11:42:00 pm »
No, it's not easy to do if you play with someone smart enough not to sit at your flag spawn point. If double cap happens very often it's only because you play with somene smarter than you. I think double scoring is good, it adds more tactics to the game.
« Last Edit: February 06, 2007, 03:16:18 am by Aquarius »

Offline Clawbug

  • Veteran
  • *****
  • Posts: 1393
  • 1184!
Re: Punish Double Scoring
« Reply #12 on: February 06, 2007, 02:46:40 pm »
IMO double scoring can be ideal tactic for some clans. If they are good at it, they deserve the win. Loser team needs just to blame itself because of losing the match, and not being able to stop the another teams tactic. :P

On public servers tho, I do not see double scoring SO tactical, but it should not be punished IMO. ;_;
Fight! Win! Prevail!

Offline truup

  • Soldier
  • **
  • Posts: 243
Re: Punish Double Scoring
« Reply #13 on: February 06, 2007, 04:16:02 pm »
IMO double scoring can be ideal tactic for some clans. If they are good at it, they deserve the win. Loser team needs just to blame itself because of losing the match, and not being able to stop the another teams tactic. :P

On public servers tho, I do not see double scoring SO tactical, but it should not be punished IMO. ;_;

2nd that. Sounds just like a 'flag runner' to me.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Punish Double Scoring
« Reply #14 on: February 07, 2007, 09:21:55 pm »
Fixed code and made it more efficient.

Offline Magic Odd Effect

  • Camper
  • ***
  • Posts: 371
Re: Punish Double Scoring
« Reply #15 on: May 24, 2007, 06:39:50 pm »
Double capping is annoying.

It is REALLY easy to double cap, since the flag is usually captured as a distraction. A group of two to three guys will go and cap the opposing team's flag, to distract them while the others move in. However, if the opposite team is eliminated, the guy with the flag will run and cap quickly.

You've already proved your win, why double it up and make a fair team work twice as hard to catch up?

I play some R/S, and it truly is annoying.

If I ever run a R/S server (which I might sometime), I'll use this script.
Don't say that you're Magic. Because you aren't, and I am.
All-around good with weapons that aren't long range, except in TW.
Now be careful out there, soldier.
Best Newbie in the May 2007 Soldatforums Member Awards!

Offline Aquarius

  • Soldier
  • **
  • Posts: 234
Re: Punish Double Scoring
« Reply #16 on: May 24, 2007, 07:47:10 pm »
You've already proved your win, why double it up and make a fair team work twice as hard to catch up?

You are contradicting yourself.
You can double cap to catch up, if it is as "REALLY easy" as you say.
And it's not unfair to double cap if enemy team double caps too.

Offline Magic Odd Effect

  • Camper
  • ***
  • Posts: 371
Re: Punish Double Scoring
« Reply #17 on: May 25, 2007, 02:37:47 am »
Play some R/S. You'll see what usually happens.

One team tries to be fair, the other double caps every time.

Also, during any one round, it's almost inevitable that a flag is going to be capped. Happens a lot, more than half the time.

Plus, it's just not fair gameplay. Like the SPAS in TW right now.
Don't say that you're Magic. Because you aren't, and I am.
All-around good with weapons that aren't long range, except in TW.
Now be careful out there, soldier.
Best Newbie in the May 2007 Soldatforums Member Awards!

Offline SDFilm

  • Inactive Staff
  • Veteran
  • *****
  • Posts: 1266
Re: Punish Double Scoring
« Reply #18 on: May 25, 2007, 03:06:48 am »
I used to be against it, but now it just sounds too much like an argument from the 'OMG flag runner nub!11' people.

Burning scarfs since 1988

Offline cynicle

  • Major(1)
  • Posts: 37
Re: Punish Double Scoring
« Reply #19 on: June 06, 2007, 04:17:40 am »
Wouldn't it be better as some of you agree and some dissagree with the whole idea that instead of punishing and so forth just deduct a point if the opposing team double scores?
Join the Army. Visit strange and exotic places. Meet fascinating people. And kill them.

Aus Soldat League 203.208.70.216:23073

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Punish Double Scoring
« Reply #20 on: June 07, 2007, 12:02:23 pm »
Wouldn't it be better as some of you agree and some dissagree with the whole idea that instead of punishing and so forth just deduct a point if the opposing team double scores?
When I made this script that wasn't possible