Script Name: Comment
Script Description:
Might have been done already, its very simple.
Essentially it lets people type in:
/comment COMMENT
/suggest SUGGESTION
/complain COMPLAINT
And it will save their name, IP, and comment into a text file.
Original Author(s): me
Core Version: 2.6.3
Code:
// Comment script by iDante
procedure AppOnIdle(Ticks: integer);
begin
// Every 5 minutes advertise a bit...
if Ticks mod (3600 * 5) = 0 then begin
WriteConsole(0,'Enjoying your stay? Tell us with /comment Im Lovin it!',$FFFFFFFF);
WriteConsole(0,'Suggestions? Let us know with /suggest Suggestion here',$FFFFFFFF);
WriteConsole(0,'Got a problem? Tell us about it: /complain I need fun',$FFFFFFFF);
end;
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Copy(lowercase(Text),0,8) = '/suggest' then begin
if WriteLnFile('scripts/Comment/comments.txt','Suggestion from '+IDToName(ID)+'('+IDToIP(ID)+'): '+Copy(Text,10,length(Text))) then
WriteConsole(ID,'Suggestion added successfully.',$FFFFFFFF);
end else if Copy(lowercase(Text),0,8) = '/comment' then begin
if WriteLnFile('scripts/Comment/comments.txt','Comment from '+IDToName(ID)+'('+IDToIP(ID)+'): '+Copy(Text,10,length(Text))) then
WriteConsole(ID,'Comment added successfully.',$FFFFFFFF);
end else if Copy(lowercase(Text),0,9) = '/complain' then begin
if WriteLnFile('scripts/Comment/comments.txt','Complaint from '+IDToName(ID)+'('+IDToIP(ID)+'): '+Copy(Text,11,length(Text))) then
WriteConsole(ID,'Complaint added successfully.',$FFFFFFFF);
end;
end;