Author Topic: Lowering Preditor Time  (Read 2473 times)

0 Members and 1 Guest are viewing this topic.

Offline Timer

  • Major(1)
  • Posts: 41
Lowering Preditor Time
« on: January 10, 2010, 04:59:14 am »
Here's the script I have for when you toss a flag you recieve a pred. I was wondering how to change the pred time to something lower like 7 secs or 420 ticks... heres the script so far

procedure OnFlagDrop(ID, TeamFlag: byte);

begin
  GiveBonus(ID, 1);
  WriteConsole(ID,'You have recieved a pred on flag throw!', $EE81FAA1);
end;   
"I was gonna clean my room, but then I got high. I was gonna get up and find the broom, but then I got high."

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Lowering Preditor Time
« Reply #1 on: January 10, 2010, 05:30:01 am »
Impossible, its hardcoded. The only way would be to givebonus something else, like a berserker, in apponidle. But that causes even more problems.


Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Lowering Preditor Time
« Reply #2 on: January 10, 2010, 11:11:24 am »
It may be possible to kill (when the custom pred timer runs out), and attempt to respawn the player with /setteam (not 100% certain if it respawns or not) at the location he died, or MovePlayer`ing him; this probably wouldn't seem very smooth though.

Offline LORD KILLA

  • Camper
  • ***
  • Posts: 254
  • Happie
Re: Lowering Preditor Time
« Reply #3 on: January 10, 2010, 01:50:35 pm »
Do GiveBonus(ID, 1). Then, to disable it, try GiveBonux(ID, 0); (just idea, not sure if works)

Offline y0uRd34th

  • Camper
  • ***
  • Posts: 325
  • [i]Look Signature![/i]
Re: Lowering Preditor Time
« Reply #4 on: January 10, 2010, 02:54:49 pm »
Nice idea, but does not work. Atleast it will force your weapons to deagles, pretty weird!

Offline Timer

  • Major(1)
  • Posts: 41
Re: Lowering Preditor Time
« Reply #5 on: January 10, 2010, 04:19:46 pm »
Here's the script I'm using now
procedure OnFlagDrop(ID, TeamFlag: byte);
  begin
    if TeamFlag = 1 then
      begin
        GiveBonus(ID, 1);
        WriteConsole(ID,'You have recieved a pred on flag throw!', $EE81FAA1);
      end;
  end;   

I would still like to only allow for a 5 sec pred somehow.
If it isn't possible I still appreciate your guys help!
« Last Edit: January 10, 2010, 09:35:58 pm by Timer »
"I was gonna clean my room, but then I got high. I was gonna get up and find the broom, but then I got high."

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Lowering Preditor Time
« Reply #6 on: January 10, 2010, 09:55:58 pm »


Offline Timer

  • Major(1)
  • Posts: 41
Re: Lowering Preditor Time
« Reply #7 on: January 10, 2010, 10:13:13 pm »
Well ok...So I changed script. (I want the preds to be available but less easy to spam the use of it aka throwing flag, get pred, catch flag, throw again ect...) so here's what I came up with that would not allow players to take the pred spawner (aka alpha teams flag) and spam use of it.

Obviously not right...can you show me what i did wrong here?

procedure OnFlagGrab(ID, TeamFlag: byte;GrabbedInBase: boolean);
  begin
    if TeamFlag = 1 then
      begin
        if GrabbedInBase = True then
          begin
            GiveBonus(ID, 1);
            WriteConsole(ID,'You have recieved a pred on flag throw!', $EE81FAA1);
          end;
      end;
  end;   
"I was gonna clean my room, but then I got high. I was gonna get up and find the broom, but then I got high."

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: Lowering Preditor Time
« Reply #8 on: January 11, 2010, 04:14:06 pm »
Well it seems like it can't detect the GrabbedInBase. I tried it in Ash and it can only detect when it not GrabbedInBase.. Strange.

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Lowering Preditor Time
« Reply #9 on: January 11, 2010, 05:03:27 pm »
Code: [Select]
var rfs,bfs: boolean;

procedure OnMapChange(NewMap: String);
begin
rfs := true;
bfs := true;
end

procedure OnFlagGrab(ID, TeamFlag: byte;GrabbedInBase: boolean);
begin
case teamflag of
1: rfs := false;
2: bfs := false;
end;
end;

procedure OnFlagReturn(ID, TeamFlag: byte);
begin
case teamflag of
1: rfs := true;
2: bfs := true;
end;
end;

procedure OnFlagScore(ID, TeamFlag: byte);
begin
case teamflag of
1: rfs := true;
2: bfs := true;
end;
end;

And only do stuff in the onflaggrab when the correct var is true.


Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Lowering Preditor Time
« Reply #10 on: January 12, 2010, 01:26:45 am »
It may be possible to kill (when the custom pred timer runs out), and attempt to respawn the player with /setteam (not 100% certain if it respawns or not) at the location he died, or MovePlayer`ing him; this probably wouldn't seem very smooth though.
You don't have to kill him, just respawn using /setteam at same position. That's possible.

DarkCrusade

  • Guest
Re: Lowering Preditor Time
« Reply #11 on: January 12, 2010, 06:58:22 am »
But that will look very unsmooth.

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Lowering Preditor Time
« Reply #12 on: January 13, 2010, 03:12:38 am »
But that will look very unsmooth.
are you serious? You mean killing a player IS smooth?!

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: Lowering Preditor Time
« Reply #13 on: January 13, 2010, 08:59:26 am »
Well, IMod has a skill that lets you "go out of your body" and then come back. (Steyr second skill)
It uses /setteam and it works well, but the problem is that a weapon menu will appear. Any ideas how to make it not showing up?
KAWAAAAAAAIIIIIIIIII

Offline y0uRd34th

  • Camper
  • ***
  • Posts: 325
  • [i]Look Signature![/i]
Re: Lowering Preditor Time
« Reply #14 on: January 13, 2010, 09:46:46 am »
well, it can be dis/enabled by TAB, but i dont think it will work via script

DarkCrusade

  • Guest
Re: Lowering Preditor Time
« Reply #15 on: January 13, 2010, 10:23:21 am »
are you serious? You mean killing a player IS smooth?!

No I didnĀ“t say that.

well, it can be dis/enabled by TAB, but i dont think it will work via script

The problem is, that no player is going to use the same weapons all way long so nobody will disable the menu. You got to deal with it.

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: Lowering Preditor Time
« Reply #16 on: January 13, 2010, 10:52:26 am »
Guys, I'm not sure, but when you join another team weapon menu pops again, even if it was TABed. :-S
KAWAAAAAAAIIIIIIIIII

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Lowering Preditor Time
« Reply #17 on: January 13, 2010, 12:47:26 pm »
Guys, I'm not sure, but when you join another team weapon menu pops again, even if it was TABed. :-S
tried disabling all weapons in soldat.ini and then setweaponactive'ing them on/off?

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: Lowering Preditor Time
« Reply #18 on: January 13, 2010, 01:39:47 pm »
nope :-S
KAWAAAAAAAIIIIIIIIII

Offline Timer

  • Major(1)
  • Posts: 41
Re: Lowering Preditor Time
« Reply #19 on: January 14, 2010, 10:23:57 pm »
Alright so I figured I try something differant anyways. Currently on the server it gives you a pred for a bravo flag return, but problem is you can't use a pred whenever you want. So i figured a good way to do this was to give everyplayer the ability to use a pred whenever they wanted but only 1. So I wanted to make the cluster grenade turn into a pred for only bravo team players... Im just beginning to try and script but I can't figure out what I did wrong here.

Quote
function OnPlayerDamage(Victim,Shooter: Byte;Damage: Integer;Weapon: Byte) : integer;
begin
   if GetPlayerStat(Victim, 'Team') = 2 then
   if Damage > 0 then
   if (Weapon = 50) then
      begin
         GiveBonus(Victim, 1)
         WriteConsole(Victim,'Magic Nade!', $EE81FAA1);
      end;
end;
"I was gonna clean my room, but then I got high. I was gonna get up and find the broom, but then I got high."