Author Topic: Leave a comment!  (Read 2240 times)

0 Members and 1 Guest are viewing this topic.

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Leave a comment!
« on: August 08, 2008, 08:33:06 pm »
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:
Code: [Select]
// 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;

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: Leave a comment!
« Reply #1 on: August 08, 2008, 08:43:20 pm »
Useful, interesting, cool. Suggestion, maybe have a limit on how many messages a single person can leave or how many can be left during each game?
There are other worlds than these

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Leave a comment!
« Reply #2 on: August 08, 2008, 08:48:07 pm »
Useful, interesting, cool. Suggestion, maybe have a limit on how many messages a single person can leave or how many can be left during each game?
I thought about having a time limit between comments, however because it saves it to a text file that can be opened later, its easy enough to just scroll through/delete a spammer's comments. Or ban his IP, which it also saves.

Offline UnknownSniper

  • Camper
  • ***
  • Posts: 428
  • Southern by the Grace of God
Re: Leave a comment!
« Reply #3 on: August 08, 2008, 09:02:25 pm »
I saw this in a 1.3.0 DM server.
Very nice script, good work. ;)
I had a job and a piece of land
My sweet wife was my best friend
But I traded that for Cocaine and a whore
-Jamey Johnson


Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Leave a comment!
« Reply #4 on: August 08, 2008, 09:08:53 pm »
I saw this in a 1.3.0 DM server.
Very nice script, good work. ;)
lol this exact script? I just made it maybe an hour ago, you sure it wasn't another script that did the same thing?

Offline UnknownSniper

  • Camper
  • ***
  • Posts: 428
  • Southern by the Grace of God
Re: Leave a comment!
« Reply #5 on: August 08, 2008, 09:27:46 pm »
I saw this in a 1.3.0 DM server.
Very nice script, good work. ;)
lol this exact script? I just made it maybe an hour ago, you sure it wasn't another script that did the same thing?

Well, obviously I meant a script that did the same thing. (Can't really see the scripts a server uses, only the names of them.) :p
I had a job and a piece of land
My sweet wife was my best friend
But I traded that for Cocaine and a whore
-Jamey Johnson


Offline As de Espada

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1493
  • Mapper
    • My maps
Re: Leave a comment!
« Reply #6 on: August 09, 2008, 02:46:31 pm »
Quote
/complain COMPLAINT
usefull, isn't COMPLAIN?
All my maps | my latest map: SoldatX Racing Mappack
me making a map on youtube: ctf_FastMade

Offline rayanaga

  • Soldier
  • **
  • Posts: 143
  • ~Fur flying~
    • Kryonex
Re: Leave a comment!
« Reply #7 on: August 10, 2008, 02:36:57 pm »
I have something like this on my server too. :D
[kY] Kryonex - Your local zombie fanatics.
http://www.kryonex.com/