• Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

PC GTA IV ScriptHook mod menu help

ClonkAndre

New Member
Hello Guys!
I am new in this Forum and i have a Question about GTA IV creating a Mod Menu.

I'am using Visual Studio 2013 to create a Mod Menu and i almost finished the Trainer but i have 1 big Problem!

When i try to add the Menu Items the Items overlapps itself :/
Here is an Image: https://imgur.com/a/4RMVshs (on imgur)
You see?

It schould be like that:
  • lol0
  • lol1
  • lol2
  • lol3
  • lol4
  • lol5
Here is my Code: (vb.net)
Code:
Private avatext(5) As String
Public Sub New()
  avatext(0) = "lol0"
  avatext(1) = "lol1"
  avatext(2) = "lol2"
  avatext(3) = "lol3"
  avatext(4) = "lol4"
  avatext(5) = "lol5"
End Sub

Private Sub GTAIV_TEST_MENU2_PerFrameDrawing(ByVal sender As Object, ByVal e As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
  Dim num As Integer = 0
  Dim topItem As UShort = PtopItem

  If menuOpen Then
  'While CInt(topItem) <= CInt(PtopItem) + 30 AndAlso CInt(topItem) < Me.avatext.Length
  '  e.Graphics.DrawText(avatext(CInt(topItem)), 20.0F, 30.0F, If(CInt(PtopItem) = CInt(Me.selectedItem), Me.selectedItemColor, Me.defaultItemColor))
  '  topItem += 1
  'End While

  For Each Element As String In avatext
  e.Graphics.DrawText(Element, 10, 10 + 30, If(CInt(topItem) = CInt(Me.selectedItem), Me.selectedItemColor, Me.defaultItemColor))
  Next
  End If
End Sub
 
DrawText has X and Y coordinate parameters. Right now you are drawing each on the same place.

You want a column of items so your X should stay the same value for each item, but your Y needs to increase for every item. I don't know much about that garbage VisualBasic language, but I can give you an example in C:

Code:
float x = 20.0f;
float y = 20.0f;
float spacing = 0.04f; // change this to increase space between each item
for (int i = 0; i < item_count; i++)
{
    // set up text formatting here
    DISPLAY_TEXT_WITH_LITERAL_STRING(x, y + (i * spacing), "STRING", "Menu Item Text");
}

If you need to use .NET, C# is at least a little better. Or C++ ScriptHook if you want to be a champion.
 
DrawText has X and Y coordinate parameters. Right now you are drawing each on the same place.

You want a column of items so your X should stay the same value for each item, but your Y needs to increase for every item. I don't know much about that garbage VisualBasic language, but I can give you an example in C:

Code:
float x = 20.0f;
float y = 20.0f;
float spacing = 0.04f; // change this to increase space between each item
for (int i = 0; i < item_count; i++)
{
    // set up text formatting here
    DISPLAY_TEXT_WITH_LITERAL_STRING(x, y + (i * spacing), "STRING", "Menu Item Text");
}

If you need to use .NET, C# is at least a little better. Or C++ ScriptHook if you want to be a champion.
Thank you for helping him, great work m8 ;)
 
DrawText has X and Y coordinate parameters. Right now you are drawing each on the same place.

You want a column of items so your X should stay the same value for each item, but your Y needs to increase for every item. I don't know much about that garbage VisualBasic language, but I can give you an example in C:

Code:
float x = 20.0f;
float y = 20.0f;
float spacing = 0.04f; // change this to increase space between each item
for (int i = 0; i < item_count; i++)
{
    // set up text formatting here
    DISPLAY_TEXT_WITH_LITERAL_STRING(x, y + (i * spacing), "STRING", "Menu Item Text");
}

If you need to use .NET, C# is at least a little better. Or C++ ScriptHook if you want to be a champion.

Much thanks to you, it's working now! ;)
 
General chit-chat
Help Users
  • @ QM|T_JinX:
    tho
  • @ God:
    That’s the truth I see I come on here often here lately, sometimes I don’t chat! But yes I really want to help out and do everything I can bring the site back like it should be bro! Maybe we could work something out, I think I have the resources and community to help
  • @ QM|T_JinX:
    yea i have seen you on here just like unbound and some others but they didnt stick haha yea would be great to see this site grow again like you said like it should be
  • @ God:
    We will see we gotta talk to the boss man Younis
  • @ QM|T_JinX:
    for sure haha well lets hope right
  • @ QM|T_JinX:
    i still think if there was a jailbreak for ps4 this site would have been back for sure
  • @ God:
    That would be awesome I’m sure it will happen before long, technology now a days is crazy! If we can work out a deal and plans I’ll be spreading the word and doing a lot to make it better more attractive and helpful fourms tips giveaways and all
  • @ God:
    I’ve been messing and working with trying to make great CSS for the names. Like Staff Premium news writer etc..
  • @ QM|T_JinX:
    ok so hows that going /
  • @ God:
    It’s going good. So we will see what happens and if the site can come back like it was or better
  • @ QM|T_JinX:
    nice yea lets hope
  • @ QM|T_JinX:
    im going to play some red dead it was great to have spoken to you bro nice to see you back on here
  • @ QM|T_JinX:
    hope you have a great night bro
  • @ God:
    It was good talking with you as well, you have a great night! We will talk later bro
    +1
  • Chat Bot:
    QM|T_JinX has joined the room.
  • @ QM|T_JinX:
    have a great weekend everybody ill be back after the weekend
  • Chat Bot:
    OkBrruh is our newest member. Welcome!
  • Chat Bot:
    uncrtin is our newest member. Welcome!
  • Chat Bot:
    BigTechModz is our newest member. Welcome!
  • @ BigTechModz:
    Hey this is RexMods I don’t remember the login to my old account so I made a new one I am now known as BigTechModz
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    iDior2K is our newest member. Welcome!
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    KillerDino49 is our newest member. Welcome!
      Chat Bot: KillerDino49 is our newest member. Welcome!
      Back
      Top