Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- Color = $FFD700;
- var
- Enable: boolean;
- BravoMaps: tstringarray;
- Warnings : array[1..32] of integer;
- //Split by DorkeyDear aka Curt
- function Split(const Source: string; const Delimiter: string): tstringarray;
- var
- i,x,d: integer;
- s: string;
- 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;
- procedure ActivateServer();
- begin
- Enable := true;
- BravoMaps := Split(LowerCase(ReadFile('scripts/MoveTeam/bravomaps.txt'))),Chr(13); + Chr(10));
- end;
- procedure OnJoinGame(ID, Team: byte);
- var
- i: integer;
- begin
- for i := 0 to ArrayHigh(BravoMaps) do if LowerCase(BravoMaps[i]) = LowerCase(CurrentMap) then begin
- WriteConsole(ID, 'Bu bir bravo map, bravo olabilirsiniz.',Color);
- DrawText(ID,'Bur bir bravo map,' + #13#10 + 'bravo olabilirsiniz.',330,Color,0.09,20,370);
- end;
- end;
- procedure OnLeaveGame(ID, Team: byte;Kicked: boolean);
- begin
- Warnings[ID] := 0;
- end;
- procedure DisableBravo;
- begin
- Enable := true;
- end;
- procedure EnableBravo;
- begin
- Enable := false;
- end;
- procedure OnMapChange(NewMap: String);
- var
- i,b : integer;
- begin
- for b := 1 to 32 do if GetPlayerStat(b,'Team') = 2 then Command('/setteam1 ' + IntToStr(b));
- for i := 0 to ArrayHigh(BravoMaps) do if LowerCase(BravoMaps[i]) = LowerCase(NewMap) then begin
- WriteConsole(0, 'Bu bir bravo map, bravo olabilirsiniz.',Color);
- DrawText(0,'Bu bir bravo map,' + #13#10 + 'bravo olabilirsiniz.',330,Color,0.09,20,370);
- EnableBravo;
- end;
- end;
- procedure OnJoinTeam(ID, Team: byte);
- var
- i: integer;
- begin
- for i := 0 to ArrayHigh(BravoMaps) do if LowerCase(BravoMaps[i]) = LowerCase(CurrentMap) then begin
- Enable := false;
- end;
- begin
- if (Team <> 1) and (Team <> 5) then begin
- if Enable = true then begin
- Command('/setteam1 ' + IntToStr(ID));
- WriteConsole(ID, 'Bravoya girme!',Color);
- Warnings[ID] := Warnings[ID] + 1
- WriteConsole(ID, 'Spam engellemek icin, yalnizca 4 defa takim degisebilirsiniz.! ' + IntToStr(Warnings[ID]) + '/4',Color);
- if Warnings[ID] = 4 then
- KickPlayer(ID);
- if Warnings[ID] = 4 then
- Warnings[ID] := 0;
- end
- else
- if (Team <> 1) and (Team <> 5) then begin
- if Enable = false then begin
- WriteConsole(ID, 'Bravo oldun kotuye kullanma!',Color);
- end;
- end;
- end;
- end;
- end;
- function OnCommand(ID: Byte; Text: string): boolean;
- var
- b : byte;
- begin
- if Text = '/kapali' then begin
- DisableBravo;
- WriteConsole(0, 'Bravo girisleri kapatildi.',Color);
- for b := 1 to 32 do if GetPlayerStat(b,'Team') = 2 then Command('/setteam1 ' + IntToStr(b));
- end
- else
- if Text = '/aktif' then begin
- EnableBravo;
- WriteConsole(0, 'Bravo girisleri acildi!',Color);
- end;
- begin
- if Text = '/bmapharita' then begin
- BravoMaps := Split(LowerCase(ReadFile('scripts/MoveTeam/bravomaps.OnCommand')),Chr(13) + Chr(10));
- WriteConsole(ID, 'Bravo haritalari yuklendi!',Color);
- end;
- begin
- if Copy(lowercase(Text),0,8) = '/ekleb' then begin
- if WriteLnFile('scripts/MoveTeam/bravomaps.txt',Copy(Text,10,length(Text))) then
- WriteConsole(ID, Copy(Text,11,length(Text)) + 'bravo haritalarina eklendi',Color);
- BravoMaps := Split(LowerCase(ReadFile('scripts/MoveTeam/bravomaps.txt')),Chr(13) + Chr(10));
- end else
- if Text = '/eklecb' then begin
- WriteLnFile('scripts/MoveTeam/bravomaps.txt','' + CurrentMap);
- WriteConsole(ID, CurrentMap + ' bravo haritalarina eklendi',Color);
- BravoMaps := Split(LowerCase(ReadFile('scripts/MoveTeam/bravomaps.txt')),Chr(13) + Chr(10));
- end;
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement