0 Members and 1 Guest are viewing this topic.
ConstFile_dir = 'Scripts/Adminnote/'; CRLF = #13#10;var File_data:String;procedure OnJoinTeam(ID,Team: byte);beginif Team = 1 then beginFile_data :=ReadFile(File_dir+'Note.txt');File_data := copy(File_data, 0, length(File_data)-2);WriteConsole(0,File_data,$EE81FAA1);end;end;function OnCommand(ID: Byte; Text: string): boolean;beginif Text = '/adnote' then beginFile_data :=ReadFile(File_dir+'Note.txt');File_data := copy(File_data, 0, length(File_data)-2);WriteConsole(0,File_data,$EE81FAA1);end;end;
const CRLF = #13#10;procedure SpewOut();var filearraylength, i: integer; filename, filedata: string; filearray: array of string;begin filename := 'scripts/' + ScriptName + '/Note.txt'; filedata := ReadFile(filename); filedata := Copy(filedata, 0, Length(filedata) - 2); filearray := Explode(filedata, CRLF); filearraylength := GetArrayLength(filearray); WriteConsole(0, 'Length of array: ' + InttoStr(filearraylength), $FFFFFFFF); if (filearraylength > 0) then for i := 0 to filearraylength - 1 do WriteConsole(0, '[' + InttoStr(i) + '] ' + filearray[i], $EE81FAA1);end;