Official Soldat Forums
Server Talk => Scripting Releases => Topic started by: DorkeyDear on August 04, 2007, 04:21:21 pm
-
Script Name: Admin Invincibility
Script Description: When an admin does '/invin', he / she becomes invincible. Repeat the command to turn invincibility off.
Original Author: Curt (DorkeyDear)
Core Version: 2.6.1b
Code: var
Invincible: array[1..32] of boolean;
function OnCommand(ID: Byte; Text: string): boolean;
begin
Result := false;
if Text = '/invin' then if Invincible[ID] then begin
WriteConsole(ID,'Invincibility has been disabled.',$FFFFFFFF);
Invincible[ID] := false;
end else begin
WriteConsole(ID,'Invincibility has been enabled.',$FFFFFFFF);
Invincible[ID] := true;
end;
end;
procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);
begin
Invincible[ID] := false;
end;
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
if Invincible[Victim] then Result := 0 else Result := Damage;
end;
In request from miketh2005.
-
If you really want to have the player completely invincible you need to set the Result in OnPlayerDamage to a relatively big negative value; or else the player will die from explosives.
Changing
if Invincible[Victim] then Result := 0 else Result := Damage;
into
if Invincible[Victim] then Result := -9999 else Result := Damage;
would do just fine.
-
thanx
but on my server were do you put the var in the begining?
-
At the beginning.
-
It doesn't work :/
But it makes me immortal xD
-
It doesn't work :/
But it makes me immortal xD
uhh...isn't that the point of the script?
-
uhh...isn't that the point of the script?
My mistake :D
-
where do i put this in, possibly a screen if possible, i suxorz at scripting.
-
Hopefully I'll get around to creating a zip with contents of the script for all my scripts, but that may be a few days.
For now, I'll tell you just to create a sub-directory in the scripts folder, and in there, have an Includes.txt with some file name in there, then create the "some file name" in the sub-directory (.pas is good extension) and paste the code in there, and save.
-
Cool... but isint it unfair to the other players?
-
Cool... but isint it unfair to the other players?
O RLY
If you're the admin, you know what you're doing, duh?
Especially when it says that it was created "In request from miketh2005."
-
I post pretty much everything people request from me, if I remember to or if I don't lose the script. :)
I would never put this script on any server hosted that I have access to and permission to do stuff in.
-
thanx
Date Posted: September 23, 2007, 07:30:14 pm
can u put this in a .zip plz?