Ejemplo n.º 1
0
 public void savePlayer(SrdmPlayer player)
 {
     Exports["mysql-async"].mysql_execute("UPDATE users SET kills = @kills, ped = @ped WHERE steamhex = @hex", // Update the db
                                          new
     {
         @hex   = player.hex,
         @kills = player.allKills.ToString(),
         @ped   = player.ped
     });
 }
Ejemplo n.º 2
0
        private void OnPlayerDropped([FromSource] Player player, string reason)
        {
            string source = player.Handle;

            try
            {
                SrdmPlayer srdmPlayer = playersData[source];

                if (srdmPlayer != null)
                {
                    savePlayer(srdmPlayer); // save player on disconnect
                }

                playersData.Remove(source);
                SyncData(); // Remove player from player list
            }
            catch (Exception e)
            {
                Debug.WriteLine($"Player {player.Handle} was not in StrefaRDM player list!");
            }
        }