I don't know if anyone has made this, anyway. ![Big Grin Big Grin](https://www.itsmods.com/forum/images/smilies/biggrin.gif)
visitplug.zip (Size: 2.08 KB / Downloads: 168)
![Big Grin Big Grin](https://www.itsmods.com/forum/images/smilies/biggrin.gif)
![ZIP File .zip](https://www.itsmods.com/forum/images/attachtypes/zip.gif)
CSHARP Code
- using System.Text;
- using Addon;
- using System.IO;
-
- namespace visitplug
- {
- public class visitplug : CPlugin
- {
- public override void OnServerLoad()
- {
- try
- {
- Directory.CreateDirectory(@"Visits");
- ServerPrint("Visit Plugin V1.0 Loaded -- SShattered");
- }
- catch (Exception ex)
- {
- ServerPrint("Visit Plugin V1.0 Loaded -- SShattered");
- }
- }
-
- public override void OnPlayerConnect(ServerClient Client)
- {
- if (File.Exists(@"Visits\" + Client.XUID + ".txt"))
- {
- string counts = File.ReadAllText(@"Visits\" + Client.XUID + ".txt");
- double count = Convert.ToDouble(counts);
- double newcc = count + 1;
- string newcount = Convert.ToString(newcc);
- File.WriteAllText(@"Visits\" + Client.XUID + ".txt", newcount);
- ServerSay("Welcome Player ^2" + Client.Name + " ^7to the Server", true);
- ServerSay("He has played ^1" + counts + " ^7times", true);
- }
- else
- {
- File.WriteAllText(@"Visits\" + Client.XUID + ".txt", "1");
- ServerSay("Welcome Player ^2" + Client.Name + " ^7to the Server", true);
- }
- }
- }
- }