Register for your free account! | Forgot your password?

You last visited: Today at 18:17

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Small Release] Report Player (5165)

Discussion on [Small Release] Report Player (5165) within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
.Beatz's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
[Small Release] Report Player (5165)

Hey guys just a small release will help some people I hope.
I did not add PM/GM check to this but it can easily be added.

This is for every player so they can report players and give their reason for the report. You will need to go to your OldCODB folder and make 2 new .txt files.
Code:
reason.txt
Code:
report.txt
Now go to your NPCDialogue.cs and add this to the bottom.
Code:
#region Report Player
                            case 9873: // make sure you change this to the npc you want to use
                                {

                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("What player would you like to report?"));
                                        GC.AddSend(Packets.NPCLink2("Type in players name", 1));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    else if (Control == 1)
                                    {
                                        string report = ReadString(Data);
                                        if (report != null)
                                        {
                                            string path = "C:\\OldCODB\\report.txt";
                                            StreamWriter SW;
                                            if (File.Exists(path))
                                            {
                                                SW = File.AppendText(path);
                                                SW.WriteLine(DateTime.Now + ": " + GC.MyChar.Name + ": " + report);
                                                //will write  --   Date and Time: Name: report
                                                SW.Close();
                                                Console.WriteLine("A player has been reported!");
                                            }
                                            else
                                            {
                                                SW = File.CreateText(path);
                                                SW.WriteLine(report);
                                                SW.Close();
                                                Console.WriteLine("A player has been reported!");
                                            }
                                        }
                                        GC.AddSend(Packets.NPCSay("Please type in the reason for reporting this player."));
                                        GC.AddSend(Packets.NPCSay("If the reason is not valid you will receive a warning."));
                                        GC.AddSend(Packets.NPCLink2("Type reason for report.", 2));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    else if (Control == 2)
                                    {
                                        string reason = ReadString(Data);
                                        if (reason != null)
                                        {
                                            string path = "C:\\OldCODB\\reason.txt";
                                            StreamWriter SW;
                                            if (File.Exists(path))
                                            {
                                                SW = File.AppendText(path);
                                                SW.WriteLine(DateTime.Now + ": " + GC.MyChar.Name + ": " + reason);
                                                //will write  --   Date and Time: Name: reason
                                                SW.Close();
                                                Console.WriteLine("A reason for report has been added!");
                                            }
                                            else
                                            {
                                                SW = File.CreateText(path);
                                                SW.WriteLine(reason);
                                                SW.Close();
                                                Console.WriteLine("A reason for report has been added!");
                                            }
                                        }
                                        GC.AddSend(Packets.NPCSay("Player has been reported. Thank you for helping keep the server friendly."));
                                        GC.AddSend(Packets.NPCLink("No problem.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    break;
                                }
                            #endregion
Add this NPC
Code:
9873 1816 2 28 1036 173 105
This NPC is near to Carpenter in market.

Hit the thanks button if this helps.
.Beatz is offline  
Thanks
5 Users
Old 07/28/2010, 21:19   #2
 
FrontBoy's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 275
Received Thanks: 142
thanks
FrontBoy is offline  
Old 07/29/2010, 00:27   #3
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
why dont u put it like: (in 1 txt)
Playername ReportedBy Reason
Fish* is offline  
Thanks
1 User
Old 07/29/2010, 00:44   #4
 
.Beatz's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
Quote:
Originally Posted by grillmad View Post
why dont u put it like: (in 1 txt)
Playername ReportedBy Reason
Do you know what? I didn't actually think of doing that lol! Yeah that would be better. If someone wants to do that its fine by me. I would do it but I dont have the time as working on adding mob spawns to my source
.Beatz is offline  
Thanks
1 User
Old 07/30/2010, 17:24   #5
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Yeah really does it make sense having 2 different text files?
Btw there's a spelling error, "If the reason is not valid you will recieve a warning." should be "receive".
copz1337 is offline  
Old 07/31/2010, 16:08   #6
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
Quote:
Originally Posted by copz1337 View Post
Yeah really does it make sense having 2 different text files?
Btw there's a spelling error, "If the reason is not valid you will recieve a warning." should be "received".
So, your saying it should have been received? Past simple? Really? ****, my teachers lied to me.
Basser is offline  
Thanks
1 User
Old 07/31/2010, 17:30   #7
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Quote:
Originally Posted by Basser View Post
So, your saying it should have been received? Past simple? Really? ****, my teachers lied to me.
*sigh* I meant "receive" lol ops. At least "received" is a word as well lol.
copz1337 is offline  
Old 07/31/2010, 17:42   #8
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Quote:
Originally Posted by copz1337 View Post
*sigh* I meant "receive" lol ops. At least "received" is a word as well lol.
well, thats also a fail.
is recieve and not receive
Fish* is offline  
Old 07/31/2010, 22:33   #9
 
.Beatz's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
*updated*

Changed the spelling mistake, Sorry I was tired when I wrote this NPC

Also Grillmad it is Receive. Recieve is a common mis-spelling of the word.
.Beatz is offline  
Old 08/01/2010, 03:30   #10
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
True
Fish* is offline  
Reply


Similar Threads Similar Threads
[Release] Report player command
06/01/2010 - CO2 PServer Guides & Releases - 21 Replies
Ok so this is a messy release that I'm sure no one will use but I figured I'd throw it out there for people who want it. What it is is a command to report a player and it will store who used the command, who was reported and the reason in a handy little database for gm's to use later. Personally I plan to use it (or a cleaned up version) to allow moderators to report problems or hackers for when a gm is not online. It's not perfect as it is but it works. Note: this version is CoEmu...
[RELEASE]Report player
05/27/2010 - CO2 PServer Guides & Releases - 19 Replies
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: if (Cmd == "/report") { if (Cmd.Length == 3) { REPORTPLAYER(Cmd, Cmd); GC.LocalMessage(2000, "You have reported: " + Cmd + " For: " + Cmd); }
[SMALL RELEASE] 5165 No Melee Attempt
04/11/2010 - CO2 PServer Guides & Releases - 12 Replies
For those of you who might've come across this issue and haven't found a quick and easy solution. I noticed when you summon your guard and try to Melee PK another character the Guard will still attack that character. This happened in the maps where PK wasn't allowed, such as killing other characters in Twin City, as well as PK maps. Most credits go to kamote for his Prohibit Guard Attackrelease. In Attack.cs Search for public static void Handle(Main.GameClient GC, byte Data) Above...
[Small release]Player limit
04/03/2010 - CO2 PServer Guides & Releases - 16 Replies
This is a simple and small release for lotf 5017 x.x Is just for adding a player limit to your server, so it won't crash, when there gets too many players :handsdown: Open client.cs and search for: if (MyChar.MyGuild != null) under the whole code paste:



All times are GMT +1. The time now is 18:22.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.