Author Topic: Admin-godmode script.  (Read 9547 times)

0 Members and 1 Guest are viewing this topic.

Offline Flippeh

  • Major
  • *
  • Posts: 58
  • Fish go moo :>
    • My Homepage
Admin-godmode script.
« on: May 20, 2007, 05:44:41 pm »
Script Name: Godmode
Script Description: .... gives you godmode.
Original Author(s): Flippeh
Core Version: 2.6.0
Code:
Code: [Select]
// Core.pas under the const:
Type Player = Record
                Admin   : Integer;
                God     : Integer;
              End;

Var iPlayer : Array[1..32] Of Player;

function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
  //NOTE: This function will be called when [_any_] player types a / command.
 
  Case Text Of
    '/adminlog '+ReadINI('soldat.ini','NETWORK','Admin_Password','...') : Begin
        iPlayer[ID].Admin := 1;
      End;
  End;
 
  If iPlayer[ID].Admin = 1 Then Begin
    Case Text Of
      '/god' :  Begin
                  If iPlayer[ID].God = 1 Then Begin
                    iPlayer[ID].God := 0;
                    WriteConsole(ID, 'Godmode turned off </3',$EE2774CF);
                  End Else Begin
                    iPlayer[ID].God := 1;
                    // Enable if you want to spam it globally
                    // WriteConsole(0, IDToName(ID)+' is now GODLIKE!', $EEFF0000);
                    WriteConsole(ID, 'Godmode turned on <3',$EE2774CF);
                  End;
                End;
    End;
  End;
 
  Result := false; //Return true if you want disable the command typed.
end;

// NetworkCore.pas
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
  If iPlayer[Victim].God = 1 Then Begin
    result := -999999; // Set it to this so NOTHING can ever kill you. If you set it to 0
                                  // you still get killed by direct explosion hits.
  End Else Begin
    result := Damage;
  End;
end;

(If there is any error, please tell me, because i don't use splitted files [NetworkCore.pas, Core.pas, ...], but a single scriptfile [script.pas]. So there could be something i might left out.)

So, whats the use of this? Actually there is no use. You don't die from shoots, nades, death-polys, the /kill command or anything else that might drop your HP. You will see yourself running around with 0 HP when you get hit. Thats because the script sets your HP to -99999, and the game isn't built to show more than the max health.

There is probably no real use in this, i made it for testing purposes. you could use it for climbservers (cheating) or something something....

Oh, and before you can use it, you have to log in with /adminlog.

Have fun with it =)

Offline xReaperx

  • Major(1)
  • Posts: 45
Re: Admin-godmode script.
« Reply #1 on: May 26, 2007, 12:43:48 am »
It does not recognize ' OnPlayerDamage ' and also, how could you run it off a different script file?

Offline Hydro

  • Major(1)
  • Posts: 31
Re: Admin-godmode script.
« Reply #2 on: May 26, 2007, 08:34:26 am »
Usefull on fcw xd

Offline Detector

  • Major
  • *
  • Posts: 55
Re: Admin-godmode script.
« Reply #3 on: May 26, 2007, 05:05:33 pm »
it does not work. I download 140, sever 260, arsse. I copy to 140 folder server, and to scripts folder copy the god script in god.pas. Starting the server, arsse, add me to admins, join, type /god. And I was killed by enemy
Read.Only.

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Admin-godmode script.
« Reply #4 on: May 26, 2007, 08:42:08 pm »
You dont copy the server into 1.4.0 folder...

Offline kusyi

  • Major(1)
  • Posts: 8
  • Ural Clan
Re: Admin-godmode script.
« Reply #5 on: June 17, 2007, 12:24:03 am »
it does not work. I download 140, sever 260, arsse. I copy to 140 folder server, and to scripts folder copy the god script in god.pas. Starting the server, arsse, add me to admins, join, type /god. And I was killed by enemy
One part of code paste to core.pas, another part paste to networkcore.pas
^^

Offline deguix

  • Major
  • *
  • Posts: 79
Re: Admin-godmode script.
« Reply #6 on: June 21, 2007, 09:33:06 am »
In 2.6.1, the following things should be noted when using this script:
- OnPlayerDamage is not called when the player is hurt (but not killed) by the map.
- Max health now is capped to 133%. In 2.6.0, it could go to integer maximum limits (which was the alternative way to fix the problem above).

Thus, this script won't protect against hurting polys in any map...

Alternative ways? None probably. OnPlayerDamage is much more effective than having to verify the difference between the health of the player before and after a time interval.

Offline Ippo

  • Major(1)
  • Posts: 5
    • My clan Mr's homepage
Re: Admin-godmode script.
« Reply #7 on: February 07, 2008, 03:15:23 pm »
Can u give other players godmode when they aren't admins and i am??

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: Admin-godmode script.
« Reply #8 on: February 08, 2008, 06:54:00 am »
Not with this script, no.

Offline Gnintendo

  • Major
  • *
  • Posts: 61
Re: Admin-godmode script.
« Reply #9 on: February 08, 2008, 07:29:28 am »
EDIT: nvm some n00b bumped this.

As a reply to the person earlier, this script can't but I made one where you can, you also don't have to log in with mine.

http://forums.soldat.pl/index.php?topic=23975.0
« Last Edit: February 08, 2008, 07:31:19 am by Gnintendo »

Offline Flippeh

  • Major
  • *
  • Posts: 58
  • Fish go moo :>
    • My Homepage
Re: Admin-godmode script.
« Reply #10 on: February 15, 2008, 02:12:36 pm »
http://forums.soldat.pl/index.php?topic=23135.0

This one has a better godmode in it, that allows your to either god yourself (/god) or god other players (/god <id>), and a big load of other candy.