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: 191)

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
Rainbow [Release] Plugin ReservedSlot v1.3 frst_ 1 5,018 11-08-2018, 19:17
Last Post: frst_
Tongue [Release] MW3 Shop plugin Dude 56 51,451 03-25-2018, 05:18
Last Post: [email protected]
  [Release] Permission plugin Pozzuh 202 164,549 05-01-2017, 15:41
Last Post: W4R||The Hyper
  [Release] FIXED SPEED PLUGIN hillbilly 2 5,672 06-02-2016, 20:23
Last Post: clacki
  [Release] Bots Plugin For Users Casper 22 39,937 08-22-2015, 17:45
Last Post: SnapBacks
  [Release] God Plugin v5.0 [Ingame Rcon Tool] OzonE 464 337,377 06-27-2015, 15:38
Last Post: bluedot
  [Release] Anti Hardscope Plugin 8q4s8 26 27,712 06-20-2015, 22:44
Last Post: urj88419
  [Release] ProMod Plugin zxz0O0 875 763,909 03-25-2015, 22:02
Last Post: kris
  [Release] [Discontinued] Speed Plugin Pozzuh 164 122,574 10-06-2014, 12:56
Last Post: Nekochan
  [help]how create a ping plugin clacki 3 5,111 09-13-2014, 01:23
Last Post: clacki

Forum Jump:


Users browsing this thread:
1 Guest(s)

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