What's new

Tutorial [Tutorial] Simple GTA Print Mod Menu!

  • Thread starter Chr0m3 x MoDz
  • Start date
  • Views 1,023
C

Chr0m3 x MoDz

Knowledge is power, Power is corruption
VIP
Messages
5,376
Reaction score
7,928
Ok guys so this morning I have been helping Duck and I came up with this it's very simple something beginners can actually learn off.

The way this menu works if you press back on your controller and it will say menu activated then you press dpad right and it will scroll through your options then you press a on the option you want once done press back again to close the menu.

Code:
#include <natives.h>
#include <common.h>
#include <strings.h>
#include <types.h>
#include <consts.h>
 
#define SELECT 0xD
#define START 0xC
#define SQUARE 0xE
#define TRIANGLE 0xF
#define X 0x10
#define CIRCLE 0x11
#define DPAD_UP 0x8
#define DPAD_DOWN 0x9
#define DPAD_LEFT 0xA
#define DPAD_RIGHT 0xB
#define L2 0x5
#define R2 0x7
#define L1 0x4
#define R1 0x6
#define STICK_L 0x12
#define STICK_R 0x13
 
int menu=0;
int select=0;
int active=0;
 
// Base made by Chr0m3 x MoDz
 
void Print(char *string) /// Print function
{
PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", string, 5000, 1);
}
 
void function(void)
{
/// Mod 1
Print("Menu Slot 1 Activated");
}
 
void function_1(void)
{
/// Mod 2
Print("Menu Slot 2 Activated");
 
}
 
void menu_check(void)
{
if (IS_BUTTON_JUST_PRESSED(0, SELECT)) // button press anything in { and } will happen when you press select
{
if (menu == 0)
{
Print("Menu Activated");
menu=1;
}
else if (menu == 1)
{
menu=0;
Print("Menu Disabled");
}
}
}
 
void menu_fun(void)
{
if (menu == 1)
{
if (IS_BUTTON_JUST_PRESSED(0, DPAD_RIGHT))
{
if (select == 0)
{
Print("Menu Slot 1");
select=1;
active=1;
}
else if (select == 1)
{
Print("Menu Slot 2");
select=0;
active=2;
}
}
}
}
 
void button(void)
{
if (menu == 1)
{
if (IS_BUTTON_JUST_PRESSED(0, X))
{
if (active == 1)
{
function();
}
else if (active == 2)
{
function_1();
}
}
}
}
 
 
void main(void)
{
THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
Print("Chr0m3 x MoDz");
while(true)
{
button();
menu_fun();
menu_check();
WAIT(0);
}
}

Function and Function_1 are where you would put your code then you would go down to the menu_fun function and change the prints to what your mods are.

Now to add on to this you would just do this for example

you would add this

Code:
void function_2(void)
{
/// Mod 3 here
Print("Menu Slot 3");
}

then you would go down to menu_fun and do this
change
Code:
else if (select == 1)
{
Print("Menu Slot 2");
select=0;
active=2;
}
to
Code:
else if (select == 1)
{
Print("Menu Slot 2");
select=2;
active=2;
}
and then add this under
Code:
else if (select == 2)
{
select=0; /// Will go back to first option
active=3;
}
then you will go in to the button function and add this

Code:
else if (active == 3)
{
function_2();
}

The final code will look like this after you have added a option

Code:
#include <natives.h>
#include <common.h>
#include <strings.h>
#include <types.h>
#include <consts.h>
 
#define SELECT 0xD
#define START 0xC
#define SQUARE 0xE
#define TRIANGLE 0xF
#define X 0x10
#define CIRCLE 0x11
#define DPAD_UP 0x8
#define DPAD_DOWN 0x9
#define DPAD_LEFT 0xA
#define DPAD_RIGHT 0xB
#define L2 0x5
#define R2 0x7
#define L1 0x4
#define R1 0x6
#define STICK_L 0x12
#define STICK_R 0x13
 
int menu=0;
int select=0;
int active=0;
 
// Base made by Chr0m3 x MoDz
 
void Print(char *string) /// Print function
{
PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", string, 5000, 1);
}
 
void function(void)
{
/// Mod 1
Print("Menu Slot 1 Activated");
}
 
void function_1(void)
{
/// Mod 2
Print("Menu Slot 2 Activated");
}
 
void function_2(void)
{
/// Mod 3
Print("Menu Slot 3 Activated");
 
}
 
void menu_check(void)
{
if (IS_BUTTON_JUST_PRESSED(0, SELECT)) // button press anything in { and } will happen when you press select
{
if (menu == 0)
{
Print("Menu Activated");
menu=1;
}
else if (menu == 1)
{
menu=0;
Print("Menu Disabled");
}
}
}
 
void menu_fun(void)
{
if (menu == 1)
{
if (IS_BUTTON_JUST_PRESSED(0, DPAD_RIGHT))
{
if (select == 0)
{
Print("Menu Slot 1");
select=1;
active=1;
}
else if (select == 1)
{
Print("Menu Slot 2");
select=2;
active=2;
}
else if (select == 2)
{
Print("Menu Slot 3");
select=0;
active=3;
}
}
}
}
 
void button(void)
{
if (menu == 1)
{
if (IS_BUTTON_JUST_PRESSED(0, X))
{
if (active == 1)
{
function();
}
else if (active == 2)
{
function_1();
}
else if (active == 3)
{
function_2();
}
}
}
}
 
 
void main(void)
{
THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
Print("Chr0m3 x MoDz");
while(true)
{
button();
menu_fun();
menu_check();
WAIT(0);
}
}
 
Last edited:
T

TheGoldenGoose

Enthusiast
Messages
97
Reaction score
58
This is Golden Goose approved.
 
F

Frankie420 3

Newbie
Messages
20
Reaction score
5
This is a nice idea! Well done Chr0m3! :biggrin:
 
D

daxxphenom

Enthusiast
Messages
219
Reaction score
101
Good little base chrome, this is good for a trolly menu tbh and its really easy for the noobs to understand this
 
C

Chr0m3 x MoDz

Knowledge is power, Power is corruption
VIP
Messages
5,376
Reaction score
7,928
Good little base chrome, this is good for a trolly menu tbh and its really easy for the noobs to understand this
It's something for the noobs to learn how to use and not just copy and paste without learning anything. Also it's really not hard to convert this to a full blown menu.
 
D

daxxphenom

Enthusiast
Messages
219
Reaction score
101
It's something for the noobs to learn how to use and not just copy and paste without learning anything. Also it's really not hard to convert this to a full blown menu.
No i didnt mean like that i meant to say like this would be good for attaching objects or even for fun cars. Or even just a car spawner on this would be good too
 
C

CASINO

Member
Messages
2,917
Reaction score
1,416
That's not Cathering...
I know that DUH...It was a joke because it just reminded me of cathering when he had that topic about Approved thing.
 
P

PCMasterRace

Glorious
Messages
4,453
Reaction score
1,462
I know that DUH...It was a joke because it just reminded me of cathering when he had that topic about Approved thing.
Oh sorry, yeah that was pretty funny. :biggrin:
 
L

Liquid44

Banned
Messages
1,159
Reaction score
691
It's something for the noobs to learn how to use and not just copy and paste without learning anything. Also it's really not hard to convert this to a full blown menu.

Nice tut, quite useful for people wanting to learn.
I wrote a simple print menu for colours ages ago but nobody was interested in learning back then lol

http://www.se7ensins.com/forums/threads/basic-menu-for-colours.715455/

No i didnt mean like that i meant to say like this would be good for attaching objects or even for fun cars. Or even just a car spawner on this would be good too

The thread example I posted above is how my objects menu is made for attaching stuff to people.
 
S

SBHAX

Aye so...
Messages
2,934
Reaction score
2,137
Nice one Chrome.
Nice to see you helping out the community once again :smile:
 
M

Mrlobbies

Enthusiast
Messages
186
Reaction score
23
Ok guys so this morning I have been helping Duck and I came up with this it's very simple something beginners can actually learn off.

The way this menu works if you press back on your controller and it will say menu activated then you press dpad right and it will scroll through your options then you press a on the option you want once done press back again to close the menu.

Code:
#include <natives.h>
#include <common.h>
#include <strings.h>
#include <types.h>
#include <consts.h>
 
#define SELECT 0xD
#define START 0xC
#define SQUARE 0xE
#define TRIANGLE 0xF
#define X 0x10
#define CIRCLE 0x11
#define DPAD_UP 0x8
#define DPAD_DOWN 0x9
#define DPAD_LEFT 0xA
#define DPAD_RIGHT 0xB
#define L2 0x5
#define R2 0x7
#define L1 0x4
#define R1 0x6
#define STICK_L 0x12
#define STICK_R 0x13
 
int menu=0;
int select=0;
int active=0;
 
// Base made by Chr0m3 x MoDz
 
void Print(char *string) /// Print function
{
PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", string, 5000, 1);
}
 
void function(void)
{
/// Mod 1
Print("Menu Slot 1 Activated");
}
 
void function_1(void)
{
/// Mod 2
Print("Menu Slot 2 Activated");
 
}
 
void menu_check(void)
{
if (IS_BUTTON_JUST_PRESSED(0, SELECT)) // button press anything in { and } will happen when you press select
{
if (menu == 0)
{
Print("Menu Activated");
menu=1;
}
else if (menu == 1)
{
menu=0;
Print("Menu Disabled");
}
}
}
 
void menu_fun(void)
{
if (menu == 1)
{
if (IS_BUTTON_JUST_PRESSED(0, DPAD_RIGHT))
{
if (select == 0)
{
Print("Menu Slot 1");
select=1;
active=1;
}
else if (select == 1)
{
Print("Menu Slot 2");
select=0;
active=2;
}
}
}
}
 
void button(void)
{
if (menu == 1)
{
if (IS_BUTTON_JUST_PRESSED(0, X))
{
if (active == 1)
{
function();
}
else if (active == 2)
{
function_1();
}
}
}
}
 
 
void main(void)
{
THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
Print("Chr0m3 x MoDz");
while(true)
{
button();
menu_fun();
menu_check();
WAIT(0);
}
}

Function and Function_1 are where you would put your code then you would go down to the menu_fun function and change the prints to what your mods are.

Now to add on to this you would just do this for example

you would add this

Code:
void function_2(void)
{
/// Mod 3 here
Print("Menu Slot 3");
}

then you would go down to menu_fun and do this
change
Code:
else if (select == 1)
{
Print("Menu Slot 2");
select=0;
active=2;
}
to
Code:
else if (select == 1)
{
Print("Menu Slot 2");
select=2;
active=2;
}
and then add this under
Code:
else if (select == 2)
{
select=0; /// Will go back to first option
active=3;
}
then you will go in to the button function and add this

Code:
else if (active == 3)
{
function_2();
}

The final code will look like this after you have added a option

Code:
#include <natives.h>
#include <common.h>
#include <strings.h>
#include <types.h>
#include <consts.h>
 
#define SELECT 0xD
#define START 0xC
#define SQUARE 0xE
#define TRIANGLE 0xF
#define X 0x10
#define CIRCLE 0x11
#define DPAD_UP 0x8
#define DPAD_DOWN 0x9
#define DPAD_LEFT 0xA
#define DPAD_RIGHT 0xB
#define L2 0x5
#define R2 0x7
#define L1 0x4
#define R1 0x6
#define STICK_L 0x12
#define STICK_R 0x13
 
int menu=0;
int select=0;
int active=0;
 
// Base made by Chr0m3 x MoDz
 
void Print(char *string) /// Print function
{
PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", string, 5000, 1);
}
 
void function(void)
{
/// Mod 1
Print("Menu Slot 1 Activated");
}
 
void function_1(void)
{
/// Mod 2
Print("Menu Slot 2 Activated");
}
 
void function_2(void)
{
/// Mod 3
Print("Menu Slot 3 Activated");
 
}
 
void menu_check(void)
{
if (IS_BUTTON_JUST_PRESSED(0, SELECT)) // button press anything in { and } will happen when you press select
{
if (menu == 0)
{
Print("Menu Activated");
menu=1;
}
else if (menu == 1)
{
menu=0;
Print("Menu Disabled");
}
}
}
 
void menu_fun(void)
{
if (menu == 1)
{
if (IS_BUTTON_JUST_PRESSED(0, DPAD_RIGHT))
{
if (select == 0)
{
Print("Menu Slot 1");
select=1;
active=1;
}
else if (select == 1)
{
Print("Menu Slot 2");
select=2;
active=2;
}
else if (select == 2)
{
Print("Menu Slot 3");
select=0;
active=3;
}
}
}
}
 
void button(void)
{
if (menu == 1)
{
if (IS_BUTTON_JUST_PRESSED(0, X))
{
if (active == 1)
{
function();
}
else if (active == 2)
{
function_1();
}
else if (active == 3)
{
function_2();
}
}
}
}
 
 
void main(void)
{
THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
Print("Chr0m3 x MoDz");
while(true)
{
button();
menu_fun();
menu_check();
WAIT(0);
}
}
Great job, finally someone is helping the beginners I will be using this thanks
 
Top Bottom