[RELEASE]Report player

05/24/2010 02:11 .Summer#1
Hello Elitepvpers, this is how you could make a report a player system for the 5165source.
First open Chat.cs and put this command for players:
Code:
                    if (Cmd[0] == "/report")
                    {
                        if (Cmd.Length == 3)
                        {
                            REPORTPLAYER(Cmd[1], Cmd[2]);
                            GC.LocalMessage(2000, "You have reported: " + Cmd[1] + " For: " + Cmd[2]);
                        }
                        else
                        {
                            GC.LocalMessage(2000, "use Charname + Reason");
                            GC.LocalMessage(2000, "Ex. /report Charname Aimbot");
                            GC.LocalMessage(2000, "YOU CANT MAKE SPACES IN THE REASON");
                        }
                    }
Now at the buttom put:
Remember that the last 2 } have to be under the code.
Code:
        public static void REPORTPLAYER(string Name, string Reason)
        {
            if (!File.Exists(@"C:\OldCODB\REPORT\" + Name + ".rpt"))
            {
                FileStream FS = new FileStream(@"C:\OldCODB\REPORT\" + Name + ".rpt", FileMode.CreateNew);
                BinaryWriter BW = new BinaryWriter(FS);
                BW.Write(Name);
                BW.Write(Reason);
                BW.Write("-ReportTime: " + DateTime.Now);
                BW.Close();
                FS.Close();
            }
        }
Now open your OldCODB and make a folder called REPORT.
And your done, pplayers can now write ex. /report DINGDONG speedhack.
and there will appear a report with Charname, reason, reporttime.
If you like it, then a thank would be appriciated :)
Goodluck
05/24/2010 02:24 scottdavey#2
You should append the file if a report already exists, otherwise only one person that report that user.
05/24/2010 02:42 pro4never#3
yahh I released this for CoEmu ages back (forgot about it till now lol)

it's definitely useful to have but I'd suggest you make it only usable by certain players or you will get a shitload of spam...
05/24/2010 19:36 .Summer#4
Code:
            if (!File.Exists(@"C:\OldCODB\REPORT\" + Name + ".rpt"))
            {
checks if the file does not exist, if it exist, then it dont create :)
05/24/2010 20:40 scottdavey#5
Quote:
Originally Posted by .Summer View Post
Code:
            if (!File.Exists(@"C:\OldCODB\REPORT\" + Name + ".rpt"))
            {
checks if the file does not exist, if it exist, then it dont create :)
Yes but there's no code to append if it already exists, meaning only one person can report another person.
05/24/2010 20:46 .Summer#6
you can report more times.
it checks for the currently cmd command.
not for only 1.
there is no problems with it :)
05/24/2010 21:40 scottdavey#7
Quote:
Originally Posted by .Summer View Post
you can report more times.
it checks for the currently cmd command.
not for only 1.
there is no problems with it :)
This code doesn't allow more than one person to report someone..
05/24/2010 22:22 MonstersAbroad#8
Here's a temp soultion
Code:
        public static void REPORTPLAYER(string Name, string Reason)
        {
            if (!File.Exists(@"C:\OldCODB\REPORT\" + Name + DateTime.Now + ".rpt"))
            {
                FileStream FS = new FileStream(@"C:\OldCODB\REPORT\" + Name + DateTime.Now + ".rpt", FileMode.CreateNew);
                BinaryWriter BW = new BinaryWriter(FS);
                BW.Write(Name);
                BW.Write(Reason);
                BW.Write("-ReportTime: " + DateTime.Now);
                BW.Close();
                FS.Close();
            }
            else
            {
[B][COLOR="Red"]                 GC.LocalMessage(2011, "This player has already been reported at this current time please try again in 1 minute");[/COLOR][/B]
             }
        }
The code in red mite need abit of editing since I coded that right here I don't code newestcoserver much so I can't remb it but apart from that you can report a player but if someone trys to report the player in the same minute it will not them that would also prevent spam of reporting a player, P.S: I think its the minute xD
05/24/2010 22:56 .Summer#9
it will give more spam.
it works as it is now.
with making it like that it can be spammed every min.
it cant report more if a player is reported.
it can first report player when the file is deleted from database.
your all wrong at this :)
05/24/2010 23:45 scottdavey#10
Quote:
Originally Posted by .Summer View Post
it will give more spam.
it works as it is now.
with making it like that it can be spammed every min.
it cant report more if a player is reported.
it can first report player when the file is deleted from database.
your all wrong at this :)
Extremely stupid, all the user has to do is report himself from another account and then nobody can report him.
05/25/2010 00:07 Arcо#11
if (Cmd[1] != GC.MyChar.Name)
05/25/2010 00:29 pro4never#12
Quote:
Originally Posted by .Arco View Post
if (Cmd[1] != GC.MyChar.Name)
They can still use an alt to report.


Needs to append a new entry to the file saying who reported the player and the reason... or just use sql which is sooo much easier imo. One i released worked just fine... the only issue was people could clog it up if you let just anyone use the cmd.

The system is useless if once a player is reported once nothing more can be done...

Also you may want to notify online gm's as soon as the report is logged so they can investigate.
05/25/2010 01:37 xScott#13
Im trying this out using INI's
but it's Number of reports increases everytime someone reports, so i dont get overloaded with spam reports. sorta hard to explain ><
05/25/2010 01:46 scottdavey#14
IMO ig report doesn't work for a game like this, best to use forum reports instead.
05/25/2010 02:04 xScott#15
Quote:
Originally Posted by scottdavey View Post
IMO ig report doesn't work for a game like this, best to use forum reports instead.
Or get a GM to hunt them down.

Im only doing this for educational purposes, im not that great with INI's, so im learning from it.