Post: Surge "Rise" Menu Base - NO OVERFLOW [UPDATED 11/11/14]
10-10-2014, 03:25 AM #1
TheFallen
Former Dark Night
(adsbygoogle = window.adsbygoogle || []).push({});
Surge "Rise" Menu Base




Surge is finally out of beta and with that comes better features and better updates! So keep your eyes out for those!
All updates will be posted here.

Update 1.3.1
(Only supported by GSC Studio)




  • Bug fixes


Features


  • Overflow fix - no more string overflows! NEW (see "Setting Text and Preventing Overflow")
  • Works with other menu base's menu formats
  • Cursor Remembrance
  • Menu Paging
  • Ultimate Control System
  • Verification
  • Live Player Menu
  • Built-in API
  • Stable
  • Multi-input functions


Controls


  • Open - Dpad Down
  • Exit - R3
  • Select - X
  • Close - O
  • Scroll Up/Down - L1/R1


API Information (Advanced)

API
accessability.gsc


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


hud_utilities.gsc


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



menu.gsc


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



toggle.gsc


Function Parameters Return CallOn Description
toggle var var
boolean state
none entity Toggles functions on and off with message



utilities.gsc


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)




Setting Text and Preventing Overflow


See "Creating Text", "Setting Text", and "Destroying Text" You must login or register to view this content.


Adding to the Menu
Adding Menus
Surge allows you to have multiple menus/submenus to help you organize your mods. You can do this by going to menu.gsc, updateMenu(), and calling addMenu(parent, name, title). Parent is the menu to add the menu to, name is the ID of the menu (must be unique), and title is the text to display for the title (if dynamic titles are enabled).

Ex:
    
updateMenu()
{
self addMenu("main", "accountSettings", "Account");
}


Adding Options
Surge allows you to have multiple menus/submenus to help you organize your mods. You can do this by going to menu.gsc, updateMenu(), and calling addOption(parent, label, function, [input], [type], [entity]). Parent is the menu to add the option to, label is the text to display, function is the function to be called when selected, input (optional) is the arguments to pass to the function when called, type (optional) is the type of function it is (see below), and entity (optional) is the entity to call the function on.

Simple

Adding a simple option is easy. All you need is the menu name, the option text, the function, and the input of you need one. Everything else is taken care of.

Ex:
    
updateMenu()
{
self addOption("main", "God Mode", ::enableGod);
self addOption("main", "God Mode", ::toggle, "god"); // Optional input
}



Advanced
Do not attempt the following unless you understand programming and what everything below means.


Surge allows you to have complete control over your mods. You can customize every aspect of the call to have it do what ever you need it to.

Input is optional but you can pass up to 5 arguments at once if you choose to. To do this simply create an array and add your desired inputs to the array and pass that in.

Type is optional and defaults to "thread" which runs the function async (along side) the rest. The other value for this is "immediate" which will pause execution, branch off, run the function, and then return to the parent thread.

Entity is optional and defaults to self. This allows you to call functions on any entity accessible in the scope.

Ex:
    
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);
}



Adding Options to the Player Menu
To add an option to the player menu add an option like you normally would except this time the type and entity arguments are required. Type should be "thread" for more info on this) and entitiy must be the client you want to call the function on (read Adding Options - Advanced for more information on these).

Ex:
    
updatePlayerMenu()
{
player = level.players[0];
self addOption(player + "Options", "Give God Mode", ::toggle, "god", "thread" player); // This will toggle god mode for this player.
}



Converting Menu Bases

Shark's Menu Base
To use Shark's menu base's option and menu format with Surge, simply copy and paste your old menu options and functions into updateMenu() or updatePlayerMenu() respectively. They will work right along with Surge's regular format with no problems.

Ex:
    
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;
}


Themes and Styling
Adding Colors
Go to main.gsc and find the function init(). Here is where you will define your colors.

Ex:
    
init()
{
//addColor(colorName, rgb)
addColor("red", (1, 0, 0));
}


Setting Colors
Go to main.gsc and find the function initSurge(). Here is where you will set your colors. You set them with setColor(type, elem, color). The type must exist in the first level of self.surge and the elem must exist in any level of self.surge[type]["hud"]. Color can be any (r, g, b) object. You can use predefined colors (view above) by calling color("color name").

Ex:
    
initSurge()
{
setColor("menu", "background", color("red"));
// or
setColor("menu", "background", (1, 0, 0));
}


Adding Themes
Go to main.gsc and find the function initSurge(). Here is where you will add your themes. You add them by calling addTheme(name, label, primaryColor, secondaryColor) with the name being the ID of the theme (must be unique), label being the text to display in the theme menu, and primaryColor and secondaryColor being any (r, g, b) object.

Ex:
    
initSurge()
{
addTheme("cherry", "Cherry", level.red, (1, 1, 1));
}


Turning On/Off Dynamic Menu Titles
Surge allows you to have dynamic menu titles. By default this is disabled to maximize stability but it can be turned on by going to main.gsc, initSurge(), and setting self.surge["settings"]["updateTitle"] = true;

Ex:
    
initSurge()
{
self.surge["settings"]["updateTitle"] = true; // On
self.surge["settings"]["updateTitle"] = false; // Off
}



Using the Toggle System
Surge comes with a easy-to-use toggle system that helps you create toggles. To start in main.gsc under initSurge() add an index to the vars array with the ID of your toggle. From there simply add an if statement with the ID of your toggle and inside of that is where the actual toggling goes on. To call it simply call toggle(var, [state]); You can either specify on/off or have it default to the opposite of what it currently is. Take a look at the example to see how to do this.

Ex:
    
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");
}


You must login or register to view this content.


Change Log

You must login or register to view this content.


  • Bug fixes



Past Updates

You must login or register to view this content.


  • Bug fixes
  • GUI change



You must login or register to view this content.


  • Shark Menu Base Converter



You must login or register to view this content.


  • Fixed Verifiaction Bug
  • Improved API
  • Added Overflow Fix (No string overflows)
  • GUI Changes



You must login or register to view this content.


Credits


  • ItsLollo1000 for his thread and anyone whose codes I used
  • Exelo for line_horizontal material
  • Taylor for reminding me how weird GSC when I tried doing something from a C language and for helping me test
  • iMCSx for his GSC Studio
  • Aiden729 for ideas and the release video
  • SyGnUs for testing
  • Adidas for testing
  • dtx12 for usage of clearAllTextAfterHudElem()
  • Shark for his menu base's option format
  • Natsu for menu base converter idea and references
Last edited by TheFallen ; 11-12-2014 at 03:52 AM. Reason: updated to 1.3.1

The following 41 users say thank you to TheFallen for this useful post:

/SneakerStreet/, A Friend, AlexNGU, anxify, BoatyMcBoatFace, BossamBemass, Bucko, canadiancaper, Chris, CustomSilent-, EncepT, ErasedDev, EternalHabit, Geo, iifire, iknownothing, Im Not Boobdidas, Im_YouViolateMe, ImPiffHD, ItsLollo1000, Jaredm09, John Leepe, M0T1VAT10N, MilkShakeModz, Obris, OrbitModding, Script Kiddie, seb5594, Shark, Source Code, StonedYoda, Taylor, SyGnUs, Synergy, Terrorize 420, The_Urban_Ninja, Vanz, zshred
10-31-2014, 03:45 AM #83
xCrankModz
Pokemon Trainer
Will this base be updates again?
10-31-2014, 04:19 AM #84
TheFallen
Former Dark Night
Originally posted by xCrankModz View Post
Will this base be updates again?


Yeah I have just been busy with other things.
10-31-2014, 09:45 AM #85
OpenlyLegit
Can’t trickshot me!
Originally posted by TheFallen View Post
Yeah I have just been busy with other things.


thanks for your hard work been using this base with no overflow or freezing only issue for me is in clients list the names disappears when that gets fixed this'll be perfect
10-31-2014, 05:47 PM #86
Sync
The (ONE) Above!
Originally posted by TheFallen View Post
kl


Why does it freeze when i inject it without changing anything on it.
10-31-2014, 09:14 PM #87
TheFallen
Former Dark Night
Originally posted by Sync View Post
Why does it freeze when i inject it without changing anything on it.


I dunno it doesn't for anyone else. I tested it myself and had no issues. When are you injecting it?
10-31-2014, 09:14 PM #88
TheFallen
Former Dark Night
Originally posted by oshea1995 View Post
thanks for your hard work been using this base with no overflow or freezing only issue for me is in clients list the names disappears when that gets fixed this'll be perfect


I plan to include that in the next update Smile

The following user thanked TheFallen for this useful post:

EternalHabit
10-31-2014, 09:20 PM #89
EternalHabit
Former Staff
Originally posted by TheFallen View Post
I plan to include that in the next update Smile


you should give DoHearts a test on your menu. it bugs outt alittle bit. the doheart will disappear then show menu names as the doheart. maybe add a custom doheart of your own inside the base to work with your menu?
10-31-2014, 09:44 PM #90
xCrankModz
Pokemon Trainer
Originally posted by xTurntUpLobbies View Post
you should give DoHearts a test on your menu. it bugs outt alittle bit. the doheart will disappear then show menu names as the doheart. maybe add a custom doheart of your own inside the base to work with your menu?


Yea i have the same issue
10-31-2014, 10:57 PM #91
Sync
The (ONE) Above!
Originally posted by TheFallen View Post
I dunno it doesn't for anyone else. I tested it myself and had no issues. When are you injecting it?


Never mind i figured it out, Anyways how can i add the Flyable Helicopter?
I had it fine on Shark's base but no luck on Surge.

Here's the code i have on my Shark's edit.

    traceBulletJet(traceDistance, traceReturn, detectPlayers)
{
if (!isDefined(traceDistance))
traceDistance = 10000000;

if (!isDefined(traceReturn))
traceReturn = "position";

if (!isDefined(detectPlayers))
detectPlayers = false;

return bulletTrace(self getEye(), self getEye() + VectorScale(AnglesToForward(self getPlayerAngles()), traceDistance), detectPlayers, self)[traceReturn];
}
changePHeliType(code, code2, print)
{
level.PHeliCheck = 1;
level.PHeliModel = code;
level.PHeliModel2 = code2;
self iPrintln("^3Set Helicopter Model to ^2" + print);
self changePHeliFov();
}
changePHeliFov()
{
if(level.PHeliModel2 == "veh_t6_drone_overwatch_light")
{
setDvar("cg_thirdPersonRange", "400");
}
else if(level.PHeliModel2 == "veh_t6_air_attack_heli_mp_dark")
{
setDvar("cg_thirdPersonRange", "550");
}
else if(level.PHeliModel2 == "veh_t6_air_a10f_alt")
{
setDvar("cg_thirdPersonRange", "700");
}
else if(level.PHeliModel2 == "veh_t6_drone_pegasus_mp")
{
setDvar("cg_thirdPersonRange", "600");
}
}
PHeliModellb()
{
changePHeliType("heli_guard_mp", "veh_t6_drone_overwatch_light", "Little Bird");
}
PHeliModelah()
{
changePHeliType("heli_ai_mp", "veh_t6_air_attack_heli_mp_dark", "Attack Helicopter");
}
PHeliModela10()
{
changePHeliType("heli_ai_mp", "veh_t6_air_a10f_alt", "A10 Thunderbolt");
}
PHeliModelstlh()
{
changePHeliType("heli_ai_mp", "veh_t6_drone_pegasus_mp", "Stealth Bomber");
}
initPilotHeli()
{
if(level.pilotHeliOn == 0)
{
level.pilotHeliOn = 1;
if(level.PHeliCheck == 0)
{
level.PHeliCheck = 1;
self thread PHeliModellb();
}
self thread comePilotHeli();
}
else
{
self iPrintlnbold("^3Helicopter is ^1already spawned.");
}
}
comePilotHeli()
{
self endon("disconnect");
self endon("stop_comePHeli");
for(;Winky Winky
{
if(level.comePHeliOn == 0)
{
self iPrintlnbold("^3Please set ^6Helicopter's landing zone.");
wait 1;
Location = locationSelector();
level.comePHeliOn = 1;
}
if(level.comePHeliOn == 1)
{
level.PHeli = spawnHelicopter(self, self.origin + (12000, 0, 1500), self.angles, level.PHeliModel, level.PHeliModel2);
level.PHeli.owner = self;
level.PHeli.team = self.team;
self iPrintlnbold("^3Landing zone ^2pointed.");
self iPrintln("^1Helicopter will arrive soon...");
level.comePHeliOn = 2;
}
if(level.comePHeliOn == 2)
{
level.PHeli setSpeed(1000, 25);
level.PHeli setVehGoalPos(Location + (0, 0, 1500), 1);
wait 14;
level.PHeli setSpeed(200, 20);
level.PHeli setVehGoalPos(Location + (0, 0, 65), 1);
level.comePHeliOn = 0;
foreach(p in level.players)
{
p thread ridePilotHeli();
}
self notify("stop_comePHeli");
}
wait 0.05;
}
}
ridePilotHeli()
{
self endon("disconnect");
self endon("stop_ridePHeli");
for(;Winky Winky
{
self.ridePHeliInfo destroy();
if(distance(self.origin, level.PHeli.origin) < 150)
{
self.ridePHeliInfo = self createFontString("hudbig", 1.Cool Man (aka Tustin);
self.ridePHeliInfo setPoint( "TOP", "TOP", 0, 50 );
self.ridePHeliInfo setText("^3Press [{+usereload}] to ^1Ride on Helicopter");

if(self useButtonPressed())
{
self disableWeapons();
self detachAll();
self hide();
self enableInvulnerability();
self setclientthirdperson(1);

self thread movePilotHeli();
self thread attackPHeli();
self thread stopPilotHeli();
self thread exitPilotHeli();
self thread infoPHeliOn();
}
}
wait 0.05;
}
}
infoPHeliOn()
{
self.PHeliInfoOn = self drawText("^0R1 ^2Accel\n^0R2 ^2Rise\n^0L2 ^2Fall\n[{+switchseat}] ^5Change Weapon\n^0L1 ^5Fire Weapon\n^0<-- ^6Change Action\n[{+actionslot 2}] do Action\n[{+stance}] ^3Exit\n^0R3 ^3Delete", "objective", 1.2, -280, 225, (1, 1, 1), 0, (0, 0, 1), 1, 1);
self.PHeliInfoOn fadeAlphaChange(.2, 1);

foreach(p in level.players)
{
p notify("stop_ridePHeli");
p.ridePHeliInfo destroy();
}
}
infoPHeliOff()
{
self.PHeliInfoOn fadeAlphaChange(.2, 0);
wait 0.2;
self.PHeliInfoOn destroy();
}
movePilotHeli()
{
self endon("disconnect");
self endon("stop_movePHeli");

self changePHeliFov();
self PlayerLinkTo(level.PHeli);
self setPlayerAngles(level.PHeli.angles + (0, 0, 0));
self setOrigin(((level.PHeli.origin + (-200, 0, 150)) + (AnglesToForward(level.PHeli.angles) * 30) + (0, 0, 3)));
level.PHeliSpeed = 0;
PHeliTrace = undefined;
newPHeliAngles = undefined;

for(;Winky Winky
{
PHeliTrace = playerAnglesToForward(self, 200 + level.PHeliSpeed);
if(self attackButtonPressed())
{
if(level.PHeliSpeed < 0)
{
level.PHeliSpeed = 0;
}
if(level.PHeliSpeed < 500)
{
level.PHeliSpeed += 5;
level.PHeli setYawSpeed(150, 80);
level.PHeli setSpeed(270, 90);
level.PHeli setVehGoalPos(PHeliTrace, 1);
}
}
if(self fragButtonPressed())
{
if(level.PHeliSpeed < 0)
{
level.PHeliSpeed = 0;
}
if(level.PHeliSpeed < 500)
{
level.PHeliSpeed += 5;
level.PHeli setYawSpeed(150, 80);
level.PHeli setSpeed(270, 90);
level.PHeli setVehGoalPos(level.PHeli.origin + (0, 0, level.PHeliSpeed), 1);
}
}
if(self secondaryOffhandButtonPressed())
{
if(level.PHeliSpeed > 0)
{
level.PHeliSpeed = 0;
}
if(level.PHeliSpeed > -500)
{
level.PHeliSpeed -= 5;
level.PHeli setYawSpeed(150, 80);
level.PHeli setSpeed(270, 90);
level.PHeli setVehGoalPos(level.PHeli.origin + (0, 0, level.PHeliSpeed), 1);
}
}
if(level.PHeliSpeed == 500)
{
level.PHeliSpeed = 400;
}
if(level.PHeliSpeed == -500)
{
level.PHeliSpeed = -400;
}
wait 0.05;
}
}
attackPHeli()
{
self endon("disconnect");
self endon("stop_attackPHeli");

if(level.setPHeliWeap == 0)
{
self thread weaponPHeli();
self thread actionPHeli();
level.setPHeliWeap = 1;
}

self.PHeliNowWeap = self drawText("^3Armament: ^1" + level.PHeliWeapName, "objective", 2, 0, 330, (1, 1, 1), 0, (1, 0, 1), 1, 1);
self.PHeliNowWeap fadeAlphaChange(.2, 1);
self.PHeliNowAction = self drawText("^3Action: ^4" + level.PHeliactionName, "objective", 2, 0, 360, (1, 1, 1), 0, (0, 1, 1), 1, 1);
self.PHeliNowAction fadeAlphaChange(.2, 1);

for(;Winky Winky
{
if(self changeSeatButtonPressed())
{
self thread weaponPHeli();
self.PHeliNowWeap destroy();
self.PHeliNowWeap = self drawText("^3Armament: ^1" + level.PHeliWeapName, "objective", 2, 0, 330, (1, 1, 1), 0, (1, 0, 1), 1, 1);
self.PHeliNowWeap fadeAlphaChange(.2, 1);
wait 0.2;
}
if(self adsButtonPressed())
{
if(level.PHeliWeapType == "cobra_20mm_mp" || level.PHeliWeapType == "helicopter_player_gunner_mp")
{
MagicBullet(level.PHeliWeapType, level.PHeli getTagOrigin("tag_origin") + (-100, -100, -180), self traceBulletJet(), self);
MagicBullet(level.PHeliWeapType, level.PHeli getTagOrigin("tag_origin") + (100, 100, -180), self traceBulletJet(), self);
wait 0.01;
}
else
{
MagicBullet(level.PHeliWeapType, level.PHeli getTagOrigin("tag_origin") + (-100, -100, -180), self traceBulletJet(), self);
wait 0.15;
MagicBullet(level.PHeliWeapType, level.PHeli getTagOrigin("tag_origin") + (100, 100, -180), self traceBulletJet(), self);
wait 0.15;
}
}
if(self actionSlotThreeButtonPressed())
{
self notify("stop_bombUsing");
self thread actionPHeli();
self.PHeliNowAction destroy();
self.PHeliNowAction = self drawText("^3Action: ^4" + level.PHeliactionName, "objective", 2, 0, 360, (1, 1, 1), 0, (0, 1, 1), 1, 1);
self.PHeliNowAction fadeAlphaChange(.2, 1);
wait 0.2;
}
if(self actionSlotTwoButtonPressed())
{
if(level.PHeliactionType == "dropCP")
{
self thread initPHeliCP();
}
else if(level.PHeliactionType == "empBomb")
{
self thread initPHeliNuke();
}
else if(level.PHeliactionType == "bomblet")
{
self thread initPHeliBomb();
}
}
wait 0.05;
}
}
initPHeliBomb()
{
self endon("disconnect");
self endon("stop_bombUsing");
for(;Winky Winky
{
MagicBullet(level.PHeliWeapType, level.PHeli.origin + (0, 0, -220), level.PHeli.origin + (0, 0, -10000), self);
wait 0.2;
}
}
initPHeliCP()
{
self endon("disconnect");
self endon("stop_cpUsing");
for(;Winky Winky
{
if(level.PHeliDroped == 0)
{
self thread maps\mp\killstreaks\_supplydrop::dropcrate(level.PHeli.origin + (0, 0, -20), self.angles, "supplydrop_mp", self, self.team, self.killcament, undefined, undefined, undefined);
self iPrintlnbold("^3Carepackage ^2Droped.");
self iPrintln("^3Next you can drop for ^1wait 5 sec.");
level.PHeliDroped = 1;
}
if(level.PHeliDroped == 1)
{
wait 5;
self iPrintln("^5Carepackage Drop ^2charged.");
level.PHeliDroped = 0;
self notify("stop_cpUsing");
}
wait 0.05;
}
}
initPHeliNuke()
{
self endon("disconnect");
self endon("stop_nukeUsing");

for(;Winky Winky
{
if(level.nukeUsed == 0)
{
foreach(p in level.players)
{
p thread maps\mp\gametypes\_hud_message::hintMessage("^3---^1Nuke Bomblet Warning^3---", 7);
}

PHeliNuke = spawn("script_model", level.PHeli.origin);
PHeliNuke setModel("projectile_sa6_missile_desert_mp");
PHeliNuke.angles = (90, 90, 90);
self thread nukeFireEffect(PHeliNuke);

PHeliNuke moveto(PHeliNuke.origin + (0, 0, -750), 9);
wait 9.1;
self notify("stop_PHeliNuke");

if(GetDvar("mapname") == "mp_nuketown_2020")
{
level._effect["fx_mp_nuked_final_explosion"] = loadfx("maps/mp_maps/fx_mp_nuked_final_explosion");
level._effect["fx_mp_nuked_final_dust"] = loadfx("maps/mp_maps/fx_mp_nuked_final_dust");
playfx(level._effect["fx_mp_nuked_final_explosion"], PHeliNuke.origin);
playfx(level._effect["fx_mp_nuked_final_dust"], PHeliNuke.origin);
}
else
{
level._effect["emp_flash"] = loadfx("weapon/emp/fx_emp_explosion");
playfx(level._effect["emp_flash"], PHeliNuke.origin);
}

foreach(p in level.players)
{
p playsound("wpn_emp_bomb");
}
earthquake(0.6, 7, PHeliNuke.origin, 12345);

foreach(p in level.players)
{
if (level.teamBased && self.pers["team"] == p.pers["team"])
{

}
else
{
if (p != self)
p thread [[level.callbackPlayerDamage]](self, self, 1000, 0, "MOD_MELEE", "remote_missile_missile_mp", (0, 0, 0), (0, 0, 0), "head", 0, 0);
}
}

wait 0.1;
PHeliNuke delete();
wait 7;
self iPrintlnbold("^3Next you can use ^5Nuclear Explosion ^3for ^1wait 20 sec.");
level.PHelinukePrint = 1;
level.nukeUsed = 1;
}
if(level.nukeUsed == 1)
{
wait 13;
self iPrintln("^5Nuclear Explosion ^2charged.");
level.nukeUsed = 0;
self notify("stop_nukeUsing");
}
wait 0.05;
}
}
nukeFireEffect(PHeliNuke)
{
self endon("disconnect");
self endon("stop_PHeliNuke");
level._effect["torch"] = loadfx( "maps/mp_maps/fx_mp_exp_rc_bomb" );
for(;Winky Winky
{
PlayFX(level._effect["torch"], PHeliNuke.origin + (0, 0, 120));
wait 0.1;
}
}
weaponPHeli()
{
if(level.PHeliWeapon == 0)
{
level.PHeliWeapon = 1;
level.PHeliWeapType = "smaw_mp";
level.PHeliWeapName = "SMAW";
}
else if(level.PHeliWeapon == 1)
{
level.PHeliWeapon = 2;
level.PHeliWeapType = "ai_tank_drone_rocket_mp";
level.PHeliWeapName = "A.G.R Rocket";
}
else if(level.PHeliWeapon == 2)
{
level.PHeliWeapon = 3;
level.PHeliWeapType = "straferun_rockets_mp";
level.PHeliWeapName = "Warthog Rockets";
}
else if(level.PHeliWeapon == 3)
{
level.PHeliWeapon = 4;
level.PHeliWeapType = "remote_missile_bomblet_mp";
level.PHeliWeapName = "Mortar Missile Burner";
}
else if(level.PHeliWeapon == 4)
{
level.PHeliWeapon = 5;
level.PHeliWeapType = "missile_swarm_projectile_mp";
level.PHeliWeapName = "Swarm";
}
else if(level.PHeliWeapon == 5)
{
level.PHeliWeapon = 6;
level.PHeliWeapType = "remote_mortar_missile_mp";
level.PHeliWeapName = "Loadstar";
}
else if(level.PHeliWeapon == 6)
{
level.PHeliWeapon = 7;
level.PHeliWeapType = "remote_missile_missile_mp";
level.PHeliWeapName = "Remote Mortar Missile";
}
else if(level.PHeliWeapon == 7)
{
level.PHeliWeapon = 0;
level.PHeliWeapType = "cobra_20mm_mp";
level.PHeliWeapName = "Cobra 20mm Bullet";
}
}
actionPHeli()
{
if(level.PHeliaction == 0)
{
level.PHeliaction = 1;
level.PHeliactionType = "dropCP";
level.PHeliactionName = "Drop CarePackage";
}
else if(level.PHeliaction == 1)
{
level.PHeliaction = 2;
level.PHeliactionType = "empBomb";
level.PHeliactionName = "Nuclear Explosion";
}
else if(level.PHeliaction == 2)
{
level.PHeliaction = 0;
level.PHeliactionType = "bomblet";
level.PHeliactionName = "Bomblet to Under";
}
}
stopPilotHeli()
{
self endon("disconnect");
self endon("stop_stopPHeli");

for(;Winky Winky
{
if(self stanceButtonPressed())
{
self notify("stop_movePHeli");
self notify("stop_attackPHeli");
self notify("stop_exitPHeli");
self notify("stop_bombUsing");

level.PHeliSpeed = 0;
setDvar("cg_thirdPersonRange", "100");

self.PHeliNowWeap destroy();
self.PHeliNowAction destroy();
self thread infoPHeliOff();
self unlink();
self enableWeapons();
self show();
self setClientThirdPerson(0);
self disableInvulnerability();

foreach(p in level.players)
{
p thread ridePilotHeli();
}
self notify("stop_stopPHeli");
}
wait 0.05;
}
}
exitPilotHeli()
{
self endon("disconnect");
self endon("stop_exitPHeli");

for(;Winky Winky
{
if(self meleeButtonPressed())
{
self notify("stop_movePHeli");
self notify("stop_attackPHeli");
self notify("stop_stopPHeli");
self notify("stop_bombUsing");

level.PHeliSpeed = 0;
setDvar("cg_thirdPersonRange", "100");

self.PHeliNowWeap destroy();
self.PHeliNowAction destroy();
self thread infoPHeliOff();
self unlink();
self enableWeapons();
self show();
self setClientThirdPerson(0);
self disableInvulnerability();

level.PHeli delete();
level.pilotHeliOn = 0;
self notify("stop_exitPHeli");
}
wait 0.05;
}
}

Copyright © 2025, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo