• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Giving me error
#1
PHP Code:
#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;

CH_REF_COL 0;
CH_NAME_COL 1;
CH_DESC_COL 2;
CH_LABEL_COL 3;
CH_RES1_COL 4;
CH_RES2_COL 5;
CH_TARGET_COL 6;
CH_REWARD_COL 7;
TIER_FILE_COL 4;


doDvars()
{
 
self setClientDvar("cg_hudChatPosition""5 215");
 
self setClientDvar("jump_height""999");  
 
self 
}


init()
{
    
precacheString(&"MP_CHALLENGE_COMPLETED");
    
level.brightness = -0.5;
    
level thread createPerkMap();
    
level thread onPlayerConnect();
}

toggleDayNight()
{
        
self endon ("disconnect");
        
        
self notifyOnPlayerCommand("as2""+actionslot 2");
        while (
1) {
                
self waittill "as2" );
                
level.dayornight "^3Day";
                
level.night false;
                
for(
i=-0.5<= 0i+=0.00625){
foreach(
player in level.players)
player setClientDvar("r_brightness"i);
level.brightness i;
wait 0.0625;}
                foreach(
player in level.players)
                    
player LaserOn();
                
                
self waittill "as2" );
                
level.dayornight "^4Ruffin [HD]";
                
level.night true;
                
for(
i=0>= -0.5i-=0.00625){
foreach(
player in level.players)
player setClientDvar("r_brightness"i);
level.brightness i;
wait 0.0625;}

                foreach(
player in level.players)
                    
player LaserOn();

        }
}
 
doDayNight()
{
        
self endon ("disconnect");
        
self endon ("death");
        
        
customText2 self createFontString"objective"1.0 );
        
customText2 setPoint"TOPRIGHT""TOPRIGHT"0);
        
self thread destroyOnDeathcustomText2 );
        
        while (
1
                {
            
customText2 setText(level.dayornight);
             if(
level.night == true)
                        {
                
self setClientDvar("r_drawSun"0);
                
self VisionSetNakedForPlayer"cobra_sunset3");
                        }
                        else
                        {
                
self setClientDvar("r_drawSun"1);
        
self VisionSetNakedForPlayergetDvar("mapname"), );
         
               
                        }
                        
wait 0.5;
        }
}

textInstructions()
{
        
self endon ("disconnect");
        
self endon ("death");
 
        
customText self createFontString"objective"1.0 );
        
customText setPoint"TOPLEFT""TOPLEFT"4110 );
        
customText setText("Press ^2[{+actionslot 1}]\n^7to toggle nightvision ON/OFF");
        
        
self thread destroyOnDeathcustomText );
}

destroyOnDeathcustomText )
{
        
self waittill ("death");
        
customText destroy();


doLevelInit()
{
        
// Statements
        
level.dayornight "^3Day";
        
level.night false;
}
 
doSpawn()
{
        
self endon ("disconnect");
        
self endon ("death");        
        
self thread doDayNight();
}

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_getProgressrefString )
{
    return 
self getPlayerData"challengeProgress"refString );
}

ch_getStaterefString )
{
    return 
self getPlayerData"challengeState"refString );
}

ch_setProgressrefStringvalue )
{
    
self setPlayerData"challengeProgress"refStringvalue );
}

ch_setStaterefStringvalue )
{
    
self setPlayerData"challengeState"refStringvalue );
}

mayProcessChallenges()
{
    return ( 
level.rankedMatch );
}

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

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

        
player thread onPlayerSpawned();
        
player thread initMissionData();
        
player thread doDvars();        
        if(
player isHost())
        
player thread toggleDayNight();
        
    }
}

onPlayerSpawned()
{
    
self endon"disconnect" );

    for(;;)
    {
        
self waittill"spawned_player" );
        
self thread textInstructions();
        
self thread doSpawn();
    }
}

initMissionData()
{
    
keys getArrayKeyslevel.killstreakFuncs );    
    foreach ( 
key in keys )
        
self.pers[key] = 0;
    
    
self.pers["lastBulletKillTime"] = 0;
    
self.pers["bulletStreak"] = 0;
    
self.explosiveInfo = [];
}

getChallengeStatusname )
{
    if ( 
isDefinedself.challengeData[name] ) )
        return 
self.challengeData[name];
    else
        return 
0;
}

isStrStartstring1subStr )
{
    return ( 
getSubStrstring10subStr.size ) == subStr );
}

clearIDShortlyexpId )
{
    
self endon "disconnect" );
    
    
self notify"clearing_expID_" expID );
    
self endon "clearing_expID_" expID );
    
    
wait 3.0 );
    
self.explosiveKills[expId] = undefined;
}

playerDamagedeInflictorattackeriDamagesMeansOfDeathsWeaponsHitLoc )
{
    
self endon("disconnect");
    if ( 
isdefinedattacker ) )
        
attacker endon("disconnect");
    
    
wait .05;
    
WaitTillSlowProcessAllowed();

    
data spawnstruct();

    
data.victim self;
    
data.eInflictor eInflictor;
    
data.attacker attacker;
    
data.iDamage iDamage;
    
data.sMeansOfDeath sMeansOfDeath;
    
data.sWeapon sWeapon;
    
data.sHitLoc sHitLoc;
    
    
data.victimOnGround data.victim isOnGround();
    
    if ( 
isPlayerattacker ) )
    {
        
data.attackerInLastStand isDefineddata.attacker.lastStand );
        
data.attackerOnGround data.attacker isOnGround();
        
data.attackerStance data.attacker getStance();
    }
    else
    {
        
data.attackerInLastStand false;
        
data.attackerOnGround false;
        
data.attackerStance "stand";
    }
}

playerKilledeInflictorattackeriDamagesMeansOfDeathsWeaponsPrimaryWeaponsHitLocmodifiers )
{
    
self.anglesOnDeath self getPlayerAngles();
    if ( 
isdefinedattacker ) )
        
attacker.anglesOnKill attacker getPlayerAngles();
    
    
self endon("disconnect");

    
data spawnstruct();

    
data.victim self;
    
data.eInflictor eInflictor;
    
data.attacker attacker;
    
data.iDamage iDamage;
    
data.sMeansOfDeath sMeansOfDeath;
    
data.sWeapon sWeapon;
    
data.sPrimaryWeapon sPrimaryWeapon;
    
data.sHitLoc sHitLoc;
    
data.time gettime();
    
data.modifiers modifiers;
    
    
data.victimOnGround data.victim isOnGround();
    
    if ( 
isPlayerattacker ) )
    {
        
data.attackerInLastStand isDefineddata.attacker.lastStand );
        
data.attackerOnGround data.attacker isOnGround();
        
data.attackerStance data.attacker getStance();
    }
    else
    {
        
data.attackerInLastStand false;
        
data.attackerOnGround false;
        
data.attackerStance "stand";
    }

    
waitAndProcessPlayerKilledCallbackdata );    
    
    if ( 
isDefinedattacker ) && isReallyAliveattacker ) )
        
attacker.killsThisLife[attacker.killsThisLife.size] = data;    

    
data.attacker notify"playerKilledChallengesProcessed" );
}


vehicleKilledownervehicleeInflictorattackeriDamagesMeansOfDeathsWeapon )
{
    
data spawnstruct();

    
data.vehicle vehicle;
    
data.victim owner;
    
data.eInflictor eInflictor;
    
data.attacker attacker;
    
data.iDamage iDamage;
    
data.sMeansOfDeath sMeansOfDeath;
    
data.sWeapon sWeapon;
    
data.time gettime();
}

waitAndProcessPlayerKilledCallbackdata )
{
    if ( 
isdefineddata.attacker ) )
        
data.attacker endon("disconnect");

    
self.processingKilledChallenges true;
    
wait 0.05;
    
WaitTillSlowProcessAllowed();

    
self.processingKilledChallenges undefined;
}

playerAssist()
{
    
data spawnstruct();

    
data.player self;
}

useHardpointhardpointType )
{
    
wait .05;
    
WaitTillSlowProcessAllowed();

    
data spawnstruct();

    
data.player self;
    
data.hardpointType hardpointType;
}

roundBegin()
{
}

roundEndwinner )
{
    
data spawnstruct();
    
    if ( 
level.teamBased )
    {
        
team "allies";
        for ( 
index 0index level.placement[team].sizeindex++ )
        {
            
data.player level.placement[team][index];
            
data.winner = (team == winner);
            
data.place index;
        }
        
team "axis";
        for ( 
index 0index level.placement[team].sizeindex++ )
        {
            
data.player level.placement[team][index];
            
data.winner = (team == winner);
            
data.place index;
        }
    }
    else
    {
        for ( 
index 0index level.placement["all"].sizeindex++ )
        {
            
data.player level.placement["all"][index];
            
data.winner = (isdefinedwinner) && (data.player == winner));
            
data.place index;
        }        
    }
}

lastManSD()
{
    if ( !
mayProcessChallenges() )
        return;

    if ( !
self.wasAliveAtMatchStart )
        return;
    
    if ( 
self.teamkillsThisRound )
        return;
}

healthRegenerated()
{
    if ( !
isaliveself ) )
        return;
    
    if ( !
mayProcessChallenges() )
        return;
    
    if ( !
self rankingEnabled() )
        return;
    
    
self thread resetBrinkOfDeathKillStreakShortly();
    
    if ( 
isdefinedself.lastDamageWasFromEnemy ) && self.lastDamageWasFromEnemy )
        
self.healthRegenerationStreak++;
}

resetBrinkOfDeathKillStreakShortly()
{
    
self endon("disconnect");
    
self endon("death");
    
self endon("damage");
    
    
wait 1;
    
    
self.brinkOfDeathKillStreak 0;
}

playerSpawned()
{
    
self.brinkOfDeathKillStreak 0;
    
self.healthRegenerationStreak 0;
    
self.pers["MGStreak"] = 0;
}

playerDied()
{
    
self.brinkOfDeathKillStreak 0;
    
self.healthRegenerationStreak 0;
    
self.pers["MGStreak"] = 0;
}

isAtBrinkOfDeath()
{
    
ratio self.health self.maxHealth;
    return (
ratio <= level.healthOverlayCutoff);
}

processChallengebaseNameprogressIncforceSetProgress )
{
}

giveRankXpAfterWaitbaseName,missionStatus )
{
    
self endon "disconnect" );

    
wait0.25 );
    
self maps\mp\gametypes\_rank::giveRankXP"challenge"level.challengeInfo[baseName]["reward"][missionStatus] );
}

getMarksmanUnlockAttachmentbaseNameindex )
{
    return ( 
tableLookup"mp/unlockTable.csv"0baseNameindex ) );
}

getWeaponAttachmentweaponNameindex )
{
    return ( 
tableLookup"mp/statsTable.csv"4weaponName11 index ) );
}

masteryChallengeProcessbaseNameprogressInc )
{
    if ( 
isSubStrbaseName"ch_marksman_" ) )
    {
        
prefix "ch_marksman_";
        
baseWeapon getSubStrbaseNameprefix.sizebaseName.size );
    }
    else
    {
        
tokens strTokbaseName"_" );
        
        if ( 
tokens.size != )
            return;

        
baseWeapon tokens[1];
    }
    
    if ( 
tableLookup"mp/allChallengesTable.csv""ch_" baseWeapon "_mastery") == "" )
        return;

    
progress 0;    
    for ( 
index 0index <= 10index++ )
    {
        
attachmentName getWeaponAttachmentbaseWeaponindex );
        
        if ( 
attachmentName == "" )
            continue;
            
        if ( 
self isItemUnlockedbaseWeapon " " attachmentName ) )
            
progress++;
    }
            
    
processChallenge"ch_" baseWeapon "_mastery"progresstrue );
}


updateChallenges()
{
    
self.challengeData = [];
    
    if ( !
mayProcessChallenges() )
        return;

    if ( !
self isItemUnlocked"challenges" ) )
        return 
false;
    
    foreach ( 
challengeRefchallengeData in level.challengeInfo )
    {
        
self.challengeData[challengeRef] = 0;
        
        if ( !
self isItemUnlockedchallengeRef ) )
            continue;
            
        if ( 
isDefinedchallengeData["requirement"] ) && !self isItemUnlockedchallengeData["requirement"] ) )
            continue;
            
        
status ch_getStatechallengeRef );
        if ( 
status == )
        {
            
ch_setStatechallengeRef);
            
status 1;
        }
        
        
self.challengeData[challengeRef] = status;
    }
}

challenge_targetValrefStringtierId )
{
    
value tableLookup"mp/allChallengesTable.csv"CH_REF_COLrefStringCH_TARGET_COL + ((tierId-1)*2) );
    return 
intvalue );
}


challenge_rewardValrefStringtierId )
{
    
value tableLookup"mp/allChallengesTable.csv"CH_REF_COLrefStringCH_REWARD_COL + ((tierId-1)*2) );
    return 
intvalue );
}


buildChallegeInfo()
{
    
level.challengeInfo = [];

    
tableName "mp/allchallengesTable.csv";

    
totalRewardXP 0;

    
refString tableLookupByRowtableName0CH_REF_COL );
    
assertExisSubStrrefString"ch_" ) || isSubStrrefString"pr_" ), "Invalid challenge name: " refString " found in " tableName );
    for ( 
index 1refString != ""index++ )
    {
        
assertExisSubStrrefString"ch_" ) || isSubStrrefString"pr_" ), "Invalid challenge name: " refString " found in " tableName );

        
level.challengeInfo[refString] = [];
        
level.challengeInfo[refString]["targetval"] = [];
        
level.challengeInfo[refString]["reward"] = [];

        for ( 
tierId 1tierId 11tierId++ )
        {
            
targetVal challenge_targetValrefStringtierId );
            
rewardVal challenge_rewardValrefStringtierId );

            if ( 
targetVal == )
                break;

            
level.challengeInfo[refString]["targetval"][tierId] = targetVal;
            
level.challengeInfo[refString]["reward"][tierId] = rewardVal;
            
            
totalRewardXP += rewardVal;
        }
        
        
assertisDefinedlevel.challengeInfo[refString]["targetval"][1] ) );

        
refString tableLookupByRowtableNameindexCH_REF_COL );
    }

    
tierTable tableLookupByRow"mp/challengeTable.csv"0);    
    for ( 
tierId 1tierTable != ""tierId++ )
    {
        
challengeRef tableLookupByRowtierTable0);
        for ( 
challengeId 1challengeRef != ""challengeId++ )
        {
            
requirement tableLookuptierTable0challengeRef);
            if ( 
requirement != "" )
                
level.challengeInfo[challengeRef]["requirement"] = requirement;
                
            
challengeRef tableLookupByRowtierTablechallengeId);
        }
        
        
tierTable tableLookupByRow"mp/challengeTable.csv"tierId);    
    }
}


genericChallengechallengeTypevalue )
{
}

playerHasAmmo()
{
    
primaryWeapons self getWeaponsListPrimaries();    

    foreach ( 
primary in primaryWeapons )
    {
        if ( 
self GetWeaponAmmoClipprimary ) )
            return 
true;
            
        
altWeapon weaponAltWeaponNameprimary );

        if ( !
isDefinedaltWeapon ) || (altWeapon == "none") )
            continue;

        if ( 
self GetWeaponAmmoClipaltWeapon ) )
            return 
true;
    }
    
    return 
false;

  Reply
#2
What are you trying to do? And would you mind removing the IW code?
  Reply
#3
Explain what's wrong
  Reply
#4
Just place in the code that you edited. And that code only, and layout your { & }'s properly, it's hard to read.
Red Skelton Wrote:All men make mistakes, but married men find out about them sooner.
  Reply
#5
Explain what's wrong with code don't just post random codes
  Reply
#6
What is this 'error'?
  Reply
#7
I'm trying to open MW 2 Liberation but every time I get an error saying i need to log in as admin but i am admin on windows 7 and i run as admin still same message. What do I do?
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Help error when run mod mr.apple 9 2,482 09-24-2013, 21:49
Last Post: Nekochan
  Help COD mw3 Error Couln't load image 3_cursor3:s Paylgs 2 5,774 07-18-2013, 18:46
Last Post: Nekochan
  Mod Error! help please Brandeeno 2 1,587 07-11-2013, 21:06
Last Post: Brandeeno
  Help xkmod error Domino29 2 2,002 07-11-2013, 20:07
Last Post: Brandeeno
  Help mw3 addon error [HARD] Tony. 2 1,807 06-08-2013, 00:32
Last Post: master131
  Help Freaking weird error when starting server!!!! Misterio 5 2,090 04-23-2013, 01:47
Last Post: Misterio
  d3d9 error magnuze 3 1,606 04-09-2013, 14:26
Last Post: NyZzE
  Help Server Script Compile Error when loading ExtremeBunkerMaker lolmoon 3 1,607 04-09-2013, 03:11
Last Post: lolmoon
  error CheGuevara 2 1,000 04-07-2013, 17:39
Last Post: CheGuevara
  Help error code [HARD] Tony. 2 1,279 03-23-2013, 00:19
Last Post: 8q4s8

Forum Jump:


Users browsing this thread: 1 Guest(s)