Post: [GSC] Use Menu in Spectator, Martyrdom, Force Prone
04-10-2017, 03:26 AM #1
ProfoundModz
Can’t trickshot me!
(adsbygoogle = window.adsbygoogle || []).push({}); These are just some basic player functions that I rarely, or haven't seen yet and a better spectator menu.


Force Prone

    initForceProne(player) //The initial function
{
if(player.Prone == 0 && !player isHost())
{
self iprintln(player.name+ " is ^2being^7 Force Proned Happy");
player.Prone = 1;
player ForceProne();
}
else
{
player.Prone = 0;
player notify("StopPronePlayer");
self iprintln(player.name+ " is ^1not^7 being Force Proned");
}
}

FPAll() //All Players
{
foreach(player in level.players)
{
if(player.Prone == false && !player isHost())
{
player thread ForceProne();
player.Prone = true;
player iPrintln("All Players are ^2being^7 Force Proned Happy");
}
else
{
player notify("StopPronePlayer");
player.Prone = false;
player iPrintln("All Players are ^1not^7 being Force Proned");
}
}
}

ForceProne() //The function
{
self endon("StopPronePlayer");
for(;Winky Winky //You could probably just do a while statement here, but it would still use a lot of memory.
{
if(!self.CurrStance)
{
self setstance("prone");
self.CurrStance = true;
wait .04;
}
self.CurrStance = false;
}
wait 0.1;
}


Call like:
::initForceProne, player); //on a player
::initForceProne, self); //on yourself
::FPAll); //All Players




Martyrdom

    
Martyrdom(player)
{
if(!player.Martyrdom)
{
player endon("disconnect");
level endon("disconnect");
player endon("End_Martyrdom");
player iPrintln("Martyrdom ^2On");
player.Martyrdom = true;
for(;Winky Winky
{
if(!player.MartyrdomSpawn)
{
player waittill("death");
player ExplodeClient();
player.MartyrdomSpawn = true;
player waittill("spawned_player");
player.MartyrdomSpawn = false;
}
}
wait 0.1;
}
else
{
player notify("End_Martyrdom");
player iPrintln("Martyrdom ^1Off");
player.Martyrdom = false;
}
}

ExplodeClient()
{
self.exp = spawn("script_model",self.origin);
self.exp playSound("exp_barrel");
Playfx(level.chopper_fx["explode"]["small"], self.origin);
Playfx(level.chopper_fx["explode"]["small"], self.origin+(0,0,30));
RadiusDamage(self.origin,500,500,500);
wait 0.1;
self.exp delete();
}


Call like:
::Martyrdom, player); //on a player
::Martyrdom, self); //on yourself





Spectator Menu
Firstly, you will need to find your initial self waittill("spawned_player"); function in the onPlayerSpawned function, and add this directly under it.


    
self.openmenu = "ALIVE-Open";
self.backmenu = "ALIVE-Back";
self.up = "ALIVE-Up";
self.down = "ALIVE-Down";



Now under all of that code, just before the end closing bracket, add this. (make sure it is still in the spawn loop, there should be 2x } after it)

    
self waittill ("death");
waittillframeend;
self.openmenu = "DEAD-Open";
self.backmenu = "DEAD-Back";
self.up = "DEAD-Up";
self.down = "DEAD-Down";



Now we need to add this function somewhere in your menu.

You can edit all of the button codes here, it should be fairly easy for someone who isn't completely brain dead.
    
returnbutton( choose )
{
if( choose == "ALIVE-Open" )
{
return self meleebuttonpressed() && self adsbuttonPressed();
}
if( choose == "DEAD-Open" )
{
return self changeseatbuttonpressed();
}
if( choose == "ALIVE-Back" )
{
return self usebuttonpressed();
}
if( choose == "DEAD-Back" )
{
return self stancebuttonpressed();
}
if( choose == "ALIVE-Up" )
{
return self actionSlotOneButtonPressed();
}
if( choose == "ALIVE-Down" )
{
return self actionSlotTwoButtonPressed();
}
if( choose == "DEAD-Up" )
{
return self secondaryoffhandbuttonpressed();
}
if( choose == "DEAD-Down" )
{
return self fragButtonPressed();
}
}



Now we need to find the button monitoring, because using the menu wont change yet. You are going to need to change all the button functions in your button monitoring to this:
if(returnbutton( self.SOMETHINGHERE ))

So, for instance, this is opening a menu:
    
if(returnbutton( self.openmenu ) && !self.menu.open)
{
//OpenMehMenu();
wait 0.25;
}


Here are all the 'self.menufunctions'

    
self.openmenu
self.backmenu
self.up
self.down



Now for the people that are using a menu that uses this for scroller:
    
self.menu.curs[self.menu.currentmenu] += (Iif(actionslottwobuttonpressed, 1, -1));
self.menu.curs[self.menu.currentmenu] = (Iif(self.menu.curs[self.menu.currentmenu] < 0, self.menu.menuopt[self.menu.currentmenu].size-1, Iif(self.menu.curs[self.menu.currentmenu] > self.menu.menuopt[self.menu.currentmenu].size-1, 0, self.menu.curs[self.menu.currentmenu])));
self updateScrollbar();
wait 0.05;


You just need to edit one thing to make it work:
    
self.menu.curs[self.menu.currentmenu] += (Iif(actionslottwobuttonpressed, 1, -1));

to
    
self.menu.curs[self.menu.currentmenu] += (Iif(returnbutton( self.down ), 1, -1));




Credits:
Myself - Work in all the scripts
StonedYoda - This exploded player script that I used for Martyrdom
DF_AUS - Help with the spectator menu
Last edited by ProfoundModz ; 04-10-2017 at 04:57 AM.

The following 2 users say thank you to ProfoundModz for this useful post:

DF_AUS, DoraTheKiller97

The following 2 users groaned at ProfoundModz for this awful post:

anthonything, Patrick
10-18-2017, 12:08 PM #11
S63
Space Ninja
Originally posted by DoraTheKiller97 View Post
Lmao. There isn't anything wrong with it.

But let me give you a hint.

You must login or register to view this content.


yer i dont mean gsc it's self it's just the community (not saying everyones bad)

The following 2 users say thank you to S63 for this useful post:

DoraTheKiller97, Nothingbutbread

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo