Author Topic: Resurrect  (Read 1164 times)

0 Members and 1 Guest are viewing this topic.

Offline Savage

  • Soldier
  • **
  • Posts: 155
Resurrect
« on: March 18, 2014, 04:06:40 pm »
Script Name: Resurrect
Script Description: Resurrect players immediately
Original Author(s): revo
Compile Test: Passed
Core Version: 2.7.6 (SC2)

This script allows you to resurrect any player, useful on survival mode(DB,RPG etc.)
I don't find working Resurrect script on this site and just cut this piece from other script.

Resurrect players by: /res id
This command is available for everyone, if you want only for admins replace that
Code: [Select]
function OnPlayerCommand(ID: Byte; Text: string): boolean;
with
Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
Whole code:
Code: [Select]
Type Player = Record
God: integer;
End;

var
iPlayer: array[1..32] of Player;
tID,tim: byte;

function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
if iPlayer[Victim].God = 1 then
begin
result := 0;
end
else
begin
result := Damage;
end;
end;

function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if(LowerCase(Copy(Text,1,5))='/res ') then
begin
tID := StrToInt( GetPiece(Text, ' ', 1) );
tim := GetPlayerStat(tID,'Team');
if tID = StrToInt( GetPiece(Text, ' ', 1) ) then
begin
iPlayer[tID].God := 1;
Command('/setteam' +inttostr(tim) + ' ' + inttostr(tID));
result := false;
WriteConsole(0,'Player: ' +GetPlayerStat(tID,'Name') +' resurrected.',$00FF00);
WriteLn('Player: ' +GetPlayerStat(tID,'Name') +' resurrected.');
if iPlayer[tID].God = 1 then
begin
    iPlayer[tID].God := 0;
end;
end;
end;
end;
« Last Edit: March 07, 2016, 05:00:44 pm by Savage »

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Re: Resurrect
« Reply #1 on: March 19, 2014, 11:30:39 am »
Useful, this clipping from a script DB
« Last Edit: April 17, 2014, 01:55:59 pm by skrX »