0 Members and 1 Guest are viewing this topic.
function isBanned(shirtColor:string; pantsColor:string): Boolean;varc: integer;shirtList: TStringList;pantsList: TStringList;beginshirtList := File.CreateStringListFromFile('antiSkin/shirt.txt');pantsList := File.CreateStringListFromFile('antiSkin/pants.txt'); for c := 0 to shirtList.count do begin if ((shirtColor = shirtList[c]) and (pantsColor = pantsList[c])) then begin result:=true; break; end else begin result:=false; end; end;end;
Thank you!I think in color range but not sure how to implement that, maybe in future versions.Greetings!
{* Unit antiSkin* Version: 1* Server version: 2.8.1* Script Core v.: 3* Creation date: 22.02.2019* Written by SaTaNiC}const BigTextLayer = 5; UseLowerCase = true;function isBanned(shirtColor:string; pantsColor:string): Boolean;var i: integer; shirtList, pantsList: TStringList;begin result := false; shirtList := File.CreateStringListFromFile('antiSkin/shirt.txt'); pantsList := File.CreateStringListFromFile('antiSkin/pants.txt'); for i := 0 to shirtList.count-1 do if (shirtColor = shirtList[i]) and (pantsColor = pantsList[i]) then begin result := true; break; end; shirtList.Free; pantsList.Free;end;procedure JoinTeam(Player: TActivePlayer; Team: TTeam);begin if (isBanned(IntToStr(Player.ShirtColor), IntToStr(Player.PantsColor))) then begin Player.BigText(BigTextLayer,'Por favor cambia tu skin',500,$FF0000,0.20,20,200); if Player.Team <> 5 then Player.Team := 5; WriteLn('[*] antiSkin-> ID:' + IntToStr(Player.ID) + ' NICK:' + Player.Name + ' Shirt:' + IntToStr(Player.ShirtColor) + ' Pants:' + IntToStr(Player.PantsColor) + ' esta baneado'); end else WriteLn('[*] antiSkin-> ID:' + IntToStr(Player.ID) + ' NICK:' + Player.Name + ' Shirt:' + IntToStr(Player.ShirtColor) + ' Pants:' + IntToStr(Player.PantsColor) + ' entro');end;function OnCommandAntiSkin(Player: TActivePlayer; Command: string): Boolean;var i: byte; TempName: string;begin result:=false; if lowercase(copy(Command, 1, 9)) = '/antiskin' then begin if UseLowerCase=true then TempName := lowercase(copy(Command, 11, 24)) else TempName := copy(Command, 11, 24); for i := 1 to Game.MaxPlayers do if Players[i].Active then begin if lowercase(Players[i].Name) = TempName then begin if not (isBanned(IntToStr(Players[i].ShirtColor), IntToStr(Players[i].PantsColor))) then begin WriteLnFile('antiSkin/shirt.txt', IntToStr(Players[i].ShirtColor)); WriteLnFile('antiSkin/pants.txt', IntToStr(Players[i].PantsColor)); WriteLn('[*] antiSkin-> '+Player.Name+' ha baneado el skin de '+Players[i].Name); Player.Tell('[*] antiSkin-> '+Players[i].Name+' skin baneado'); Players[i].BigText(BigTextLayer,'Tu skin ha sido baneado',500,$FF0000,0.20,20,200); if Player.Team <> 5 then Players[i].Team := 5; end else Player.Tell('[*] antiSkin-> '+Players[i].Name+' skin ya estaba baneado'); Exit; end; end; Player.Tell('[*] antiSkin-> Error, intenta nuevamente'); end;end;var i: byte;begin for i := 1 to Game.MaxPlayers do Players[i].OnCommand := @OnCommandAntiSkin; for i := 0 to 5 do Game.Teams[i].OnJoin := @JoinTeam;end.
{* Unit antiSkin* Version: 1.0.1* Server version: 2.8.1* Script Core v.: 3* Creation date: 07.03.2019* Written by SaTaNiC set by Dominik}const BigTextLayer = 5; UseLowerCase = true; PlusShirtColor = 10; MiniusShirtColor = 10; PlusPantsColor = 10; MiniusPantsColor = 10; var i: byte;function isBanned(shirtColor, pantsColor:longint): Boolean;var i: integer; shirtList, pantsList: TStringList;begin result := false; shirtList := File.CreateStringListFromFile('antiSkin/shirt.txt'); pantsList := File.CreateStringListFromFile('antiSkin/pants.txt'); for i := 0 to shirtList.count-1 do if (shirtColor >= (strtoint(shirtList[i])-MiniusShirtColor)) and (shirtColor <= (strtoint(shirtList[i])+PlusShirtColor)) and (pantsColor >= (strtoint(pantsList[i])-MiniusPantsColor)) and (pantsColor <= (strtoint(pantsList[i])+PlusPantsColor)) then begin result := true; break; end; shirtList.Free; pantsList.Free;end;procedure JoinTeam(Player: TActivePlayer; Team: TTeam);begin if (isBanned(Player.ShirtColor, Player.PantsColor)) then begin Player.BigText(BigTextLayer,'Por favor cambia tu skin',500,$FF0000,0.20,20,200); if Player.Team <> 5 then Player.Team := 5; WriteLn('[*] antiSkin-> ID:' + IntToStr(Player.ID) + ' NICK:' + Player.Name + ' Shirt:' + IntToStr(Player.ShirtColor) + ' Pants:' + IntToStr(Player.PantsColor) + ' esta baneado'); end else WriteLn('[*] antiSkin-> ID:' + IntToStr(Player.ID) + ' NICK:' + Player.Name + ' Shirt:' + IntToStr(Player.ShirtColor) + ' Pants:' + IntToStr(Player.PantsColor) + ' entro');end;function OnCommandAntiSkin(Player: TActivePlayer; Command: string): Boolean;var i: byte; TempName: string;begin result:=false; if lowercase(copy(Command, 1, 9)) = '/antiskin' then begin if UseLowerCase=true then TempName := lowercase(copy(Command, 11, 24)) else TempName := copy(Command, 11, 24); for i := 1 to Game.MaxPlayers do if Players[i].Active then begin if lowercase(Players[i].Name) = TempName then begin if not (isBanned(Players[i].ShirtColor,Players[i].PantsColor)) then begin WriteLnFile('antiSkin/shirt.txt', IntToStr(Players[i].ShirtColor)); WriteLnFile('antiSkin/pants.txt', IntToStr(Players[i].PantsColor)); WriteLn('[*] antiSkin-> '+Player.Name+' ha baneado el skin de '+Players[i].Name); Player.Tell('[*] antiSkin-> '+Players[i].Name+' skin baneado'); Players[i].BigText(BigTextLayer,'Tu skin ha sido baneado',500,$FF0000,0.20,20,200); if Player.Team <> 5 then Players[i].Team := 5; end else Player.Tell('[*] antiSkin-> '+Players[i].Name+' skin ya estaba baneado'); Exit; end; end; Player.Tell('[*] antiSkin-> Error, intenta nuevamente'); end;end;begin for i := 1 to Game.MaxPlayers do Players[i].OnCommand := @OnCommandAntiSkin; for i := 0 to 5 do Game.Teams[i].OnJoin := @JoinTeam;end.