Author Topic: Respawn after Flag cap  (Read 1295 times)

0 Members and 1 Guest are viewing this topic.

Offline Mishkin

  • Major(1)
  • Posts: 13
Respawn after Flag cap
« on: August 30, 2009, 12:11:46 pm »
I have noticed in some servers (mostly climb and race) when a player captures and scores with the flag they are respawned after scoring. I have searched for this script but cannot find it.. does anyone know if this script is available for download somewhere?

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Respawn after Flag cap
« Reply #1 on: August 30, 2009, 12:49:17 pm »
Code: [Select]
procedure OnFlagScore(ID, TeamFlag: byte);
begin
  DoDamage(ID,666);
end;

Offline Mishkin

  • Major(1)
  • Posts: 13
Re: Respawn after Flag cap
« Reply #2 on: August 30, 2009, 01:20:07 pm »
Im new to using scripts in soldat, i tried to add that code to an existing script but my server will not start as a result.

Im not sure exactly where to place it in the pas file

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Respawn after Flag cap
« Reply #3 on: August 30, 2009, 02:27:48 pm »
Put it in another script.
Or just find OnFlagScore in the existing script and stick DoDamage(ID, 666); into there somewhere.

By the way, whenever the server doesn't start, give us the output of it (what error it gives before it dies).

Offline Croatian

  • Major
  • *
  • Posts: 85
  • :)
Re: Respawn after Flag cap
« Reply #4 on: August 30, 2009, 03:23:16 pm »
Code: [Select]
procedure OnFlagScore(ID, TeamFlag: byte);
begin
  DoDamage(ID,666);
end;

Other way to not killing player? Does database have coordinates of respawn places?

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Re: Respawn after Flag cap
« Reply #5 on: August 30, 2009, 04:02:03 pm »
Code: [Select]
procedure OnFlagScore(ID, TeamFlag: byte);
begin
MovePlayer(ID, GetSpawnStat(ID, 'X'), GetSpawnStat(ID, 'Y'));
end;

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Respawn after Flag cap
« Reply #6 on: August 30, 2009, 05:41:34 pm »
Code: [Select]
procedure OnFlagScore(ID, TeamFlag: byte);
begin
MovePlayer(ID, GetSpawnStat(ID, 'X'), GetSpawnStat(ID, 'Y'));
end;
Nope.

Alternative for killing player:
Code: [Select]
procedure OnFlagScore(ID, TeamFlag: byte);
var i: byte;
begin
  for i:= 1 to 254 do if GetSpawnStat(i,'Style') = GetPlayerStat(ID,'Team') then begin
    MovePlayer(ID, GetSpawnStat(i,'X'), GetSpawnStat(i,'Y'));
    break;
  end;
end;

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: Respawn after Flag cap
« Reply #7 on: August 30, 2009, 06:49:17 pm »
Oh! Guys! Try setteam I always use it! Something like
Command('/setteam'+inttostr(GetPlayerStat(ID,'Team'))+' '+inttostr(ID));
Haven't scripted for almost a year.. but try it.
KAWAAAAAAAIIIIIIIIII

Offline Shoozza

  • Retired Soldat Developer
  • Veteran
  • ******
  • Posts: 1632
  • Soldat's Babysitter
    • Website
Re: Respawn after Flag cap
« Reply #8 on: August 30, 2009, 07:02:00 pm »
Or do it the lame way by moving the player outside the map.

MovePlayer(ID, 99999999999, 99999999999);
Rules
Tools: ARSSE - SARS - SRB - chatMod

Offline Neosano

  • Camper
  • ***
  • Posts: 253
  • IIAWAK!
Re: Respawn after Flag cap
« Reply #9 on: August 30, 2009, 07:41:53 pm »
Or do it the lame way by moving the player outside the map.

MovePlayer(ID, 99999999999, 99999999999);
NICE! Didn't think about it!
KAWAAAAAAAIIIIIIIIII

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Respawn after Flag cap
« Reply #10 on: August 31, 2009, 04:19:41 am »
Ah, I forgot about those. Imo setting to team is more smooth.