PC GTA IV ScriptHook mod menu help

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

ClonkAndre

New Member
Jan 3, 2019
2
0
1
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
 

coldmurda

Member
Nov 14, 2013
20
13
63
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.
 

lxlKingzOFAllModzlxl

Community Veteran
Retired Staff
Community Veteran
Determined Poster
Active Member
Console ID Poster
May 1, 2016
1,386
1,161
398
inside your mind
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 ;)
 

ClonkAndre

New Member
Jan 3, 2019
2
0
1
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
  • No one is chatting at the moment.
  • @ lurch6661:
    this site
  • @ QM|T_JinX:
    think there will be more online is when the jb on ps4 starts running
  • @ QM|T_JinX:
    not everybody have a ps5 and ps4 need low fw ps4 on lowfw is hard to find
  • @ lurch6661:
    yea that is very true
  • @ lurch6661:
    iam sure if my name was illuminated we could get more followers for cc
  • @ lurch6661:
    i forget how much it is
  • @ QM|T_JinX:
    not sure
  • Chat Bot:
    extiflyy is our newest member. Welcome!
  • @ lurch6661:
    my minds playing tricks on me
  • @ lurch6661:
    lol
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    viejo loco is our newest member. Welcome!
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    jaywill32 is our newest member. Welcome!
  • Chat Bot:
    iShatOnU__ has left the room.
  • Chat Bot:
    Pizzasheit has joined the room.
  • Chat Bot:
    oARSN is our newest member. Welcome!
  • Chat Bot:
    AbuDzar is our newest member. Welcome!
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    luizxert has posted a new reply in the thread "Premium Console ID #152".
    Chat Bot: luizxert has posted a new reply in the thread "Premium Console ID #152".