Example #1
0
 public void OnPlayerConnected(User pl)
 {
     PlayerDatabase.AddSetting(pl.SteamID, "ID", pl.SteamID);
     PlayerDatabase.AddSetting(pl.SteamID, "IP", pl.IP);
     PlayerDatabase.AddSetting(pl.SteamID, "Name", pl.Name);
     PlayerDatabase.AddSetting(pl.SteamID, "FID", pl.ToString());
     if(EnableJoinMessages)
     {
         if (!PlayerDatabase.ContainsSetting(pl.SteamID, "Joined"))
         {
             PlayerDatabase.AddSetting(pl.SteamID, "Joined", "yes");
             PlayerDatabase.Save();
             if (EnableFirstjoinMessages)
             {
                 Logger.Log("[Fougerite-Essentials] " + pl.Name + " has joined the server for the first time");
                 string message = FirstJoinMessage.Replace("{player}", pl.Name);
                 Broadcast(message);
             }
         }
         if (EnableCountryMessages)
         {
             FindCountry(pl);
         }
         else
         {
             string msg = JoinMessage.Replace("{player}", pl.Name);
             Broadcast(msg);
         }
         PlayerDatabase.Save();
     }                    
 }