0 Members and 3 Guests are viewing this topic.
saykillkickpasswordsetteammaprestartpauseunpausegmuteungmute
And if the first person that joins is an idiot he will screw up your server...
what program do you use for the scripts?
CrossFunc([ID, MasterCmds], 'SCRIPTNAME.OnCommand');
For those who want this to work with other scripts with custom commands, do this:1. open Master.pas file2. do "find" and find "Break;"3. on the line BEFORE THIS LINE, add this:QuoteCrossFunc([ID, MasterCmds], 'SCRIPTNAME.OnCommand');where as "SCRIPTNAME" is the name of the folder that the script is in..if u want it to work with more than 1 script, juts add the exact same thing under this... but with a different SCRIPTNAME.
const AutoMaster = false; Color = $0000FF;var Master: byte; MasterCmds: tstringarray;function Split(const Source: string; const Delimiter: string): tstringarray;var i,x,d: integer; s: string;begin if Source <> '' then begin  d := Length(Delimiter);  x := 0;  i := 1;  SetArrayLength(Result,1);  while i <= Length(source) do begin   s := Copy(Source,i,d);   if s = Delimiter then begin    Inc(i,d);    Inc(x,1);    SetArrayLength(result,x + 1);   end else begin    Result := Result + Copy(s,1,1);    Inc(i,1);   end;  end; end else SetArrayLength(Result,0);end;procedure ActivateServer();begin MasterCmds := Split(ReadFile('scripts/Master/Commands.txt'),Chr(13) + Chr(10));end;function OnCommand(ID: Byte; Text: string): boolean;var i: integer;begin Result := false; if Text = '/loadmasterfile' then MasterCmds := Split(ReadFile('scripts/Master/Commands.txt'),Chr(13) + Chr(10)); if Master = ID then for i := 0 to ArrayHigh(MasterCmds) - 1 do if MasterCmds = Copy(Text,2,Length(MasterCmds)) then Result := true;end;function OnPlayerCommand(ID: Byte; Text: string): boolean;var i: integer;begin if Master = 0 then begin  if (ID <> 255) and (LowerCase(Text) = '/master') then if Master = 0 then begin   Master := ID;   WriteConsole(0,GetPlayerStat(ID,'Name') + ' VIP zaktualizowany!.',Color);  end else WriteConsole(ID,'Master has already been claimed by ' + GetPlayerStat(Master,'Name') + '.',Color); end else if Master = ID then for i := 0 to ArrayHigh(MasterCmds) - 1 do if MasterCmds = Copy(Text,2,Length(MasterCmds)) then begin  Command(Text);  if Text <> '/loadmasterfile' then OnCommand(ID,Text);  CrossFunc([ID, MasterCmds], 'InfiPred.OnCommand'); Break; end;end;procedure OnJoinGame(ID, Team: byte);begin if (AutoMaster) and (Master = 0) then OnPlayerCommand(ID,'/master');end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin if ID = Master then Master := 0;end;
const AutoMaster = false; Color = $FFFFFF;var Master: byte; MasterCmds: tstringarray;function Split(const Source: string; const Delimiter: string): tstringarray;var i,x,d: integer; s: string;begin if Source <> '' then begin  d := Length(Delimiter);  x := 0;  i := 1;  SetArrayLength(Result,1);  while i <= Length(source) do begin   s := Copy(Source,i,d);   if s = Delimiter then begin    Inc(i,d);    Inc(x,1);    SetArrayLength(result,x + 1);   end else begin    Result[x] := Result[x] + Copy(s,1,1);    Inc(i,1);   end;  end; end else SetArrayLength(Result,0);end;procedure ActivateServer();begin MasterCmds := Split(ReadFile('scripts/Master/Commands.txt'),Chr(13) + Chr(10));end;function OnCommand(ID: Byte; Text: string): boolean;var i: integer;begin Result := false; if Text = '/loadmasterfile' then MasterCmds := Split(ReadFile('scripts/Master/Commands.txt'),Chr(13) + Chr(10)); if Master = ID then for i := 0 to ArrayHigh(MasterCmds) - 1 do if MasterCmds[i] = Copy(Text,2,Length(MasterCmds[i])) then Result := true;end;function OnPlayerCommand(ID: Byte; Text: string): boolean;var i: integer;begin if Master = 0 then begin  if (ID <> 255) and (LowerCase(Text) = '/master') then if Master = 0 then begin   Master := ID;   WriteConsole(0,GetPlayerStat(ID,'Name') + ' has claimed master for the server.',Color);  end else WriteConsole(ID,'Master has already been claimed by ' + GetPlayerStat(Master,'Name') + '.',Color); end else if Master = ID then for i := 0 to ArrayHigh(MasterCmds) - 1 do if MasterCmds[i] = Copy(Text,2,Length(MasterCmds[i])) then begin  Command(Text);  if Text <> '/loadmasterfile' then OnCommand(ID,Text);  CrossFunc([ID, MasterCmds[i]], 'InfiPred.OnCommand');  Break; end;end;procedure OnJoinGame(ID, Team: byte);begin if (AutoMaster) and (Master = 0) then OnPlayerCommand(ID,'/master');end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin if ID = Master then Master := 0;end;