0 Members and 2 Guests are viewing this topic.
function OnPlayerCommand(ID: Byte; Text: string): boolean;var i: byte; Vips: TStringArray; Match: boolean;begin if GetPiece(Text,' ',0) = '/sayv' then begin SetArrayLength(Vips, 1); Vips:= xsplit(ReadFile('vips.txt'), #10 + #13); Match:= false; for i:= 0 to ArrayHigh(Vips) do begin if IDToIP(ID) = Vips<i> then Match:= true; end; if Match then WriteConsole(0,'[VIP][' + IDToName(ID) + ']' + Copy(Text,6,Length(Text)), Color); end;end;
Invalid number of parameters in if
08-10-18 20:21:50 [*] colortextvip -> [Error] (10:12): Unknown identifier 'xsplit'
function xsplit(const source: string; const delimiter: string):TStringArray;vari,x,d:integer;s:string;begind:=length(delimiter);x:=0;i:=1;SetArrayLength(Result,1);while(i<=length(source)) do begins:=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;function OnPlayerCommand(ID: Byte; Text: string): boolean;var i: byte; Vips: TStringArray; Match: boolean;begin if GetPiece(Text,' ',0) = '/sayv' then begin  SetArrayLength(Vips, 1);  Vips:= xsplit(ReadFile('vips.txt'), #10 + #13);  Match:= false;  for i:= 0 to ArrayHigh(Vips) do begin   if IDToIP(ID) = Vips<i> then Match:= true;  end;  if Match then WriteConsole(0,'[VIP][' + IDToName(ID) + ']' + Copy(Text,6,Length(Text)), Color); end;end;
08-10-18 20:55:17Â [*] colortextvip -> [Error] (37:93): Unknown identifier 'Color'
const Color = $FFFFFF //white
08-10-18 22:11:42 [*] colortextvip2 -> [Error] (26:1): Semicolon (';') expected
function xsplit(const source: string; const delimiter: string):TStringArray;vari,x,d:integer;s:string;begind:=length(delimiter);x:=0;i:=1;SetArrayLength(Result,1);while(i<=length(source)) do begins:=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;const Color = $FFFFFF //whitefunction OnPlayerCommand(ID: Byte; Text: string): boolean;var i: byte; Vips: TStringArray; Match: boolean;begin if GetPiece(Text,' ',0) = '/sayv' then begin SetArrayLength(Vips, 1); Vips:= xsplit(ReadFile('vips.txt'), #10 + #13); Match:= false; for i:= 0 to ArrayHigh(Vips) do begin if IDToIP(ID) = Vips[i] then Match:= true; end; if Match then WriteConsole(0,'[VIP][' + IDToName(ID) + ']' + Copy(Text,6,Length(Text)), Color); end;
08-10-19 10:08:25Â [*] colortextvip -> [Error] (42:10): Identifier expected