Log in to reply
 

Need Help With NativeUI Ticks



  • Hey, I've been coding in C# for about 2 years now and just got into the GTA 5 modding "game" I guess and I've got down a whole menu base with options but the ones I can't get my head around are the ones that need ticks. I know how to use ticks but not with the UIMenuCheckboxes e.g, Never Wanted, Hashes such as "SET_FIRE_AMMO_THIS_FRAME" or "Game.Player.SetSuperJumpThisFram etc. And it's really bugging me so I finally broke and asked for help. Thank you in advance. I can't seem to stop the tick of the "Tick += (o, e) => Game.Player.WantedLevel = 0;" Don't slaughter me in the replies lmao

    Code:
    var policeNotWanted = new UIMenuCheckboxItem("Never Wanted", checkbox, "Enable Or Disable Never Wanted");
    playerMenu.AddItem(policeNotWanted);
    playerMenu.OnCheckboxChange += (sender, item, checked_) =>
    {
    if (item == policeNotWanted)
    if (checked_ == true)
    {
    Tick += (o, e) => Game.Player.WantedLevel = 0;
    UI.Notify("Never Wanted On");
    }
    else if (checked_ == false)
    {
    PLACE I CAN'T SEEM TO STOP THE TICK
    UI.Notify("Never Wanted Off");
    }
    };



  • try:

    void t_NeverWanted(o, e)
    {
        Game.Player.WantedLevel = 0;
    }
    
    var policeNotWanted = new UIMenuCheckboxItem("Never Wanted", checkbox, "Enable Or Disable Never Wanted");
    playerMenu.AddItem(policeNotWanted);
    playerMenu.OnCheckboxChange += (sender, item, checked_) =>
    {
    if (item == policeNotWanted)
    if (checked_ == true)
    {
    Tick += t_NeverWanted;
    UI.Notify("Never Wanted On");
    }
    else if (checked_ == false)
    {
    Tick -= t_NeverWanted;
    UI.Notify("Never Wanted Off");
    }
    };
    


  • That actually worked, thanks heaps. You don't believe how relieved I am


Log in to reply
 

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