Author Topic: Problem with script multimod  (Read 1154 times)

0 Members and 1 Guest are viewing this topic.

Offline daniel35

  • Major(1)
  • Posts: 19
Problem with script multimod
« on: February 09, 2011, 10:15:11 am »
I downloaded a script multimode stuffy, so far so good,
When I put the script to vote I do not know what word to vote for the script
! f12 or / true, it works

Please Help!  :'(

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: Problem with script multimod
« Reply #1 on: February 09, 2011, 01:18:46 pm »
« Last Edit: February 10, 2011, 01:36:10 am by Stuffy »
The truth is out there? Does anyone know the URL?
The URL is here

Offline thegrandmaster

  • Flagrunner
  • ****
  • Posts: 543
    • Grandy on Steam
Re: Problem with script multimod
« Reply #2 on: February 09, 2011, 04:55:56 pm »
link broken. remove the "" and the http:// from your link.
ohgodwhydidInamemyselfthis. Just call me Grandy.

Offline daniel35

  • Major(1)
  • Posts: 19
Re: Problem with script multimod
« Reply #3 on: February 10, 2011, 05:33:59 pm »
The ta script like this:
Quote
const
   Color = $E56600;
   VoteTime = 60;
   AddTime = 15;
   VotePerc = 65;

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/script-vote/' + ScriptName + '/Includes.txt') then begin
     exit;
  end;
  Index := ReadFile('scripts/script-vote/' + ScriptName + '/Includes.txt');
    SIndex := Copy(Index,0,length(Index));
     rec := false;
       if (State) and (Copy(Index,0,2) = '//') then begin
         WriteFile('scripts/script-vote/' + ScriptName + '/Includes.txt',Copy(Index,3,length(Index)));
          rec := true;
       end else if not (State) and (Copy(Index,0,2) <> '//') then begin
         WriteFile('scripts/script-vote/' + ScriptName + '/Includes.txt','//' + 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('/recompile ' + ScriptName);
       end else if not rec then exit;
end;

function GetScriptState(const ScriptName : string): boolean;

var
   Index : string;
   
begin

  if FileExists('scripts/script-vote/' + ScriptName + '/Includes.txt') then begin
    Index := ReadFile('scripts/' + ScriptName + '/Includes.txt');
     if Copy(Index,0,2) = '//' 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/script-vote/' + 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 := false;
  WriteConsole(0, 'Script-Vote failed', Color);
  end;
end;

is missing something?
« Last Edit: February 10, 2011, 05:36:01 pm by daniel35 »

Offline mascarado

  • Major(1)
  • Posts: 16
Re: Problem with script multimod
« Reply #4 on: February 26, 2011, 07:51:37 am »
Author: Kowalski  ~ BR ~
Date: February 7, 2011.
Description: Script for servers that use multi-modes, supporting up to six different modes.
Server version: 2.6.5

Commands for Players
!m /!md /!modes: Shows the list of modes enabled on the server.
!vote [ID]: Starts a vote for any mode according to the ID entered.
!f12: To vote in any vote.

Admin Commands
/onvote: Active Votes.
/offvote: Disables the votes.
/mode [1-6]: Switches to the mode chosen according to the ID. [1-6]
/Cancelar: Cancel the vote that is in progress.

How to Install
1 - Unzip the zip file in the folder of your server.
2 - Open the folder "confmodes", set up each file according to the mode.
Ex: If you want the ID is an HNS mode, then open the files with the number 1 (mapas1, conf1, armas1) and configure them according to the mode. If you do not use all six modes, no need to configure the remaining immortals.
3 - Open the folder "scripts\VoteMode.
4 - Open the file VoteMode.pas. (I recommend the use of the Programme NotePad + + for editing this file type)
5 Edit the constants in the beginning of the file, according to the modes of your server. (! ATTENTION!)
6 - Save the file.
7 - Open of the server. (Critically important to the operation)  ::)

Part of the script being edited:

Code: [Select]
{              ... HOME OF THE CONSTANT ...
        FILL ALL THE CONSTANT VERY CAREFULLY!
      Always keep the 'single quotes' WHERE APPROPRIATE.
    AND READ ALL INFORMATION CONTAINED ON THE RIGHT TO CONSTANT.  }
const
NomeServidor = 'Kowalsky - Multi Modes.';     // Name Your server.
MaxM = 6;                      //   Choose Max Modes your server. (1 - 6)
Script1 = 'script1.pas';               // Name of Script 1 mode. Ex: Arquivo1.pas
Script2 = 'script2.pas';               // Name of Script 2 mode. Ex: Arquivo2.pas
Script3 = 'script3.pas';               // Name of Script 3 mode. Ex: Arquivo3.pas
Script4 = 'script4.pas';               // Name of Script 4 mode. Ex: Arquivo4.pas
Script5 = 'script5.pas';               // Name of Script 5 mode. Ex: Arquivo5.pas
Script6 = 'script6.pas';               // Name of Script 6 mode. Ex: Arquivo6.pas
Pasta1 = 'Pasta_Mode1';          //Paste the 1st script.
Pasta2 = 'Pasta_Mode2';          //Paste the 2st script.
Pasta3 = 'Pasta_Mode3';          //Paste the 3st script.
Pasta4 = 'Pasta_Mode4';          //Paste the 4st script.
Pasta5 = 'Pasta_Mode5';          //Paste the 5st script.
Pasta6 = 'Pasta_Mode6';          //Paste the 5st script.
Mode1 = 'Mode 1';                    // Name of Mode ID 1. Ex: Hide'N'Seek.
Mode2 = 'Mode 2';                    // Name of Mode ID 2. Ex: Knife Voley.
Mode3 = 'Mode 3';                    // Name of Mode ID 3. Ex: Zrpg.
Mode4 = 'Mode 4';                    // Name of Mode ID 4. Ex: Climb.
Mode5 = 'Mode 5';                    // Name of Mode ID 5. Ex: M79 Climb.
Mode6 = 'Mode 6';                    // Name of Mode ID 6. Ex: Mission Mod.
Cor = $FFFFFF;                 // Default color of the posts is WHITE         
Tempomax = 80;                 // Time limit for a vote to stayativa. (in seconds)
PercentualN = 75;              // Max Vote Percent
ModeP = 1;                     // Default Mode when the server starts.
Desativar = '//';       // Do not lock here!
CorS = $FFFBDA22;   
{             ...END OF CONSTANT...     

and so do you translate the script for their language

Download:
http://www.megaupload.com/?d=AWC1M44T Portuguese Site

Download:
http://www.mediafire.com/?d83ond36dhyohqv English Site

Any Doubt, Send me MP

« Last Edit: February 26, 2011, 08:29:03 am by mascarado »