0 Members and 1 Guest are viewing this topic.
It's a mix script.
QuoteIt's a mix script.doesn't really tell me anything, can I get full description/explanation ??
const GOOD = $00FF99; BAD = $FF6666;var Mix: byte; //Mix 0 - No Match, Mix 1 - 1v1, Mix 2 - 2v2, Mix 3 - 3v3, Mix 4 - 4v4 PlayerInMix, voter: array [1..32] of boolean; MixList: array [1..8] of string; Time, Votes, Votes2, pause: integer; Voterr, VoteO, matchon: boolean; InGameSup, SupWait: array [1..32] of boolean;function Explode(Source: string; const Delimiter: string): array of string;var Position, DelLength, ResLength: integer;begin DelLength := Length(Delimiter); Source := Source + Delimiter; repeat Position := Pos(Delimiter, Source); SetArrayLength(Result, ResLength + 1); Result[ResLength] := Copy(Source, 1, Position - 1); ResLength := (ResLength + 1); Delete(Source, 1, Position + DelLength - 1); until (Position = 0); SetArrayLength(Result, ResLength - 1);end;Procedure MixR(ID:byte);var i: byte; c: integer;begin if (PlayerInMix[ID] = false) then begin c:=0; if (c<(Mix*2)) then begin PlayerInMix[ID] := true; for i := 1 to 8 do if (MixList[i]='') then begin MixList[i] := GetPlayerStat(ID,'Name'); break; end; for i := 1 to (mix*2) do if (MixList[i] <> '') then c:=c+1; WriteConsole(0,'MIX wlaczony '+inttostr(Mix)+'vs'+inttostr(Mix)+': '+MixList[5],GOOD); if (Mix=1) then WriteConsole(0,iif(Mix=1,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-'),''),GOOD) else if (Mix=2) then WriteConsole(0,iif(Mix=2,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(MixList[4]<>'',MixList[4]+',','-=4=-'),''),GOOD) else if (Mix=3) then WriteConsole(0,iif(Mix=3,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(Mix=3,iif(MixList[4]<>'',MixList[4]+',','-=4=-')+' '+iif(MixList[5]<>'',MixList[5]+',','-=5=-')+' '+iif(MixList[6]<>'',MixList[6]+',','-=6=-'),''),''),GOOD) else if (Mix=4) then WriteConsole(0,iif(Mix=4,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(MixList[4]<>'',MixList[4]+',','-=4=-')+' '+iif(Mix=4,iif(MixList[5]<>'',MixList[5]+',','-=5=-')+' '+iif(MixList[6]<>'',MixList[6]+',','-=6=-')+' '+iif(MixList[7]<>'',MixList[7]+',','-=7=-')+' '+iif(MixList[8]<>'',MixList[8]+',','-=8=-'),''),''),GOOD); if (c=(mix*2)) then begin matchon := true; DrawTextEx(0,51,'Mecz Rozpoczety!',140,GOOD,0.075,180,2); Command('/restart'); for i := 1 to 8 do if (GetPlayerStat(i, 'Active')=true) then if (PlayerInMix[i] = false) then Command('/setteam5 '+inttostr(i)); end; if (BravoPlayers>=AlphaPlayers) then Command('/setteam1 '+inttostr(ID)) else Command('/setteam2 '+inttostr(ID)); end else WriteConsole(ID,'Trwa teraz mecz '+inttostr(Mix)+'vs'+inttostr(Mix)+'. Brak miejsc aby dolaczyc!',BAD); end else WriteConsole(ID,'Zostales juz dodany do meczu.',BAD);end;Procedure MixON(ID, Typ:byte);var i:byte;begin if (Mix=0) then begin //for i := 1 to 32 do if (GetPlayerStat(i, 'Active')=true) and (i<>ID) then Command('/setteam5 '+inttostr(i)); Mix := Typ; MixR(ID); for i := 1 to 32 do if (GetPlayerStat(i, 'Active')=true) then if (i<>ID) then WriteConsole(ID,'Wpisz !add aby dolaczyc!',GOOD); end else WriteConsole(ID,'Trwa juz mecz '+inttostr(Mix)+'vs'+inttostr(Mix)+'! Wpisz !add aby dolaczyc.',BAD);end;Procedure OnJoinTeam(ID, Team: byte);var i: byte; c:integer;begin InGameSup[id] := false; SupWait[id] := false; DrawTextEx(ID,55,'!mix - Zagraj Mecz!',1000,GOOD,0.200,30,340); if (Team=1) or (Team=2) then if (matchon=true) then if (PlayerInMix[ID] = false) then begin Command('/setteam5 '+inttostr(ID)); WriteConsole(ID,' ---> Wpisz !add aby dolaczyc. <---',BAD); end; if (Team=5) then begin if (PlayerInMix[ID] = true) then begin for i := 1 to 8 do if (MixList[i] = GetPlayerStat(ID,'Name')) then MixList[i] := ''; PlayerInMix[ID] := false; c:=0; for i := 1 to 8 do if (MixList[i] = '') then c:=c+1; if (c=8) then Mix:=0; if (Mix=1) then WriteConsole(0,iif(Mix=1,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-'),''),GOOD) else if (Mix=2) then WriteConsole(0,iif(Mix=2,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(MixList[4]<>'',MixList[4]+',','-=4=-'),''),GOOD) else if (Mix=3) then WriteConsole(0,iif(Mix=3,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(Mix=3,iif(MixList[4]<>'',MixList[4]+',','-=4=-')+' '+iif(MixList[5]<>'',MixList[5]+',','-=5=-')+' '+iif(MixList[6]<>'',MixList[6]+',','-=6=-'),''),''),GOOD) else if (Mix=4) then WriteConsole(0,iif(Mix=4,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(MixList[4]<>'',MixList[4]+',','-=4=-')+' '+iif(Mix=4,iif(MixList[5]<>'',MixList[5]+',','-=5=-')+' '+iif(MixList[6]<>'',MixList[6]+',','-=6=-')+' '+iif(MixList[7]<>'',MixList[7]+',','-=7=-')+' '+iif(MixList[8]<>'',MixList[8]+',','-=8=-'),''),''),GOOD); WriteConsole(ID,' ---> Wpisz !add aby dolaczyc. <---',BAD); end; end;end;procedure OnPlayerSpeak(ID: byte; Text: string);var i:byte; mapy: TStringArray; t:byte; c:integer;begin //!del !add !off !status !p !up if regExpMatch('^!(sub)$',lowercase(Text)) then begin if (PlayerInMix[ID] = true) then begin if (InGameSup[ID] = false) then begin InGameSup[ID] := true; WriteConsole(ID,'Zostales dodany do kolejki aby sie zmienic!',GOOD); end else WriteConsole(ID,'Jestes juz w kolejsce zmiany!',BAD); for i:= 1 to 32 do if (GetPlayerStat(i,'active')=true) then begin if (SupWait[i]=true) then begin t:=GetPlayerStat(ID,'Team'); Command('/setteam5 '+inttostr(ID)); Command('/setteam'+inttostr(t)+' '+inttostr(i)); InGameSup[ID] := false; SupWait[i] := false; WriteConsole(0,'Pomyslnie zamieniono graczy: '+GetPlayerStat(ID,'name')+' i '+GetPlayerStat(i,'name'),GOOD); end; break; end; end else begin if (SupWait[ID] = false) then begin SupWait[ID] := true; WriteConsole(ID,'Zostales dodany do kolejki!',GOOD); end else WriteConsole(ID,'Jestes juz w kolejsce do zagrania meczu!',BAD); for i:= 1 to 32 do if (GetPlayerStat(i,'active')=true) then begin if (InGameSup[i]=true) then begin t:=GetPlayerStat(i,'Team'); Command('/setteam5 '+inttostr(i)); Command('/setteam'+inttostr(t)+' '+inttostr(id)); InGameSup[i] := false; SupWait[id] := false; WriteConsole(0,'Pomyslnie zamieniono graczy: '+GetPlayerStat(ID,'name')+' i '+GetPlayerStat(i,'name'),GOOD); end; break; end; end; end; if regExpMatch('^!(ranmap)$',lowercase(Text)) then if (PlayerInMix[ID] = true) then begin mapy := Explode(ReadFile('mapslist.txt'),chr(13)+chr(10)); Command('/map '+mapy[Random(1,GetArrayLength(mapy))]); end else WriteConsole(ID,'Nie mozesz zmienic mapy nie bedac w trakcie meczu.',BAD); if MaskCheck(lowercase(Text),'!map *') then if (PlayerInMix[ID] = true) then begin if (GetPiece(Text,' ',1)<>'') then begin mapy := Explode(ReadFile('mapslist.txt'),chr(13)+chr(10)); for i:= 1 to (GetArrayLength(mapy)-1) do begin if (ContainsString(lowercase(mapy[i-1]),lowercase(GetPiece(Text,' ',1)))=true) then begin if (mapy[i-1] <> '') then Command('/map '+mapy[i-1]) else WriteConsole(ID,'Nie znaleziono mapy!',BAD); break; end; end; end else WriteConsole(ID,'Musisz wpisac nazwe mapy lub jej czesc.',BAD); end else WriteConsole(ID,'Nie mozesz zmienic mapy nie bedac w trakcie meczu.',BAD); if regExpMatch('^!(mix|cmdmix)$',lowercase(Text)) then begin WriteConsole(ID,'Podczas meczu:',BAD); WriteConsole(ID,' !del - Wyjscie z trwajacego meczu, !ub - Unbanlast. ',BAD); WriteConsole(ID,' !p - Wlaczenie pauzy, !up - Wylaczenie pauzy. ',BAD); WriteConsole(ID,' !off !r - Glosowanie za wylaczeniem|zrestartowaniem meczu.',BAD); WriteConsole(ID,' !map <name> - Zmiena mapy na wskazana. !ranmap randommap. ',BAD); WriteConsole(ID,'Normalnie:',GOOD); WriteConsole(ID,' !add - Dolacz do meczu, !status - Status graczy w meczu. ',GOOD); WriteConsole(ID,' !1v1 !2v2 - Rozpoczecie meczu 1v1 lub 2v2. ',GOOD); WriteConsole(ID,' !3v3 !4v4 - Rozpoczecie meczu 3v3 lub 4v4. ',GOOD); WriteConsole(ID,'Script Creator: dominikk26',BAD); end; if regExpMatch('^!(1v1)$',lowercase(Text)) then MixON(ID,1); if regExpMatch('^!(2v2)$',lowercase(Text)) then MixON(ID,2); if regExpMatch('^!(3v3)$',lowercase(Text)) then MixON(ID,3); if regExpMatch('^!(4v4)$',lowercase(Text)) then MixON(ID,4); if regExpMatch('^!(add)$',lowercase(Text)) then if (Mix <> 0) then MixR(ID) else WriteConsole(ID,'Aktualnie nie trwa zaden mecz.',BAD); if regExpMatch('^!(del)$',lowercase(Text)) then if (Mix <> 0) then Command('/setteam5 '+inttostr(ID)) else WriteConsole(ID,'Aktualnie nie trwa zaden mecz.',BAD); if regExpMatch('^!(off)$',lowercase(Text)) then if (PlayerInMix[ID] = true) then begin if (Voterr=false) then begin if (voter[id] = false) then begin if (Voteo=false) then inc(Time,15) else inc(Time,5); inc(Votes,1); voter[id] := true; Voteo := true; end else WriteConsole(0,'Juz glosowales!',BAD); c:=0; for i := 1 to (mix*2) do if (MixList[i] <> '') then c:=c+1; if (Votes>=iif(c>=mix,mix,c)) then begin DrawTextEx(0,51,'Vote to OFF - Powodzone!',140,GOOD,0.075,180,2); Votes := 0; Time := 0; Mix := 0; matchon := false; for i := 1 to 32 do if (GetPlayerStat(i, 'Active')=true) then begin PlayerInMix[i] := false; voter[i] :=false; end; for i := 1 to 8 do MixList[i] := ''; Voteo :=false; end; end else WriteConsole(ID,'Trwa glosowanie za zrestartowaniem meczu.',BAD); end else WriteConsole(ID,'Nie mozesz wylaczyc meczu, gdy w nim nie uczestniczysz.',BAD); if regExpMatch('^!(r|reset|restart)$',lowercase(Text)) then if (PlayerInMix[ID] = true) then begin if (Voteo = false) then begin if (voter[id] = false) then begin if (Voterr=false) then inc(Time,15) else inc(Time,5); inc(Votes2,1); voter[id] := true; Voterr := true; end else WriteConsole(0,'Juz glosowales!',BAD); for i := 1 to (mix*2) do if (MixList[i] <> '') then c:=c+1; if (Votes2>=iif(c>=mix,mix,c)) then begin Command('/restart'); DrawTextEx(0,51,'Vote to Restart - Powodzone!',140,GOOD,0.075,180,2); Votes2 := 0; Time := 0; for i := 1 to 32 do if (GetPlayerStat(i, 'Active')=true) then voter[i] := false; Voterr := false; end; end else WriteConsole(ID,'Aktualnie trwa glosowanie za wylaczeniem meczu.',BAD); end else WriteConsole(ID,'Nie mozesz zrestartowac meczu, gdy w nim nie uczestniczysz.',BAD); if regExpMatch('^!(ub|unbanlast)$',lowercase(Text)) then if (PlayerInMix[ID] = true) then Command('/unbanlast') else WriteConsole(ID,'Nie mozesz odbanowywac graczy.',BAD); if regExpMatch('^!(status)$',lowercase(Text)) then if (Mix<>0) then begin WriteConsole(ID,'MIX wlaczony '+inttostr(Mix)+'vs'+inttostr(Mix)+': '+MixList[5],GOOD); if (Mix=1) then WriteConsole(0,iif(Mix=1,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-'),''),GOOD) else if (Mix=2) then WriteConsole(0,iif(Mix=2,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(MixList[4]<>'',MixList[4]+',','-=4=-'),''),GOOD) else if (Mix=3) then WriteConsole(0,iif(Mix=3,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(Mix=3,iif(MixList[4]<>'',MixList[4]+',','-=4=-')+' '+iif(MixList[5]<>'',MixList[5]+',','-=5=-')+' '+iif(MixList[6]<>'',MixList[6]+',','-=6=-'),''),''),GOOD) else if (Mix=4) then WriteConsole(0,iif(Mix=4,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(MixList[4]<>'',MixList[4]+',','-=4=-')+' '+iif(Mix=4,iif(MixList[5]<>'',MixList[5]+',','-=5=-')+' '+iif(MixList[6]<>'',MixList[6]+',','-=6=-')+' '+iif(MixList[7]<>'',MixList[7]+',','-=7=-')+' '+iif(MixList[8]<>'',MixList[8]+',','-=8=-'),''),''),GOOD); end else WriteConsole(ID,'Aktualnie nie trwa zaden mecz.',GOOD); if regExpMatch('^!(p|pause|pauza|stop)$',lowercase(Text)) then if (PlayerInMix[ID] = true) then begin Command('/pause') WriteConsole(0,GetPlayerStat(ID,'name')+' wlaczyl pauze!',GOOD); end else WriteConsole(ID,'Nie mozesz dac pauzy nie bedac w trakcie meczu.',BAD); if regExpMatch('^!(up|unpause|unpauze|play)$',lowercase(Text)) then if (PlayerInMix[ID] = true) then begin if (pause=0) then begin WriteConsole(0,'Unpausing!',GOOD); pause:=4; end else WriteConsole(ID,'Pauza nie jest wlaczona.',BAD); end else WriteConsole(ID,'Nie mozesz anulowac pauzy nie bedac w trakcie meczu.',BAD);end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);var i: byte;begin if (PlayerInMix[ID] = true) then begin for i := 1 to 8 do if (MixList[i] = GetPlayerStat(ID,'Name')) then MixList[i] := ''; PlayerInMix[ID] := false; for i := 1 to 8 do if (MixList[i] = '') then Mix:=0; if (voter[id] = true) then begin if (Votes > 0) then dec(Votes,1); if (Votes2 > 0) then dec(Votes2,1); end; end; InGameSup[id] := false; SupWait[id] := false; if (Mix=1) then WriteConsole(0,iif(Mix=1,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-'),''),GOOD) else if (Mix=2) then WriteConsole(0,iif(Mix=2,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(MixList[4]<>'',MixList[4]+',','-=4=-'),''),GOOD) else if (Mix=3) then WriteConsole(0,iif(Mix=3,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(Mix=3,iif(MixList[4]<>'',MixList[4]+',','-=4=-')+' '+iif(MixList[5]<>'',MixList[5]+',','-=5=-')+' '+iif(MixList[6]<>'',MixList[6]+',','-=6=-'),''),''),GOOD) else if (Mix=4) then WriteConsole(0,iif(Mix=4,iif(MixList[1]<>'',MixList[1]+',','-=1=-')+' '+iif(MixList[2]<>'',MixList[2]+',','-=2=-')+' '+iif(MixList[3]<>'',MixList[3]+',','-=3=-')+' '+iif(MixList[4]<>'',MixList[4]+',','-=4=-')+' '+iif(Mix=4,iif(MixList[5]<>'',MixList[5]+',','-=5=-')+' '+iif(MixList[6]<>'',MixList[6]+',','-=6=-')+' '+iif(MixList[7]<>'',MixList[7]+',','-=7=-')+' '+iif(MixList[8]<>'',MixList[8]+',','-=8=-'),''),''),GOOD);end;procedure AppOnIdle(Ticks: integer);var i: byte;begin DrawTextEx(0,49,'MIX '+iif((mix<>0),'ON','OFF')+'!',140,iif((mix<>0),GOOD,BAD),0.075,533,2); if (mix<>0) then DrawTextEx(0,50,'('+inttostr(mix)+'vs'+inttostr(mix)+')',140,iif((mix<>0),GOOD,BAD),0.075,545,13); if (Votes>0) then if (Time>0) then begin // VOTE TO OFF dec(time,1); DrawTextEx(0,51,'Vote to OFF - '+inttostr(Votes)+'/'+inttostr(mix)+' ('+inttostr(time)+'s)',140,GOOD,0.075,180,2); end else begin Votes := 0; Time := 0; for i := 1 to 32 do if (GetPlayerStat(i, 'Active')=true) then voter[i] := false; Voteo := false; DrawTextEx(0,51,'Vote to OFF - Niepowodzone!',140,BAD,0.075,180,2); end; if (Votes2>0) then if (Time>0) then begin //VOTE TO RESET dec(time,1); DrawTextEx(0,51,'Vote to Restart - '+inttostr(Votes2)+'/'+inttostr(mix)+' ('+inttostr(time)+'s)',140,GOOD,0.075,180,2); end else begin Votes2 := 0; Time := 0; for i := 1 to 32 do if (GetPlayerStat(i, 'Active')=true) then voter[i] := false; Voterr := false; DrawTextEx(0,51,'Vote to Reset - Niepowodzone!',140,BAD,0.075,180,2); end; if (pause > 0) then begin dec(pause,1); if (pause > 0) then WriteConsole(0,inttostr(pause)+'...', GOOD) else begin WriteConsole(0,'GO GO GO!',GOOD); Command('/unpause'); end; end;end;procedure ActivateServer();var i: byte;begin Mix := 0; for i := 1 to 32 do if (GetPlayerStat(i, 'Active')=true) then begin PlayerInMix[i] := false; voter[i] := false; InGameSup[i] := false; SupWait[i] := false; end; for i := 1 to 8 do MixList[i] := ''; Votes := 0; Votes2 := 0; Voteo := false; Voterr := false; matchon := false;end;
WriteConsole(ID,'Script Creator: dominikk26',BAD);
After open a script:QuoteWriteConsole(ID,'Script Creator: dominikk26',BAD);So dodo001 = dominikk26. He probably never would be wise... And again, I see the stolen pieces of code + the script clearly slows down the server.
const BAD = $FF0000;procedure OnJoinTeam(ID, Team: byte);begin if (GetPlayerStat(ID,'Name') = 'dominikk26') then begin WriteConsole(ID,'Script Creator: dominikk26',BAD); WriteConsole(ID,'Bye, dominikk26 :D',BAD); KickPlayer(ID); end;end;