Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/14/19 in all areas

  1. I figured I'd share what worked for me in case someone else has the same issue, googles it, finds one of these threads, sees that it's been resolved, but also is frustrated that the fix was never shared... 1) Go to your GTA V directory 2) Right click on "GTA5.exe" 3) Click on the Compatibility tab 4) Make sure "Run this program as an administrator" is OFF/UNCHECKED 5) Repeat steps 2-4 for the "GTAVLauncher.exe" file Viola and you're welcome, stranger who googled this like me and couldn't find the solution.
    1 point
  2. I was on the edge to use it or not. Some say it's not needed but as you stated in a multi threaded environment with many db calls, immediately disposing is the way to go. Since this was targeted at beginners you can see why I did the way I did, BUT I guess no harm can be done if I update my tutorial. Thank you for the feedback, I appreciate it!
    1 point
  3. Hi, you need to set license field to 0 in all the questions you want to show on the application test. Change that and it should work, the rest is fine.
    1 point
  4. Great tutorial but I see a couple of issues in using a single context to access the database especially in a very competitive multi-threading environment which would make everything run slow and synchronously even if the calls are asynchronous. So, In order to take advantage of connection pooling (and you should), database connections should be as short lived as possible. Create, use and then immediately destroy. here's an example based on the original examples: using System; // Add the missing usings namespace EFCoreTutorial { public class Account { [Key] public int Id { get; set; } public string Username { get; set; } public string Password { get; set; } } public class DBCtx : DbContext { // Account model class created somewhere else public DbSet<Account> Accounts { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseMySql("Server=localhost;Database=mydatabsename;Uid=root;Pwd=mypassword"); } } public class Main : Script { [ServerEvent(Event.ResourceStart)] public void OnResourceStart() { using (var ctx = new DBCtx()) { var playerCount = ctx.Accounts.Count(); NAPI.Util.ConsoleOutput("Total players in the database: " + playerCount); } } [Command("register")] public void AccountCmdRegister(Client player, string username, string password) { // create a new Account object var account = new Account { Username = username, Password = password }; using (var ctx = new DBCtx()) { // Add this account data to the current context ctx.Accounts.Add(account); // And finally insert the data into the database ctx.SaveChanges(); } player.SendChatMessage("~g~Registration successful!"); } } }
    1 point
  5. Скачал последнюю версию клиента с сайта, гта лицензия, недавно купил в стиме. Пытаюсь открыть через ярлык на рабочем столе, появляется очертание небольшого окошка меньше чем на секунду и сразу пропадает. Переустанавливал сам плагин, переустанавливал всякие штуки от майкрасофт типо висуал студио. Ничего не помогло. Помогите пожалуйста решить проблему
    1 point
×
×
  • Create New...