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

Autoload Scripts Tutorial

SwizzyPlays

Active Poster
CC Dev Team
Active Member
Hello guys here is a quick tut on how to make "Mod Settings" or auto loads for your menu! A couple days ago I couldn't figure out how to do but I eventually figured it out!

AUTO LOADS SCO'S TUTORIAL
This is a simple auto loader that you could perfect if you wanted! I am not that good at coding lol so this was useful to me!

How to set the autoload function
void godmodescript(void)
{
if (GET_NUMBER_OF_INSTANCES_OF_STREAMED_SCRIPT("godmode_uclip") == 0)
{
REQUEST_SCRIPT("godmode_uclip");
//name of sco. Example used here: godmode_uclip
while (!HAS_SCRIPT_LOADED("godmode_uclip"))
WAIT(0);

START_NEW_SCRIPT("godmode_uclip", 1024);
MARK_SCRIPT_AS_NO_LONGER_NEEDED("godmode_uclip");
}
}

Where to call the function(main)
void main(void)
{

protections_load();
godmodescript();
//Where the function is called, I have other set as above & below!
NETWORK_GHOST();
loadmod();
menu_core_startup();
draw_startup();
disablemenuinpause();

while(true)
{
WAIT(0);

if (!IS_STRING_NULL(load_script) && !script_loaded)
load_script_prioritized();

// Core menu function (Catch button press. Set menu).
if (IS_STRING_NULL(load_script))
menu_core();

// Draw background/header/text.
drawWindow();
//drawwindow2();

// Draw button input.
drawFrontend();

drawHeader();
//drawHeader2();
//drawFoot();
//drawFoot2();
menu_draw();

DESTROY_MOBILE_PHONE();

TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME("disablemenu");
HIDE_HELP_TEXT_THIS_FRAME();
HIDE_HUD_AND_RADAR_THIS_FRAME();
}
}



Hope this helped someone! One thing that this does cause is that everytime you open your menu up the sco's reload. Other than that its good!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
      Chat Bot: jerpator is our newest member. Welcome!
      Back
      Top