Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void GetHits(UnturnedPlayer player)
- {
- try
- {
- if (HitsListExist(player))
- {
- MySqlConnection connection = CreateConnection();
- connection.Open();
- MySqlCommand command = new MySqlCommand("SELECT * FROM DarkWeb_Hits WHERE ID = @ID", connection);
- command.Parameters.AddWithValue("@ID", player.Player.gameObject.GetComponent<PlayerComponent>().currentPage);
- command.Prepare();
- MySqlDataReader reader = command.ExecuteReader();
- if (reader.Read())
- {
- EffectManager.sendUIEffect(12692, 12692, player.CSteamID, true, reader[1].ToString(), "Price: " + reader[3].ToString());
- connection.Close();
- reader.Close();
- }
- else
- {
- }
- }
- }
- catch (Exception ex)
- {
- Rocket.Core.Logging.Logger.LogException(ex);
- }
- }
- public bool HitsListExist(UnturnedPlayer player)
- {
- try
- {
- MySqlConnection connection = CreateConnection();
- connection.Open();
- MySqlCommand command = new MySqlCommand("SELECT * FROM DarkWeb_Hits WHERE ID = @ID", connection);
- command.Parameters.AddWithValue("@ID", player.Player.gameObject.GetComponent<PlayerComponent>().currentPage);
- command.Prepare();
- MySqlDataReader reader = command.ExecuteReader();
- if (reader.Read())
- {
- return true;
- }
- else
- {
- UnturnedChat.Say(player, "No more hits to load");
- player.Player.gameObject.GetComponent<PlayerComponent>().currentPage--;
- return false;
- }
- }
- catch (Exception ex)
- {
- Rocket.Core.Logging.Logger.LogException(ex);
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement