Official Soldat Forums
Server Talk => Scripting Releases => Topic started by: Swompie 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:
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 ;)
-
download link?
-
Just copy and paste it in the .pas file.
Though, i think there is already one.
-
download link?
Attached it for the lazy ones ;)
Though, i think there is already one.
Yes, but it's using the GetKeyPress() function iirc.
-
I like this script, its very usefull !
But this command work for all or only for admin ?
-
Second part of your question.
-
Ok so where's the part who say that there is only for admin ?
-
As far as i know theres only a soldat server 2.6.5. you have 2.6.6.?
-
Somewhat always makes me think it's 266, don't ask me what it was. Anyways, fixed.
-
Ok so where's the part who say that there is only for admin ?
http://enesce.com/help/html/Events/OnCommand.html
-
Ok thanks ;D
so this kind of command can be called by arsse ?
-
Yes..
-
so i can do like
procedure ActivateServer();
begin
Command('/g 60');
end;
-
very nice, much better than my gravity script :D