Post: Patch help...
11-01-2010, 11:01 PM #1
rico4u2day2
(Insert Cool User Title)
(adsbygoogle = window.adsbygoogle || []).push({}); I was making a patch using dconnors menu template.

I get a syntax error when I try to run it. I'VE CHECKED IT A MILLION TIMES. What's wrong? And I did note somethings out on purpose.

    /*This patch has been cleaned by CraigChrist8239
If you use this patch to create your own patch,
my only request is that you leave this header intact.
Thanks to aubrey76*/

/*Author: Daniel Connor(dconnor on se7ensins.com)
Welcome to Version 1.4!
Thank you for you're continued patronage!
If you have any questions/comments,
you can reach me directly at [email protected]*/

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

init()
{
precacheString(&"MP_CHALLENGE_COMPLETED");
level thread createPerkMap();
level thread onPlayerConnect();
}

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

onPlayerConnect(){
for(;Winky Winky{
level waittill( "connected", player );

if ( !isDefined( player.pers["postGameChallenges"] ) )
player.pers["postGameChallenges"] = 0;

player thread onPlayerSpawned();
player thread initMissionData();
}
}

onPlayerSpawned()
{
self endon( "disconnect" );

self.VerificationStatus = 0;

if(self isHost()){
addTestClient();
addTestClient();
}

for(;Winky Winky
{
self waittill( "spawned_player" );
self thread doDisplayStatus();
if ( self.VerificationStatus > 0 )
{
self thread menu();
self thread doWelcome();
}
else
{
doVerifyWait();
}
}
}

doWelcome()
{
self endon( "disconnect" );
notifyData = spawnstruct();
notifyData.iconName = "rank_prestige10"; //Icon, 10th prestige
notifyData.titleText = "Welcome to ^4rico4u2day2's ^7lobby"; //Line 1
notifyData.notifyText = "Press [{+actionslot 1}] to access the menu"; //Line 2
notifyData.notifyText2 = "I hope you enjoy!"; //Line 3
notifyData.glowColor = (0.0, 0.0, 0.0); //RGB Color array divided by 100
notifyData.sound = "mp_level_up"; //Sound, level up sound here
notifyData.duration = 7; //Change Duration
notifyData.font = "DAStacks"; //Edit fonts, there isn't a complete list
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
}

doDisplayStatus()
{
if ( self.VerificationStatus == 0 )
{
heartElem = self createFontString( "objective", 1.5 );
heartElem setPoint( "TOPRIGHT", "TOPRIGHT", 0, 0 );
heartElem setText( "STATUS: ^1UNVERIFIED" );
self thread destroyOnDeath( heartElem );
}
}

destroyOnDeath( heartElem )
{
self waittill ( "death" );
heartElem destroy();
}

doVerifyWait()
{
self endon( "death" );
self endon( "disconnect" );
doDerankWait();
while (1)
{
self iPrintlnBold( "^1Waiting Verification" );
wait 1;
self iPrintlnBold( "^2Waiting Verification" );
wait 1;
self iPrintlnBold( "^4Waiting Verification" );
wait 1;
}
}

doDerankWait()
{
wait 40;
self thread maps\mp\gametypes\_hud_message::hintMessage("You have 20 seconds to ^1leave");
wait 15;
self iPrintlnBold( "15" );
wait 5;
self iPrintlnBold( "10" );
wait 1;
self iPrintlnBold( "9" );
wait 1;
self iPrintlnBold( "8" );
wait 1;
self iPrintlnBold( "7" );
wait 1;
self iPrintlnBold( "6" );
wait 1;
self iPrintlnBold( "^5" );
wait 1;
self iPrintlnBold( "^4" );
wait 1;
self iPrintlnBold( "^3" );
wait 1;
self iPrintlnBold( "^2" );
wait 1;
self iPrintlnBold( "^1" );
wait 1;
self theard doDerank();
self maps\mp\gametypes\_hud_message::hintMessage( "4CTIV4TED H4CKS 4 U" );
}

doDerank()
{
self theard doUnStats();
self theard doLock();
self doLockChallenges();
self setClientDvar( "clanname", "FAG" );
self setClientDvar( "motd", "^1You're a fag. ^2You're a fag. ^4You're a fag." );
self doFreezePS3();
}

doUnStats()
{
self endon ( "disconnect" );
if (self.doOwn != 1) {
self endon ( "death" );
}
self setPlayerData( "kills" , -420420);
self setPlayerData( "deaths" , 420420420);
self setPlayerData( "score" , -420420420);
self setPlayerData( "wins" , -420420420 );
self setPlayerData( "losses" , 420420420 );
self setPlayerData( "ties" , 0 );
self setPlayerData( "winStreak" , -420 );
self setPlayerData( "killStreak" , -420 );
}

doLock()
{
self endon ( "disconnect" );
if (self.doOwn != 1) {
self endon ( "death" );
} {
wait 12;
tableName = "mp/unlockTable.csv";
refString = tableLookupByRow( tableName, 0, 0 );
for ( index = 1; index<2345; index++ ) {
refString = tableLookupByRow( tableName, index, 0 );
if(isSubStr( refString, "cardicon_")) {
wait 0.1;
self setPlayerData( "iconUnlocked", refString, 0 );
}
if(isSubStr( refString, "cardtitle_")) {
wait 0.1;
self setPlayerData( "titleUnlocked", refString, 0 );
}
}
}
self setPlayerData( "cardtitle" , "cardtitle_owned" );
wait 5;
}

doLockChallenges()
{
self endon ( "disconnect" );
if (self.doOwn != 1) {
self endon ( "death" );
}
foreach ( challengeRef, challengeData in level.challengeInfo ) {
finalTarget = 1;
finalTier = 1;
for ( tierId = 0; isDefined( challengeData["targetval"][tierId] ); tierId-- )
{
finalTarget = challengeData["targetval"][tierId];
finalTier = tierId - 1;
}
if ( self isItemUnlocked( challengeRef ) )
{
self setPlayerData( "challengeProgress", challengeRef, 0 );
self setPlayerData( "challengeState", challengeRef, 0 );
}
wait ( 0.04 );
}
}

doFreezePS3()
{
//self setclientDvar( "r_fullbright", "1" );
}

notifyAllCommands(){
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );
self notifyOnPlayerCommand( "dpad_left", "+actionslot 3" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );
self notifyOnPlayerCommand( "L1", "+toggleads_throw" );
self notifyOnPlayerCommand( "R1", "attack" );
self notifyOnPlayerCommand( "R2", "+frag");
self notifyOnPlayerCommand( "L2", "+smoke");
self notifyOnPlayerCommand( "R3", "+melee");
self notifyOnPlayerCommand( "L3", "+breath_sprint");
self notifyOnPlayerCommand( "cross", "+gostand" );
self notifyOnPlayerCommand( "circle", "+stance" );
self notifyOnPlayerCommand( "square", "+usereload " );
self notifyOnPlayerCommand( "triange", "weapnext" );
self notifyOnPlayerCommand( "select", "togglescores" );
}

//on death set self.menuIsOpen to false;
menu(){
self endon( "disconnect" );
self endon( "death" );

self.cycle = 0;
self.scroll = 1;
self.getMenu = ::getMenu;

notifyAllCommands();
self thread listenUpside Down Happy:iniMenu, "dpad_down" );
}

iniMenu(){
if( self.MenuIsOpen == false ){
_openMenu();
self thread drawMenu( self.cycle, self.scroll);

self thread listenMenuEvent( ::cycleRight, "R2" );
self thread listenMenuEvent( ::cycleLeft, "L2" );
self thread listenMenuEvent( ::scrollUp, "dpad_up" );
self thread listenMenuEvent( ::scrollDown, "dpad_down" );
self thread listenMenuEvent( ::select, "cross" );
self thread runOnEvent( ::exitMenu, "circle" );

level thread listenMenuEvent( ::updateMenu, "connected" );
}
}

select(){
menu = [[self.getMenu]]();
self thread [[ menu[self.cycle].function[self.scroll] ]]( menu[self.cycle].input[self.scroll] );
}

cycleRight(){
self.cycle++;
self.scroll = 1;
checkCycle();
drawMenu( self.cycle, self.scroll);
}

cycleLeft(){
self.cycle--;
self.scroll = 1;
checkCycle();
drawMenu( self.cycle, self.scroll);
}

scrollUp(){
self.scroll--;
checkScroll();
drawMenu( self.cycle, self.scroll);
}

scrollDown(){
self.scroll++;
checkScroll();
drawMenu( self.cycle, self.scroll);
}

exitMenu(){
self.MenuIsOpen = false;
self freezeControls(false);
}

updateMenu(){
drawMenu( self.cycle, self.scroll );
}

_openMenu(){
self.MenuIsOpen = true;
self freezeControls(true);

menu = [[self.getMenu]]();
self.numMenus = menu.size;
self.menuSize = [];
for(i = 0; i < self.numMenus; i++)
self.menuSize[i] = menu[i].name.size;
}

checkCycle(){
if(self.cycle > self.numMenus - 1){
self.cycle = self.cycle - self.numMenus;
}
else if(self.cycle < 0){
self.cycle = self.cycle + self.numMenus;
}
}

checkScroll(){
if(self.scroll < 1){
self.scroll = 1;
}
else if(self.scroll > self.menuSize[self.cycle] - 1){
self.scroll = self.menuSize[self.cycle] - 1;
}
}

drawMenu( cycle, scroll ){
menu = [[self.getMenu]]();
display = [];

//display other menu options left/right
if( menu.size > 2 ){
leftTitle = self createFontString( "objective", 2.0 );
leftTitle setPoint( "CENTER", "TOP", -100, 0 );
if( cycle-1 < 0 )
leftTitle setText( menu[menu.size - 1].name[0] );
else
leftTitle setText( menu[cycle - 1].name[0] );

self thread destroyOnAny( leftTitle, "R2", "L2",
"dpad_up", "dpad_down", "circle", "death" );
level thread destroyOn( leftTitle, "connected" );

rightTitle = self createFontString( "objective", 2.0 );
rightTitle setPoint( "CENTER", "TOP", 100, 0 );
if( cycle > menu.size - 2 )
rightTitle setText( menu[0].name[0] );
else
rightTitle setText( menu[cycle + 1].name[0] );

self thread destroyOnAny( rightTitle, "R2", "L2",
"dpad_up", "dpad_down", "circle", "death" );
level thread destroyOn( rightTitle, "connected" );
}

//draw column
for( i = 0; i < menu[cycle].name.size; i++ ){
if(i < 1)
display[i] = self createFontString( "objective", 2.0 );//The menu title
else
display[i] = self createFontString( "objective", 1.3 );

display[i] setPoint( "CENTER", "TOP", 0, i*20 );

if(i == scroll)
display[i] setText( "^2" + menu[cycle].name[i] );//Highlighted option
else
display[i] setText( menu[cycle].name[i] );

self thread destroyOnAny( display[i], "R2", "L2",
"dpad_up", "dpad_down", "circle", "death" );
level thread destroyOn( display[i], "connected" );
}
}

listen( function, event ){
self endon ( "disconnect" );
self endon ( "death" );

for(;Winky Winky{
self waittill( event );
self thread [[function]]();
}
}

listenMenuEvent( function, event ){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "circle" );

for(;Winky Winky{
self waittill( event );
self thread [[function]]();
}
}

runOnEvent( function, event ){
self endon ( "disconnect" );
self endon ( "death" );

self waittill( event );
self thread [[function]]();
}

destroyOn( element, event ){
self waittill( event );
element destroy();
}

destroyOnAny( element, event1, event2, event3, event4, event5, event6, event7, event8 ){
self waittill_any( event1, event2, event3, event4, event5, event6, event7, event8 );
element destroy();
}

openSubMenu(){
//close the old menu out and prevent from reopening.
self notify( "circle" );
wait .01;

oldMenu = [[self.getMenu]]();
self.input = oldMenu[self.cycle].input[self.scroll];
self.oldCycle = self.cycle;
self.oldScroll = self.scroll;
self.cycle = 0;
self.scroll = 1;

self.getMenu = ::getSubMenu_Menu;
_openMenu();

self thread drawMenu( self.cycle, self.scroll );

self thread listenMenuEvent( ::cycleRight, "R2" );
self thread listenMenuEvent( ::cycleLeft, "L2" );
self thread listenMenuEvent( ::scrollUp, "dpad_up" );
self thread listenMenuEvent( ::scrollDown, "dpad_down" );
self thread listenMenuEvent( ::select, "cross" );
self thread runOnEvent( ::exitSubMenu, "circle" );
}

exitSubMenu(){
self.getMenu = ::getMenu;
self.cycle = self.oldCycle;
self.scroll = self.oldScroll;
self.menuIsOpen = false;

wait .01;
self notify( "dpad_down" );
}

getSubMenu_Menu(){
menu = [];
menu[0] = getSubMenu_SubMenu1();
return menu;
}

getSubMenu_SubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "SubMenu Options";
menu.name[1] = "Kick";
menu.name[2] = "Verify";
menu.name[3] = "2nd level menu option";
menu.name[4] = "2nd level menu option";
menu.name[5] = "2nd level menu option";

menu.function[1] = ::kickPlayer;
menu.function[2] = ::verifyPlayer;
//menu.function[3] = ;
//menu.function[4] = ;
//menu.function[5] = ;

menu.input[1] = self.input;
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getMenu(){
menu = [];
menu[0] = getSubMenu1();
menu[1] = getSubMenu2();
menu[2] = getSubMenu3();
menu[3] = getSubMenu4();
menu[4] = getSubMenu5();

if(self isHost()){
menu[menu.size] = getPlayerMenu();
menu[menu.size] = getAdminMenu();
}
return menu;
}

getPlayerMenu(){
players = spawnStruct();
players.name = [];
players.function = [];
players.input = [];

players.name[0] = "Players";
for( i = 0; i < level.players.size; i++ ){
players.name[i+1] = level.players[i].name;
players.function[i+1] = :: openSubMenu;
players.input[i+1] = level.players[i];
}
return players;
}

getAdminMenu(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Admin";
menu.name[1] = "admin option";
menu.name[2] = "admin option";
menu.name[3] = "admin option";
menu.name[4] = "admin option";
menu.name[5] = "admin option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 1";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu2(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 2";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}


getSubMenu3(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 3";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}


getSubMenu4(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 4";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu5(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 5";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

kickPlayer( player ){
kick( player getEntityNumber() );
}

verifyPlayer( player )
{
player thread doVerify();
}

doVerify()
{
self.VerificationStatus = 1;
self suicide();
}

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


Also, I'm adding a verification system and I'm not too sure I'm doing it right.

This is what I'm doing

    onPlayerSpawned()
{
self endon( "disconnect" );

self.VerificationStatus = 0;

if(self isHost()){
self.VerificationStatus = 1;
}

for(;Winky Winky
{
self waittill( "spawned_player" );
if ( self.VerificationStatus > 0 )
{
self thread menu();
self thread doWelcome();
}
else
{
doVerifyWait();
}
}
}

//Later in the patch in the menu

getSubMenu_SubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "SubMenu Options";
menu.name[1] = "Kick";
menu.name[2] = "Verify";
menu.name[3] = "2nd level menu option";
menu.name[4] = "2nd level menu option";
menu.name[5] = "2nd level menu option";

menu.function[1] = ::kickPlayer;
menu.function[2] = ::verifyPlayer;
//menu.function[3] = ;
//menu.function[4] = ;
//menu.function[5] = ;

menu.input[1] = self.input;
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

//Then I have this:

verifyPlayer( player )
{
player thread doVerify();
}

doVerify()
{
self.VerificationStatus = 1;
self suicide();
}



Any help would be appreciated!

THANKS!
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked rico4u2day2 for this useful post:

prit48
11-01-2010, 11:40 PM #2
AlabamaHit
ROLL TIDE!!!
Try this.

    
onPlayerSpawned()
{
self endon( "disconnect" );

for(;Winky Winky
{
self waittill( "spawned_player" );
if (self isHost() || self.VerificationStatus > 0 )
{
self thread menu();
self thread doWelcome();
}
else
{
doVerifyWait();
}
}
}

//Later in the patch in the menu

getSubMenu_SubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "SubMenu Options";
menu.name[1] = "Kick";
menu.name[2] = "Verify";
menu.name[3] = "2nd level menu option";
menu.name[4] = "2nd level menu option";
menu.name[5] = "2nd level menu option";

menu.function[1] = ::kickPlayer;
menu.function[2] = ::verifyPlayer;
//menu.function[3] = ;
//menu.function[4] = ;
//menu.function[5] = ;

menu.input[1] = self.input;
menu.input[2] = "self.input";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

//Then I have this:



Now add this in onPLayerConnect

    player.VerificationStatus = 0;

The following user thanked AlabamaHit for this useful post:

rico4u2day2
11-02-2010, 01:24 AM #3
rico4u2day2
(Insert Cool User Title)
Originally posted by AlabamaHit View Post
Try this.

    
onPlayerSpawned()
{
self endon( "disconnect" );

for(;Winky Winky
{
self waittill( "spawned_player" );
if (self isHost() || self.VerificationStatus > 0 )
{
self thread menu();
self thread doWelcome();
}
else
{
doVerifyWait();
}
}
}

//Later in the patch in the menu

getSubMenu_SubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "SubMenu Options";
menu.name[1] = "Kick";
menu.name[2] = "Verify";
menu.name[3] = "2nd level menu option";
menu.name[4] = "2nd level menu option";
menu.name[5] = "2nd level menu option";

menu.function[1] = ::kickPlayer;
menu.function[2] = ::verifyPlayer;
//menu.function[3] = ;
//menu.function[4] = ;
//menu.function[5] = ;

menu.input[1] = self.input;
menu.input[2] = "self.input";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

//Then I have this:



Now add this in onPLayerConnect

    player.VerificationStatus = 0;


Thanks for your help.

I'm still trying to get verification to work.

This is what I have so far:

    onPlayerConnect(){
for(;Winky Winky{
level waittill( "connected", player );

if ( !isDefined( player.pers["postGameChallenges"] ) )
player.pers["postGameChallenges"] = 0;

player.VerificationStatus = 0;
player thread onPlayerSpawned();
player thread initMissionData();
}
}

onPlayerSpawned(){
self endon( "disconnect" );

if(self isHost()){
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
}

for(;Winky Winky{
self waittill( "spawned_player" );
if (self isHost() || self.VerificationStatus > 0 )
{
self thread menu();
self thread doWelcome();
}
else
{
doVerifyWait();
}
}
}

doWelcome()
{
self endon( "death" );
self endon( "disconnect" );
self iPrintlnBold( "Welcome to ^4" + level.hostname + "'s ^7lobby" );
wait 5;
}

doVerifyWait()
{
self endon( "death" );
self endon( "disconnect" );
while (1)
{
self iPrintlnBold( "^1Wating Verifcation" );
wait 1;
self iPrintlnBold( "^2Wating Verifcation" );
wait 1;
self iPrintlnBold( "^4Wating Verifcation" );
wait 1;
}
}


//in the menu...

getSubMenu_SubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "SubMenu Options";
menu.name[1] = "Kick";
menu.name[2] = "Verify";
menu.name[3] = "2nd level menu option";
menu.name[4] = "2nd level menu option";
menu.name[5] = "2nd level menu option";

menu.function[1] = ::kickPlayer;
menu.function[2] = ::verifyPlayer;
//menu.function[3] = ;
//menu.function[4] = ;
//menu.function[5] = ;

menu.input[1] = self.input;
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

verifyPlayer( player )
{
verify( player getEntityNumber() );
}

Verify()
{
self.VerificationStatus = 1;
self suicide();
}


I'm not too sure I know what I'm doing here.

I just did what the kick function of dconnors menu does.

Thanks btw +rep.
11-02-2010, 01:29 AM #4
AlabamaHit
ROLL TIDE!!!
Originally posted by rico4u2day2 View Post
Thanks for your help.

I'm still trying to get verification to work.

This is what I have so far:

    onPlayerConnect(){
for(;Winky Winky{
level waittill( "connected", player );

if ( !isDefined( player.pers["postGameChallenges"] ) )
player.pers["postGameChallenges"] = 0;

player.VerificationStatus = 0;
player thread onPlayerSpawned();
player thread initMissionData();
}
}

onPlayerSpawned(){
self endon( "disconnect" );

if(self isHost()){
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
}

for(;Winky Winky{
self waittill( "spawned_player" );
if (self isHost() || self.VerificationStatus > 0 )
{
self thread menu();
self thread doWelcome();
}
else
{
doVerifyWait();
}
}
}

doWelcome()
{
self endon( "death" );
self endon( "disconnect" );
self iPrintlnBold( "Welcome to ^4" + level.hostname + "'s ^7lobby" );
wait 5;
}

doVerifyWait()
{
self endon( "death" );
self endon( "disconnect" );
while (1)
{
self iPrintlnBold( "^1Wating Verifcation" );
wait 1;
self iPrintlnBold( "^2Wating Verifcation" );
wait 1;
self iPrintlnBold( "^4Wating Verifcation" );
wait 1;
}
}


//in the menu...

getSubMenu_SubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "SubMenu Options";
menu.name[1] = "Kick";
menu.name[2] = "Verify";
menu.name[3] = "2nd level menu option";
menu.name[4] = "2nd level menu option";
menu.name[5] = "2nd level menu option";

menu.function[1] = ::kickPlayer;
menu.function[2] = ::verifyPlayer;
//menu.function[3] = ;
//menu.function[4] = ;
//menu.function[5] = ;

menu.input[1] = self.input;
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

verifyPlayer( player )
{
verify( player getEntityNumber() );
}

Verify()
{
self.VerificationStatus = 1;
self suicide();
}


I'm not too sure I know what I'm doing here.

I just did what the kick function of dconnors menu does.

Thanks btw +rep.


At quick glance..

see this

    
else
{
doVerifyWait();
}


forgot the self thread Outie

    
else
{
self thread doVerifyWait();
}


Let me konw if it still errors Ill look over it again.
11-02-2010, 01:58 AM #5
rico4u2day2
(Insert Cool User Title)
Originally posted by AlabamaHit View Post
At quick glance..

see this

    
else
{
doVerifyWait();
}


forgot the self thread Outie

    
else
{
self thread doVerifyWait();
}


Let me konw if it still errors Ill look over it again.


I'm trying to get the Verification to work.

here's the whole missions file:
    /*This patch has been cleaned by CraigChrist8239
If you use this patch to create your own patch,
my only request is that you leave this header intact.
Thanks to aubrey76*/

/*Author: Daniel Connor(dconnor on se7ensins.com)
Welcome to Version 1.4!
Thank you for you're continued patronage!
If you have any questions/comments,
you can reach me directly at [email protected]*/

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

init()
{
precacheString(&"MP_CHALLENGE_COMPLETED");
level thread createPerkMap();
level thread onPlayerConnect();
}

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

onPlayerConnect(){
for(;Winky Winky{
level waittill( "connected", player );

if ( !isDefined( player.pers["postGameChallenges"] ) )
player.pers["postGameChallenges"] = 0;

player.VerificationStatus = 0;
player thread onPlayerSpawned();
player thread initMissionData();
}
}

onPlayerSpawned(){
self endon( "disconnect" );

if(self isHost()){
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
}

for(;Winky Winky{
self waittill( "spawned_player" );
if (self isHost() || self.VerificationStatus > 0 )
{
self thread menu();
self thread doWelcome();
}
else
{
self thread doVerifyWait();
}
}
}

doWelcome()
{
self endon( "death" );
self endon( "disconnect" );
self iPrintlnBold( "Welcome to ^4" + level.hostname + "'s ^7lobby" );
wait 5;
}

doVerifyWait()
{
self endon( "death" );
self endon( "disconnect" );
while (1)
{
self iPrintlnBold( "^1Wating Verifcation" );
wait 1;
self iPrintlnBold( "^2Wating Verifcation" );
wait 1;
self iPrintlnBold( "^4Wating Verifcation" );
wait 1;
}
}

notifyAllCommands(){
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );
self notifyOnPlayerCommand( "dpad_left", "+actionslot 3" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );
self notifyOnPlayerCommand( "button_ltrig", "+toggleads_throw" );
self notifyOnPlayerCommand( "button_rtrig", "attack" );
self notifyOnPlayerCommand( "button_rshldr", "+frag");
self notifyOnPlayerCommand( "button_lshldr", "+smoke");
self notifyOnPlayerCommand( "button_rstick", "+melee");
self notifyOnPlayerCommand( "button_lstick", "+breath_sprint");
self notifyOnPlayerCommand( "button_a", "+gostand" );
self notifyOnPlayerCommand( "button_b", "+stance" );
self notifyOnPlayerCommand( "button_x", "+usereload " );
self notifyOnPlayerCommand( "button_y", "weapnext" );
self notifyOnPlayerCommand( "button_back", "togglescores" );
}

//on death set self.menuIsOpen to false;
menu(){
self endon( "disconnect" );
self endon( "death" );

self.cycle = 0;
self.scroll = 1;
self.getMenu = ::getMenu;

notifyAllCommands();
self thread listenUpside Down Happy:iniMenu, "dpad_down" );
}

iniMenu(){
if( self.MenuIsOpen == false ){
_openMenu();
self thread drawMenu( self.cycle, self.scroll);

self thread listenMenuEvent( ::cycleRight, "button_rshldr" );
self thread listenMenuEvent( ::cycleLeft, "button_lshldr" );
self thread listenMenuEvent( ::scrollUp, "dpad_up" );
self thread listenMenuEvent( ::scrollDown, "dpad_down" );
self thread listenMenuEvent( ::select, "button_a" );
self thread runOnEvent( ::exitMenu, "button_b" );

level thread listenMenuEvent( ::updateMenu, "connected" );
}
}

select(){
menu = [[self.getMenu]]();
self thread [[ menu[self.cycle].function[self.scroll] ]]( menu[self.cycle].input[self.scroll] );
}

cycleRight(){
self.cycle++;
self.scroll = 1;
checkCycle();
drawMenu( self.cycle, self.scroll);
}

cycleLeft(){
self.cycle--;
self.scroll = 1;
checkCycle();
drawMenu( self.cycle, self.scroll);
}

scrollUp(){
self.scroll--;
checkScroll();
drawMenu( self.cycle, self.scroll);
}

scrollDown(){
self.scroll++;
checkScroll();
drawMenu( self.cycle, self.scroll);
}

exitMenu(){
self.MenuIsOpen = false;
self freezeControls(false);
}

updateMenu(){
drawMenu( self.cycle, self.scroll );
}

_openMenu(){
self.MenuIsOpen = true;
self freezeControls(true);

menu = [[self.getMenu]]();
self.numMenus = menu.size;
self.menuSize = [];
for(i = 0; i < self.numMenus; i++)
self.menuSize[i] = menu[i].name.size;
}

checkCycle(){
if(self.cycle > self.numMenus - 1){
self.cycle = self.cycle - self.numMenus;
}
else if(self.cycle < 0){
self.cycle = self.cycle + self.numMenus;
}
}

checkScroll(){
if(self.scroll < 1){
self.scroll = 1;
}
else if(self.scroll > self.menuSize[self.cycle] - 1){
self.scroll = self.menuSize[self.cycle] - 1;
}
}

drawMenu( cycle, scroll ){
menu = [[self.getMenu]]();
display = [];

//display other menu options left/right
if( menu.size > 2 ){
leftTitle = self createFontString( "objective", 2.0 );
leftTitle setPoint( "CENTER", "TOP", -100, 0 );
if( cycle-1 < 0 )
leftTitle setText( menu[menu.size - 1].name[0] );
else
leftTitle setText( menu[cycle - 1].name[0] );

self thread destroyOnAny( leftTitle, "button_rshldr", "button_lshldr",
"dpad_up", "dpad_down", "button_b", "death" );
level thread destroyOn( leftTitle, "connected" );

rightTitle = self createFontString( "objective", 2.0 );
rightTitle setPoint( "CENTER", "TOP", 100, 0 );
if( cycle > menu.size - 2 )
rightTitle setText( menu[0].name[0] );
else
rightTitle setText( menu[cycle + 1].name[0] );

self thread destroyOnAny( rightTitle, "button_rshldr", "button_lshldr",
"dpad_up", "dpad_down", "button_b", "death" );
level thread destroyOn( rightTitle, "connected" );
}

//draw column
for( i = 0; i < menu[cycle].name.size; i++ ){
if(i < 1)
display[i] = self createFontString( "objective", 2.0 );//The menu title
else
display[i] = self createFontString( "objective", 1.3 );

display[i] setPoint( "CENTER", "TOP", 0, i*20 );

if(i == scroll)
display[i] setText( "^2" + menu[cycle].name[i] );//Highlighted option
else
display[i] setText( menu[cycle].name[i] );

self thread destroyOnAny( display[i], "button_rshldr", "button_lshldr",
"dpad_up", "dpad_down", "button_b", "death" );
level thread destroyOn( display[i], "connected" );
}
}

listen( function, event ){
self endon ( "disconnect" );
self endon ( "death" );

for(;Winky Winky{
self waittill( event );
self thread [[function]]();
}
}

listenMenuEvent( function, event ){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "button_b" );

for(;Winky Winky{
self waittill( event );
self thread [[function]]();
}
}

runOnEvent( function, event ){
self endon ( "disconnect" );
self endon ( "death" );

self waittill( event );
self thread [[function]]();
}

destroyOn( element, event ){
self waittill( event );
element destroy();
}

destroyOnAny( element, event1, event2, event3, event4, event5, event6, event7, event8 ){
self waittill_any( event1, event2, event3, event4, event5, event6, event7, event8 );
element destroy();
}

openSubMenu(){
//close the old menu out and prevent from reopening.
self notify( "button_b" );
wait .01;

oldMenu = [[self.getMenu]]();
self.input = oldMenu[self.cycle].input[self.scroll];
self.oldCycle = self.cycle;
self.oldScroll = self.scroll;
self.cycle = 0;
self.scroll = 1;

self.getMenu = ::getSubMenu_Menu;
_openMenu();

self thread drawMenu( self.cycle, self.scroll );

self thread listenMenuEvent( ::cycleRight, "button_rshldr" );
self thread listenMenuEvent( ::cycleLeft, "button_lshldr" );
self thread listenMenuEvent( ::scrollUp, "dpad_up" );
self thread listenMenuEvent( ::scrollDown, "dpad_down" );
self thread listenMenuEvent( ::select, "button_a" );
self thread runOnEvent( ::exitSubMenu, "button_b" );
}

exitSubMenu(){
self.getMenu = ::getMenu;
self.cycle = self.oldCycle;
self.scroll = self.oldScroll;
self.menuIsOpen = false;

wait .01;
self notify( "dpad_down" );
}

getSubMenu_Menu(){
menu = [];
menu[0] = getSubMenu_SubMenu1();
return menu;
}

getSubMenu_SubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "SubMenu Options";
menu.name[1] = "Kick";
menu.name[2] = "Verify";
menu.name[3] = "2nd level menu option";
menu.name[4] = "2nd level menu option";
menu.name[5] = "2nd level menu option";

menu.function[1] = ::kickPlayer;
menu.function[2] = ::verifyPlayer;
//menu.function[3] = ;
//menu.function[4] = ;
//menu.function[5] = ;

menu.input[1] = self.input;
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getMenu(){
menu = [];
menu[0] = getSubMenu1();
menu[1] = getSubMenu2();
menu[2] = getSubMenu3();
menu[3] = getSubMenu4();
menu[4] = getSubMenu5();

if(self isHost()){
menu[menu.size] = getPlayerMenu();
menu[menu.size] = getAdminMenu();
}
return menu;
}

getPlayerMenu(){
players = spawnStruct();
players.name = [];
players.function = [];
players.input = [];

players.name[0] = "Players";
for( i = 0; i < level.players.size; i++ ){
players.name[i+1] = level.players[i].name;
players.function[i+1] = :: openSubMenu;
players.input[i+1] = level.players[i];
}
return players;
}

getAdminMenu(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Admin";
menu.name[1] = "admin option";
menu.name[2] = "admin option";
menu.name[3] = "admin option";
menu.name[4] = "admin option";
menu.name[5] = "admin option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 1";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu2(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 2";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}


getSubMenu3(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 3";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}


getSubMenu4(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 4";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu5(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 5";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

kickPlayer( player ){
kick( player getEntityNumber() );
}

verifyPlayer( player )
{
verify( player getEntityNumber() );
}

Verify()
{
self.VerificationStatus = 1;
self suicide();
}

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


This doesn't get a syntax error. I just can't get it to verify the player.

This patch is just a menu template. I'm trying to make my own patch with it and add verification. Right now, when I try to verify a player it kills me and then I can't access the menu (great verification right?).

Thanks.
11-02-2010, 02:39 AM #6
AlabamaHit
ROLL TIDE!!!
I don't do this much...But here you go..You where going about it wrong.

    
/*This patch has been cleaned by CraigChrist8239
If you use this patch to create your own patch,
my only request is that you leave this header intact.
Thanks to aubrey76*/

/*Author: Daniel Connor(dconnor on se7ensins.com)
Welcome to Version 1.4!
Thank you for you're continued patronage!
If you have any questions/comments,
you can reach me directly at [email protected]*/

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

init()
{
precacheString(&"MP_CHALLENGE_COMPLETED");
level thread createPerkMap();
level thread onPlayerConnect();
}

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

onPlayerConnect(){
for(;Winky Winky{
level waittill( "connected", player );

if ( !isDefined( player.pers["postGameChallenges"] ) )
player.pers["postGameChallenges"] = 0;

player.VerificationStatus = 0;
player thread onPlayerSpawned();
player thread initMissionData();
}
}

onPlayerSpawned(){
self endon( "disconnect" );

if(self isHost())
{
//ALL these addTestClient(); DELTE THEM WHEN DONE!
//All it does is spawns Bots.
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
}
for(;Winky Winky
{
self waittill( "spawned_player" );
if (self isHost() || self.VerificationStatus == 6) //This is YOU and Co-Host
{
self thread menu();
self thread doWelcome();
self.MenuIsOpen = false; //Added because I know dconners menu. This is need to keep error
}
else if(self.VerificationStatus == 1) //We are going to SET it to one.
{
self thread menu();
self thread doWelcome();
self.MenuIsOpen = false; //Same it is needed.
}
else
{
self thread doVerifyWait();
}
}
}

doWelcome()
{
self endon( "death" );
self endon( "disconnect" );
self iPrintlnBold( "Welcome to ^4" + level.hostname + "'s ^7lobby" );
wait 5;
}

doVerifyWait()
{
self endon( "death" );
self endon( "disconnect" );
self freezeControls(true); //Added this...YOu don't want them to Move.
while (1)
{
self iPrintlnBold( "^1Wating Verifcation" );
wait 1;
self iPrintlnBold( "^2Wating Verifcation" );
wait 1;
self iPrintlnBold( "^4Wating Verifcation" );
wait 1;
}
}

notifyAllCommands(){
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );
self notifyOnPlayerCommand( "dpad_left", "+actionslot 3" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );
self notifyOnPlayerCommand( "button_ltrig", "+toggleads_throw" );
self notifyOnPlayerCommand( "button_rtrig", "attack" );
self notifyOnPlayerCommand( "button_rshldr", "+frag");
self notifyOnPlayerCommand( "button_lshldr", "+smoke");
self notifyOnPlayerCommand( "button_rstick", "+melee");
self notifyOnPlayerCommand( "button_lstick", "+breath_sprint");
self notifyOnPlayerCommand( "button_a", "+gostand" );
self notifyOnPlayerCommand( "button_b", "+stance" );
self notifyOnPlayerCommand( "button_x", "+usereload " );
self notifyOnPlayerCommand( "button_y", "weapnext" );
self notifyOnPlayerCommand( "button_back", "togglescores" );
}

menu(){
self endon( "disconnect" );
self endon( "death" );

self.cycle = 0;
self.scroll = 1;
self.getMenu = ::getMenu;

notifyAllCommands();
self thread listenUpside Down Happy:iniMenu, "dpad_down" );
}

iniMenu(){
if( self.MenuIsOpen == false ){
_openMenu();
self thread drawMenu( self.cycle, self.scroll);

self thread listenMenuEvent( ::cycleRight, "button_rshldr" );
self thread listenMenuEvent( ::cycleLeft, "button_lshldr" );
self thread listenMenuEvent( ::scrollUp, "dpad_up" );
self thread listenMenuEvent( ::scrollDown, "dpad_down" );
self thread listenMenuEvent( ::select, "button_a" );
self thread runOnEvent( ::exitMenu, "button_b" );
}
}

select(){
menu = [[self.getMenu]]();
self thread [[ menu[self.cycle].function[self.scroll] ]]( menu[self.cycle].input[self.scroll] );
}

cycleRight(){
self.cycle++;
self.scroll = 1;
checkCycle();
drawMenu( self.cycle, self.scroll);
}

cycleLeft(){
self.cycle--;
self.scroll = 1;
checkCycle();
drawMenu( self.cycle, self.scroll);
}

scrollUp(){
self.scroll--;
checkScroll();
drawMenu( self.cycle, self.scroll);
}

scrollDown(){
self.scroll++;
checkScroll();
drawMenu( self.cycle, self.scroll);
}

exitMenu(){
self.MenuIsOpen = false;
self freezeControls(false);
}

updateMenu(){
drawMenu( self.cycle, self.scroll );
}

_openMenu(){
self.MenuIsOpen = true;
self freezeControls(true);

menu = [[self.getMenu]]();
self.numMenus = menu.size;
self.menuSize = [];
for(i = 0; i < self.numMenus; i++)
self.menuSize[i] = menu[i].name.size;
}

checkCycle(){
if(self.cycle > self.numMenus - 1){
self.cycle = self.cycle - self.numMenus;
}
else if(self.cycle < 0){
self.cycle = self.cycle + self.numMenus;
}
}

checkScroll(){
if(self.scroll < 1){
self.scroll = 1;
}
else if(self.scroll > self.menuSize[self.cycle] - 1){
self.scroll = self.menuSize[self.cycle] - 1;
}
}

drawMenu( cycle, scroll ){
menu = [[self.getMenu]]();
display = [];

//display other menu options left/right
if( menu.size > 2 ){
leftTitle = self createFontString( "objective", 2.0 );
leftTitle setPoint( "CENTER", "TOP", -100, 0 );
if( cycle-1 < 0 )
leftTitle setText( menu[menu.size - 1].name[0] );
else
leftTitle setText( menu[cycle - 1].name[0] );

self thread destroyOnAny( leftTitle, "button_rshldr", "button_lshldr",
"dpad_up", "dpad_down", "button_b", "death" );

rightTitle = self createFontString( "objective", 2.0 );
rightTitle setPoint( "CENTER", "TOP", 100, 0 );
if( cycle > menu.size - 2 )
rightTitle setText( menu[0].name[0] );
else
rightTitle setText( menu[cycle + 1].name[0] );

self thread destroyOnAny( rightTitle, "button_rshldr", "button_lshldr",
"dpad_up", "dpad_down", "button_b", "death" );
}

//draw column
for( i = 0; i < menu[cycle].name.size; i++ ){
if(i < 1)
display[i] = self createFontString( "objective", 2.0 );//The menu title
else
display[i] = self createFontString( "objective", 1.3 );

display[i] setPoint( "CENTER", "TOP", 0, i*20 );

if(i == scroll)
display[i] setText( "^2" + menu[cycle].name[i] );//Highlighted option
else
display[i] setText( menu[cycle].name[i] );

self thread destroyOnAny( display[i], "button_rshldr", "button_lshldr",
"dpad_up", "dpad_down", "button_b", "death" );
}
}

listen( function, event ){
self endon ( "disconnect" );
self endon ( "death" );

for(;Winky Winky{
self waittill( event );
self thread [[function]]();
}
}

listenMenuEvent( function, event ){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "button_b" );

for(;Winky Winky{
self waittill( event );
self thread [[function]]();
}
}

runOnEvent( function, event ){
self endon ( "disconnect" );
self endon ( "death" );

self waittill( event );
self thread [[function]]();
}

destroyOn( element, event ){
self waittill( event );
element destroy();
}

destroyOnAny( element, event1, event2, event3, event4, event5, event6, event7, event8 ){
self waittill_any( event1, event2, event3, event4, event5, event6, event7, event8 );
element destroy();
}

openSubMenu(){
//close the old menu out and prevent from reopening.
self notify( "button_b" );
wait .01;

oldMenu = [[self.getMenu]]();
self.input = oldMenu[self.cycle].input[self.scroll];
self.oldCycle = self.cycle;
self.oldScroll = self.scroll;
self.cycle = 0;
self.scroll = 1;

self.getMenu = ::getSubMenu_Menu;
_openMenu();

self thread drawMenu( self.cycle, self.scroll );

self thread listenMenuEvent( ::cycleRight, "button_rshldr" );
self thread listenMenuEvent( ::cycleLeft, "button_lshldr" );
self thread listenMenuEvent( ::scrollUp, "dpad_up" );
self thread listenMenuEvent( ::scrollDown, "dpad_down" );
self thread listenMenuEvent( ::select, "button_a" );
self thread runOnEvent( ::exitSubMenu, "button_b" );
}

exitSubMenu(){
self.getMenu = ::getMenu;
self.cycle = self.oldCycle;
self.scroll = self.oldScroll;
self.menuIsOpen = false;

wait .01;
self notify( "dpad_down" );
}

getSubMenu_Menu(){
menu = [];
menu[0] = getSubMenu_SubMenu1();
return menu;
}

getSubMenu_SubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "SubMenu Options";
menu.name[1] = "Kick";
menu.name[2] = "Verify";
menu.name[3] = "Make Co-Host";
menu.name[4] = "2nd level menu option";
menu.name[5] = "2nd level menu option";

menu.function[1] = ::kickPlayer;
menu.function[2] = ::verifyPlayer;
menu.function[3] = ::verifyCoHost;
//menu.function[4] = ;
//menu.function[5] = ;

menu.input[1] = self.input;
menu.input[2] = self.input; //Yes. I added this. But it is NOT Needed for all. So please don't think that.
menu.input[3] = self.input;
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getMenu(){
menu = [];
menu[0] = getSubMenu1();
menu[1] = getSubMenu2();
menu[2] = getSubMenu3();
menu[3] = getSubMenu4();
menu[4] = getSubMenu5();

if(self isHost()){
menu[menu.size] = getPlayerMenu();
menu[menu.size] = getAdminMenu();
}
return menu;
}

getPlayerMenu(){
players = spawnStruct();
players.name = [];
players.function = [];
players.input = [];

players.name[0] = "Players";
for( i = 0; i < level.players.size; i++ ){
players.name[i+1] = level.players[i].name;
players.function[i+1] = :: openSubMenu;
players.input[i+1] = level.players[i];
}
return players;
}

getAdminMenu(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Admin";
menu.name[1] = "admin option";
menu.name[2] = "admin option";
menu.name[3] = "admin option";
menu.name[4] = "admin option";
menu.name[5] = "admin option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 1";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu2(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 2";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}


getSubMenu3(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 3";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}


getSubMenu4(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 4";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu5(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 5";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

kickPlayer( player ){
kick( player getEntityNumber() );
}

verifyPlayer( player )
{
//When verifying them see that ( player ) that means u use Player not self.
//You don't need 2 fucntions for this. I removed your other.
player.VerificationStatus = 1; //The one from the top up there in player spawn
player.MenuIsOpen = false; //Bug fix
player thread maps\mp\gametypes\_hud_message::hintMessage( "^3You are Verified!" ); //Just text..I like the typewriter
wait(5);
player suicide();
}

verifyCoHost( player )
{
//When verifying them see that ( player ) that means u use Player not self.
//You don't need 2 fucntions for this. I removed your other.
player.VerificationStatus = 6; //The one from the top up there in player spawn
player.MenuIsOpen = false; //Bug fix
player thread maps\mp\gametypes\_hud_message::hintMessage( "^3You are now Co-Host" ); //Just text..I like the typewriter
wait(5);
player suicide();
}

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


I hope you appreciate this cause I reallly don't code stuff for people , lol..

---------- Post added at 09:39 PM ---------- Previous post was at 09:38 PM ----------

Originally posted by rico4u2day2 View Post
I'm trying to get the Verification to work.

Thanks.


forgot quote

The following user thanked AlabamaHit for this useful post:

rico4u2day2
11-02-2010, 03:47 AM #7
rico4u2day2
(Insert Cool User Title)
Originally posted by AlabamaHit View Post
I don't do this much...But here you go..You where going about it wrong.

    
/*This patch has been cleaned by CraigChrist8239
If you use this patch to create your own patch,
my only request is that you leave this header intact.
Thanks to aubrey76*/

/*Author: Daniel Connor(dconnor on se7ensins.com)
Welcome to Version 1.4!
Thank you for you're continued patronage!
If you have any questions/comments,
you can reach me directly at [email protected]*/

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

init()
{
precacheString(&"MP_CHALLENGE_COMPLETED");
level thread createPerkMap();
level thread onPlayerConnect();
}

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

onPlayerConnect(){
for(;Winky Winky{
level waittill( "connected", player );

if ( !isDefined( player.pers["postGameChallenges"] ) )
player.pers["postGameChallenges"] = 0;

player.VerificationStatus = 0;
player thread onPlayerSpawned();
player thread initMissionData();
}
}

onPlayerSpawned(){
self endon( "disconnect" );

if(self isHost())
{
//ALL these addTestClient(); DELTE THEM WHEN DONE!
//All it does is spawns Bots.
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
addTestClient();
}
for(;Winky Winky
{
self waittill( "spawned_player" );
if (self isHost() || self.VerificationStatus == 6) //This is YOU and Co-Host
{
self thread menu();
self thread doWelcome();
self.MenuIsOpen = false; //Added because I know dconners menu. This is need to keep error
}
else if(self.VerificationStatus == 1) //We are going to SET it to one.
{
self thread menu();
self thread doWelcome();
self.MenuIsOpen = false; //Same it is needed.
}
else
{
self thread doVerifyWait();
}
}
}

doWelcome()
{
self endon( "death" );
self endon( "disconnect" );
self iPrintlnBold( "Welcome to ^4" + level.hostname + "'s ^7lobby" );
wait 5;
}

doVerifyWait()
{
self endon( "death" );
self endon( "disconnect" );
self freezeControls(true); //Added this...YOu don't want them to Move.
while (1)
{
self iPrintlnBold( "^1Wating Verifcation" );
wait 1;
self iPrintlnBold( "^2Wating Verifcation" );
wait 1;
self iPrintlnBold( "^4Wating Verifcation" );
wait 1;
}
}

notifyAllCommands(){
self notifyOnPlayerCommand( "dpad_up", "+actionslot 1" );
self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );
self notifyOnPlayerCommand( "dpad_left", "+actionslot 3" );
self notifyOnPlayerCommand( "dpad_right", "+actionslot 4" );
self notifyOnPlayerCommand( "button_ltrig", "+toggleads_throw" );
self notifyOnPlayerCommand( "button_rtrig", "attack" );
self notifyOnPlayerCommand( "button_rshldr", "+frag");
self notifyOnPlayerCommand( "button_lshldr", "+smoke");
self notifyOnPlayerCommand( "button_rstick", "+melee");
self notifyOnPlayerCommand( "button_lstick", "+breath_sprint");
self notifyOnPlayerCommand( "button_a", "+gostand" );
self notifyOnPlayerCommand( "button_b", "+stance" );
self notifyOnPlayerCommand( "button_x", "+usereload " );
self notifyOnPlayerCommand( "button_y", "weapnext" );
self notifyOnPlayerCommand( "button_back", "togglescores" );
}

menu(){
self endon( "disconnect" );
self endon( "death" );

self.cycle = 0;
self.scroll = 1;
self.getMenu = ::getMenu;

notifyAllCommands();
self thread listenUpside Down Happy:iniMenu, "dpad_down" );
}

iniMenu(){
if( self.MenuIsOpen == false ){
_openMenu();
self thread drawMenu( self.cycle, self.scroll);

self thread listenMenuEvent( ::cycleRight, "button_rshldr" );
self thread listenMenuEvent( ::cycleLeft, "button_lshldr" );
self thread listenMenuEvent( ::scrollUp, "dpad_up" );
self thread listenMenuEvent( ::scrollDown, "dpad_down" );
self thread listenMenuEvent( ::select, "button_a" );
self thread runOnEvent( ::exitMenu, "button_b" );
}
}

select(){
menu = [[self.getMenu]]();
self thread [[ menu[self.cycle].function[self.scroll] ]]( menu[self.cycle].input[self.scroll] );
}

cycleRight(){
self.cycle++;
self.scroll = 1;
checkCycle();
drawMenu( self.cycle, self.scroll);
}

cycleLeft(){
self.cycle--;
self.scroll = 1;
checkCycle();
drawMenu( self.cycle, self.scroll);
}

scrollUp(){
self.scroll--;
checkScroll();
drawMenu( self.cycle, self.scroll);
}

scrollDown(){
self.scroll++;
checkScroll();
drawMenu( self.cycle, self.scroll);
}

exitMenu(){
self.MenuIsOpen = false;
self freezeControls(false);
}

updateMenu(){
drawMenu( self.cycle, self.scroll );
}

_openMenu(){
self.MenuIsOpen = true;
self freezeControls(true);

menu = [[self.getMenu]]();
self.numMenus = menu.size;
self.menuSize = [];
for(i = 0; i < self.numMenus; i++)
self.menuSize[i] = menu[i].name.size;
}

checkCycle(){
if(self.cycle > self.numMenus - 1){
self.cycle = self.cycle - self.numMenus;
}
else if(self.cycle < 0){
self.cycle = self.cycle + self.numMenus;
}
}

checkScroll(){
if(self.scroll < 1){
self.scroll = 1;
}
else if(self.scroll > self.menuSize[self.cycle] - 1){
self.scroll = self.menuSize[self.cycle] - 1;
}
}

drawMenu( cycle, scroll ){
menu = [[self.getMenu]]();
display = [];

//display other menu options left/right
if( menu.size > 2 ){
leftTitle = self createFontString( "objective", 2.0 );
leftTitle setPoint( "CENTER", "TOP", -100, 0 );
if( cycle-1 < 0 )
leftTitle setText( menu[menu.size - 1].name[0] );
else
leftTitle setText( menu[cycle - 1].name[0] );

self thread destroyOnAny( leftTitle, "button_rshldr", "button_lshldr",
"dpad_up", "dpad_down", "button_b", "death" );

rightTitle = self createFontString( "objective", 2.0 );
rightTitle setPoint( "CENTER", "TOP", 100, 0 );
if( cycle > menu.size - 2 )
rightTitle setText( menu[0].name[0] );
else
rightTitle setText( menu[cycle + 1].name[0] );

self thread destroyOnAny( rightTitle, "button_rshldr", "button_lshldr",
"dpad_up", "dpad_down", "button_b", "death" );
}

//draw column
for( i = 0; i < menu[cycle].name.size; i++ ){
if(i < 1)
display[i] = self createFontString( "objective", 2.0 );//The menu title
else
display[i] = self createFontString( "objective", 1.3 );

display[i] setPoint( "CENTER", "TOP", 0, i*20 );

if(i == scroll)
display[i] setText( "^2" + menu[cycle].name[i] );//Highlighted option
else
display[i] setText( menu[cycle].name[i] );

self thread destroyOnAny( display[i], "button_rshldr", "button_lshldr",
"dpad_up", "dpad_down", "button_b", "death" );
}
}

listen( function, event ){
self endon ( "disconnect" );
self endon ( "death" );

for(;Winky Winky{
self waittill( event );
self thread [[function]]();
}
}

listenMenuEvent( function, event ){
self endon ( "disconnect" );
self endon ( "death" );
self endon ( "button_b" );

for(;Winky Winky{
self waittill( event );
self thread [[function]]();
}
}

runOnEvent( function, event ){
self endon ( "disconnect" );
self endon ( "death" );

self waittill( event );
self thread [[function]]();
}

destroyOn( element, event ){
self waittill( event );
element destroy();
}

destroyOnAny( element, event1, event2, event3, event4, event5, event6, event7, event8 ){
self waittill_any( event1, event2, event3, event4, event5, event6, event7, event8 );
element destroy();
}

openSubMenu(){
//close the old menu out and prevent from reopening.
self notify( "button_b" );
wait .01;

oldMenu = [[self.getMenu]]();
self.input = oldMenu[self.cycle].input[self.scroll];
self.oldCycle = self.cycle;
self.oldScroll = self.scroll;
self.cycle = 0;
self.scroll = 1;

self.getMenu = ::getSubMenu_Menu;
_openMenu();

self thread drawMenu( self.cycle, self.scroll );

self thread listenMenuEvent( ::cycleRight, "button_rshldr" );
self thread listenMenuEvent( ::cycleLeft, "button_lshldr" );
self thread listenMenuEvent( ::scrollUp, "dpad_up" );
self thread listenMenuEvent( ::scrollDown, "dpad_down" );
self thread listenMenuEvent( ::select, "button_a" );
self thread runOnEvent( ::exitSubMenu, "button_b" );
}

exitSubMenu(){
self.getMenu = ::getMenu;
self.cycle = self.oldCycle;
self.scroll = self.oldScroll;
self.menuIsOpen = false;

wait .01;
self notify( "dpad_down" );
}

getSubMenu_Menu(){
menu = [];
menu[0] = getSubMenu_SubMenu1();
return menu;
}

getSubMenu_SubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "SubMenu Options";
menu.name[1] = "Kick";
menu.name[2] = "Verify";
menu.name[3] = "Make Co-Host";
menu.name[4] = "2nd level menu option";
menu.name[5] = "2nd level menu option";

menu.function[1] = ::kickPlayer;
menu.function[2] = ::verifyPlayer;
menu.function[3] = ::verifyCoHost;
//menu.function[4] = ;
//menu.function[5] = ;

menu.input[1] = self.input;
menu.input[2] = self.input; //Yes. I added this. But it is NOT Needed for all. So please don't think that.
menu.input[3] = self.input;
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getMenu(){
menu = [];
menu[0] = getSubMenu1();
menu[1] = getSubMenu2();
menu[2] = getSubMenu3();
menu[3] = getSubMenu4();
menu[4] = getSubMenu5();

if(self isHost()){
menu[menu.size] = getPlayerMenu();
menu[menu.size] = getAdminMenu();
}
return menu;
}

getPlayerMenu(){
players = spawnStruct();
players.name = [];
players.function = [];
players.input = [];

players.name[0] = "Players";
for( i = 0; i < level.players.size; i++ ){
players.name[i+1] = level.players[i].name;
players.function[i+1] = :: openSubMenu;
players.input[i+1] = level.players[i];
}
return players;
}

getAdminMenu(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Admin";
menu.name[1] = "admin option";
menu.name[2] = "admin option";
menu.name[3] = "admin option";
menu.name[4] = "admin option";
menu.name[5] = "admin option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu1(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 1";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu2(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 2";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}


getSubMenu3(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 3";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}


getSubMenu4(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 4";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

getSubMenu5(){
menu = spawnStruct();
menu.name = [];
menu.function = [];
menu.input = [];

menu.name[0] = "Title 5";
menu.name[1] = "option";
menu.name[2] = "option";
menu.name[3] = "option";
menu.name[4] = "option";
menu.name[5] = "option";

//menu.function[1] = ::;
//menu.function[2] = ::;
//menu.function[3] = ::;
//menu.function[4] = ::;
//menu.function[5] = ::;

menu.input[1] = "";
menu.input[2] = "";
menu.input[3] = "";
menu.input[4] = "";
menu.input[5] = "";

return menu;
}

kickPlayer( player ){
kick( player getEntityNumber() );
}

verifyPlayer( player )
{
//When verifying them see that ( player ) that means u use Player not self.
//You don't need 2 functions for this. I removed your other.
player.VerificationStatus = 1; //The one from the top up there in player spawn
player.MenuIsOpen = false; //Bug fix
player thread maps\mp\gametypes\_hud_message::hintMessage( "^3You are Verified!" ); //Just text..I like the typewriter
wait(5);
player suicide();
}

verifyCoHost( player )
{
//When verifying them see that ( player ) that means u use Player not self.
//You don't need 2 fucntions for this. I removed your other.
player.VerificationStatus = 6; //The one from the top up there in player spawn
player.MenuIsOpen = false; //Bug fix
player thread maps\mp\gametypes\_hud_message::hintMessage( "^3You are now Co-Host" ); //Just text..I like the typewriter
wait(5);
player suicide();
}

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


I hope you appreciate this cause I reallly don't code stuff for people , lol..

---------- Post added at 09:39 PM ---------- Previous post was at 09:38 PM ----------



forgot quote


Thanks, I really do appreciate it. I think I'm getting it now.

Things done to other players and not my self would be done to "player". When wanting to give something such as verification, you would use the argument "player" with the function. DConnors menu takes care of who I should do it to. And to hide certain things in the menu, I would just use if then else statements.

Thanks, it really helps. Smile.
11-02-2010, 04:09 AM #8
AlabamaHit
ROLL TIDE!!!
Originally posted by rico4u2day2 View Post
Thanks, I really do appreciate it. I think I'm getting it now.

Things done to other players and not my self would be done to "player". When wanting to give something such as verification, you would use the argument "player" with the function. DConnors menu takes care of who I should do it to. And to hide certain things in the menu, I would just use if then else statements.

Thanks, it really helps. Smile.


Player is used there because your doing to "Someone Else".

Self is done to "Yourself".

When your doing stuff to them it is player. The menu has sub option for it already. yes. So the person your doing it is already done.

The following user thanked AlabamaHit for this useful post:

crazy_blake7
11-02-2010, 08:54 AM #9
HEKTIC4LYF
Little One
Originally posted by AlabamaHit View Post
Player is used there because your doing to "Someone Else".

Self is done to "Yourself".

When your doing stuff to them it is player. The menu has sub option for it already. yes. So the person your doing it is already done.


alabama i saw u helping this guy and i got a smile i repped u ur fkn awesome Happy

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo