Author Topic: Admin Invincibility  (Read 9207 times)

0 Members and 1 Guest are viewing this topic.

Offline Gnintendo

  • Major
  • *
  • Posts: 61
Admin Invincibility
« on: January 16, 2008, 05:54:26 pm »
Script Name: Admin Invincibility
Script Description: Use /invin to give yourself Invincibility and type /invin again to get rid of it.  You can also use /invin <ID> to give it to other people (or take it from them.)
Original Author(s): Gnintendo
Core Version: 2.6.3
Code Snippet:
Code: [Select]
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
if Players[Victim].Invincible then Result := -999999999999999999999999999999999999 else Result := Damage;
end;

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: Admin Invincibility
« Reply #1 on: January 16, 2008, 06:06:32 pm »
theres no need to add that many 9s, about 4 or 5 will do.

Offline Gnintendo

  • Major
  • *
  • Posts: 61
Re: Admin Invincibility
« Reply #2 on: January 16, 2008, 06:06:51 pm »
theres no need to add that many 9s, about 4 or 5 will do.
I know...I was having fun with it xD.
(Besides there are some modded attacks on some servers that do insane damage...so just to be safe anyway.)

Offline Hershey

  • Camper
  • ***
  • Posts: 343
Re: Admin Invincibility
« Reply #3 on: January 16, 2008, 06:38:02 pm »
pretty good, i like it

Offline rhide

  • Major
  • *
  • Posts: 60
  • Coffee-addict
    • Vrastar-Hai soldat clan
Re: Admin Invincibility
« Reply #4 on: January 19, 2008, 02:05:47 pm »
Im not sure why it compiles, but an integer cannot hold that large numbers (OnPlayerDamage returns an integer). Why dont you just set the damage to 0? Or set the player health to 100%?
Warning! Division by zero seriously injures yourself and the people in your surroundings.

Proud member of Vrastar-Hai:
http://www.guldheden.com/~erga050/vrastar-hai

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: Admin Invincibility
« Reply #5 on: January 19, 2008, 02:06:53 pm »
Explosions still kill if the damage is set to 0 or you set the players hp to 100%.

Offline Gnintendo

  • Major
  • *
  • Posts: 61
Re: Admin Invincibility
« Reply #6 on: January 19, 2008, 05:54:11 pm »
Im not sure why it compiles, but an integer cannot hold that large numbers (OnPlayerDamage returns an integer). Why dont you just set the damage to 0? Or set the player health to 100%?
And OBVIOUSLY they do hold integers that high...-.-.  duh...

Offline Snake

  • Soldier
  • **
  • Posts: 178
  • Chu Canadien Criss!
Re: Admin Invincibility
« Reply #7 on: January 19, 2008, 06:45:37 pm »
nice cool I like it

Offline rhide

  • Major
  • *
  • Posts: 60
  • Coffee-addict
    • Vrastar-Hai soldat clan
Re: Admin Invincibility
« Reply #8 on: January 23, 2008, 06:05:55 pm »
Im not sure why it compiles, but an integer cannot hold that large numbers (OnPlayerDamage returns an integer). Why dont you just set the damage to 0? Or set the player health to 100%?
And OBVIOUSLY they do hold integers that high...-.-.  duh...

No. Integers, depending on the computer, are often 16 bit - that is - at most 65 536. I belive that the compiler either sets it to the largest negative number a integer can hold, or perhaps it wraps around a huge amount of times... At least the actual value returnes will NOT be the one you entered.
Warning! Division by zero seriously injures yourself and the people in your surroundings.

Proud member of Vrastar-Hai:
http://www.guldheden.com/~erga050/vrastar-hai

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Admin Invincibility
« Reply #9 on: January 24, 2008, 06:29:30 am »
integers are -32768 to 32767 so the actual number is somewhere between those.

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Admin Invincibility
« Reply #10 on: January 24, 2008, 07:58:14 am »
In the scripting engine Integers are 32 bit, meanings they are in the range -2147483648 to 2147483647. The value will wrap around and end up being some number between that, not sure what it would be offhand.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Admin Invincibility
« Reply #11 on: January 25, 2008, 06:35:55 am »
In the scripting engine Integers are 32 bit, meanings they are in the range -2147483648 to 2147483647. The value will wrap around and end up being some number between that, not sure what it would be offhand.
Hm, makes me curious about other things I google being wrong for this scripting engine..
So what would be an 16 bit integer (signed and/or unsigned)?
« Last Edit: January 25, 2008, 06:39:56 am by DorkeyDear »

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Admin Invincibility
« Reply #12 on: January 25, 2008, 06:34:35 pm »
From my understanding and calculation, 16 bit would be from -65535 to 65534, If not close to it
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Admin Invincibility
« Reply #13 on: January 25, 2008, 07:24:58 pm »
From my understanding and calculation, 16 bit would be from -65535 to 65534, If not close to it
I meant what would the datatype be?

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Admin Invincibility
« Reply #14 on: January 25, 2008, 07:38:45 pm »
If you mean as in longint, shortint, then it would be a 'word', that actually goes from 0 to 65535
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline Gnintendo

  • Major
  • *
  • Posts: 61
Re: Admin Invincibility
« Reply #15 on: January 25, 2008, 09:19:07 pm »
Why the hell are we arguing about this anyway, all that matters is the code works...
« Last Edit: January 26, 2008, 08:25:36 am by Gnintendo »

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Admin Invincibility
« Reply #16 on: January 25, 2008, 09:45:42 pm »
Who's arguing?
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Admin Invincibility
« Reply #17 on: May 03, 2008, 12:01:46 am »
nice script, i like it, much more stable than fistbox, stops arguing amung players, very nice
check out my server! click here

If at first you don't succeed, Improvise! :D

Offline Gnintendo

  • Major
  • *
  • Posts: 61
Re: Admin Invincibility
« Reply #18 on: October 03, 2008, 03:22:45 pm »
I recently became aware that on climb servers Incremental Damage Polys could still kill you for some reason, I've edited the script and am doing final testing.

As soon as I am sure this works I will upload a new version.

Please keep in mind this probably doesn't affect 99% of you.

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Admin Invincibility
« Reply #19 on: October 03, 2008, 03:57:09 pm »
nice script, i like it, much more stable than fistbox, stops arguing amung players, very nice
er what? what does it have to do with fistbox anyways? and how does it stop arguing amung players? lololol

about the script, pretty nice :P