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
  • @ lurch6661:
    but i will download the game
  • @ QM|T_JinX:
    cool
  • @ lurch6661:
    did you look into getting a new mic
  • @ QM|T_JinX:
    now not yet got one my self but i do got one lol
  • @ lurch6661:
    lol
  • @ QM|T_JinX:
    you got one /
  • @ lurch6661:
    gonna get one
  • @ lurch6661:
    need a wireless one
  • @ QM|T_JinX:
    well when you get your money maybe get one
  • @ QM|T_JinX:
    im gonna buy one this month but i also want to get the edg controler hahaha
  • @ QM|T_JinX:
    edge
  • @ QM|T_JinX:
    but let me know if you realy gonna install mw3 and if you want to play some matches we can work on a menu for you then
  • @ QM|T_JinX:
    im gonna watch a movie so catch you on the flip side
  • @ lurch6661:
    ok cool bro tc
  • @ lurch6661:
    i will download it for sure then
  • @ QM|T_JinX:
    keep in mind i do think there are free ones you maybe have to buy one and also dont do it on your main account make new one
  • @ ZockMock131:
    Hello there, is the Admin online?
  • @ QM|T_JinX:
    well im not a admin but maybe i can help /
  • @ ZockMock131:
    I want to delete my old account permantly bcs i dont use it anymore
  • @ QM|T_JinX:
    there is no option to delete a account for members im afraid
  • @ ZockMock131:
    Why is that bro
    ?
  • @ QM|T_JinX:
    not sure
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    nodikx is our newest member. Welcome!
  • Chat Bot:
    KrxzyMods is our newest member. Welcome!
    Chat Bot: KrxzyMods is our newest member. Welcome!