Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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: 168)

CSHARP Code
  1. using System.Text;
  2. using Addon;
  3. using System.IO;
  4.  
  5. namespace visitplug
  6. {
  7. public class visitplug : CPlugin
  8. {
  9. public override void OnServerLoad()
  10. {
  11. try
  12. {
  13. Directory.CreateDirectory(@"Visits");
  14. ServerPrint("Visit Plugin V1.0 Loaded -- SShattered");
  15. }
  16. catch (Exception ex)
  17. {
  18. ServerPrint("Visit Plugin V1.0 Loaded -- SShattered");
  19. }
  20. }
  21.  
  22. public override void OnPlayerConnect(ServerClient Client)
  23. {
  24. if (File.Exists(@"Visits\" + Client.XUID + ".txt"))
  25. {
  26. string counts = File.ReadAllText(@"Visits\" + Client.XUID + ".txt");
  27. double count = Convert.ToDouble(counts);
  28. double newcc = count + 1;
  29. string newcount = Convert.ToString(newcc);
  30. File.WriteAllText(@"Visits\" + Client.XUID + ".txt", newcount);
  31. ServerSay("Welcome Player ^2" + Client.Name + " ^7to the Server", true);
  32. ServerSay("He has played ^1" + counts + " ^7times", true);
  33. }
  34. else
  35. {
  36. File.WriteAllText(@"Visits\" + Client.XUID + ".txt", "1");
  37. ServerSay("Welcome Player ^2" + Client.Name + " ^7to the Server", true);
  38. }
  39. }
  40. }
  41. }
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 4,194 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,787 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 41,943 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,725 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 5,244 10-19-2013, 06:59
Last Post: iRoNinja
  [Release] Yurio Map Plugin Yurio 101 62,839 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 18,769 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,727 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,479 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Search Plugin Fluid Killcam N3xT_974 1 3,085 09-10-2013, 20:27
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

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