-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass1.cs
More file actions
44 lines (42 loc) · 1.31 KB
/
Class1.cs
File metadata and controls
44 lines (42 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using SDG.Unturned;
using PointBlank.API;
using PointBlank.API.Server;
using PointBlank.API.Server.Extensions;
using PointBlank.API.Server.Attributes;
using System.IO;
using System.Net;
namespace PlayerList
{
[Plugin("PlayerList", "Roy", false, false)]
public class Main : PBPlugin
{
public string directory = Directory.GetCurrentDirectory() + "/..";
WebClient webclient;
public override void onLoad()
{
PBLogging.logImportant("PlayerList Loaded!");
if (File.Exists(directory + "/PlayerList.txt"))
{
PBLogging.log(directory + "/PlayerList.txt Already Exists");
}
else
{
File.CreateText(directory + "/PlayerList.txt");
}
PBServer.OnPlayerJoin += PBServer_OnPlayerJoin;
}
private void PBServer_OnPlayerJoin(PBPlayer player)
{
using (StreamWriter w = File.AppendText(directory + "/PlayerList.txt"))
{
w.WriteLine("[" + player.playerID.characterName + "]" + " " + "[Ping : " + player.steamPlayer.lastPing + " ] " + "[IP : " + player.IP + " ]");
w.Close();
}
}
}
}