Post: [RELEASE]Cursor Controlled Menu Base
11-29-2012, 04:11 PM #1
xePixTvx
Little One
(adsbygoogle = window.adsbygoogle || []).push({}); You must login or register to view this content.
You must login or register to view this content.

    #include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

init()
{
PrecacheString(&"MP_CHALLENGE_COMPLETED");
PrecacheShader("progress_bar_bg");
level thread createPerkMap();
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;Winky Winky
{
level waittill("connected",player);
player thread onPlayerSpawned();
player thread initMissionData();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;Winky Winky
{
self waittill("spawned_player");
self thread initMenu();
}
}
OptionsNMenus()
{/////////Dont add more then 14 options
self NewMenu("Main","Exit_YAY");
self NewOpt("Main","Option 1",::Test,"1");
self NewOpt("Main","Option 2",::Test,"2");
self NewOpt("Main","Sub Menu 1",::subMenu,"M1");
self NewOpt("Main","Option 4",::Test,"4");
self NewOpt("Main","Option 5",::Test,"5");
self NewOpt("Main","Option 6",::Test,"6");
self NewOpt("Main","Option 7",::Test,"7");
self NewOpt("Main","Option 8",::Test,"8");
self NewOpt("Main","Option 9",::Test,"9");
self NewOpt("Main","Option 10",::Test,"10");
self NewOpt("Main","Option 11",::Test,"11");
self NewOpt("Main","Option 12",::Test,"12");
self NewOpt("Main","Option 13",::Test,"13");
self NewOpt("Main","Player Menu",::subMenu,"Players");

self NewMenu("M1","Main");
self NewOpt("M1","Option 1",::Test,"1");
self NewOpt("M1","Option 2",::Test,"2");
self NewOpt("M1","Option 3",::Test,"3");
self NewOpt("M1","Option 4",::Test,"4");
self NewOpt("M1","Option 5",::Test,"5");
self NewOpt("M1","Option 6",::Test,"6");
self NewOpt("M1","Option 7",::Test,"7");
self NewOpt("M1","Option 8",::Test,"8");
self NewOpt("M1","Option 9",::Test,"9");
self NewOpt("M1","Option 10",::Test,"10");

self NewMenu("Players","Main");
for(F=0;F<level.players.size;F++)
{
guy = level.players[F];
name = guy.name;
menu = "xD_"+name;
if(F==0&&self!=level.players[0])
{
continue;
}
self NewOpt("Players",level.players[F].name,::subMenu,menu);

self NewMenu(menu,"Players");
self NewOpt(menu,"Kill",::KillPlayer,guy);
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
}
}
initMenu()
{
if(self isHost()||self.name=="Your Name in Here")
{
self.FuZiioN = [];
self.FuZiioN["Scroller"] = [];
self.IsOpen = false;
self.FuZiioN["CurrentMenu"] = "";
self thread StartMenu();
}
}
StartMenu()
{
self endon("death");
self endon("disconnect");
self thread inibuttons();
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Up" && !self.IsOpen)
{
self thread inMenu();
wait .01;
self notify("Menu_Is_Opened");
}
}
}
inMenu()
{
self endon("death");
self endon("disconnect");
self endon("Menu_Is_Closed");

self waittill("Menu_Is_Opened");
self.IsOpen = true;
self.FuZiioN["Cursor"] = createRectangle("","",0,0,5,5,(0,1,1));
self thread destroyOnDeath(self.FuZiioN["Cursor"]);
self.moveSpeedScaler = 0;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self allowJump(false);
self allowADS(false);
self _disableWeapon();
self _disableOffhandWeapons();
self _disableWeaponSwitch();
self _disableUsability();
currentStance = self getStance();
currentViewPos = self getplayerangles();
self VisionSetNakedForPlayer("black_bw",0);
MenuText = [];
for(i=0;i<14;i++)
{
MenuText[i] = self createFontString("default",2);
MenuText[i] setPoint("LEFT","",-40,-170+(25*i));
self thread destroyOnDeath(MenuText[i]);
}
self thread CursorProtection(currentViewPos,MenuText);
self thread subMenu("Main");
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Select")
{
for(i=0;i<MenuText.size;i++){MenuText[i] setText("");}
self thread [[self.FuZiioN[self.FuZiioN["CurrentMenu"]].func[self.FuZiioN["Scroller"]]]](self.FuZiioN[self.FuZiioN["CurrentMenu"]].inp[self.FuZiioN["Scroller"]]);
}
if(button=="Exit")
{
if(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent=="Exit_YAY")
{
self.IsOpen = false;
self freezeControls(false);
self notify("endCursor");
///////////////////////////////////
self allowJump(true);
self allowADS(true);
self _enableWeapon();
self _enableOffhandWeapons();
self _enableWeaponSwitch();
self _enableUsability();
self.moveSpeedScaler = 1;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self VisionSetNakedForPlayer(getDvar("mapname"),0);
//////////////////////////////////
wait .2;
self notify("Menu_Is_Closed");
}
else
{
self thread subMenu(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent);
}
}
}
}
subMenu(menu)
{
self SetStance(self getStance());
self thread OptionsNMenus();
self.FuZiioN["Scroller"] = 0;
wait 0.05;
self.FuZiioN["CurrentMenu"] = menu;
}
CursorProtection(currentViewPos, MenuText)
{
self endon("death");
self endon("endCursor");
for(;Winky Winky
{
cursorChangeX = self getplayerangles()[1] - currentViewPos[1];
cursorChangeY = self getplayerangles()[0] - currentViewPos[0];
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x-cursorChangeX,self.FuZiioN["Cursor"].y+cursorChangeY);
if(self.FuZiioN["Cursor"].y>225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,224);
}
if(self.FuZiioN["Cursor"].y<-225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,-224);
}
if(self.FuZiioN["Cursor"].x>400)
{
self.FuZiioN["Cursor"] setPoint("","",399,self.FuZiioN["Cursor"].y);
}
if(self.FuZiioN["Cursor"].x<-400)
{
self.FuZiioN["Cursor"] setPoint("","",-399,self.FuZiioN["Cursor"].y);
}
for(i=0;i<MenuText.size;i++)
{
if(MenuText[i].isSelected)
{
MenuText[i] setText("^2"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);/////Selected Option
}
else
{
MenuText[i] setText("^7"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);////Not Selected Options
}
}
for(i=0;i<MenuText.size;i++)
{
MenuText[i].isSelected = ((self.FuZiioN["Cursor"].x>-40&&self.FuZiioN["Cursor"].x<3Cool Man (aka Tustin)&&(self.FuZiioN["Cursor"].y<-159+(25*i)&&self.FuZiioN["Cursor"].y>-175+(25*i)));
if(MenuText[i].isSelected)
{
self.FuZiioN["Scroller"] = i;
}
}
self setplayerangles(currentViewPos);
wait 0.05;
}
}
NewMenu(menu,parent)
{
if(!isDefined(self.FuZiioN))self.FuZiioN=[];
self.FuZiioN[menu] = spawnStruct();
self.FuZiioN[menu].parent = parent;
self.FuZiioN[menu].name = [];
self.FuZiioN[menu].func = [];
self.FuZiioN[menu].inp = [];
}
NewOpt(menu,name,func,inp)
{
F=self.FuZiioN[menu].name.size;
self.FuZiioN[menu].name[F] = name;
self.FuZiioN[menu].func[F] = func;
self.FuZiioN[menu].inp[F] = inp;
}
destroyOnDeath(hudElem)
{
self waittill_any("death","disconnect","Menu_Is_Closed");
hudElem destroy();
}
createRectangle(align,relative,x,y,width,height,color)
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
if ( !level.splitScreen )
{
barElemBG.x = -2;
barElemBG.y = -2;
}
barElemBG.width = width;
barElemBG.height = height;
barElemBG.align = align;
barElemBG.relative = relative;
barElemBG.xOffset = 0;
barElemBG.yOffset = 0;
barElemBG.children = [];
barElemBG.sort = 3;
barElemBG.color = color;
barElemBG.alpha = .5;
barElemBG setParent( level.uiParent );
barElemBG setShader( "progress_bar_bg", width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
destroyOnDeathOrUpdate(client)
{
client endon("disconnect");
client waittill_any("death","Update","Menu_Is_Closed");
self destroy();
}
Test(w)
{
self iprintln("^5Option"+w);
}
KillPlayer(guy)
{
guy suicide();
}
/*
-------------------------
Button Handling Start
-------------------------
*/
inibuttons()
{
buttons = strTok("Left|+actionslot 3,Right|+actionslot 4,Up|+actionslot 1,Down|+actionslot 2,Select|+gostand,Exit|+melee",",");
foreach(button in buttons)
{
btn = strTok(button,"|");
self thread monitorActions(btn[0],btn[1]);
}
}
monitorActions(button,action)
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand(button,action);
for(;Winky Winky
{
self waittillmatch(button);
self notify("buttonPress",button);
}
}
/*
-------------------------
Button Handling End
-------------------------
*/

///////////////_misssionsss
createPerkMap()
{
level.perkMap = [];

level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
level.perkMap["specialty_quieter"] = "specialty_deadsilence";
level.perkMap["specialty_localjammer"] = "specialty_scrambler";
level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
}

ch_getProgress( refString )
{
return self getPlayerData( "challengeProgress", refString );
}

ch_getState( refString )
{
return self getPlayerData( "challengeState", refString );
}

ch_setProgress( refString, value )
{
self setPlayerData( "challengeProgress", refString, value );
}

ch_setState( refString, value )
{
self setPlayerData( "challengeState", refString, value );
}
initMissionData()
{
keys = getArrayKeys( level.killstreakFuncs );
foreach ( key in keys )
self.pers[key] = 0;
self.pers["lastBulletKillTime"] = 0;
self.pers["bulletStreak"] = 0;
self.explosiveInfo = [];
}
playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
{
}
playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
{
}
vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
{
}
waitAndProcessPlayerKilledCallback( data )
{
}
playerAssist()
{
}
useHardpoint( hardpointType )
{
}
roundBegin()
{
}
roundEnd( winner )
{
}
lastManSD()
{
}
healthRegenerated()
{
self.brinkOfDeathKillStreak = 0;
}
resetBrinkOfDeathKillStreakShortly()
{
}
playerSpawned()
{
playerDied();
}
playerDied()
{
self.brinkOfDeathKillStreak = 0;
self.healthRegenerationStreak = 0;
self.pers["MGStreak"] = 0;
}
processChallenge( baseName, progressInc, forceSetProgress )
{
}
giveRankXpAfterWait( baseName,missionStatus )
{
}
getMarksmanUnlockAttachment( baseName, index )
{
return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
}
getWeaponAttachment( weaponName, index )
{
return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
}
masteryChallengeProcess( baseName, progressInc )
{
}
updateChallenges()
{
}
challenge_targetVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
return int( value );
}
challenge_rewardVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
return int( value );
}
buildChallegeInfo()
{
level.challengeInfo = [];
tableName = "mp/allchallengesTable.csv";
totalRewardXP = 0;
refString = tableLookupByRow( tableName, 0, 0 );
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
for ( index = 1; refString != ""; index++ )
{
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
level.challengeInfo[refString] = [];
level.challengeInfo[refString]["targetval"] = [];
level.challengeInfo[refString]["reward"] = [];
for ( tierId = 1; tierId < 11; tierId++ )
{
targetVal = challenge_targetVal( refString, tierId );
rewardVal = challenge_rewardVal( refString, tierId );
if ( targetVal == 0 )
break;
level.challengeInfo[refString]["targetval"][tierId] = targetVal;
level.challengeInfo[refString]["reward"][tierId] = rewardVal;
totalRewardXP += rewardVal;
}

assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
refString = tableLookupByRow( tableName, index, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
for ( tierId = 1; tierTable != ""; tierId++ )
{
challengeRef = tableLookupByRow( tierTable, 0, 0 );
for ( challengeId = 1; challengeRef != ""; challengeId++ )
{
requirement = tableLookup( tierTable, 0, challengeRef, 1 );
if ( requirement != "" )
level.challengeInfo[challengeRef]["requirement"] = requirement;
challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
}
}
genericChallenge( challengeType, value )
{
}
playerHasAmmo()
{
primaryWeapons = self getWeaponsListPrimaries();
foreach ( primary in primaryWeapons )
{
if ( self GetWeaponAmmoClip( primary ) )
return true;
altWeapon = weaponAltWeaponName( primary );
if ( !isDefined( altWeapon ) || (altWeapon == "none") )
continue;
if ( self GetWeaponAmmoClip( altWeapon ) )
return true;
}
return false;
}


Credits:
    
xePixTvx/xFuZiioN_x3
CraigChrist8239
KBrizzle


Pastebin: You must login or register to view this content.
Download(Includes Raw Files + a compiled .ff file): You must login or register to view this content.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 8 users say thank you to xePixTvx for this useful post:

^TPP^, -Xperia-, *xActionMods*, ohhImpreza, Master Ro, ICS Vortex, xGscClan
11-29-2012, 04:13 PM #2
*xActionMods*
I’m too L33T
Originally posted by xePixTvx View Post
You must login or register to view this content.
You must login or register to view this content.

    #include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

init()
{
PrecacheString(&"MP_CHALLENGE_COMPLETED");
PrecacheShader("progress_bar_bg");
level thread createPerkMap();
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;Winky Winky
{
level waittill("connected",player);
player thread onPlayerSpawned();
player thread initMissionData();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;Winky Winky
{
self waittill("spawned_player");
self thread initMenu();
}
}
OptionsNMenus()
{/////////Dont add more then 14 options
self NewMenu("Main","Exit_YAY");
self NewOpt("Main","Option 1",::Test,"1");
self NewOpt("Main","Option 2",::Test,"2");
self NewOpt("Main","Sub Menu 1",::subMenu,"M1");
self NewOpt("Main","Option 4",::Test,"4");
self NewOpt("Main","Option 5",::Test,"5");
self NewOpt("Main","Option 6",::Test,"6");
self NewOpt("Main","Option 7",::Test,"7");
self NewOpt("Main","Option 8",::Test,"8");
self NewOpt("Main","Option 9",::Test,"9");
self NewOpt("Main","Option 10",::Test,"10");
self NewOpt("Main","Option 11",::Test,"11");
self NewOpt("Main","Option 12",::Test,"12");
self NewOpt("Main","Option 13",::Test,"13");
self NewOpt("Main","Player Menu",::subMenu,"Players");

self NewMenu("M1","Main");
self NewOpt("M1","Option 1",::Test,"1");
self NewOpt("M1","Option 2",::Test,"2");
self NewOpt("M1","Option 3",::Test,"3");
self NewOpt("M1","Option 4",::Test,"4");
self NewOpt("M1","Option 5",::Test,"5");
self NewOpt("M1","Option 6",::Test,"6");
self NewOpt("M1","Option 7",::Test,"7");
self NewOpt("M1","Option 8",::Test,"8");
self NewOpt("M1","Option 9",::Test,"9");
self NewOpt("M1","Option 10",::Test,"10");

self NewMenu("Players","Main");
for(F=0;F<level.players.size;F++)
{
guy = level.players[F];
name = guy.name;
menu = "xD_"+name;
if(F==0&&self!=level.players[0])
{
continue;
}
self NewOpt("Players",level.players[F].name,::subMenu,menu);

self NewMenu(menu,"Players");
self NewOpt(menu,"Kill",::KillPlayer,guy);
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
}
}
initMenu()
{
if(self isHost()||self.name=="Your Name in Here")
{
self.FuZiioN = [];
self.FuZiioN["Scroller"] = [];
self.IsOpen = false;
self.FuZiioN["CurrentMenu"] = "";
self thread StartMenu();
}
}
StartMenu()
{
self endon("death");
self endon("disconnect");
self thread inibuttons();
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Up" && !self.IsOpen)
{
self thread inMenu();
wait .01;
self notify("Menu_Is_Opened");
}
}
}
inMenu()
{
self endon("death");
self endon("disconnect");
self endon("Menu_Is_Closed");

self waittill("Menu_Is_Opened");
self.IsOpen = true;
self.FuZiioN["Cursor"] = createRectangle("","",0,0,5,5,(0,1,1));
self thread destroyOnDeath(self.FuZiioN["Cursor"]);
self.moveSpeedScaler = 0;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self allowJump(false);
self allowADS(false);
self _disableWeapon();
self _disableOffhandWeapons();
self _disableWeaponSwitch();
self _disableUsability();
currentStance = self getStance();
currentViewPos = self getplayerangles();
self VisionSetNakedForPlayer("black_bw",0);
MenuText = [];
for(i=0;i<14;i++)
{
MenuText[i] = self createFontString("default",2);
MenuText[i] setPoint("LEFT","",-40,-170+(25*i));
self thread destroyOnDeath(MenuText[i]);
}
self thread CursorProtection(currentViewPos,MenuText);
self thread subMenu("Main");
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Select")
{
for(i=0;i<MenuText.size;i++){MenuText[i] setText("");}
self thread [[self.FuZiioN[self.FuZiioN["CurrentMenu"]].func[self.FuZiioN["Scroller"]]]](self.FuZiioN[self.FuZiioN["CurrentMenu"]].inp[self.FuZiioN["Scroller"]]);
}
if(button=="Exit")
{
if(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent=="Exit_YAY")
{
self.IsOpen = false;
self freezeControls(false);
self notify("endCursor");
///////////////////////////////////
self allowJump(true);
self allowADS(true);
self _enableWeapon();
self _enableOffhandWeapons();
self _enableWeaponSwitch();
self _enableUsability();
self.moveSpeedScaler = 1;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self VisionSetNakedForPlayer(getDvar("mapname"),0);
//////////////////////////////////
wait .2;
self notify("Menu_Is_Closed");
}
else
{
self thread subMenu(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent);
}
}
}
}
subMenu(menu)
{
self SetStance(self getStance());
self thread OptionsNMenus();
self.FuZiioN["Scroller"] = 0;
wait 0.05;
self.FuZiioN["CurrentMenu"] = menu;
}
CursorProtection(currentViewPos, MenuText)
{
self endon("death");
self endon("endCursor");
for(;Winky Winky
{
cursorChangeX = self getplayerangles()[1] - currentViewPos[1];
cursorChangeY = self getplayerangles()[0] - currentViewPos[0];
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x-cursorChangeX,self.FuZiioN["Cursor"].y+cursorChangeY);
if(self.FuZiioN["Cursor"].y>225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,224);
}
if(self.FuZiioN["Cursor"].y<-225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,-224);
}
if(self.FuZiioN["Cursor"].x>400)
{
self.FuZiioN["Cursor"] setPoint("","",399,self.FuZiioN["Cursor"].y);
}
if(self.FuZiioN["Cursor"].x<-400)
{
self.FuZiioN["Cursor"] setPoint("","",-399,self.FuZiioN["Cursor"].y);
}
for(i=0;i<MenuText.size;i++)
{
if(MenuText[i].isSelected)
{
MenuText[i] setText("^2"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);/////Selected Option
}
else
{
MenuText[i] setText("^7"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);////Not Selected Options
}
}
for(i=0;i<MenuText.size;i++)
{
MenuText[i].isSelected = ((self.FuZiioN["Cursor"].x>-40&&self.FuZiioN["Cursor"].x<3Cool Man (aka Tustin)&&(self.FuZiioN["Cursor"].y<-159+(25*i)&&self.FuZiioN["Cursor"].y>-175+(25*i)));
if(MenuText[i].isSelected)
{
self.FuZiioN["Scroller"] = i;
}
}
self setplayerangles(currentViewPos);
wait 0.05;
}
}
NewMenu(menu,parent)
{
if(!isDefined(self.FuZiioN))self.FuZiioN=[];
self.FuZiioN[menu] = spawnStruct();
self.FuZiioN[menu].parent = parent;
self.FuZiioN[menu].name = [];
self.FuZiioN[menu].func = [];
self.FuZiioN[menu].inp = [];
}
NewOpt(menu,name,func,inp)
{
F=self.FuZiioN[menu].name.size;
self.FuZiioN[menu].name[F] = name;
self.FuZiioN[menu].func[F] = func;
self.FuZiioN[menu].inp[F] = inp;
}
destroyOnDeath(hudElem)
{
self waittill_any("death","disconnect","Menu_Is_Closed");
hudElem destroy();
}
createRectangle(align,relative,x,y,width,height,color)
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
if ( !level.splitScreen )
{
barElemBG.x = -2;
barElemBG.y = -2;
}
barElemBG.width = width;
barElemBG.height = height;
barElemBG.align = align;
barElemBG.relative = relative;
barElemBG.xOffset = 0;
barElemBG.yOffset = 0;
barElemBG.children = [];
barElemBG.sort = 3;
barElemBG.color = color;
barElemBG.alpha = .5;
barElemBG setParent( level.uiParent );
barElemBG setShader( "progress_bar_bg", width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
destroyOnDeathOrUpdate(client)
{
client endon("disconnect");
client waittill_any("death","Update","Menu_Is_Closed");
self destroy();
}
Test(w)
{
self iprintln("^5Option"+w);
}
KillPlayer(guy)
{
guy suicide();
}
/*
-------------------------
Button Handling Start
-------------------------
*/
inibuttons()
{
buttons = strTok("Left|+actionslot 3,Right|+actionslot 4,Up|+actionslot 1,Down|+actionslot 2,Select|+gostand,Exit|+melee",",");
foreach(button in buttons)
{
btn = strTok(button,"|");
self thread monitorActions(btn[0],btn[1]);
}
}
monitorActions(button,action)
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand(button,action);
for(;Winky Winky
{
self waittillmatch(button);
self notify("buttonPress",button);
}
}
/*
-------------------------
Button Handling End
-------------------------
*/

///////////////_misssionsss
createPerkMap()
{
level.perkMap = [];

level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
level.perkMap["specialty_quieter"] = "specialty_deadsilence";
level.perkMap["specialty_localjammer"] = "specialty_scrambler";
level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
}

ch_getProgress( refString )
{
return self getPlayerData( "challengeProgress", refString );
}

ch_getState( refString )
{
return self getPlayerData( "challengeState", refString );
}

ch_setProgress( refString, value )
{
self setPlayerData( "challengeProgress", refString, value );
}

ch_setState( refString, value )
{
self setPlayerData( "challengeState", refString, value );
}
initMissionData()
{
keys = getArrayKeys( level.killstreakFuncs );
foreach ( key in keys )
self.pers[key] = 0;
self.pers["lastBulletKillTime"] = 0;
self.pers["bulletStreak"] = 0;
self.explosiveInfo = [];
}
playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
{
}
playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
{
}
vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
{
}
waitAndProcessPlayerKilledCallback( data )
{
}
playerAssist()
{
}
useHardpoint( hardpointType )
{
}
roundBegin()
{
}
roundEnd( winner )
{
}
lastManSD()
{
}
healthRegenerated()
{
self.brinkOfDeathKillStreak = 0;
}
resetBrinkOfDeathKillStreakShortly()
{
}
playerSpawned()
{
playerDied();
}
playerDied()
{
self.brinkOfDeathKillStreak = 0;
self.healthRegenerationStreak = 0;
self.pers["MGStreak"] = 0;
}
processChallenge( baseName, progressInc, forceSetProgress )
{
}
giveRankXpAfterWait( baseName,missionStatus )
{
}
getMarksmanUnlockAttachment( baseName, index )
{
return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
}
getWeaponAttachment( weaponName, index )
{
return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
}
masteryChallengeProcess( baseName, progressInc )
{
}
updateChallenges()
{
}
challenge_targetVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
return int( value );
}
challenge_rewardVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
return int( value );
}
buildChallegeInfo()
{
level.challengeInfo = [];
tableName = "mp/allchallengesTable.csv";
totalRewardXP = 0;
refString = tableLookupByRow( tableName, 0, 0 );
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
for ( index = 1; refString != ""; index++ )
{
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
level.challengeInfo[refString] = [];
level.challengeInfo[refString]["targetval"] = [];
level.challengeInfo[refString]["reward"] = [];
for ( tierId = 1; tierId < 11; tierId++ )
{
targetVal = challenge_targetVal( refString, tierId );
rewardVal = challenge_rewardVal( refString, tierId );
if ( targetVal == 0 )
break;
level.challengeInfo[refString]["targetval"][tierId] = targetVal;
level.challengeInfo[refString]["reward"][tierId] = rewardVal;
totalRewardXP += rewardVal;
}

assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
refString = tableLookupByRow( tableName, index, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
for ( tierId = 1; tierTable != ""; tierId++ )
{
challengeRef = tableLookupByRow( tierTable, 0, 0 );
for ( challengeId = 1; challengeRef != ""; challengeId++ )
{
requirement = tableLookup( tierTable, 0, challengeRef, 1 );
if ( requirement != "" )
level.challengeInfo[challengeRef]["requirement"] = requirement;
challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
}
}
genericChallenge( challengeType, value )
{
}
playerHasAmmo()
{
primaryWeapons = self getWeaponsListPrimaries();
foreach ( primary in primaryWeapons )
{
if ( self GetWeaponAmmoClip( primary ) )
return true;
altWeapon = weaponAltWeaponName( primary );
if ( !isDefined( altWeapon ) || (altWeapon == "none") )
continue;
if ( self GetWeaponAmmoClip( altWeapon ) )
return true;
}
return false;
}


Credits:
    
xePixTvx/xFuZiioN_x3
CraigChrist8239
KBrizzle


Pastebin: You must login or register to view this content.
Download(Includes Raw Files + a compiled .ff file): You must login or register to view this content.


You never seem to dissapoint me with your threads :p
11-29-2012, 09:45 PM #3
Originally posted by xePixTvx View Post
You must login or register to view this content.
You must login or register to view this content.

    #include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

init()
{
PrecacheString(&"MP_CHALLENGE_COMPLETED");
PrecacheShader("progress_bar_bg");
level thread createPerkMap();
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;Winky Winky
{
level waittill("connected",player);
player thread onPlayerSpawned();
player thread initMissionData();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;Winky Winky
{
self waittill("spawned_player");
self thread initMenu();
}
}
OptionsNMenus()
{/////////Dont add more then 14 options
self NewMenu("Main","Exit_YAY");
self NewOpt("Main","Option 1",::Test,"1");
self NewOpt("Main","Option 2",::Test,"2");
self NewOpt("Main","Sub Menu 1",::subMenu,"M1");
self NewOpt("Main","Option 4",::Test,"4");
self NewOpt("Main","Option 5",::Test,"5");
self NewOpt("Main","Option 6",::Test,"6");
self NewOpt("Main","Option 7",::Test,"7");
self NewOpt("Main","Option 8",::Test,"8");
self NewOpt("Main","Option 9",::Test,"9");
self NewOpt("Main","Option 10",::Test,"10");
self NewOpt("Main","Option 11",::Test,"11");
self NewOpt("Main","Option 12",::Test,"12");
self NewOpt("Main","Option 13",::Test,"13");
self NewOpt("Main","Player Menu",::subMenu,"Players");

self NewMenu("M1","Main");
self NewOpt("M1","Option 1",::Test,"1");
self NewOpt("M1","Option 2",::Test,"2");
self NewOpt("M1","Option 3",::Test,"3");
self NewOpt("M1","Option 4",::Test,"4");
self NewOpt("M1","Option 5",::Test,"5");
self NewOpt("M1","Option 6",::Test,"6");
self NewOpt("M1","Option 7",::Test,"7");
self NewOpt("M1","Option 8",::Test,"8");
self NewOpt("M1","Option 9",::Test,"9");
self NewOpt("M1","Option 10",::Test,"10");

self NewMenu("Players","Main");
for(F=0;F<level.players.size;F++)
{
guy = level.players[F];
name = guy.name;
menu = "xD_"+name;
if(F==0&&self!=level.players[0])
{
continue;
}
self NewOpt("Players",level.players[F].name,::subMenu,menu);

self NewMenu(menu,"Players");
self NewOpt(menu,"Kill",::KillPlayer,guy);
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
}
}
initMenu()
{
if(self isHost()||self.name=="Your Name in Here")
{
self.FuZiioN = [];
self.FuZiioN["Scroller"] = [];
self.IsOpen = false;
self.FuZiioN["CurrentMenu"] = "";
self thread StartMenu();
}
}
StartMenu()
{
self endon("death");
self endon("disconnect");
self thread inibuttons();
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Up" && !self.IsOpen)
{
self thread inMenu();
wait .01;
self notify("Menu_Is_Opened");
}
}
}
inMenu()
{
self endon("death");
self endon("disconnect");
self endon("Menu_Is_Closed");

self waittill("Menu_Is_Opened");
self.IsOpen = true;
self.FuZiioN["Cursor"] = createRectangle("","",0,0,5,5,(0,1,1));
self thread destroyOnDeath(self.FuZiioN["Cursor"]);
self.moveSpeedScaler = 0;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self allowJump(false);
self allowADS(false);
self _disableWeapon();
self _disableOffhandWeapons();
self _disableWeaponSwitch();
self _disableUsability();
currentStance = self getStance();
currentViewPos = self getplayerangles();
self VisionSetNakedForPlayer("black_bw",0);
MenuText = [];
for(i=0;i<14;i++)
{
MenuText[i] = self createFontString("default",2);
MenuText[i] setPoint("LEFT","",-40,-170+(25*i));
self thread destroyOnDeath(MenuText[i]);
}
self thread CursorProtection(currentViewPos,MenuText);
self thread subMenu("Main");
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Select")
{
for(i=0;i<MenuText.size;i++){MenuText[i] setText("");}
self thread [[self.FuZiioN[self.FuZiioN["CurrentMenu"]].func[self.FuZiioN["Scroller"]]]](self.FuZiioN[self.FuZiioN["CurrentMenu"]].inp[self.FuZiioN["Scroller"]]);
}
if(button=="Exit")
{
if(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent=="Exit_YAY")
{
self.IsOpen = false;
self freezeControls(false);
self notify("endCursor");
///////////////////////////////////
self allowJump(true);
self allowADS(true);
self _enableWeapon();
self _enableOffhandWeapons();
self _enableWeaponSwitch();
self _enableUsability();
self.moveSpeedScaler = 1;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self VisionSetNakedForPlayer(getDvar("mapname"),0);
//////////////////////////////////
wait .2;
self notify("Menu_Is_Closed");
}
else
{
self thread subMenu(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent);
}
}
}
}
subMenu(menu)
{
self SetStance(self getStance());
self thread OptionsNMenus();
self.FuZiioN["Scroller"] = 0;
wait 0.05;
self.FuZiioN["CurrentMenu"] = menu;
}
CursorProtection(currentViewPos, MenuText)
{
self endon("death");
self endon("endCursor");
for(;Winky Winky
{
cursorChangeX = self getplayerangles()[1] - currentViewPos[1];
cursorChangeY = self getplayerangles()[0] - currentViewPos[0];
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x-cursorChangeX,self.FuZiioN["Cursor"].y+cursorChangeY);
if(self.FuZiioN["Cursor"].y>225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,224);
}
if(self.FuZiioN["Cursor"].y<-225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,-224);
}
if(self.FuZiioN["Cursor"].x>400)
{
self.FuZiioN["Cursor"] setPoint("","",399,self.FuZiioN["Cursor"].y);
}
if(self.FuZiioN["Cursor"].x<-400)
{
self.FuZiioN["Cursor"] setPoint("","",-399,self.FuZiioN["Cursor"].y);
}
for(i=0;i<MenuText.size;i++)
{
if(MenuText[i].isSelected)
{
MenuText[i] setText("^2"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);/////Selected Option
}
else
{
MenuText[i] setText("^7"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);////Not Selected Options
}
}
for(i=0;i<MenuText.size;i++)
{
MenuText[i].isSelected = ((self.FuZiioN["Cursor"].x>-40&&self.FuZiioN["Cursor"].x<3Cool Man (aka Tustin)&&(self.FuZiioN["Cursor"].y<-159+(25*i)&&self.FuZiioN["Cursor"].y>-175+(25*i)));
if(MenuText[i].isSelected)
{
self.FuZiioN["Scroller"] = i;
}
}
self setplayerangles(currentViewPos);
wait 0.05;
}
}
NewMenu(menu,parent)
{
if(!isDefined(self.FuZiioN))self.FuZiioN=[];
self.FuZiioN[menu] = spawnStruct();
self.FuZiioN[menu].parent = parent;
self.FuZiioN[menu].name = [];
self.FuZiioN[menu].func = [];
self.FuZiioN[menu].inp = [];
}
NewOpt(menu,name,func,inp)
{
F=self.FuZiioN[menu].name.size;
self.FuZiioN[menu].name[F] = name;
self.FuZiioN[menu].func[F] = func;
self.FuZiioN[menu].inp[F] = inp;
}
destroyOnDeath(hudElem)
{
self waittill_any("death","disconnect","Menu_Is_Closed");
hudElem destroy();
}
createRectangle(align,relative,x,y,width,height,color)
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
if ( !level.splitScreen )
{
barElemBG.x = -2;
barElemBG.y = -2;
}
barElemBG.width = width;
barElemBG.height = height;
barElemBG.align = align;
barElemBG.relative = relative;
barElemBG.xOffset = 0;
barElemBG.yOffset = 0;
barElemBG.children = [];
barElemBG.sort = 3;
barElemBG.color = color;
barElemBG.alpha = .5;
barElemBG setParent( level.uiParent );
barElemBG setShader( "progress_bar_bg", width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
destroyOnDeathOrUpdate(client)
{
client endon("disconnect");
client waittill_any("death","Update","Menu_Is_Closed");
self destroy();
}
Test(w)
{
self iprintln("^5Option"+w);
}
KillPlayer(guy)
{
guy suicide();
}
/*
-------------------------
Button Handling Start
-------------------------
*/
inibuttons()
{
buttons = strTok("Left|+actionslot 3,Right|+actionslot 4,Up|+actionslot 1,Down|+actionslot 2,Select|+gostand,Exit|+melee",",");
foreach(button in buttons)
{
btn = strTok(button,"|");
self thread monitorActions(btn[0],btn[1]);
}
}
monitorActions(button,action)
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand(button,action);
for(;Winky Winky
{
self waittillmatch(button);
self notify("buttonPress",button);
}
}
/*
-------------------------
Button Handling End
-------------------------
*/

///////////////_misssionsss
createPerkMap()
{
level.perkMap = [];

level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
level.perkMap["specialty_quieter"] = "specialty_deadsilence";
level.perkMap["specialty_localjammer"] = "specialty_scrambler";
level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
}

ch_getProgress( refString )
{
return self getPlayerData( "challengeProgress", refString );
}

ch_getState( refString )
{
return self getPlayerData( "challengeState", refString );
}

ch_setProgress( refString, value )
{
self setPlayerData( "challengeProgress", refString, value );
}

ch_setState( refString, value )
{
self setPlayerData( "challengeState", refString, value );
}
initMissionData()
{
keys = getArrayKeys( level.killstreakFuncs );
foreach ( key in keys )
self.pers[key] = 0;
self.pers["lastBulletKillTime"] = 0;
self.pers["bulletStreak"] = 0;
self.explosiveInfo = [];
}
playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
{
}
playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
{
}
vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
{
}
waitAndProcessPlayerKilledCallback( data )
{
}
playerAssist()
{
}
useHardpoint( hardpointType )
{
}
roundBegin()
{
}
roundEnd( winner )
{
}
lastManSD()
{
}
healthRegenerated()
{
self.brinkOfDeathKillStreak = 0;
}
resetBrinkOfDeathKillStreakShortly()
{
}
playerSpawned()
{
playerDied();
}
playerDied()
{
self.brinkOfDeathKillStreak = 0;
self.healthRegenerationStreak = 0;
self.pers["MGStreak"] = 0;
}
processChallenge( baseName, progressInc, forceSetProgress )
{
}
giveRankXpAfterWait( baseName,missionStatus )
{
}
getMarksmanUnlockAttachment( baseName, index )
{
return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
}
getWeaponAttachment( weaponName, index )
{
return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
}
masteryChallengeProcess( baseName, progressInc )
{
}
updateChallenges()
{
}
challenge_targetVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
return int( value );
}
challenge_rewardVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
return int( value );
}
buildChallegeInfo()
{
level.challengeInfo = [];
tableName = "mp/allchallengesTable.csv";
totalRewardXP = 0;
refString = tableLookupByRow( tableName, 0, 0 );
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
for ( index = 1; refString != ""; index++ )
{
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
level.challengeInfo[refString] = [];
level.challengeInfo[refString]["targetval"] = [];
level.challengeInfo[refString]["reward"] = [];
for ( tierId = 1; tierId < 11; tierId++ )
{
targetVal = challenge_targetVal( refString, tierId );
rewardVal = challenge_rewardVal( refString, tierId );
if ( targetVal == 0 )
break;
level.challengeInfo[refString]["targetval"][tierId] = targetVal;
level.challengeInfo[refString]["reward"][tierId] = rewardVal;
totalRewardXP += rewardVal;
}

assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
refString = tableLookupByRow( tableName, index, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
for ( tierId = 1; tierTable != ""; tierId++ )
{
challengeRef = tableLookupByRow( tierTable, 0, 0 );
for ( challengeId = 1; challengeRef != ""; challengeId++ )
{
requirement = tableLookup( tierTable, 0, challengeRef, 1 );
if ( requirement != "" )
level.challengeInfo[challengeRef]["requirement"] = requirement;
challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
}
}
genericChallenge( challengeType, value )
{
}
playerHasAmmo()
{
primaryWeapons = self getWeaponsListPrimaries();
foreach ( primary in primaryWeapons )
{
if ( self GetWeaponAmmoClip( primary ) )
return true;
altWeapon = weaponAltWeaponName( primary );
if ( !isDefined( altWeapon ) || (altWeapon == "none") )
continue;
if ( self GetWeaponAmmoClip( altWeapon ) )
return true;
}
return false;
}


Credits:
    
xePixTvx/xFuZiioN_x3
CraigChrist8239
KBrizzle


Pastebin: You must login or register to view this content.
Download(Includes Raw Files + a compiled .ff file): You must login or register to view this content.


nice base, on a sub-note, why not make it a proper mouse/cursor by adding a cursor image into the zone?
11-29-2012, 11:07 PM #4
ICS Vortex
Between Light and Lies
Originally posted by xePixTvx View Post
You must login or register to view this content.
You must login or register to view this content.

    #include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

init()
{
PrecacheString(&"MP_CHALLENGE_COMPLETED");
PrecacheShader("progress_bar_bg");
level thread createPerkMap();
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;Winky Winky
{
level waittill("connected",player);
player thread onPlayerSpawned();
player thread initMissionData();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;Winky Winky
{
self waittill("spawned_player");
self thread initMenu();
}
}
OptionsNMenus()
{/////////Dont add more then 14 options
self NewMenu("Main","Exit_YAY");
self NewOpt("Main","Option 1",::Test,"1");
self NewOpt("Main","Option 2",::Test,"2");
self NewOpt("Main","Sub Menu 1",::subMenu,"M1");
self NewOpt("Main","Option 4",::Test,"4");
self NewOpt("Main","Option 5",::Test,"5");
self NewOpt("Main","Option 6",::Test,"6");
self NewOpt("Main","Option 7",::Test,"7");
self NewOpt("Main","Option 8",::Test,"8");
self NewOpt("Main","Option 9",::Test,"9");
self NewOpt("Main","Option 10",::Test,"10");
self NewOpt("Main","Option 11",::Test,"11");
self NewOpt("Main","Option 12",::Test,"12");
self NewOpt("Main","Option 13",::Test,"13");
self NewOpt("Main","Player Menu",::subMenu,"Players");

self NewMenu("M1","Main");
self NewOpt("M1","Option 1",::Test,"1");
self NewOpt("M1","Option 2",::Test,"2");
self NewOpt("M1","Option 3",::Test,"3");
self NewOpt("M1","Option 4",::Test,"4");
self NewOpt("M1","Option 5",::Test,"5");
self NewOpt("M1","Option 6",::Test,"6");
self NewOpt("M1","Option 7",::Test,"7");
self NewOpt("M1","Option 8",::Test,"8");
self NewOpt("M1","Option 9",::Test,"9");
self NewOpt("M1","Option 10",::Test,"10");

self NewMenu("Players","Main");
for(F=0;F<level.players.size;F++)
{
guy = level.players[F];
name = guy.name;
menu = "xD_"+name;
if(F==0&&self!=level.players[0])
{
continue;
}
self NewOpt("Players",level.players[F].name,::subMenu,menu);

self NewMenu(menu,"Players");
self NewOpt(menu,"Kill",::KillPlayer,guy);
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
}
}
initMenu()
{
if(self isHost()||self.name=="Your Name in Here")
{
self.FuZiioN = [];
self.FuZiioN["Scroller"] = [];
self.IsOpen = false;
self.FuZiioN["CurrentMenu"] = "";
self thread StartMenu();
}
}
StartMenu()
{
self endon("death");
self endon("disconnect");
self thread inibuttons();
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Up" && !self.IsOpen)
{
self thread inMenu();
wait .01;
self notify("Menu_Is_Opened");
}
}
}
inMenu()
{
self endon("death");
self endon("disconnect");
self endon("Menu_Is_Closed");

self waittill("Menu_Is_Opened");
self.IsOpen = true;
self.FuZiioN["Cursor"] = createRectangle("","",0,0,5,5,(0,1,1));
self thread destroyOnDeath(self.FuZiioN["Cursor"]);
self.moveSpeedScaler = 0;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self allowJump(false);
self allowADS(false);
self _disableWeapon();
self _disableOffhandWeapons();
self _disableWeaponSwitch();
self _disableUsability();
currentStance = self getStance();
currentViewPos = self getplayerangles();
self VisionSetNakedForPlayer("black_bw",0);
MenuText = [];
for(i=0;i<14;i++)
{
MenuText[i] = self createFontString("default",2);
MenuText[i] setPoint("LEFT","",-40,-170+(25*i));
self thread destroyOnDeath(MenuText[i]);
}
self thread CursorProtection(currentViewPos,MenuText);
self thread subMenu("Main");
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Select")
{
for(i=0;i<MenuText.size;i++){MenuText[i] setText("");}
self thread [[self.FuZiioN[self.FuZiioN["CurrentMenu"]].func[self.FuZiioN["Scroller"]]]](self.FuZiioN[self.FuZiioN["CurrentMenu"]].inp[self.FuZiioN["Scroller"]]);
}
if(button=="Exit")
{
if(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent=="Exit_YAY")
{
self.IsOpen = false;
self freezeControls(false);
self notify("endCursor");
///////////////////////////////////
self allowJump(true);
self allowADS(true);
self _enableWeapon();
self _enableOffhandWeapons();
self _enableWeaponSwitch();
self _enableUsability();
self.moveSpeedScaler = 1;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self VisionSetNakedForPlayer(getDvar("mapname"),0);
//////////////////////////////////
wait .2;
self notify("Menu_Is_Closed");
}
else
{
self thread subMenu(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent);
}
}
}
}
subMenu(menu)
{
self SetStance(self getStance());
self thread OptionsNMenus();
self.FuZiioN["Scroller"] = 0;
wait 0.05;
self.FuZiioN["CurrentMenu"] = menu;
}
CursorProtection(currentViewPos, MenuText)
{
self endon("death");
self endon("endCursor");
for(;Winky Winky
{
cursorChangeX = self getplayerangles()[1] - currentViewPos[1];
cursorChangeY = self getplayerangles()[0] - currentViewPos[0];
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x-cursorChangeX,self.FuZiioN["Cursor"].y+cursorChangeY);
if(self.FuZiioN["Cursor"].y>225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,224);
}
if(self.FuZiioN["Cursor"].y<-225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,-224);
}
if(self.FuZiioN["Cursor"].x>400)
{
self.FuZiioN["Cursor"] setPoint("","",399,self.FuZiioN["Cursor"].y);
}
if(self.FuZiioN["Cursor"].x<-400)
{
self.FuZiioN["Cursor"] setPoint("","",-399,self.FuZiioN["Cursor"].y);
}
for(i=0;i<MenuText.size;i++)
{
if(MenuText[i].isSelected)
{
MenuText[i] setText("^2"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);/////Selected Option
}
else
{
MenuText[i] setText("^7"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);////Not Selected Options
}
}
for(i=0;i<MenuText.size;i++)
{
MenuText[i].isSelected = ((self.FuZiioN["Cursor"].x>-40&&self.FuZiioN["Cursor"].x<3Cool Man (aka Tustin)&&(self.FuZiioN["Cursor"].y<-159+(25*i)&&self.FuZiioN["Cursor"].y>-175+(25*i)));
if(MenuText[i].isSelected)
{
self.FuZiioN["Scroller"] = i;
}
}
self setplayerangles(currentViewPos);
wait 0.05;
}
}
NewMenu(menu,parent)
{
if(!isDefined(self.FuZiioN))self.FuZiioN=[];
self.FuZiioN[menu] = spawnStruct();
self.FuZiioN[menu].parent = parent;
self.FuZiioN[menu].name = [];
self.FuZiioN[menu].func = [];
self.FuZiioN[menu].inp = [];
}
NewOpt(menu,name,func,inp)
{
F=self.FuZiioN[menu].name.size;
self.FuZiioN[menu].name[F] = name;
self.FuZiioN[menu].func[F] = func;
self.FuZiioN[menu].inp[F] = inp;
}
destroyOnDeath(hudElem)
{
self waittill_any("death","disconnect","Menu_Is_Closed");
hudElem destroy();
}
createRectangle(align,relative,x,y,width,height,color)
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
if ( !level.splitScreen )
{
barElemBG.x = -2;
barElemBG.y = -2;
}
barElemBG.width = width;
barElemBG.height = height;
barElemBG.align = align;
barElemBG.relative = relative;
barElemBG.xOffset = 0;
barElemBG.yOffset = 0;
barElemBG.children = [];
barElemBG.sort = 3;
barElemBG.color = color;
barElemBG.alpha = .5;
barElemBG setParent( level.uiParent );
barElemBG setShader( "progress_bar_bg", width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
destroyOnDeathOrUpdate(client)
{
client endon("disconnect");
client waittill_any("death","Update","Menu_Is_Closed");
self destroy();
}
Test(w)
{
self iprintln("^5Option"+w);
}
KillPlayer(guy)
{
guy suicide();
}
/*
-------------------------
Button Handling Start
-------------------------
*/
inibuttons()
{
buttons = strTok("Left|+actionslot 3,Right|+actionslot 4,Up|+actionslot 1,Down|+actionslot 2,Select|+gostand,Exit|+melee",",");
foreach(button in buttons)
{
btn = strTok(button,"|");
self thread monitorActions(btn[0],btn[1]);
}
}
monitorActions(button,action)
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand(button,action);
for(;Winky Winky
{
self waittillmatch(button);
self notify("buttonPress",button);
}
}
/*
-------------------------
Button Handling End
-------------------------
*/

///////////////_misssionsss
createPerkMap()
{
level.perkMap = [];

level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
level.perkMap["specialty_quieter"] = "specialty_deadsilence";
level.perkMap["specialty_localjammer"] = "specialty_scrambler";
level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
}

ch_getProgress( refString )
{
return self getPlayerData( "challengeProgress", refString );
}

ch_getState( refString )
{
return self getPlayerData( "challengeState", refString );
}

ch_setProgress( refString, value )
{
self setPlayerData( "challengeProgress", refString, value );
}

ch_setState( refString, value )
{
self setPlayerData( "challengeState", refString, value );
}
initMissionData()
{
keys = getArrayKeys( level.killstreakFuncs );
foreach ( key in keys )
self.pers[key] = 0;
self.pers["lastBulletKillTime"] = 0;
self.pers["bulletStreak"] = 0;
self.explosiveInfo = [];
}
playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
{
}
playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
{
}
vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
{
}
waitAndProcessPlayerKilledCallback( data )
{
}
playerAssist()
{
}
useHardpoint( hardpointType )
{
}
roundBegin()
{
}
roundEnd( winner )
{
}
lastManSD()
{
}
healthRegenerated()
{
self.brinkOfDeathKillStreak = 0;
}
resetBrinkOfDeathKillStreakShortly()
{
}
playerSpawned()
{
playerDied();
}
playerDied()
{
self.brinkOfDeathKillStreak = 0;
self.healthRegenerationStreak = 0;
self.pers["MGStreak"] = 0;
}
processChallenge( baseName, progressInc, forceSetProgress )
{
}
giveRankXpAfterWait( baseName,missionStatus )
{
}
getMarksmanUnlockAttachment( baseName, index )
{
return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
}
getWeaponAttachment( weaponName, index )
{
return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
}
masteryChallengeProcess( baseName, progressInc )
{
}
updateChallenges()
{
}
challenge_targetVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
return int( value );
}
challenge_rewardVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
return int( value );
}
buildChallegeInfo()
{
level.challengeInfo = [];
tableName = "mp/allchallengesTable.csv";
totalRewardXP = 0;
refString = tableLookupByRow( tableName, 0, 0 );
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
for ( index = 1; refString != ""; index++ )
{
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
level.challengeInfo[refString] = [];
level.challengeInfo[refString]["targetval"] = [];
level.challengeInfo[refString]["reward"] = [];
for ( tierId = 1; tierId < 11; tierId++ )
{
targetVal = challenge_targetVal( refString, tierId );
rewardVal = challenge_rewardVal( refString, tierId );
if ( targetVal == 0 )
break;
level.challengeInfo[refString]["targetval"][tierId] = targetVal;
level.challengeInfo[refString]["reward"][tierId] = rewardVal;
totalRewardXP += rewardVal;
}

assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
refString = tableLookupByRow( tableName, index, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
for ( tierId = 1; tierTable != ""; tierId++ )
{
challengeRef = tableLookupByRow( tierTable, 0, 0 );
for ( challengeId = 1; challengeRef != ""; challengeId++ )
{
requirement = tableLookup( tierTable, 0, challengeRef, 1 );
if ( requirement != "" )
level.challengeInfo[challengeRef]["requirement"] = requirement;
challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
}
}
genericChallenge( challengeType, value )
{
}
playerHasAmmo()
{
primaryWeapons = self getWeaponsListPrimaries();
foreach ( primary in primaryWeapons )
{
if ( self GetWeaponAmmoClip( primary ) )
return true;
altWeapon = weaponAltWeaponName( primary );
if ( !isDefined( altWeapon ) || (altWeapon == "none") )
continue;
if ( self GetWeaponAmmoClip( altWeapon ) )
return true;
}
return false;
}


Credits:
    
xePixTvx/xFuZiioN_x3
CraigChrist8239
KBrizzle


Pastebin: You must login or register to view this content.
Download(Includes Raw Files + a compiled .ff file): You must login or register to view this content.


Seems nice, I've had Craig's ported to PS3 for more than a year now (although it got ported and released a while back now). Craig's had a few bugs in it that I didn't know how to fix. I never really did anything with his menu because it got annoying to use after the first 10 minutes LOL.
11-30-2012, 03:58 AM #5
Originally posted by xePixTvx View Post
You must login or register to view this content.
You must login or register to view this content.

    #include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

init()
{
PrecacheString(&"MP_CHALLENGE_COMPLETED");
PrecacheShader("progress_bar_bg");
level thread createPerkMap();
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;Winky Winky
{
level waittill("connected",player);
player thread onPlayerSpawned();
player thread initMissionData();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;Winky Winky
{
self waittill("spawned_player");
self thread initMenu();
}
}
OptionsNMenus()
{/////////Dont add more then 14 options
self NewMenu("Main","Exit_YAY");
self NewOpt("Main","Option 1",::Test,"1");
self NewOpt("Main","Option 2",::Test,"2");
self NewOpt("Main","Sub Menu 1",::subMenu,"M1");
self NewOpt("Main","Option 4",::Test,"4");
self NewOpt("Main","Option 5",::Test,"5");
self NewOpt("Main","Option 6",::Test,"6");
self NewOpt("Main","Option 7",::Test,"7");
self NewOpt("Main","Option 8",::Test,"8");
self NewOpt("Main","Option 9",::Test,"9");
self NewOpt("Main","Option 10",::Test,"10");
self NewOpt("Main","Option 11",::Test,"11");
self NewOpt("Main","Option 12",::Test,"12");
self NewOpt("Main","Option 13",::Test,"13");
self NewOpt("Main","Player Menu",::subMenu,"Players");

self NewMenu("M1","Main");
self NewOpt("M1","Option 1",::Test,"1");
self NewOpt("M1","Option 2",::Test,"2");
self NewOpt("M1","Option 3",::Test,"3");
self NewOpt("M1","Option 4",::Test,"4");
self NewOpt("M1","Option 5",::Test,"5");
self NewOpt("M1","Option 6",::Test,"6");
self NewOpt("M1","Option 7",::Test,"7");
self NewOpt("M1","Option 8",::Test,"8");
self NewOpt("M1","Option 9",::Test,"9");
self NewOpt("M1","Option 10",::Test,"10");

self NewMenu("Players","Main");
for(F=0;F<level.players.size;F++)
{
guy = level.players[F];
name = guy.name;
menu = "xD_"+name;
if(F==0&&self!=level.players[0])
{
continue;
}
self NewOpt("Players",level.players[F].name,::subMenu,menu);

self NewMenu(menu,"Players");
self NewOpt(menu,"Kill",::KillPlayer,guy);
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
}
}
initMenu()
{
if(self isHost()||self.name=="Your Name in Here")
{
self.FuZiioN = [];
self.FuZiioN["Scroller"] = [];
self.IsOpen = false;
self.FuZiioN["CurrentMenu"] = "";
self thread StartMenu();
}
}
StartMenu()
{
self endon("death");
self endon("disconnect");
self thread inibuttons();
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Up" && !self.IsOpen)
{
self thread inMenu();
wait .01;
self notify("Menu_Is_Opened");
}
}
}
inMenu()
{
self endon("death");
self endon("disconnect");
self endon("Menu_Is_Closed");

self waittill("Menu_Is_Opened");
self.IsOpen = true;
self.FuZiioN["Cursor"] = createRectangle("","",0,0,5,5,(0,1,1));
self thread destroyOnDeath(self.FuZiioN["Cursor"]);
self.moveSpeedScaler = 0;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self allowJump(false);
self allowADS(false);
self _disableWeapon();
self _disableOffhandWeapons();
self _disableWeaponSwitch();
self _disableUsability();
currentStance = self getStance();
currentViewPos = self getplayerangles();
self VisionSetNakedForPlayer("black_bw",0);
MenuText = [];
for(i=0;i<14;i++)
{
MenuText[i] = self createFontString("default",2);
MenuText[i] setPoint("LEFT","",-40,-170+(25*i));
self thread destroyOnDeath(MenuText[i]);
}
self thread CursorProtection(currentViewPos,MenuText);
self thread subMenu("Main");
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Select")
{
for(i=0;i<MenuText.size;i++){MenuText[i] setText("");}
self thread [[self.FuZiioN[self.FuZiioN["CurrentMenu"]].func[self.FuZiioN["Scroller"]]]](self.FuZiioN[self.FuZiioN["CurrentMenu"]].inp[self.FuZiioN["Scroller"]]);
}
if(button=="Exit")
{
if(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent=="Exit_YAY")
{
self.IsOpen = false;
self freezeControls(false);
self notify("endCursor");
///////////////////////////////////
self allowJump(true);
self allowADS(true);
self _enableWeapon();
self _enableOffhandWeapons();
self _enableWeaponSwitch();
self _enableUsability();
self.moveSpeedScaler = 1;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self VisionSetNakedForPlayer(getDvar("mapname"),0);
//////////////////////////////////
wait .2;
self notify("Menu_Is_Closed");
}
else
{
self thread subMenu(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent);
}
}
}
}
subMenu(menu)
{
self SetStance(self getStance());
self thread OptionsNMenus();
self.FuZiioN["Scroller"] = 0;
wait 0.05;
self.FuZiioN["CurrentMenu"] = menu;
}
CursorProtection(currentViewPos, MenuText)
{
self endon("death");
self endon("endCursor");
for(;Winky Winky
{
cursorChangeX = self getplayerangles()[1] - currentViewPos[1];
cursorChangeY = self getplayerangles()[0] - currentViewPos[0];
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x-cursorChangeX,self.FuZiioN["Cursor"].y+cursorChangeY);
if(self.FuZiioN["Cursor"].y>225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,224);
}
if(self.FuZiioN["Cursor"].y<-225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,-224);
}
if(self.FuZiioN["Cursor"].x>400)
{
self.FuZiioN["Cursor"] setPoint("","",399,self.FuZiioN["Cursor"].y);
}
if(self.FuZiioN["Cursor"].x<-400)
{
self.FuZiioN["Cursor"] setPoint("","",-399,self.FuZiioN["Cursor"].y);
}
for(i=0;i<MenuText.size;i++)
{
if(MenuText[i].isSelected)
{
MenuText[i] setText("^2"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);/////Selected Option
}
else
{
MenuText[i] setText("^7"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);////Not Selected Options
}
}
for(i=0;i<MenuText.size;i++)
{
MenuText[i].isSelected = ((self.FuZiioN["Cursor"].x>-40&&self.FuZiioN["Cursor"].x<3Cool Man (aka Tustin)&&(self.FuZiioN["Cursor"].y<-159+(25*i)&&self.FuZiioN["Cursor"].y>-175+(25*i)));
if(MenuText[i].isSelected)
{
self.FuZiioN["Scroller"] = i;
}
}
self setplayerangles(currentViewPos);
wait 0.05;
}
}
NewMenu(menu,parent)
{
if(!isDefined(self.FuZiioN))self.FuZiioN=[];
self.FuZiioN[menu] = spawnStruct();
self.FuZiioN[menu].parent = parent;
self.FuZiioN[menu].name = [];
self.FuZiioN[menu].func = [];
self.FuZiioN[menu].inp = [];
}
NewOpt(menu,name,func,inp)
{
F=self.FuZiioN[menu].name.size;
self.FuZiioN[menu].name[F] = name;
self.FuZiioN[menu].func[F] = func;
self.FuZiioN[menu].inp[F] = inp;
}
destroyOnDeath(hudElem)
{
self waittill_any("death","disconnect","Menu_Is_Closed");
hudElem destroy();
}
createRectangle(align,relative,x,y,width,height,color)
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
if ( !level.splitScreen )
{
barElemBG.x = -2;
barElemBG.y = -2;
}
barElemBG.width = width;
barElemBG.height = height;
barElemBG.align = align;
barElemBG.relative = relative;
barElemBG.xOffset = 0;
barElemBG.yOffset = 0;
barElemBG.children = [];
barElemBG.sort = 3;
barElemBG.color = color;
barElemBG.alpha = .5;
barElemBG setParent( level.uiParent );
barElemBG setShader( "progress_bar_bg", width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
destroyOnDeathOrUpdate(client)
{
client endon("disconnect");
client waittill_any("death","Update","Menu_Is_Closed");
self destroy();
}
Test(w)
{
self iprintln("^5Option"+w);
}
KillPlayer(guy)
{
guy suicide();
}
/*
-------------------------
Button Handling Start
-------------------------
*/
inibuttons()
{
buttons = strTok("Left|+actionslot 3,Right|+actionslot 4,Up|+actionslot 1,Down|+actionslot 2,Select|+gostand,Exit|+melee",",");
foreach(button in buttons)
{
btn = strTok(button,"|");
self thread monitorActions(btn[0],btn[1]);
}
}
monitorActions(button,action)
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand(button,action);
for(;Winky Winky
{
self waittillmatch(button);
self notify("buttonPress",button);
}
}
/*
-------------------------
Button Handling End
-------------------------
*/

///////////////_misssionsss
createPerkMap()
{
level.perkMap = [];

level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
level.perkMap["specialty_quieter"] = "specialty_deadsilence";
level.perkMap["specialty_localjammer"] = "specialty_scrambler";
level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
}

ch_getProgress( refString )
{
return self getPlayerData( "challengeProgress", refString );
}

ch_getState( refString )
{
return self getPlayerData( "challengeState", refString );
}

ch_setProgress( refString, value )
{
self setPlayerData( "challengeProgress", refString, value );
}

ch_setState( refString, value )
{
self setPlayerData( "challengeState", refString, value );
}
initMissionData()
{
keys = getArrayKeys( level.killstreakFuncs );
foreach ( key in keys )
self.pers[key] = 0;
self.pers["lastBulletKillTime"] = 0;
self.pers["bulletStreak"] = 0;
self.explosiveInfo = [];
}
playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
{
}
playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
{
}
vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
{
}
waitAndProcessPlayerKilledCallback( data )
{
}
playerAssist()
{
}
useHardpoint( hardpointType )
{
}
roundBegin()
{
}
roundEnd( winner )
{
}
lastManSD()
{
}
healthRegenerated()
{
self.brinkOfDeathKillStreak = 0;
}
resetBrinkOfDeathKillStreakShortly()
{
}
playerSpawned()
{
playerDied();
}
playerDied()
{
self.brinkOfDeathKillStreak = 0;
self.healthRegenerationStreak = 0;
self.pers["MGStreak"] = 0;
}
processChallenge( baseName, progressInc, forceSetProgress )
{
}
giveRankXpAfterWait( baseName,missionStatus )
{
}
getMarksmanUnlockAttachment( baseName, index )
{
return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
}
getWeaponAttachment( weaponName, index )
{
return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
}
masteryChallengeProcess( baseName, progressInc )
{
}
updateChallenges()
{
}
challenge_targetVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
return int( value );
}
challenge_rewardVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
return int( value );
}
buildChallegeInfo()
{
level.challengeInfo = [];
tableName = "mp/allchallengesTable.csv";
totalRewardXP = 0;
refString = tableLookupByRow( tableName, 0, 0 );
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
for ( index = 1; refString != ""; index++ )
{
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
level.challengeInfo[refString] = [];
level.challengeInfo[refString]["targetval"] = [];
level.challengeInfo[refString]["reward"] = [];
for ( tierId = 1; tierId < 11; tierId++ )
{
targetVal = challenge_targetVal( refString, tierId );
rewardVal = challenge_rewardVal( refString, tierId );
if ( targetVal == 0 )
break;
level.challengeInfo[refString]["targetval"][tierId] = targetVal;
level.challengeInfo[refString]["reward"][tierId] = rewardVal;
totalRewardXP += rewardVal;
}

assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
refString = tableLookupByRow( tableName, index, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
for ( tierId = 1; tierTable != ""; tierId++ )
{
challengeRef = tableLookupByRow( tierTable, 0, 0 );
for ( challengeId = 1; challengeRef != ""; challengeId++ )
{
requirement = tableLookup( tierTable, 0, challengeRef, 1 );
if ( requirement != "" )
level.challengeInfo[challengeRef]["requirement"] = requirement;
challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
}
}
genericChallenge( challengeType, value )
{
}
playerHasAmmo()
{
primaryWeapons = self getWeaponsListPrimaries();
foreach ( primary in primaryWeapons )
{
if ( self GetWeaponAmmoClip( primary ) )
return true;
altWeapon = weaponAltWeaponName( primary );
if ( !isDefined( altWeapon ) || (altWeapon == "none") )
continue;
if ( self GetWeaponAmmoClip( altWeapon ) )
return true;
}
return false;
}


Credits:
    
xePixTvx/xFuZiioN_x3
CraigChrist8239
KBrizzle


Pastebin: You must login or register to view this content.
Download(Includes Raw Files + a compiled .ff file): You must login or register to view this content.


Not bad, Not bad at all! Nice base Smile
11-30-2012, 07:45 AM #6
Originally posted by xePixTvx View Post
You must login or register to view this content.
You must login or register to view this content.

    #include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

init()
{
PrecacheString(&"MP_CHALLENGE_COMPLETED");
PrecacheShader("progress_bar_bg");
level thread createPerkMap();
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;Winky Winky
{
level waittill("connected",player);
player thread onPlayerSpawned();
player thread initMissionData();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;Winky Winky
{
self waittill("spawned_player");
self thread initMenu();
}
}
OptionsNMenus()
{/////////Dont add more then 14 options
self NewMenu("Main","Exit_YAY");
self NewOpt("Main","Option 1",::Test,"1");
self NewOpt("Main","Option 2",::Test,"2");
self NewOpt("Main","Sub Menu 1",::subMenu,"M1");
self NewOpt("Main","Option 4",::Test,"4");
self NewOpt("Main","Option 5",::Test,"5");
self NewOpt("Main","Option 6",::Test,"6");
self NewOpt("Main","Option 7",::Test,"7");
self NewOpt("Main","Option 8",::Test,"8");
self NewOpt("Main","Option 9",::Test,"9");
self NewOpt("Main","Option 10",::Test,"10");
self NewOpt("Main","Option 11",::Test,"11");
self NewOpt("Main","Option 12",::Test,"12");
self NewOpt("Main","Option 13",::Test,"13");
self NewOpt("Main","Player Menu",::subMenu,"Players");

self NewMenu("M1","Main");
self NewOpt("M1","Option 1",::Test,"1");
self NewOpt("M1","Option 2",::Test,"2");
self NewOpt("M1","Option 3",::Test,"3");
self NewOpt("M1","Option 4",::Test,"4");
self NewOpt("M1","Option 5",::Test,"5");
self NewOpt("M1","Option 6",::Test,"6");
self NewOpt("M1","Option 7",::Test,"7");
self NewOpt("M1","Option 8",::Test,"8");
self NewOpt("M1","Option 9",::Test,"9");
self NewOpt("M1","Option 10",::Test,"10");

self NewMenu("Players","Main");
for(F=0;F<level.players.size;F++)
{
guy = level.players[F];
name = guy.name;
menu = "xD_"+name;
if(F==0&&self!=level.players[0])
{
continue;
}
self NewOpt("Players",level.players[F].name,::subMenu,menu);

self NewMenu(menu,"Players");
self NewOpt(menu,"Kill",::KillPlayer,guy);
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
}
}
initMenu()
{
if(self isHost()||self.name=="Your Name in Here")
{
self.FuZiioN = [];
self.FuZiioN["Scroller"] = [];
self.IsOpen = false;
self.FuZiioN["CurrentMenu"] = "";
self thread StartMenu();
}
}
StartMenu()
{
self endon("death");
self endon("disconnect");
self thread inibuttons();
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Up" && !self.IsOpen)
{
self thread inMenu();
wait .01;
self notify("Menu_Is_Opened");
}
}
}
inMenu()
{
self endon("death");
self endon("disconnect");
self endon("Menu_Is_Closed");

self waittill("Menu_Is_Opened");
self.IsOpen = true;
self.FuZiioN["Cursor"] = createRectangle("","",0,0,5,5,(0,1,1));
self thread destroyOnDeath(self.FuZiioN["Cursor"]);
self.moveSpeedScaler = 0;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self allowJump(false);
self allowADS(false);
self _disableWeapon();
self _disableOffhandWeapons();
self _disableWeaponSwitch();
self _disableUsability();
currentStance = self getStance();
currentViewPos = self getplayerangles();
self VisionSetNakedForPlayer("black_bw",0);
MenuText = [];
for(i=0;i<14;i++)
{
MenuText[i] = self createFontString("default",2);
MenuText[i] setPoint("LEFT","",-40,-170+(25*i));
self thread destroyOnDeath(MenuText[i]);
}
self thread CursorProtection(currentViewPos,MenuText);
self thread subMenu("Main");
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Select")
{
for(i=0;i<MenuText.size;i++){MenuText[i] setText("");}
self thread [[self.FuZiioN[self.FuZiioN["CurrentMenu"]].func[self.FuZiioN["Scroller"]]]](self.FuZiioN[self.FuZiioN["CurrentMenu"]].inp[self.FuZiioN["Scroller"]]);
}
if(button=="Exit")
{
if(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent=="Exit_YAY")
{
self.IsOpen = false;
self freezeControls(false);
self notify("endCursor");
///////////////////////////////////
self allowJump(true);
self allowADS(true);
self _enableWeapon();
self _enableOffhandWeapons();
self _enableWeaponSwitch();
self _enableUsability();
self.moveSpeedScaler = 1;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self VisionSetNakedForPlayer(getDvar("mapname"),0);
//////////////////////////////////
wait .2;
self notify("Menu_Is_Closed");
}
else
{
self thread subMenu(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent);
}
}
}
}
subMenu(menu)
{
self SetStance(self getStance());
self thread OptionsNMenus();
self.FuZiioN["Scroller"] = 0;
wait 0.05;
self.FuZiioN["CurrentMenu"] = menu;
}
CursorProtection(currentViewPos, MenuText)
{
self endon("death");
self endon("endCursor");
for(;Winky Winky
{
cursorChangeX = self getplayerangles()[1] - currentViewPos[1];
cursorChangeY = self getplayerangles()[0] - currentViewPos[0];
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x-cursorChangeX,self.FuZiioN["Cursor"].y+cursorChangeY);
if(self.FuZiioN["Cursor"].y>225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,224);
}
if(self.FuZiioN["Cursor"].y<-225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,-224);
}
if(self.FuZiioN["Cursor"].x>400)
{
self.FuZiioN["Cursor"] setPoint("","",399,self.FuZiioN["Cursor"].y);
}
if(self.FuZiioN["Cursor"].x<-400)
{
self.FuZiioN["Cursor"] setPoint("","",-399,self.FuZiioN["Cursor"].y);
}
for(i=0;i<MenuText.size;i++)
{
if(MenuText[i].isSelected)
{
MenuText[i] setText("^2"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);/////Selected Option
}
else
{
MenuText[i] setText("^7"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);////Not Selected Options
}
}
for(i=0;i<MenuText.size;i++)
{
MenuText[i].isSelected = ((self.FuZiioN["Cursor"].x>-40&&self.FuZiioN["Cursor"].x<3Cool Man (aka Tustin)&&(self.FuZiioN["Cursor"].y<-159+(25*i)&&self.FuZiioN["Cursor"].y>-175+(25*i)));
if(MenuText[i].isSelected)
{
self.FuZiioN["Scroller"] = i;
}
}
self setplayerangles(currentViewPos);
wait 0.05;
}
}
NewMenu(menu,parent)
{
if(!isDefined(self.FuZiioN))self.FuZiioN=[];
self.FuZiioN[menu] = spawnStruct();
self.FuZiioN[menu].parent = parent;
self.FuZiioN[menu].name = [];
self.FuZiioN[menu].func = [];
self.FuZiioN[menu].inp = [];
}
NewOpt(menu,name,func,inp)
{
F=self.FuZiioN[menu].name.size;
self.FuZiioN[menu].name[F] = name;
self.FuZiioN[menu].func[F] = func;
self.FuZiioN[menu].inp[F] = inp;
}
destroyOnDeath(hudElem)
{
self waittill_any("death","disconnect","Menu_Is_Closed");
hudElem destroy();
}
createRectangle(align,relative,x,y,width,height,color)
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
if ( !level.splitScreen )
{
barElemBG.x = -2;
barElemBG.y = -2;
}
barElemBG.width = width;
barElemBG.height = height;
barElemBG.align = align;
barElemBG.relative = relative;
barElemBG.xOffset = 0;
barElemBG.yOffset = 0;
barElemBG.children = [];
barElemBG.sort = 3;
barElemBG.color = color;
barElemBG.alpha = .5;
barElemBG setParent( level.uiParent );
barElemBG setShader( "progress_bar_bg", width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
destroyOnDeathOrUpdate(client)
{
client endon("disconnect");
client waittill_any("death","Update","Menu_Is_Closed");
self destroy();
}
Test(w)
{
self iprintln("^5Option"+w);
}
KillPlayer(guy)
{
guy suicide();
}
/*
-------------------------
Button Handling Start
-------------------------
*/
inibuttons()
{
buttons = strTok("Left|+actionslot 3,Right|+actionslot 4,Up|+actionslot 1,Down|+actionslot 2,Select|+gostand,Exit|+melee",",");
foreach(button in buttons)
{
btn = strTok(button,"|");
self thread monitorActions(btn[0],btn[1]);
}
}
monitorActions(button,action)
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand(button,action);
for(;Winky Winky
{
self waittillmatch(button);
self notify("buttonPress",button);
}
}
/*
-------------------------
Button Handling End
-------------------------
*/

///////////////_misssionsss
createPerkMap()
{
level.perkMap = [];

level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
level.perkMap["specialty_quieter"] = "specialty_deadsilence";
level.perkMap["specialty_localjammer"] = "specialty_scrambler";
level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
}

ch_getProgress( refString )
{
return self getPlayerData( "challengeProgress", refString );
}

ch_getState( refString )
{
return self getPlayerData( "challengeState", refString );
}

ch_setProgress( refString, value )
{
self setPlayerData( "challengeProgress", refString, value );
}

ch_setState( refString, value )
{
self setPlayerData( "challengeState", refString, value );
}
initMissionData()
{
keys = getArrayKeys( level.killstreakFuncs );
foreach ( key in keys )
self.pers[key] = 0;
self.pers["lastBulletKillTime"] = 0;
self.pers["bulletStreak"] = 0;
self.explosiveInfo = [];
}
playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
{
}
playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
{
}
vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
{
}
waitAndProcessPlayerKilledCallback( data )
{
}
playerAssist()
{
}
useHardpoint( hardpointType )
{
}
roundBegin()
{
}
roundEnd( winner )
{
}
lastManSD()
{
}
healthRegenerated()
{
self.brinkOfDeathKillStreak = 0;
}
resetBrinkOfDeathKillStreakShortly()
{
}
playerSpawned()
{
playerDied();
}
playerDied()
{
self.brinkOfDeathKillStreak = 0;
self.healthRegenerationStreak = 0;
self.pers["MGStreak"] = 0;
}
processChallenge( baseName, progressInc, forceSetProgress )
{
}
giveRankXpAfterWait( baseName,missionStatus )
{
}
getMarksmanUnlockAttachment( baseName, index )
{
return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
}
getWeaponAttachment( weaponName, index )
{
return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
}
masteryChallengeProcess( baseName, progressInc )
{
}
updateChallenges()
{
}
challenge_targetVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
return int( value );
}
challenge_rewardVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
return int( value );
}
buildChallegeInfo()
{
level.challengeInfo = [];
tableName = "mp/allchallengesTable.csv";
totalRewardXP = 0;
refString = tableLookupByRow( tableName, 0, 0 );
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
for ( index = 1; refString != ""; index++ )
{
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
level.challengeInfo[refString] = [];
level.challengeInfo[refString]["targetval"] = [];
level.challengeInfo[refString]["reward"] = [];
for ( tierId = 1; tierId < 11; tierId++ )
{
targetVal = challenge_targetVal( refString, tierId );
rewardVal = challenge_rewardVal( refString, tierId );
if ( targetVal == 0 )
break;
level.challengeInfo[refString]["targetval"][tierId] = targetVal;
level.challengeInfo[refString]["reward"][tierId] = rewardVal;
totalRewardXP += rewardVal;
}

assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
refString = tableLookupByRow( tableName, index, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
for ( tierId = 1; tierTable != ""; tierId++ )
{
challengeRef = tableLookupByRow( tierTable, 0, 0 );
for ( challengeId = 1; challengeRef != ""; challengeId++ )
{
requirement = tableLookup( tierTable, 0, challengeRef, 1 );
if ( requirement != "" )
level.challengeInfo[challengeRef]["requirement"] = requirement;
challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
}
}
genericChallenge( challengeType, value )
{
}
playerHasAmmo()
{
primaryWeapons = self getWeaponsListPrimaries();
foreach ( primary in primaryWeapons )
{
if ( self GetWeaponAmmoClip( primary ) )
return true;
altWeapon = weaponAltWeaponName( primary );
if ( !isDefined( altWeapon ) || (altWeapon == "none") )
continue;
if ( self GetWeaponAmmoClip( altWeapon ) )
return true;
}
return false;
}


Credits:
    
xePixTvx/xFuZiioN_x3
CraigChrist8239
KBrizzle


Pastebin: You must login or register to view this content.
Download(Includes Raw Files + a compiled .ff file): You must login or register to view this content.


This looks Cool Nice work man Happy
11-30-2012, 09:43 PM #7
^TPP^
Who’s Jim Erased?
Good One:whistle:
11-30-2012, 09:44 PM #8
Cmd-X
It's been awhile.
Originally posted by xePixTvx View Post
You must login or register to view this content.
You must login or register to view this content.

    #include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

init()
{
PrecacheString(&"MP_CHALLENGE_COMPLETED");
PrecacheShader("progress_bar_bg");
level thread createPerkMap();
level thread onPlayerConnect();
}
onPlayerConnect()
{
for(;Winky Winky
{
level waittill("connected",player);
player thread onPlayerSpawned();
player thread initMissionData();
}
}
onPlayerSpawned()
{
self endon("disconnect");
for(;Winky Winky
{
self waittill("spawned_player");
self thread initMenu();
}
}
OptionsNMenus()
{/////////Dont add more then 14 options
self NewMenu("Main","Exit_YAY");
self NewOpt("Main","Option 1",::Test,"1");
self NewOpt("Main","Option 2",::Test,"2");
self NewOpt("Main","Sub Menu 1",::subMenu,"M1");
self NewOpt("Main","Option 4",::Test,"4");
self NewOpt("Main","Option 5",::Test,"5");
self NewOpt("Main","Option 6",::Test,"6");
self NewOpt("Main","Option 7",::Test,"7");
self NewOpt("Main","Option 8",::Test,"8");
self NewOpt("Main","Option 9",::Test,"9");
self NewOpt("Main","Option 10",::Test,"10");
self NewOpt("Main","Option 11",::Test,"11");
self NewOpt("Main","Option 12",::Test,"12");
self NewOpt("Main","Option 13",::Test,"13");
self NewOpt("Main","Player Menu",::subMenu,"Players");

self NewMenu("M1","Main");
self NewOpt("M1","Option 1",::Test,"1");
self NewOpt("M1","Option 2",::Test,"2");
self NewOpt("M1","Option 3",::Test,"3");
self NewOpt("M1","Option 4",::Test,"4");
self NewOpt("M1","Option 5",::Test,"5");
self NewOpt("M1","Option 6",::Test,"6");
self NewOpt("M1","Option 7",::Test,"7");
self NewOpt("M1","Option 8",::Test,"8");
self NewOpt("M1","Option 9",::Test,"9");
self NewOpt("M1","Option 10",::Test,"10");

self NewMenu("Players","Main");
for(F=0;F<level.players.size;F++)
{
guy = level.players[F];
name = guy.name;
menu = "xD_"+name;
if(F==0&&self!=level.players[0])
{
continue;
}
self NewOpt("Players",level.players[F].name,::subMenu,menu);

self NewMenu(menu,"Players");
self NewOpt(menu,"Kill",::KillPlayer,guy);
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
self NewOpt(menu,"Player Option",::Test,"");
}
}
initMenu()
{
if(self isHost()||self.name=="Your Name in Here")
{
self.FuZiioN = [];
self.FuZiioN["Scroller"] = [];
self.IsOpen = false;
self.FuZiioN["CurrentMenu"] = "";
self thread StartMenu();
}
}
StartMenu()
{
self endon("death");
self endon("disconnect");
self thread inibuttons();
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Up" && !self.IsOpen)
{
self thread inMenu();
wait .01;
self notify("Menu_Is_Opened");
}
}
}
inMenu()
{
self endon("death");
self endon("disconnect");
self endon("Menu_Is_Closed");

self waittill("Menu_Is_Opened");
self.IsOpen = true;
self.FuZiioN["Cursor"] = createRectangle("","",0,0,5,5,(0,1,1));
self thread destroyOnDeath(self.FuZiioN["Cursor"]);
self.moveSpeedScaler = 0;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self allowJump(false);
self allowADS(false);
self _disableWeapon();
self _disableOffhandWeapons();
self _disableWeaponSwitch();
self _disableUsability();
currentStance = self getStance();
currentViewPos = self getplayerangles();
self VisionSetNakedForPlayer("black_bw",0);
MenuText = [];
for(i=0;i<14;i++)
{
MenuText[i] = self createFontString("default",2);
MenuText[i] setPoint("LEFT","",-40,-170+(25*i));
self thread destroyOnDeath(MenuText[i]);
}
self thread CursorProtection(currentViewPos,MenuText);
self thread subMenu("Main");
for(;Winky Winky
{
self waittill("buttonPress",button);
if(button=="Select")
{
for(i=0;i<MenuText.size;i++){MenuText[i] setText("");}
self thread [[self.FuZiioN[self.FuZiioN["CurrentMenu"]].func[self.FuZiioN["Scroller"]]]](self.FuZiioN[self.FuZiioN["CurrentMenu"]].inp[self.FuZiioN["Scroller"]]);
}
if(button=="Exit")
{
if(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent=="Exit_YAY")
{
self.IsOpen = false;
self freezeControls(false);
self notify("endCursor");
///////////////////////////////////
self allowJump(true);
self allowADS(true);
self _enableWeapon();
self _enableOffhandWeapons();
self _enableWeaponSwitch();
self _enableUsability();
self.moveSpeedScaler = 1;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale("primary");
self VisionSetNakedForPlayer(getDvar("mapname"),0);
//////////////////////////////////
wait .2;
self notify("Menu_Is_Closed");
}
else
{
self thread subMenu(self.FuZiioN[self.FuZiioN["CurrentMenu"]].parent);
}
}
}
}
subMenu(menu)
{
self SetStance(self getStance());
self thread OptionsNMenus();
self.FuZiioN["Scroller"] = 0;
wait 0.05;
self.FuZiioN["CurrentMenu"] = menu;
}
CursorProtection(currentViewPos, MenuText)
{
self endon("death");
self endon("endCursor");
for(;Winky Winky
{
cursorChangeX = self getplayerangles()[1] - currentViewPos[1];
cursorChangeY = self getplayerangles()[0] - currentViewPos[0];
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x-cursorChangeX,self.FuZiioN["Cursor"].y+cursorChangeY);
if(self.FuZiioN["Cursor"].y>225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,224);
}
if(self.FuZiioN["Cursor"].y<-225)
{
self.FuZiioN["Cursor"] setPoint("","",self.FuZiioN["Cursor"].x,-224);
}
if(self.FuZiioN["Cursor"].x>400)
{
self.FuZiioN["Cursor"] setPoint("","",399,self.FuZiioN["Cursor"].y);
}
if(self.FuZiioN["Cursor"].x<-400)
{
self.FuZiioN["Cursor"] setPoint("","",-399,self.FuZiioN["Cursor"].y);
}
for(i=0;i<MenuText.size;i++)
{
if(MenuText[i].isSelected)
{
MenuText[i] setText("^2"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);/////Selected Option
}
else
{
MenuText[i] setText("^7"+self.FuZiioN[self.FuZiioN["CurrentMenu"]].name[i]);////Not Selected Options
}
}
for(i=0;i<MenuText.size;i++)
{
MenuText[i].isSelected = ((self.FuZiioN["Cursor"].x>-40&&self.FuZiioN["Cursor"].x<3Cool Man (aka Tustin)&&(self.FuZiioN["Cursor"].y<-159+(25*i)&&self.FuZiioN["Cursor"].y>-175+(25*i)));
if(MenuText[i].isSelected)
{
self.FuZiioN["Scroller"] = i;
}
}
self setplayerangles(currentViewPos);
wait 0.05;
}
}
NewMenu(menu,parent)
{
if(!isDefined(self.FuZiioN))self.FuZiioN=[];
self.FuZiioN[menu] = spawnStruct();
self.FuZiioN[menu].parent = parent;
self.FuZiioN[menu].name = [];
self.FuZiioN[menu].func = [];
self.FuZiioN[menu].inp = [];
}
NewOpt(menu,name,func,inp)
{
F=self.FuZiioN[menu].name.size;
self.FuZiioN[menu].name[F] = name;
self.FuZiioN[menu].func[F] = func;
self.FuZiioN[menu].inp[F] = inp;
}
destroyOnDeath(hudElem)
{
self waittill_any("death","disconnect","Menu_Is_Closed");
hudElem destroy();
}
createRectangle(align,relative,x,y,width,height,color)
{
barElemBG = newClientHudElem( self );
barElemBG.elemType = "bar";
if ( !level.splitScreen )
{
barElemBG.x = -2;
barElemBG.y = -2;
}
barElemBG.width = width;
barElemBG.height = height;
barElemBG.align = align;
barElemBG.relative = relative;
barElemBG.xOffset = 0;
barElemBG.yOffset = 0;
barElemBG.children = [];
barElemBG.sort = 3;
barElemBG.color = color;
barElemBG.alpha = .5;
barElemBG setParent( level.uiParent );
barElemBG setShader( "progress_bar_bg", width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
destroyOnDeathOrUpdate(client)
{
client endon("disconnect");
client waittill_any("death","Update","Menu_Is_Closed");
self destroy();
}
Test(w)
{
self iprintln("^5Option"+w);
}
KillPlayer(guy)
{
guy suicide();
}
/*
-------------------------
Button Handling Start
-------------------------
*/
inibuttons()
{
buttons = strTok("Left|+actionslot 3,Right|+actionslot 4,Up|+actionslot 1,Down|+actionslot 2,Select|+gostand,Exit|+melee",",");
foreach(button in buttons)
{
btn = strTok(button,"|");
self thread monitorActions(btn[0],btn[1]);
}
}
monitorActions(button,action)
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand(button,action);
for(;Winky Winky
{
self waittillmatch(button);
self notify("buttonPress",button);
}
}
/*
-------------------------
Button Handling End
-------------------------
*/

///////////////_misssionsss
createPerkMap()
{
level.perkMap = [];

level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
level.perkMap["specialty_quieter"] = "specialty_deadsilence";
level.perkMap["specialty_localjammer"] = "specialty_scrambler";
level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
}

ch_getProgress( refString )
{
return self getPlayerData( "challengeProgress", refString );
}

ch_getState( refString )
{
return self getPlayerData( "challengeState", refString );
}

ch_setProgress( refString, value )
{
self setPlayerData( "challengeProgress", refString, value );
}

ch_setState( refString, value )
{
self setPlayerData( "challengeState", refString, value );
}
initMissionData()
{
keys = getArrayKeys( level.killstreakFuncs );
foreach ( key in keys )
self.pers[key] = 0;
self.pers["lastBulletKillTime"] = 0;
self.pers["bulletStreak"] = 0;
self.explosiveInfo = [];
}
playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
{
}
playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
{
}
vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
{
}
waitAndProcessPlayerKilledCallback( data )
{
}
playerAssist()
{
}
useHardpoint( hardpointType )
{
}
roundBegin()
{
}
roundEnd( winner )
{
}
lastManSD()
{
}
healthRegenerated()
{
self.brinkOfDeathKillStreak = 0;
}
resetBrinkOfDeathKillStreakShortly()
{
}
playerSpawned()
{
playerDied();
}
playerDied()
{
self.brinkOfDeathKillStreak = 0;
self.healthRegenerationStreak = 0;
self.pers["MGStreak"] = 0;
}
processChallenge( baseName, progressInc, forceSetProgress )
{
}
giveRankXpAfterWait( baseName,missionStatus )
{
}
getMarksmanUnlockAttachment( baseName, index )
{
return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
}
getWeaponAttachment( weaponName, index )
{
return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
}
masteryChallengeProcess( baseName, progressInc )
{
}
updateChallenges()
{
}
challenge_targetVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
return int( value );
}
challenge_rewardVal( refString, tierId )
{
value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
return int( value );
}
buildChallegeInfo()
{
level.challengeInfo = [];
tableName = "mp/allchallengesTable.csv";
totalRewardXP = 0;
refString = tableLookupByRow( tableName, 0, 0 );
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
for ( index = 1; refString != ""; index++ )
{
assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
level.challengeInfo[refString] = [];
level.challengeInfo[refString]["targetval"] = [];
level.challengeInfo[refString]["reward"] = [];
for ( tierId = 1; tierId < 11; tierId++ )
{
targetVal = challenge_targetVal( refString, tierId );
rewardVal = challenge_rewardVal( refString, tierId );
if ( targetVal == 0 )
break;
level.challengeInfo[refString]["targetval"][tierId] = targetVal;
level.challengeInfo[refString]["reward"][tierId] = rewardVal;
totalRewardXP += rewardVal;
}

assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
refString = tableLookupByRow( tableName, index, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
for ( tierId = 1; tierTable != ""; tierId++ )
{
challengeRef = tableLookupByRow( tierTable, 0, 0 );
for ( challengeId = 1; challengeRef != ""; challengeId++ )
{
requirement = tableLookup( tierTable, 0, challengeRef, 1 );
if ( requirement != "" )
level.challengeInfo[challengeRef]["requirement"] = requirement;
challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
}
tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
}
}
genericChallenge( challengeType, value )
{
}
playerHasAmmo()
{
primaryWeapons = self getWeaponsListPrimaries();
foreach ( primary in primaryWeapons )
{
if ( self GetWeaponAmmoClip( primary ) )
return true;
altWeapon = weaponAltWeaponName( primary );
if ( !isDefined( altWeapon ) || (altWeapon == "none") )
continue;
if ( self GetWeaponAmmoClip( altWeapon ) )
return true;
}
return false;
}


Credits:
    
xePixTvx/xFuZiioN_x3
CraigChrist8239
KBrizzle


Pastebin: You must login or register to view this content.
Download(Includes Raw Files + a compiled .ff file): You must login or register to view this content.


Really nice work, but cursors are fucking annoying.

The following 2 users say thank you to Cmd-X for this useful post:

ICS Vortex
12-03-2012, 10:02 PM #9
Black Panther
Former Staff
Originally posted by X View Post
Really nice work, but cursors are fucking annoying.

Could be fun, for like a hide and go seek gamemode.

The following user thanked Black Panther for this useful post:

Cmd-X

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo