Log in to reply
 

[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



  • @CrazyMaisy3
    Make a empty .ini file and call it

    Quick_Waypoint_Remover.ini

    Inside the: Quick_Waypoint_Remover.ini

    type this.

    [Options]
    toggleKey=L

    Inside the source i send you there is a default key set Thats L
    You can change that in the source to your liking but remember when people edit the .ini thats the key that is used

    http://pastebin.com/G7r6wx0p

    Tell me if this helped you. Feel free to use it.
    There is another way to make a .ini but it's more complicated and this is maybe a good begin to practice :D



  • @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.



  • @CrazyMaisy3

    Sure no worries :D



  • @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!



  • @CrazyMaisy3
    No problem mate ;)

    I have made the script for you.
    Added the .ini and added the source code so you can edit it read it use it :D
    The script works so test it do anything you like with it. you can rename it :D
    I have send you the Download link ( DropBox ) in a message on the Gta 5 forum. ;)



  • @Rjvisser01 Thank you SOOOO MUCH



  • @CrazyMaisy3
    no problem :D anytime :D



  • Why you using ++ for this



  • This post is deleted!

Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.