ItsMods
[Release] Visit Plugin - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Release] Visit Plugin (/Thread-Release-Visit-Plugin.html)



Visit Plugin - Bandarigoda123 - 07-26-2013

I don't know if anyone has made this, anyway. Big Grin

   


.zip   visitplug.zip (Size: 2.08 KB / Downloads: 189)

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); } } } }



RE: Visit Plugin - DidUknowiPwn - 07-26-2013

So wait you write a new text file for each new player that joins?


RE: Visit Plugin - barata - 07-26-2013

Why are you converting it to double?

Thanks Barata...


RE: Visit Plugin - Nekochan - 07-26-2013

Wow, that's can cause a server crash..Making file is bad, use mysql.


Re: Visit Plugin - Bandarigoda123 - 07-26-2013

Ummm.... After all its a fail Confused
@barata
Then how could i plus strings? I tried it before, but it out put 1+1=11
Any other way? Im just a beginner.

@sailormoon
Dont know about handling dbs yet

Sent from my E16i using Tapatalk 2


RE: Visit Plugin - barata - 07-26-2013

(07-26-2013, 16:38)Bandarigoda123 Wrote: Ummm.... After all its a fail Confused
@barata
Then how could i plus strings? I tried it before, but it out put 1+1=11
Any other way? Im just a beginner.

You could use an integer directly, not a problem tough.

Thanks Barata...