Author Topic: Script help  (Read 2902 times)

0 Members and 4 Guests are viewing this topic.

Offline script

  • Major(1)
  • Posts: 6
Script help
« on: December 08, 2010, 05:37:34 pm »
Hi, Could someone create a script multi modes for me? I would be grateful  :)

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: Script help
« Reply #1 on: December 08, 2010, 06:18:16 pm »
Ekhm...more details?
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline script

  • Major(1)
  • Posts: 6
Re: Script help
« Reply #2 on: December 08, 2010, 07:36:56 pm »
a script that  when you type !commands appears gamemodes available and for open a vote use !f12 or !f11 for change gamemode

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: Script help
« Reply #3 on: December 08, 2010, 07:42:07 pm »
I believe that there was some script like that. Search the "Scripting releases" subforum.
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Script help
« Reply #4 on: December 08, 2010, 08:51:49 pm »
Do you mean built in gamemodes (ctf, inf, dm, etc) or custom sub-gamemodes (climb, knife volleyball, flying socoms, etc..).

First option you can take a look here, it will need to be updated to work with the new scriptcore: http://forums.soldat.pl/index.php?topic=8205.0

As for the other, bombski's multimode is the only thing I know of like it, and I don't think it is publicly available, but you can look here for more info: http://eat-that.org/index.php?topic=1317.0
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline script

  • Major(1)
  • Posts: 6
Re: Script help
« Reply #5 on: December 09, 2010, 07:43:23 am »
I took a look at this link http://forums.soldat.pl/index.php?topic=8205.0 and I think this script has didn't commands of vote

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: Script help
« Reply #6 on: December 09, 2010, 11:31:01 am »
Code: [Select]
procedure ScriptChange(const ScriptName : string; const State : boolean; const ID : byte);

var
Index, SIndex : string;
rec : boolean;

begin
  if not FileExists('scripts/' + ScriptName + '/Includes.txt') then begin
    WriteConsole(ID,'File not found!',Color);
    exit;
  end;
  Index := ReadFile('scripts/' + ScriptName + '/Includes.txt');
    SIndex := Copy(Index,0,length(Index));
  rec := false;
    if (State) and (Copy(Index,0,2) = '//') then begin
      WriteFile('scripts/' + ScriptName + '/Includes.txt',Copy(Index,2,length(Index)));
    WriteConsole(ID,'Script ' + ScriptName + ' enabled.',Color);
      rec := true;
    end else if not (State) and (Copy(Index,0,2) <> '//') then begin
      WriteFile('scripts/' + ScriptName + '/Includes.txt','//' + SIndex);
    WriteConsole(ID,'Script ' + ScriptName + ' disabled.',Color);
      rec := true;
    end else if not (State) and (Copy(Index,0,2) = '//') then begin
      WriteConsole(ID,'Script ' + ScriptName + ' seems to be disabled already.',Color);
    rec := false;
    end else if (State) and (Copy(Index,0,2) <> '//') then begin
      WriteConsole(ID,'Script ' + ScriptName + ' seems to be enabled already.',Color);
        rec := false;
        end;
    if rec then begin
      Command('/recompile ' + ScriptName);
    end else if not rec then exit;
end;

Will disable or enable a script. Like in bomskis multi mode (f.e ScriptChange(VolleyBall,true 'or' false,ID) will en or disable VolleyBall).
The truth is out there? Does anyone know the URL?
The URL is here

Offline script

  • Major(1)
  • Posts: 6
Re: Script help
« Reply #7 on: December 09, 2010, 02:02:46 pm »
Code: [Select]
procedure ScriptChange(const ScriptName : string; const State : boolean; const ID : byte);

var
Index, SIndex : string;
rec : boolean;

begin
  if not FileExists('scripts/' + ScriptName + '/Includes.txt') then begin
    WriteConsole(ID,'File not found!',Color);
    exit;
  end;
  Index := ReadFile('scripts/' + ScriptName + '/Includes.txt');
    SIndex := Copy(Index,0,length(Index));
  rec := false;
    if (State) and (Copy(Index,0,2) = '//') then begin
      WriteFile('scripts/' + ScriptName + '/Includes.txt',Copy(Index,2,length(Index)));
    WriteConsole(ID,'Script ' + ScriptName + ' enabled.',Color);
      rec := true;
    end else if not (State) and (Copy(Index,0,2) <> '//') then begin
      WriteFile('scripts/' + ScriptName + '/Includes.txt','//' + SIndex);
    WriteConsole(ID,'Script ' + ScriptName + ' disabled.',Color);
      rec := true;
    end else if not (State) and (Copy(Index,0,2) = '//') then begin
      WriteConsole(ID,'Script ' + ScriptName + ' seems to be disabled already.',Color);
    rec := false;
    end else if (State) and (Copy(Index,0,2) <> '//') then begin
      WriteConsole(ID,'Script ' + ScriptName + ' seems to be enabled already.',Color);
        rec := false;
        end;
    if rec then begin
      Command('/recompile ' + ScriptName);
    end else if not rec then exit;
end;

Will disable or enable a script. Like in bomskis multi mode (f.e ScriptChange(VolleyBall,true 'or false,ID) will en or disable VolleyBall).

Type this script is already with the command ! Vote + number of mod and when I put copies of soldat.ini I put everything in the same folder?

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: Script help
« Reply #8 on: December 10, 2010, 06:12:52 am »
I'll do it when Im back at home
The truth is out there? Does anyone know the URL?
The URL is here

Offline script

  • Major(1)
  • Posts: 6
Re: Script help
« Reply #9 on: December 10, 2010, 10:20:42 am »
ok,thanks

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: Script help
« Reply #10 on: December 10, 2010, 03:19:59 pm »
Here it is, !change <ScriptName> is the command.
I've only tested it on my local test-server, so tell me if there are any bugs in it.

EDIT: Corrected Version.
« Last Edit: February 08, 2011, 01:38:13 am by Stuffy »
The truth is out there? Does anyone know the URL?
The URL is here

Offline script

  • Major(1)
  • Posts: 6
Re: Script help
« Reply #11 on: December 12, 2010, 09:15:32 am »
I put this script together with the multi script mods?

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: Script help
« Reply #12 on: December 13, 2010, 02:42:34 am »
you do not need any other script, just use mine.
The truth is out there? Does anyone know the URL?
The URL is here

Offline daniel35

  • Major(1)
  • Posts: 19
Re: Script help
« Reply #13 on: February 07, 2011, 10:56:11 am »
This script has a command to see the scripts that exist on the server? you could make a script with this command?: / modes: the scripts of shows serv with the ID of the script
exp:
1 - volleyball
2 - m79 climb
there to vote for the volleyball type !vote 1
and climb to vote for m79 type !vote 2
Can you make a script like this?
« Last Edit: February 07, 2011, 11:02:08 am by daniel35 »

Offline mascarado

  • Major(1)
  • Posts: 16
Re: Script help
« Reply #14 on: February 07, 2011, 05:05:24 pm »
Dear Stuffy.

I am not able to configure this scripted mode. :'(

I was wondering if you could configure it with the following scripts  :'(

ZRPG, Hide n Seek, Pirate Vs Ninja, Lawcath, Volley boll ... :D

Or make a tutorial on how to install them ... :D


Code: [Select]
const
Color = $E56600;
VoteTime = 60;
AddTime = 60;
VotePerc = 70;

var
Voted : array[1..32] of boolean;
VoteRun, EnDis : boolean;
Time : integer;
Script : string;

procedure ScriptChange(const ScriptName : string; const State : boolean);

var
Index, SIndex : string;
rec : boolean;

begin
  if not FileExists('scripts/' + ScriptName + '/Includes.txt') then begin
  exit;
  end;
  Index := ReadFile('scripts/' + ScriptName + '/Includes.txt');
    SIndex := Copy(Index,0,length(Index));
  rec := false;
    if (State) and (Copy(Index,0,2) = 'ZRPG') then begin
      WriteFile('scripts/' + ScriptName + '/Includes.txt',Copy(Index,3,length(Index)));
    rec := true;
    end else if not (State) and (Copy(Index,0,2) <> 'ZRPG') then begin
      WriteFile('scripts/' + ScriptName + '/Includes.txt','ZRPG' + SIndex);
    rec := true;
    end else if not (State) and (Copy(Index,0,2) = '//') then begin
  rec := false;
    end else if (State) and (Copy(Index,0,2) <> '//') then begin
      rec := false;
        end;
    if rec then begin
    Command('/loadcon ZRPG.ini'); 
            Command('/loadlist ZRPGMAPS');
            Command('/recompile ' + ScriptName);
    end else if not rec then exit;
end;

function GetScriptState(const ScriptName : string): boolean;

var
Index : string;

begin

  if FileExists('scripts/' + ScriptName + '/Includes.txt') then begin
    Index := ReadFile('Modes/' + ScriptName + '/Includes.txt');
  if Copy(Index,0,2) = 'ZRPG' then begin
    Result := false;
  end else Result := true
  end;
end;

procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);

begin

end;

procedure OnPlayerSpeak(ID: byte; Text: string);

var
Total, i : integer;
begin
  if (LowerCase(GetPiece(Text,' ',0)) = '!vote') and not (Voted[ID]) then
    if (GetPlayerStat(ID,'Active')) then
  if FileExists('scripts/' + GetPiece(Text,' ',1) + '/Includes.txt') then begin
    Total := Total + 1;
      Voted[ID] := true;
        VoteRun := true;
  if Time = 0 then Time := VoteTime else Time := Time + AddTime;
        if GetScriptState(GetPiece(Text,' ',1)) = true then begin
      EnDis := false;
    WriteConsole(ID,'Player ' + IdToName(ID) + ' voted to enable the script ' + GetPiece(Text,' ',1),Color);
end else if GetScriptState(GetPiece(Text,' ',1)) = false then begin
      EnDis := true;
    WriteConsole(ID,'Player ' + IdToName(ID) + ' voted to disable the script ' + GetPiece(Text,' ',1),Color);
end;
  Script := GetPiece(Text,' ',1);
 
 
    if (100 * Total / (NumPlayers - NumBots) >= VotePerc) then begin
      for i := 1 to 32 do Voted[ID] := false;
    WriteConsole(ID,'Script-Change vote passed! Script "' + Script + '" is now ' +iif(EnDis,'en','dis') + 'abled',Color);
      ScriptChange(Script,EnDis);
 end else WriteConsole(0,FloatToStr(RoundTo(100 * Total / (NumPlayers - NumBots), 2)) + '% / ' + InttoStr(VotePerc) + '% required for a vote pass', Color);
   end else WriteConsole(ID,'Error, Script ' + GetPiece(Text,' ',1) + ' not found.',Color);
end;

procedure AppOnIdle(Ticks: integer);

var
i, b : integer;
begin

  if Time >= 0 then begin
    Time := Time - 1;
  end;
 
  if Time = 0 then begin
    for b := 1 to 32 do Voted[b] := false;
  WriteConsole(0, 'Script-Vote failed', Color);
  end;
end;

:D

Offline daniel35

  • Major(1)
  • Posts: 19
Re: Script help
« Reply #15 on: February 07, 2011, 08:15:11 pm »
(I changed my vote to change) when I type! vote appears the id of the script file does not exist I do not know where the scripts for that poem to vote for someone knows where to put the scripts?
« Last Edit: February 07, 2011, 08:17:07 pm by daniel35 »

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: Script help
« Reply #16 on: February 08, 2011, 01:36:57 am »
Version I've uploaded in the earlier posts is wrong, I'll attach the correct version. (the one I posted earlier is missing some parts.)

The command is !change <script-name>, so if you playing Volley Ball and like to change to ZRPG, you've to type !change ZRPG to start the vote.

And, since theres are some people who want to use this script, I'll create a better one later this day, with a config.ini where you can set the scripts you like to use and just vote them with ID's then.

« Last Edit: February 08, 2011, 01:44:36 am by Stuffy »
The truth is out there? Does anyone know the URL?
The URL is here

Offline daniel35

  • Major(1)
  • Posts: 19
Re: Script help
« Reply #17 on: February 08, 2011, 08:01:04 am »
Version I've uploaded in the earlier posts is wrong, I'll attach the correct version. (the one I posted earlier is missing some parts.)

The command is !change <script-name>, so if you playing Volley Ball and like to change to ZRPG, you've to type !change ZRPG to start the vote.

And, since theres are some people who want to use this script, I'll create a better one later this day, with a config.ini where you can set the scripts you like to use and just vote them with ID's then.
You can enter a command that whoever / modes appears in the list of mods you have on serv?


From: February 08, 2011, 05:51:42 pm
There's not a better place to leave the scripts instead of being in the "scripts", you could not have created a folder within your script? For here the scripts are collapsing  :-X

From: February 08, 2011, 07:48:35 pm
I modified the script so that the mods are within the "vote-script" folder so that scripts do not collapse

was not so hard to change that:)
stuffy have a question: the command is necessary for people to vote in the mod? because when I type !f12 nothing happens
« Last Edit: February 08, 2011, 07:48:35 pm by daniel35 »