Everything posted by AlwayzPatty
-
[Solved] Can't attach debugger to GTAV.exe
Hello yes the title may say that its not for LSPDFR but yet it is. So yesterday I got the info how to debug my plugins through attaching on GTAV.exe and create breakpoints. So I tried this and I got an instant error after attaching... The error I got was a System.ExcecutionEngineException and it opened a piece of code of LSPDFR: So if anyone knows how to help please help so I can stop using debug logs xD
-
Get Callout info
Okay thanks
-
Get Callout info
Also is there a way to get the suspects of a callout?
-
Get Callout info
Severety i was basing around the code of the callout like it shows in the backup menu.
-
Get Callout info
Well im making a leveling system that gives you XP but I want it to be dependend on severety and the distance of the player so that the player gets more XP from certain calls.
-
Problems with ini file
Fixed the issue it was apperantly an encoding issue that was already mentioned as a bug to RPH. Thanks to PNWParksFan
-
Get Callout info
Okay now I'm coming to the conclusion that I might need the location of the callout and the severity. Is this possible?
-
Problems with ini file
The new code: internal static class Settings { private static InitializationFile iniFile; #region User Settings public static Keys OpenMenuKey = Keys.U; public static Keys ModOpenMenuKey = Keys.None; #endregion #region System Settings public static float PercentageIncrementExpNeeded = .35f; #endregion static KeysConverter kc = new KeysConverter(); public static void Load() { Common.Log("Loading config."); Common.Log(GetIniString("Keybindings", "MenuKey")); Common.Log(GetIniString("Keybindings", "MenuKeyModifier")); OpenMenuKey = (Keys)kc.ConvertFromString(GetIniString("Keybindings", "MenuKey", "U")); ModOpenMenuKey = (Keys)kc.ConvertFromString(GetIniString("Keybindings", "MenuKeyModifier", "None")); } private static InitializationFile initialiseFile() { if (iniFile != null && iniFile.Exists()) return iniFile; iniFile = new InitializationFile(@"Plugins\LSPDFR\LevelSystem.ini"); iniFile.Create(); if (iniFile.Exists()) return iniFile; else throw new Exception("Ini doesn't exist."); } private static string GetIniString(string section, string key, string defaultVal = "") { try { Common.Log($"[Requesting INI String] Section: {section}, Key: {key}, FileLocation: {initialiseFile().FileName}, IniValidation: {ValidateIni(section, key).ToString()}"); if (ValidateIni(section, key)) { return initialiseFile().ReadString(section, key, defaultVal); } else { Common.Log("Ini file doesn't exist."); Game.DisplayNotification("mprpsymbol", "rp", "~b~LSPDFR Level System", "~r~Ini file error", $"Ini File doesnt exist!"); return defaultVal; } } catch(Exception e) { Common.Log($"[ERROR] {e.Message}"); return defaultVal; } } private static bool ValidateIni(string section, string key) { return initialiseFile().DoesSectionExist(section) && initialiseFile().DoesKeyExist(section, key); } } This results to this being said in the logs: So your solution doesn't work. I will try some stuff today myself and you will hear from me if I found the solution.
-
Problems with ini file
Thanks I'll try that but the code that I used as a reference didn't do that either so idk if thats the problem tbh. Referenced code
-
Problems with ini file
So I am making a plugin but when I try to load my INI file it just says that the object isn't set. internal static class Settings { public static Keys OpenMenuKey = Keys.U; public static Keys ModOpenMenuKey = Keys.None; static KeysConverter kc = new KeysConverter(); public static void Load() { Common.Log("Loading config."); Common.Log(GetIniString("Keybindings", "MenuKey")); Common.Log(GetIniString("Keybindings", "MenuKeyModifier")); OpenMenuKey = (Keys)kc.ConvertFromString(GetIniString("Keybindings", "MenuKey", "U")); ModOpenMenuKey = (Keys)kc.ConvertFromString(GetIniString("Keybindings", "MenuKeyModifier", "None")); } private static InitializationFile initialiseFile() { InitializationFile ini = new InitializationFile(@"Plugins\LSPDFR\LevelSystem.ini"); ini.Create(); return ini; } private static string GetIniString(string section, string key, string defaultVal = "") { if (initialiseFile().Exists() && ValidateIni(section, key)) { return initialiseFile().ReadString(section, key, defaultVal); } else { Common.Log("Ini file doesn't exist."); Game.DisplayNotification("mprpsymbol", "rp", "~b~LSPDFR Level System", "~r~Ini file error", $"Ini File doesnt exist!"); return defaultVal; } } private static bool ValidateIni(string section, string key) { return initialiseFile().DoesSectionExist(section) && initialiseFile().DoesKeyExist(section, key); } } Also my Common Logs are empty where I request the value. Am I doing something wrong? Also the "initialiseFile().Exists()" returns true but the "ValidateIni()" returns false The INI I'm using: [Keybindings] MenuKey = U MenuKeyModifier = None
-
Get Callout info
Nvm i kinda was looking for the name but found out that there was a call for it my bad. Was reading old api references before.
-
Get Callout info
Is there a way to get a callout's info by feeding the LHandle? If not can maybe a developer make such a function?