Author Topic: Almighty Gravity changer  (Read 3665 times)

0 Members and 1 Guest are viewing this topic.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Almighty Gravity changer
« on: July 08, 2010, 02:48:40 pm »
Author: Swompie (Mini thx to Curt` for some RegEx help)
Server version: 2.6.5 or higher
Command: /g NN (where NN represents a number; synonyms are /grav and /gravity)

Here's the source for the Almighty Gravity changer:
Code: (pascal) [Select]
const
    OnGravChangeNotice = true; // set to true to display a message to all players when gravity has changed
    Color = $FFFFFF; // color of the message

function OnCommand(ID: byte; Text: string): boolean;
var g: integer;
begin
  result := false;
  if (RegExpMatch('^/(g|grav|gravity) (-?\d+)', lowercase(Text))) then begin
    g := strtoint(GetPiece(Text, ' ', 1));
    ServerModifier('Gravity', g * 0.0006);
    if OnGravChangeNotice then
      WriteConsole(0, 'Gravity changed to ' + inttostr(g) + '%', Color);
    exit;
  end;
end;

Use /g 100 for default gravity!
Have fun making the people in your server beeing "WTF!" when you change the gravity ;)
« Last Edit: July 10, 2010, 05:11:26 am by Swompie »

Offline PKS|Shooter

  • Soldier
  • **
  • Posts: 130
  • Dont fuck with us!
    • PKS - La Familia
Re: Almighty Gravity changer
« Reply #1 on: July 08, 2010, 05:57:57 pm »
download link?

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: Almighty Gravity changer
« Reply #2 on: July 08, 2010, 06:02:23 pm »
Just copy and paste it in the .pas file.

Though, i think there is already one.
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Almighty Gravity changer
« Reply #3 on: July 09, 2010, 06:10:31 am »
download link?
Attached it for the lazy ones ;)

Though, i think there is already one.
Yes, but it's using the GetKeyPress() function iirc.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Almighty Gravity changer
« Reply #4 on: July 09, 2010, 02:56:42 pm »
I like this script, its very usefull !
But this command work for all or only for admin ?

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Almighty Gravity changer
« Reply #5 on: July 09, 2010, 03:24:58 pm »
Second part of your question.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Almighty Gravity changer
« Reply #6 on: July 09, 2010, 03:38:58 pm »
Ok so where's the part who say that there is only for admin ?

Offline the halo fan

  • Camper
  • ***
  • Posts: 285
  • Mustly the heat of battle is just the begining
Re: Almighty Gravity changer
« Reply #7 on: July 09, 2010, 09:57:16 pm »
As far as i know theres only a soldat server 2.6.5. you have 2.6.6.?

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Almighty Gravity changer
« Reply #8 on: July 10, 2010, 05:11:14 am »
Somewhat always makes me think it's 266, don't ask me what it was. Anyways, fixed.

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Almighty Gravity changer
« Reply #9 on: July 10, 2010, 08:32:26 am »

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Almighty Gravity changer
« Reply #10 on: July 10, 2010, 08:36:46 am »
Ok thanks  ;D
so this kind of command can be called by arsse ?

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Almighty Gravity changer
« Reply #11 on: July 10, 2010, 08:41:16 am »
Yes..

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Almighty Gravity changer
« Reply #12 on: July 10, 2010, 08:47:50 am »
so i can do like
Code: [Select]
procedure ActivateServer();
begin
Command('/g 60');
end;


Offline frosty

  • Flagrunner
  • ****
  • Posts: 601
  • Uber Desert Eagle ^^
Re: Almighty Gravity changer
« Reply #13 on: July 11, 2010, 01:23:53 pm »
very nice, much better than my gravity script :D
check out my server! click here

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