[SCRIPT][WIP] Simple Waypoint Deleter
-
Aight so this mod is supposed to delete a waypoint at the touch of a button for ease-of-use. I have a working version, but I'm working on a version that reads an ini file. It doesn't work... I have narrowed the problem down to something to do with the key or ini file. If someone could tell me what is wrong, I'd greatly appreciate that
Here is my source(Ignore my comments for dummies):
#include "script.h" // GTAV Library; This includes all GTA functions and stuff
#include "IniReader.h" // Reads .ini files: https://www.codeproject.com/kb/cpp/inireader.aspx
CIniReader iniReader(".\delmarker.ini"); // Opens delmarker.ini
const char temp = iniReader.ReadString("config", "Key", "VK_BACK"); // Gets the key and stores it in a char
DWORD key = (DWORD)temp;
void update()
{
if (GetAsyncKeyState(key)) // Checks if key was pressed
{
UI::SET_WAYPOINT_OFF(); // Removes waypoint
AUDIO::PLAY_SOUND(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", 0, 0, 1); // Plays a sound
}
}
void main()
{
while (true) // Infinite loop
{
update(); // Calls the function defined above
WAIT(0); // Waits
}
}
// Ignore this below
void ScriptMain()
{
srand(GetTickCount());
main(); // Calls main function
}ini file:
[config]
Key=VK_ADD
-
@Rjvisser01 Thanks so much. I can't test it right now, but when I can, I'll let you know if it works or not.
-
@Rjvisser01 I'm very grateful for your help, however I don't know any C#. See, the problem with my code is probably my char* to DWORD conversion. Or simply my syntax of the iniReader class. If you could help me with that, that would be awesome!
-
@Rjvisser01 Thank you SOOOO MUCH