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
function OnPlayerCommand(ID: Byte; Text: string): boolean;
with
function OnCommand(ID: Byte; Text: string): boolean;
Whole code:
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;