Release Visit Plugin
#1
Tongue 
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); } } } }
Reply

#2
So wait you write a new text file for each new player that joins?
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#3
Why are you converting it to double?

Thanks Barata...
Don't worry if things aren't the way you planned, in the end everything will solve itself...
Reply

#4
Wow, that's can cause a server crash..Making file is bad, use mysql.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#5
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
Reply

#6
(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...
Don't worry if things aren't the way you planned, in the end everything will solve itself...
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 6,491 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 7,589 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 55,804 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 7,643 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 8,295 10-19-2013, 06:59
Last Post: iRoNinja
  [Release] Yurio Map Plugin Yurio 101 82,036 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 25,156 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 3,654 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 44,650 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Search Plugin Fluid Killcam N3xT_974 1 3,974 09-10-2013, 20:27
Last Post: Nekochan

Forum Jump:


Users browsing this thread:

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.