creds
BluntStuffy did a tut on this 1st
I had to make this for my mod I needed one button that's not used by default and can be picked up by GSC
I used all the normal ones up like AdsButtonPressed() FragButtonPressed() the only downside I see now is it doesn't save the button after the game is closed 4 some people tested with 5 diff testers
and yes this works coop as long as they set a button on main menu like in the pic below dont mater what is set will still
notified a gsc its bin pressed
this can also be set up to set dvars and other stuff pm me for info on that
if you need coop testers check this discord its where i get mine
https://discord.gg/PncbcvTvid of a coop test
step 1go to raw/ui/main.menu // or the name of a main menu you made or have if not go to raw/ui/main.menu
open it look for this line
will look like this but a number where ? is mine is on line 523 yours will be around same place i added other stuff to my main.menu needs to be under #ifdef PC some ways down
CHOICE_BUTTON_VIS( ?, "@MENU_QUIT", open quit_popmenu, when( !localvarBool( ui_hideBack ) ); )
step 2put this right above it
CHOICE_BIND( ?, "button name here", "openScriptMenu allmods_menu allmodsgscnotify", ; )
you see where the ? is put the number that this has there in the CHOICE_BIND where its ? is then make the CHOICE_BUTTON_VIS ? one number bigger
CHOICE_BUTTON_VIS( ?, "@MENU_QUIT", open quit_popmenu, when( !localvarBool( ui_hideBack ) ); )
will look something like this
CHOICE_BIND( 9, "button name here", "openScriptMenu allmods_menu allmodsgscnotify", ; )
CHOICE_BUTTON_VIS( 10, "@MENU_QUIT", open quit_popmenu, when( !localvarBool( ui_hideBack ) ); )
where this is put what you want it to show in game on main menu in this part "button name here"
save the main.menu file and close it
step 3put this in mod.csv if your dont have a one // if you do this should be dun already for your menu file
step 4setting up the GSc to be notified of the button being pressed
you set with new button you set on the main menu in game // just click it in game on mane menu and push a button dont use already used buttons when you make your mod every player will need to set what ever buttons they want
will notified a gsc the same no matter what is picked
in gsc use this setup to pick up the new button being pressed and what you want in it and it can be looped
whatever()
{
self endon("disconnect");
for(;;)
{
self waittill("menuresponse",menu,response);
{
if(response == "allmodsgscnotify")
{
iprintlnbold("test new button "); // remove after testing
your code her
}
}
wait 0.05;
}
}
warning do not Precache the pics you use will get error in coop sooner or latter they will still showthats it all dun build your mod set button on main menu go in game test your new button out
if used cred all above in creds
more getting added to tut soon