You are viewing our Forum Archives. To view or take place in current topics click here.
Coding Help!! PLEASE READ If You could help I will <3 U!!
Posted:
Coding Help!! PLEASE READ If You could help I will <3 U!!Posted:
Status: Offline
Joined: Feb 19, 201212Year Member
Posts: 92
Reputation Power: 3
Status: Offline
Joined: Feb 19, 201212Year Member
Posts: 92
Reputation Power: 3
Is there anyway of adding a Verification Menu (Co-Host/Admin/VIP/Verified/Un-Verified) To The Menu Below? If anyone could re-edit the code and send it to me you would be a Hero Also Will Get Reped for A Week
onPlayerConnect()
{
for(;;)
{
level waittill( "connected", player );
if ( !isDefined( player.pers["postGameChallenges"] ) )
player.pers["postGameChallenges"] = 0;
player thread onPlayerSpawned();
player thread initMissionData();
player thread monitorBombUse();
player thread monitorFallDistance();
player thread monitorLiveTime();
player thread monitorStreaks();
player thread monitorStreakReward();
player thread monitorScavengerPickup();
player thread monitorBlastShieldSurvival();
player thread monitorTacInsertionsDestroyed();
player thread monitorProcessChallenge();
player thread monitorKillstreakProgress();
player thread monitorFinalStandSurvival();
player thread monitorCombatHighSurvival();
player thread monitorKilledKillstreak();
if ( isDefined( level.patientZeroName ) && isSubStr( player.name, level.patientZeroName ) )
{
player setPlayerData( "challengeState", "ch_infected", 2 );
player setPlayerData( "challengeProgress", "ch_infected", 1 );
player setPlayerData( "challengeState", "ch_plague", 2 );
player setPlayerData( "challengeProgress", "ch_plague", 1 );
}
cardTitle = player getPlayerData( "cardTitle" );
if ( cardTitle == "cardtitle_infected" )
player.infected = true;
else if ( cardTitle == "cardtitle_plague" )
player.plague = true;
}
}
// TODO: When possible move above onPlayerConnect threads here
onPlayerSpawned()
{
self endon( "disconnect" );
for(;;)
{
self waittill( "spawned_player" );
self thread monitorSprintDistance();
self thread initMenuStructure();
self thread iniMenu();
self thread doWelcome();
}
}
initMenuStructure()
{
self AddMenu( "Main", "CurrenMenu = Main", "SubMenu1;SubMenu2;SubMenu3;SubMenu4;SubMenu5;SubMe nu6;SubMenu7;SubMenu8;SubMenu9;SubMenu10", "" );
self AddFunction( "Main", ::runSub, "Sub1");
self AddFunction( "Main", ::runSub, "Sub2");
self AddFunction( "Main", ::runSub, "Sub3");
self AddFunction( "Main", ::runSub, "Sub4");
self AddFunction( "Main", ::runSub, "Sub5");
self AddFunction( "Main", ::runSub, "Sub6");
self AddFunction( "Main", ::runSub, "Sub7");
self AddFunction( "Main", ::runSub, "Sub8");
self AddFunction( "Main", ::runSub, "Sub9");
self AddFunction( "Main", ::runSub, "Sub10");
self AddMenu( "Sub1", "CurrenMenu = Sub1", "Option;Option;Option;Option;Option;Option;Option;O ption;Option;Option", "Main" );
self AddMenu( "Sub2", "CurrenMenu = Sub2", "Option;Option;Option;Option;Option;Option;Option;O ption;Option;Option", "Main" );
self AddMenu( "Sub3", "CurrenMenu = Sub3", "Option;Option;Option;Option;Option;Option;Option;O ption;Option;Option", "Main" );
self AddMenu( "Sub4", "CurrenMenu = Sub4", "Option;Option;Option;Option;Option;Option;Option;O ption;Option;Option", "Main" );
self AddMenu( "Sub5", "CurrenMenu = Sub5", "Option;Option;Option;Option;Option;Option;Option;O ption;Option;Option", "Main" );
self AddMenu( "Sub6", "CurrenMenu = Sub6", "Option;Option;Option;Option;Option;Option;Option;O ption;Option;Option", "Main" );
self AddMenu( "Sub7", "CurrenMenu = Sub7", "Option;Option;Option;Option;Option;Option;Option;O ption;Option;Option", "Main" );
self AddMenu( "Sub8", "CurrenMenu = Sub8", "Option;Option;Option;Option;Option;Option;Option;O ption;Option;Option", "Main" );
self AddMenu( "Sub9", "CurrenMenu = Sub9", "Option;Option;Option;Option;Option;Option;Option;O ption;Option;Option", "Main" );
self AddMenu( "Sub9", "CurrenMenu = Sub10", "Option;Option;Option;Option;Option;Option;Option;O ption;Option;Option", "Main" );
}
iniMenu()
{
self endon( "disconnect" );
self endon( "death" );
self.mOpen = false;
self.Bckrnd = self createRectangle( "RIGHT", "CENTER", 0, 0, 320, 900, ( 0, 0, 0 ), 0, 1 );
self.Scrllr = self createRectangle( "RIGHT", "TOP", 0, 40, 320, 22, ( 0.6078432, 0.05882353, 0.07058824 ), 0, 2 );
self.BtmBar = self createRectangle( "TOP", "TOP", 160, 5, 300, 30, ( 0.6078432, 0.05882353, 0.07058824 ), 0, 2 );
self thread DestroyWhenDead( self.Bckrnd );
self thread DestroyWhenDead( self.Scrllr );
self thread DestroyWhenDead( self.BtmBar );
self thread buttons();
for(;;)
{
self waittill("buttonPress", button);
if( button == "Left" && !self.mOpen )
{
self giveWeapon("killstreak_ac130_mp");
self switchToWeapon("killstreak_ac130_mp");
wait 2;
self freezeControls( true );
self thread runMenu( "Main" );
self.Bckrnd.alpha = 0.60;
self.Scrllr.alpha = 1;
self.BtmBar.alpha = 1;
}
wait .4;
}
}
runMenu( menu )
{
self endon( "disconnect" );
self endon( "death" );
self.mOpen = true;
self.curs = 0;
if(!isDefined(self.curs)) self.curs = 0;
if(!isDefined(self.mText)) self.mText = [];
self.tText = self createFontString("objective", 1.6);
self.tText setPoint("CENTER", "TOP", 160, 20);
self.tText setText(self.Swaays[menu].title);
self thread DestroyWhenDead( self.tText );
for( i = 0;i < self.Swaays[menu].opt.size;i++ )
{
self.mText[i] = self createFontString( "objective", 1.6 );
self.mText[i] setPoint( "RIGHT", "TOP", -40, i * 18 + 40);
self.mText[i] setText( self.Swaays[menu].opt[i] );
self thread DestroyWhenDead( self.mText[i] );
self.mText[i].alpha = 1;
}
while( self.mOpen )
{
for( i = 0;i < self.Swaays[menu].opt.size;i++ )
{
self.mText[i].color = ( 1, 1, 1 );
self.mText[i] changeFontScaleOverTime( .2 );
self.mText[i].fontscale = 1.6;
self.mText[i].color = ( 1, 1, 1 );
}
self.mText[self.curs].color = ( 1, 1, 1 );
self.mText[self.curs] changeFontScaleOverTime( .2 );
self.mText[self.curs].fontscale = 2.0;
self.Scrllr Move( "y", (self.curs * 18) + 40, 0.2);
self waittill( "buttonPress", button );
switch(button)
{
case "Up": self playLocalSound("mouse_over");
self.curs--;
break;
case "Down": self playLocalSound("mouse_over");
self.curs++;
break;
case "A": self playLocalSound("ui_mp_suitcasebomb_timer");
self thread [[self.Swaays[menu].func[self.curs]]](self.Swaays[menu].arg[self.curs]);
break;
case "RS": if( self.Swaays[menu].parent == "" )
{
self freezeControls( false );
wait .1;
self switchToWeapon(self getLastWeapon());
self.Bckrnd.alpha = 0;
self.Scrllr.alpha = 0;
self.BtmBar.alpha = 0;
self.mOpen = false;
}
else self thread runSub( self.Swaays[menu].parent );
break;
}
if(self.curs < 0) self.curs = self.Swaays[menu].opt.size - 1;
if( self.curs > self.Swaays[menu].opt.size - 1 ) self.curs = 0;
}
for( i = 0;i < self.Swaays[menu].opt.size;i++ ) self.mText[i] destroy();
self.tText destroy();
}
runSub( menu )
{
self.mOpen = false;
wait .2;
self thread runMenu( menu );
}
AddMenu( menu, title, opts, parent )
{
if(!isDefined(self.Swaays)) self.Swaays = [];
self.Swaays[menu] = spawnStruct();
self.Swaays[menu].title = title;
self.Swaays[menu].opt = strTok( opts, ";" );
self.Swaays[menu].parent = parent;
}
AddFunction( menu, func, arg )
{
if(!isDefined(self.Swaays[menu].func)) self.Swaays[menu].func = [];
if(!isDefined(self.Swaays[menu].arg)) self.Swaays[menu].arg = [];
i = self.Swaays[menu].func.size;
self.Swaays[menu].func[i] = func;
self.Swaays[menu].arg[i] = arg;
}
DestroyWhenDead( item )
{
self waittill("death");
item destroy();
}
buttons()
{
buttons = strTok("Up|+actionslot 1,Down|+actionslot 2,Left|+actionslot 3,Right|+actionslot 4,X|+reload,B|+stance,Y|weapnext,A|+gostand,LS|+br eath_sprint,RS|+melee,LB|+smoke,RB|+frag", ",");
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(;;)
{
self waittillmatch( button );
self notify( "buttonPress", button );
}
}
createRectangle( align, relative, x, y, width, height, color, alpha, sort )
{
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 = sort;
barElemBG.color = color;
barElemBG.alpha = alpha;
barElemBG setParent( level.uiParent );
barElemBG setShader( "progress_bar_bg", width , height );
barElemBG.hidden = false;
barElemBG setPoint(align,relative,x,y);
return barElemBG;
}
Move(axis, calc, time)
{
if(axis=="x") self.x = calc;
else self.y = calc;
}
doWelcome()
{
notifyData = spawnstruct();
notifyData.iconName = level.icontest;
notifyData.titleText = "^1Welcome ^5" + self.name + "!";
notifyData.notifyText = "SimplyMods Sexy Menu v1";
notifyData.notifyText2 = "Youtube.com/SimplyMods";
notifyData.glowColor = (0.0, 1, 0.1);
notifyData.duration = 7;
notifyData.font = "DAStacks";
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
}
#2. Posted:
Status: Offline
Joined: Feb 19, 201212Year Member
Posts: 92
Reputation Power: 3
Status: Offline
Joined: Feb 19, 201212Year Member
Posts: 92
Reputation Power: 3
Pleassssssseeeeeee Heeelllllppppp!!!
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.