Function | Parameters | Return | CallOn | Description |
checkAccess | none | none | client | Checks if the player has access and welcome them |
changePlayerAccess | client player int accessLevel |
none | client | Changes the access level of a player with a message |
setAccessLevel | int accessLevel | none | client | Sets the access level of a player |
getAccessLevel | none | int | client | Gets the access level of a player |
getAccessLevelStatus | [string acLevel] | string | client | Gets the access level status of a player |
Function | Parameters | Return | CallOn | Description |
setColor | string type string elem string color |
none | level | Sets an elements color in settings (does not actually change the visible color) |
color | string name | rgb | level | Gets the rgb values for the specificed color (color must be defined using setColor()) |
addTheme | string name string label (r,g,b) primaryColor (r,g,b) secondaryColor |
none | client | Adds a theme for the menu |
setSafeText | client player string str |
none | text element | Sets an element |
Function | Parameters | Return | CallOn | Description |
addMenu | string parent string name string title |
none | client | Adds a menu |
addOption | string parent string label function function var input string type entity entity |
none | client | Adds an option to a menu |
exitMenu | none | none | client | Exits the menu |
Function | Parameters | Return | CallOn | Description |
toggle | var var boolean state |
none | entity | Toggles functions on and off with message |
Function | Parameters | Return | CallOn | Description |
getName | none | string | client | Gets the player's name without a clantag |
isEmpty | var var | boolean | entity | Tells if the var is defined or is empty |
enableDebugMode | boolean toggle | none | level | Toggles debug mode for Surge |
addSetting | string name val value |
none | level | Adds a setting for Surge |
getSetting | string name | val | level | Gets the value of a setting for Surge |
addVar | string name val value |
none | client | Adds a var for a player (used in toggles) |
getVar | string name | val | client | Gets the value of a var for a player (used in toggles) |
updateMenu()
{
self addMenu("main", "accountSettings", "Account");
}
updateMenu()
{
self addOption("main", "God Mode", ::enableGod);
self addOption("main", "God Mode", ::toggle, "god"); // Optional input
}
updateMenu()
{
player = level.players[0];
inputArray = [];
inputArray[0] = "arg1";
inputArray[1] = 2;
...
inputArray[4] = myObj; // last;
self addOption("main", "Multi Arg Func", ::multiFunc, input, "immediate", player); // This is equivalent to player multiFunc("arg1", 2, ..., myObj);
self addOption("main", "Multi Arg Func 2", ::multiFunc, input, "thread", player); // This is equivalent to player thread multiFunc("arg1", 2, ..., myObj);
}
updatePlayerMenu()
{
player = level.players[0];
self addOption(player + "Options", "Give God Mode", ::toggle, "god", "thread" player); // This will toggle god mode for this player.
}
updateMenu()
{
self addMenu("", "main", "Surge");
self add_menu("test", "main", "Test Menu");
// Options in Shark's menu base format
self add_option("test", "Item", ::test);
self add_option("test", "Item 1", ::testOne, "arg1");
self add_option("test", "Item 2", ::testTwo, "arg1", "arg2");
self add_menu_alt("subMenu", "test");
self add_option("subMenu", "Sub Item", ::test);
self add_option("subMenu", "Sub Item 1", ::testOne, "arg1");
self add_option("subMenu", "Sub Item 2", ::testTwo, "arg1", "arg2");
//
self addMenu("main", "self", "Me");
self addOption("self", "God Mode", ::toggle, "god");
self addOption("self", "Unlimited Ammo", ::toggle, "ammo");
self addOption("self", "No Clip", ::toggle, "noclip");
}
updatePlayersMenu()
{
self.surge["menu"]["players"]["options"] = [];
foreach(player in level.players)
{
name = player getName();
menu = "player_" + name;
accessLevelsMenu = name + "_access_levels";
self addMenu("players", menu, "[" + player getAccessLevelStatus() + "] " + name);
if(player isHost() == false)
{
self addMenu(menu, accessLevelsMenu, "Change Access Level");
input = [];
input[0] = player; // This never changes because our first input is always the player
input[1] = 0; // This changed because it represents different access levels
self addOption(accessLevelsMenu, "Level 0 (" + level.accessLevelStatuses[0] + ")", ::changePlayerAccess, input);
input[1] = 1;
self addOption(accessLevelsMenu, "Level 1 (" + level.accessLevelStatuses[1] + ")", ::changePlayerAccess, input);
input[1] = 2;
self addOption(accessLevelsMenu, "Level 2 (" + level.accessLevelStatuses[2] + ")", ::changePlayerAccess, input);
// Shark's Menu Option Format
self add_option(accessLevelsMenu, "Option", ::function, input1, input2);
self add_option(accessLevelsMenu, "Option 1", ::function, input1, input2);
self add_option(accessLevelsMenu, "Option 2", ::function, input1, input2);
//
}
}
if(isEmpty(self.surge["menu"]["players"]["options"][self.surge["menu"]["players"]["position"]]))
self.surge["menu"]["players"]["position"] = 0;
}
init()
{
//addColor(colorName, rgb)
addColor("red", (1, 0, 0));
}
initSurge()
{
setColor("menu", "background", color("red"));
// or
setColor("menu", "background", (1, 0, 0));
}
initSurge()
{
addTheme("cherry", "Cherry", level.red, (1, 1, 1));
}
initSurge()
{
self.surge["settings"]["updateTitle"] = true; // On
self.surge["settings"]["updateTitle"] = false; // Off
}
initSurge()
{
self.surge["vars"]["god"] = false; // Defaults to false because we don't have god mode on when we spawn.
}
toggle(var, state)
{
if(isEmpty(state))
self.surge["vars"][var] = !self.surge["vars"][var];
else
self.surge["vars"][var] = state;
if(self.surge["vars"][var] == true)
status = "^2Enabled";
else
status = "^1Disabled";
// God mode
if(var == "god")
{
self iprintln("God Mode: " + status);
if(self.surge["vars"][var] == true)
self EnableInvulnerability();
else
{
// Only disable if not in menu; else will be disabled upon menu exit
if(self.surge["menu"]["active"] == false)
self DisableInvulnerability();
}
}
// generic example
else if(var == "varName")
{
self iprintln("Var Name: " + status); // prints out our status
if(self.surge["vars"][var] == true) // toggled on
self thread turnOnVar();
else // toggled off
self thread turnOffVar();
}
}
updateMenu()
{
self addOption("main", "God Mode", ::toggle, "god");
}
Function | Parameters | Return | CallOn | Description |
checkAccess | none | none | client | Checks if the player has access and welcome them |
changePlayerAccess | client player int accessLevel |
none | client | Changes the access level of a player with a message |
setAccessLevel | int accessLevel | none | client | Sets the access level of a player |
getAccessLevel | none | int | client | Gets the access level of a player |
getAccessLevelStatus | [string acLevel] | string | client | Gets the access level status of a player |
Function | Parameters | Return | CallOn | Description |
setColor | string type string elem string color |
none | N/A | Sets an elements color in settings (does not actually change the visible color) |
addTheme | string name string label (r,g,b) primaryColor (r,g,b) secondaryColor |
none | client | Adds a theme for the menu |
Function | Parameters | Return | CallOn | Description |
addMenu | string parent string name string title |
none | client | Adds a menu |
addOption | string parent string label function function var input string type entity entity |
none | client | Adds an option to a menu |
exitMenu | none | none | client | Exits the menu |
Function | Parameters | Return | CallOn | Description |
toggle | var var boolean state |
none | entity | Toggles functions on and off with message |
Function | Parameters | Return | CallOn | Description |
getName | none | string | client | Gets the player's name without a clantag |
isEmpty | var var | boolean | entity | Tells if the var is defined or is empty |
init()
{
level.red = (1, 0, 0);
}
initSurge()
{
setColor("menu", "background", red);
// or
setColor("menu", "background", (1, 0, 0));
}
initSurge()
{
addTheme("cherry", "Cherry", level.red, (1, 1, 1));
}
initSurge()
{
self.surge["settings"]["updateTitle"] = true; // On
self.surge["settings"]["updateTitle"] = false; // Off
}
updateMenu()
{
self addMenu("main", "accountSettings", "Account");
}
updateMenu()
{
self addOption("main", "God Mode", ::enableGod);
self addOption("main", "God Mode", ::toggle, "god"); // Optional input
}
updateMenu()
{
player = level.players[0];
inputArray = [];
inputArray[0] = "arg1";
inputArray[1] = 2;
...
inputArray[4] = myObj; // last;
self addOption("main", "Multi Arg Func", ::multiFunc, input, "immediate", player); // This is equivalent to player multiFunc("arg1", 2, ..., myObj);
self addOption("main", "Multi Arg Func 2", ::multiFunc, input, "thread", player); // This is equivalent to player thread multiFunc("arg1", 2, ..., myObj);
}
updatePlayerMenu()
{
player = level.players[0];
self addOption(player + "Options", "Give God Mode", ::toggle, "god", "thread" player); // This will toggle god mode for this player.
}
Copyright © 2024, NextGenUpdate.
All Rights Reserved.