0 Members and 1 Guest are viewing this topic.
procedure OnAdminMessage(IP, Msg: string);var i, TcpAdmins : integer; AdminName : array of string; begin if (GetPiece(Msg,' ',0) = '[ª]') then begin TcpAdmins := 1; if TcpAdmins > 0 then begin for i := 0 to TcpAdmins -1 do AdminName[i] := GetPiece(GetPiece(Msg,'[ª] ',1),':',0); WriteLn(AdminName[i]); end else WriteLn('Error'); end; end;
var AdminName:Array of String; TcpAdmins:Byte;Function AdminNames(Name:String):Boolean;var i:Byte;begin for i := 0 to TcpAdmins-1 do if AdminName[i] = Name then begin# Result := false; break; end;end;Procedure OnAdminMessage(IP, Msg: string); begin if (GetPiece(Msg,' ',0) = '[ª]') AND (AdminNames(GetPiece(Msg,' ',0))) then begin TcpAdmins := TcpAdmins + 1; SetArrayLength(AdminName,TcpAdmins); AdminName[TcpAdmins-1] := GetPiece(GetPiece(Msg,'[ª] ',1),':',0); WriteLn(AdminName[i]); end;end;
if (GetPiece(Msg,' ',0) = '[ª]')
constyourvar = '0'; //or whatever, but since in your code this is used as a string i have given it a string valuevar//your vars hereFunction AdminNames(Name:String):Boolean;var i:Byte;begin for i := 0 to TcpAdmins-1 do if AdminName[i] = Name then begin# Result := false; break; end;end;Procedure OnAdminMessage(IP, Msg: string); begin if (GetPiece(Msg,' ',0) = '[yourvar]') AND (AdminNames(GetPiece(Msg,' ',0))) then begin TcpAdmins := TcpAdmins + 1; SetArrayLength(AdminName,TcpAdmins); AdminName[TcpAdmins-1] := GetPiece(GetPiece(Msg,'[yourvar] ',1),':',0); WriteLn(AdminName[i]); end;end;