Author Topic: Admin Invincibility  (Read 6011 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Admin Invincibility
« 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:
Code: [Select]
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.
« Last Edit: December 23, 2007, 02:28:25 pm by DorkeyDear »

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: Admin Invincibility
« Reply #1 on: August 04, 2007, 04:35:54 pm »
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
Code: [Select]
if Invincible[Victim] then Result := 0 else Result := Damage;into
Code: [Select]
if Invincible[Victim] then Result := -9999 else Result := Damage;would do just fine.

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Admin Invincibility
« Reply #2 on: August 04, 2007, 05:03:31 pm »
thanx

but on my server were do you put the var in the begining?
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: Admin Invincibility
« Reply #3 on: August 04, 2007, 05:54:37 pm »
At the beginning.
-=Gradius wuz you=-

Offline Freedom

  • Major
  • *
  • Posts: 97
  • Veritas Vincit
Re: Admin Invincibility
« Reply #4 on: August 16, 2007, 04:35:22 am »
It doesn't work :/
But it makes me immortal xD
Cum pare contendere anceps est, cum superiore furiosum, cum inferiore sordidum.

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: Admin Invincibility
« Reply #5 on: August 16, 2007, 07:57:54 am »
It doesn't work :/
But it makes me immortal xD
uhh...isn't that the point of the script?

Offline Freedom

  • Major
  • *
  • Posts: 97
  • Veritas Vincit
Re: Admin Invincibility
« Reply #6 on: August 16, 2007, 08:22:02 am »
Quote
uhh...isn't that the point of the script?

My mistake :D
Cum pare contendere anceps est, cum superiore furiosum, cum inferiore sordidum.

Offline JoeCool

  • Major(1)
  • Posts: 35
  • Watdfuxup?
Re: Admin Invincibility
« Reply #7 on: August 16, 2007, 11:43:34 am »
where do i put this in, possibly a screen if possible, i suxorz at scripting.
[ban] TEH NOOBS

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Admin Invincibility
« Reply #8 on: August 16, 2007, 12:12:16 pm »
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.

Offline Dr. Zombi3

  • Soldier
  • **
  • Posts: 224
  • Happy Almost Halloween :)
Re: Admin Invincibility
« Reply #9 on: August 16, 2007, 01:04:27 pm »
Cool... but isint it unfair to the other players?
3 warnings then did naughty thing. Now Banned.

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Admin Invincibility
« Reply #10 on: August 16, 2007, 01:08:59 pm »
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."

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Admin Invincibility
« Reply #11 on: August 16, 2007, 01:11:17 pm »
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.

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Admin Invincibility
« Reply #12 on: December 18, 2007, 09:18:07 pm »
thanx

Date Posted: September 23, 2007, 07:30:14 pm
can u put this in a .zip plz?
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.