Author Topic: Soldat.gather ingame  (Read 5683 times)

0 Members and 1 Guest are viewing this topic.

Offline Dr.Thrax

  • Major
  • *
  • Posts: 70
    • Lostgalaxy.de
Soldat.gather ingame
« on: December 05, 2008, 03:55:04 pm »
Hi
This morning lessons in school was canceled and i wasted my time to create a soldat.gather script as a server script.
I mean it works and you can use several commands but i don't know what to use it for!
perhaps you can just take it to create easily mixed teams.

Script Name:  Soldat.gather ingame
Script Description:  a full soldat gather like you can get in IRC for you own soldat server
Original Author: Dr.Thrax
Core Version: newest

avaiable commands:
- !on - to start a gather
- !add - to add to a gather
- !del - to delete your name in the gatherlist
- !off - to definetly end a gather (only needed after finishing it!)
- !sub - just pauses the game to give time to look after a substitute
- !change <ordinary value between 3 and 11> - to change the max players of a gather (!change 6 will create an CTF(3on3))

some additional commands like:
- !pause - pauses the game
- !go - will unpause the game with countdown
- !restart - will restart the map
- !unbanlast - will unbanlast the last kicked player
- !map ctf_<Mapname> - will change to that map if written down in the mapslist.txt with countdown (uses xsplit)

and a pw-creator:
- !pw - no pw
- !pw wtf! - will change pw to "wtf!"
- !pw random <length between 1 and 10> - will create a numeric based random pw with <length> characters


When you type "!on" you will start a gather , "!del" will let you delete your name in the list and turns the gather off if no one else had already added. Default it is "3on3" adjusted , if you want to change it just "!change <value>" it even if the gather is already running! When the gather is full , teams will randomly be created , showed and automatically changed. Every player who does not belong to the gather will be joined the spectator.
Thats it. Quite useless but tell me how to use it  :P.

Code-example:

Code: [Select]
if (LowerCase(text) = '!on') then
  begin
  if (gather_mod = 0) and (player[id] = 0) then
    begin
    player[id] := 1;
    temp := '';
    temp := temp + idtoname(id) + ' ';
    gather_mod := 1;
    WriteConsole(0,'Soldat Gather Bot started! Script by Dr.Thrax',RGB(255,130,23));
    WriteLn(' [*] GatherBot: Soldat Gather Bot started! Script by Dr.Thrax');
    WriteConsole(0,'CTF('+inttostr(c_pl/2)+'on'+inttostr(c_pl/2)+'): '+temp,RGB(255,130,23));
    WriteLn(' [*] GatherBot: CTF('+inttostr(c_pl/2)+'on'+inttostr(c_pl/2)+'): '+temp);
    end else WriteConsole(id,'Gather already running!',RGB(255,130,23));
  end;


if (LowerCase(Text) = '!add') then
  begin
  if (gather_mod = 1) and (player[id] = 0) then
    begin
    player[id] := 1;
    temp := temp + idtoname(id) + ' ';
    WriteConsole(0,'CTF('+inttostr(c_pl/2)+'on'+inttostr(c_pl/2)+'): '+temp,RGB(255,130,23));
    WriteLn(' [*] GatherBot: CTF('+inttostr(c_pl/2)+'on'+inttostr(c_pl/2)+'): '+temp);
    end else
    begin
         if (gather_mod = 0) then WriteConsole(id,'No gather running! Type "!on" to start a Gather!',RGB(255,130,23))
          else if (player[id] = 1) then WriteConsole(id,'You already added on this gather!',RGB(255,130,23))
         end;
  end;


if (LowerCase(Text) = '!status') then
  begin
  if (gather_mod = 1) then
    begin
    WriteConsole(0,'CTF('+inttostr(c_pl/2)+'on'+inttostr(c_pl/2)+'): '+temp,RGB(255,130,23));
    WriteLn(' [*] GatherBot: CTF('+inttostr(c_pl/2)+'on'+inttostr(c_pl/2)+'): '+temp);
    end else WriteConsole(id,'No gather running! Type "!on" to start a Gather!',RGB(255,130,23));
  end;


if (LowerCase(Text) = '!del') then
  begin
    if (gather_mod = 1) and (player[id] = 1) then
      begin
      player[id] := 0;
      nametemp := idtoname(id);
      Delete(temp,pos(idtoname(id),temp),Length(nametemp)+1);
      gath := false;
      for i := 1 to 32 do if player[i] = 1 then gath := true;
      if gath = true then
      begin
         WriteConsole(0,'CTF('+inttostr(c_pl/2)+'on'+inttostr(c_pl/2)+'): '+temp,RGB(255,130,23));
         WriteLn(' [*] GatherBot: CTF('+inttostr(c_pl/2)+'on'+inttostr(c_pl/2)+'): '+temp);
         end;
      end else WriteConsole(id,'No gather running or you didnt add yet!',RGB(255,130,23));
    if gather_mod = 1 then
    begin
    gath := false;
    for i := 1 to 32 do if player[i] = 1 then gath := true;
    if gath = false then
        begin
        temp := '';
        gather_mod := 0;
        WriteConsole(0,'Gather turned off!',RGB(255,130,23));
                 WriteLn(' [*] GatherBot: Gather turned off!');
        end;
    end;
  end;

Download


Dr.Thrax

Offline Mr.Dark

  • Major(1)
  • Posts: 4
Re: Soldat.gather ingame
« Reply #1 on: January 22, 2011, 06:33:02 am »
Good job!
Very useful script for me, but download link is dead. :/ Can u fix it please?

Offline Dr.Thrax

  • Major
  • *
  • Posts: 70
    • Lostgalaxy.de
Re: Soldat.gather ingame
« Reply #2 on: January 22, 2011, 10:53:10 am »
here it is:

Download

Offline themangokid2

  • Major(1)
  • Posts: 20
Re: Soldat.gather ingame
« Reply #3 on: April 20, 2012, 07:37:42 am »
The link is broken/file is gone. Can you reupload?

Offline Dr.Thrax

  • Major
  • *
  • Posts: 70
    • Lostgalaxy.de
Re: Soldat.gather ingame
« Reply #4 on: April 20, 2012, 09:03:56 am »
Let me see if i got that for you

Offline Dr.Thrax

  • Major
  • *
  • Posts: 70
    • Lostgalaxy.de
Re: Soldat.gather ingame
« Reply #5 on: April 20, 2012, 09:06:28 am »
I found it and uploaded the code to nopaste, but it's kinda old, so better have a look at it.

http://nopaste.info/94861c0785.html

Greets DrThrax

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: Soldat.gather ingame
« Reply #6 on: April 20, 2012, 10:34:02 am »
Would be better if you attached a file into first post...

Offline themangokid2

  • Major(1)
  • Posts: 20
Re: Soldat.gather ingame
« Reply #7 on: April 21, 2012, 04:56:09 pm »
Okay, but I'm novice and have noidea where the script goes. link to tutorial? Thanks anyways!

Offline StayAlive

  • Major(1)
  • Posts: 8
Re: Soldat.gather ingame
« Reply #8 on: June 07, 2012, 01:19:31 pm »
To everyone who cannot download file:
1) copy whole code from nopaste (watch out! do not copy number of lines)
2) then make folder for example "gather" in folder "scripts" (without " ") - example directory: "C:\SoldatDedicatedServer\scripts\gather\"
3) paste whole code into some editor like Notepad or Notepad++
4) save this file to your folder "gather" and call it for example "gather.pas" (withous " ") - it have to be this *.pas file format
5) make file "Includes.txt" in which you will write only these words: "gather.pas", save it to the same folder "gather"
6) run your server (soldatserver.exe in your soldat dedicated server folder) and enjoy :D

Dr.Thrax: I found some bug. When we run this script and write any command in game like for example /pause or /addbot or whatever - script automatically stops. I've got solution for it, function OnCommand should looks like this:

Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
if (text = '/gather') and (gather_on = false) then
    begin
        Command('/say Gather online');
        gather_on := true;
    end
else if (text = '/gather') and (gather_on = true) then begin
              Command('/say Gather offline');
              gather_on := false;
              end;
end;

Offline themangokid2

  • Major(1)
  • Posts: 20
Re: Soldat.gather ingame
« Reply #9 on: June 13, 2012, 09:48:23 am »
Can some one make a new version with an updated scriptcore? (ver. 1.6.3)

Would be greatly appreciated.