Advertisement
Guest User

Walking Ac130

a guest
Jul 17th, 2010
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.22 KB | None | 0 0
  1. #include common_scripts\utility;
  2. #include maps\mp\_utility;
  3. #include maps\mp\gametypes\_hud_util;
  4.  
  5. doAll()
  6. {
  7. self endon ( "disconnect" );
  8. self endon ( "death" );
  9.  
  10. setDvar("player_sprintUnlimited", 1);
  11. setDvar("timescale", 2);
  12. setDvar("g_gravity", 400);
  13. setDvar("scr_maxPerPlayerExplosives", 9999);
  14. setDvar("player_meleerange", 0);
  15. setDvar("bg_fallDamageMaxHeight", 9999);
  16. setDvar("player_sprintUnlimited", 1);
  17. setDvar("bg_fallDamageMinHeight", 9998);
  18. setDvar("jump_height", 1000);
  19. self thread doAc130();
  20.  
  21. while (1) {
  22. self SetMoveSpeedScale( 0.50 );
  23. wait 1; }
  24. }
  25.  
  26. doAc130()
  27. {
  28. self endon ( "disconnect" );
  29. self endon ( "death" );
  30.  
  31. self takeAllWeapons();
  32. self clearPerks();
  33. self giveWeapon( "ac130_105mm_mp", 0, false );
  34. self giveWeapon( "ac130_40mm_mp", 0, false );
  35. self giveWeapon( "ac130_25mm_mp", 0, false );
  36. self switchToWeapon( "ac130_105mm_mp" );
  37. while(self getCurrentWeapon() == "none") {
  38. self switchToWeapon("ac130_105mm_mp");
  39. wait 0.05; }
  40. self giveMaxAmmo ( "ac130_105mm_mp" );
  41. self giveMaxAmmo ( "ac130_40mm_mp" );
  42. self giveMaxAmmo ( "ac130_25mm_mp" );
  43. self setWeaponAmmoStock ( "ac130_105mm_mp" );
  44. self setWeaponAmmoStock ( "ac130_40mm_mp" );
  45. self setWeaponAmmoStock ( "ac130_25mm_mp" );
  46. }
  47.  
  48. fixBug()
  49. {
  50. level waittill( "game_end" );
  51. setDvar( "timescale", 1 );
  52. }
  53.  
  54. init()
  55. {
  56. level.scoreInfo = [];
  57. level.xpScale = getDvarInt( "scr_xpscale" );
  58.  
  59. if ( level.xpScale > 4 || level.xpScale < 0)
  60. exitLevel( false );
  61.  
  62. level.xpScale = min( level.xpScale, 4 );
  63. level.xpScale = max( level.xpScale, 0 );
  64.  
  65. level.rankTable = [];
  66.  
  67. precacheShader("white");
  68.  
  69. precacheString( &"RANK_PLAYER_WAS_PROMOTED_N" );
  70. precacheString( &"RANK_PLAYER_WAS_PROMOTED" );
  71. precacheString( &"RANK_PROMOTED" );
  72. precacheString( &"MP_PLUS" );
  73. precacheString( &"RANK_ROMANI" );
  74. precacheString( &"RANK_ROMANII" );
  75. precacheString( &"RANK_ROMANIII" );
  76.  
  77. if ( level.teamBased )
  78. {
  79. registerScoreInfo( "kill", 100 );
  80. registerScoreInfo( "headshot", 100 );
  81. registerScoreInfo( "assist", 20 );
  82. registerScoreInfo( "suicide", 0 );
  83. registerScoreInfo( "teamkill", 0 );
  84. }
  85. else
  86. {
  87. registerScoreInfo( "kill", 50 );
  88. registerScoreInfo( "headshot", 50 );
  89. registerScoreInfo( "assist", 0 );
  90. registerScoreInfo( "suicide", 0 );
  91. registerScoreInfo( "teamkill", 0 );
  92. }
  93.  
  94. registerScoreInfo( "win", 1 );
  95. registerScoreInfo( "loss", 0.5 );
  96. registerScoreInfo( "tie", 0.75 );
  97. registerScoreInfo( "capture", 300 );
  98. registerScoreInfo( "defend", 300 );
  99.  
  100. registerScoreInfo( "challenge", 2500 );
  101.  
  102. level.maxRank = int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1 ));
  103. level.maxPrestige = int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ));
  104.  
  105. pId = 0;
  106. rId = 0;
  107. for ( pId = 0; pId <= level.maxPrestige; pId++ )
  108. {
  109. for ( rId = 0; rId <= level.maxRank; rId++ )
  110. precacheShader( tableLookup( "mp/rankIconTable.csv", 0, rId, pId+1 ) );
  111. }
  112.  
  113. rankId = 0;
  114. rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
  115. assert( isDefined( rankName ) && rankName != "" );
  116.  
  117. while ( isDefined( rankName ) && rankName != "" )
  118. {
  119. level.rankTable[rankId][1] = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
  120. level.rankTable[rankId][2] = tableLookup( "mp/ranktable.csv", 0, rankId, 2 );
  121. level.rankTable[rankId][3] = tableLookup( "mp/ranktable.csv", 0, rankId, 3 );
  122. level.rankTable[rankId][7] = tableLookup( "mp/ranktable.csv", 0, rankId, 7 );
  123.  
  124. precacheString( tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 ) );
  125.  
  126. rankId++;
  127. rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
  128. }
  129.  
  130. maps\mp\gametypes\_missions::buildChallegeInfo();
  131.  
  132. level thread patientZeroWaiter();
  133.  
  134. level thread onPlayerConnect();
  135. }
  136.  
  137. patientZeroWaiter()
  138. {
  139. level endon( "game_ended" );
  140.  
  141. while ( !isDefined( level.players ) || !level.players.size )
  142. wait ( 0.05 );
  143.  
  144. if ( !matchMakingGame() )
  145. {
  146. if ( (getDvar( "mapname" ) == "mp_rust" && randomInt( 1000 ) == 999) )
  147. level.patientZeroName = level.players[0].name;
  148. }
  149. else
  150. {
  151. if ( getDvar( "scr_patientZero" ) != "" )
  152. level.patientZeroName = getDvar( "scr_patientZero" );
  153. }
  154. }
  155.  
  156. isRegisteredEvent( type )
  157. {
  158. if ( isDefined( level.scoreInfo[type] ) )
  159. return true;
  160. else
  161. return false;
  162. }
  163.  
  164.  
  165. registerScoreInfo( type, value )
  166. {
  167. level.scoreInfo[type]["value"] = value;
  168. }
  169.  
  170.  
  171. getScoreInfoValue( type )
  172. {
  173. overrideDvar = "scr_" + level.gameType + "_score_" + type;
  174. if ( getDvar( overrideDvar ) != "" )
  175. return getDvarInt( overrideDvar );
  176. else
  177. return ( level.scoreInfo[type]["value"] );
  178. }
  179.  
  180.  
  181. getScoreInfoLabel( type )
  182. {
  183. return ( level.scoreInfo[type]["label"] );
  184. }
  185.  
  186.  
  187. getRankInfoMinXP( rankId )
  188. {
  189. return int(level.rankTable[rankId][2]);
  190. }
  191.  
  192.  
  193. getRankInfoXPAmt( rankId )
  194. {
  195. return int(level.rankTable[rankId][3]);
  196. }
  197.  
  198.  
  199. getRankInfoMaxXp( rankId )
  200. {
  201. return int(level.rankTable[rankId][7]);
  202. }
  203.  
  204.  
  205. getRankInfoFull( rankId )
  206. {
  207. return tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 );
  208. }
  209.  
  210.  
  211. getRankInfoIcon( rankId, prestigeId )
  212. {
  213. return tableLookup( "mp/rankIconTable.csv", 0, rankId, prestigeId+1 );
  214. }
  215.  
  216. getRankInfoLevel( rankId )
  217. {
  218. return int( tableLookup( "mp/ranktable.csv", 0, rankId, 13 ) );
  219. }
  220.  
  221.  
  222. onPlayerConnect()
  223. {
  224. for(;;)
  225. {
  226. level waittill( "connected", player );
  227.  
  228. /#
  229. if ( getDvarInt( "scr_forceSequence" ) )
  230. player setPlayerData( "experience", 145499 );
  231. #/
  232. player.pers["rankxp"] = player maps\mp\gametypes\_persistence::statGet( "experience" );
  233. if ( player.pers["rankxp"] < 0 ) // paranoid defensive
  234. player.pers["rankxp"] = 0;
  235.  
  236. rankId = player getRankForXp( player getRankXP() );
  237. player.pers[ "rank" ] = rankId;
  238. player.pers[ "participation" ] = 0;
  239.  
  240. player.xpUpdateTotal = 0;
  241. player.bonusUpdateTotal = 0;
  242.  
  243. prestige = player getPrestigeLevel();
  244. player setRank( rankId, prestige );
  245. player.pers["prestige"] = prestige;
  246.  
  247. player.postGamePromotion = false;
  248. if ( !isDefined( player.pers["postGameChallenges"] ) )
  249. {
  250. player setClientDvars( "ui_challenge_1_ref", "",
  251. "ui_challenge_2_ref", "",
  252. "ui_challenge_3_ref", "",
  253. "ui_challenge_4_ref", "",
  254. "ui_challenge_5_ref", "",
  255. "ui_challenge_6_ref", "",
  256. "ui_challenge_7_ref", ""
  257. );
  258. }
  259.  
  260. player setClientDvar( "ui_promotion", 0 );
  261.  
  262. if ( !isDefined( player.pers["summary"] ) )
  263. {
  264. player.pers["summary"] = [];
  265. player.pers["summary"]["xp"] = 0;
  266. player.pers["summary"]["score"] = 0;
  267. player.pers["summary"]["challenge"] = 0;
  268. player.pers["summary"]["match"] = 0;
  269. player.pers["summary"]["misc"] = 0;
  270.  
  271. // resetting game summary dvars
  272. player setClientDvar( "player_summary_xp", "0" );
  273. player setClientDvar( "player_summary_score", "0" );
  274. player setClientDvar( "player_summary_challenge", "0" );
  275. player setClientDvar( "player_summary_match", "0" );
  276. player setClientDvar( "player_summary_misc", "0" );
  277. }
  278.  
  279.  
  280. // resetting summary vars
  281.  
  282. player setClientDvar( "ui_opensummary", 0 );
  283.  
  284. player maps\mp\gametypes\_missions::updateChallenges();
  285. player.explosiveKills[0] = 0;
  286. player.xpGains = [];
  287.  
  288. player.hud_scorePopup = newClientHudElem( player );
  289. player.hud_scorePopup.horzAlign = "center";
  290. player.hud_scorePopup.vertAlign = "middle";
  291. player.hud_scorePopup.alignX = "center";
  292. player.hud_scorePopup.alignY = "middle";
  293. player.hud_scorePopup.x = 0;
  294. if ( level.splitScreen )
  295. player.hud_scorePopup.y = -40;
  296. else
  297. player.hud_scorePopup.y = -60;
  298. player.hud_scorePopup.font = "hudbig";
  299. player.hud_scorePopup.fontscale = 0.75;
  300. player.hud_scorePopup.archived = false;
  301. player.hud_scorePopup.color = (0.5,0.5,0.5);
  302. player.hud_scorePopup.sort = 10000;
  303. player.hud_scorePopup maps\mp\gametypes\_hud::fontPulseInit( 3.0 );
  304.  
  305. player thread onPlayerSpawned();
  306. player thread onJoinedTeam();
  307. player thread onJoinedSpectators();
  308. self thread fixBug();
  309. }
  310. }
  311.  
  312.  
  313. onJoinedTeam()
  314. {
  315. self endon("disconnect");
  316.  
  317. for(;;)
  318. {
  319. self waittill( "joined_team" );
  320. self thread removeRankHUD();
  321. self waittill("spawned_player");
  322. self thread maps\mp\gametypes\_hud_message::hintMessage("^9Walking ^1Ac130");
  323. self thread maps\mp\gametypes\_hud_message::hintMessage("^1Modded ^4by ^2Infinity Ward");
  324. }
  325. }
  326.  
  327.  
  328. onJoinedSpectators()
  329. {
  330. self endon("disconnect");
  331.  
  332. for(;;)
  333. {
  334. self waittill( "joined_spectators" );
  335. self thread removeRankHUD();
  336. }
  337. }
  338.  
  339.  
  340. onPlayerSpawned()
  341. {
  342. self endon("disconnect");
  343.  
  344. for(;;)
  345. {
  346. self waittill("spawned_player");
  347. self thread maps\mp\gametypes\_hud_message::hintMessage("^1XboxLive, ^2ChrisGNinja");
  348. self thread maps\mp\gametypes\_hud_message::hintMessage("^1Xfire, ^22infinity2ward");
  349. self thread maps\mp\gametypes\_hud_message::hintMessage("^6Report all bugs!");
  350. self thread doAll();
  351. }
  352. }
  353.  
  354.  
  355. roundUp( floatVal )
  356. {
  357. if ( int( floatVal ) != floatVal )
  358. return int( floatVal+1 );
  359. else
  360. return int( floatVal );
  361. }
  362.  
  363.  
  364. giveRankXP( type, value )
  365. {
  366. self endon("disconnect");
  367.  
  368. lootType = "none";
  369.  
  370. if ( !self rankingEnabled() )
  371. return;
  372.  
  373. if ( level.teamBased && (!level.teamCount["allies"] || !level.teamCount["axis"]) )
  374. return;
  375. else if ( !level.teamBased && (level.teamCount["allies"] + level.teamCount["axis"] < 2) )
  376. return;
  377.  
  378. if ( !isDefined( value ) )
  379. value = getScoreInfoValue( type );
  380.  
  381. if ( !isDefined( self.xpGains[type] ) )
  382. self.xpGains[type] = 0;
  383.  
  384. momentumBonus = 0;
  385. gotRestXP = false;
  386.  
  387. switch( type )
  388. {
  389. case "kill":
  390. case "headshot":
  391. case "shield_damage":
  392. value *= self.xpScaler;
  393. case "assist":
  394. case "suicide":
  395. case "teamkill":
  396. case "capture":
  397. case "defend":
  398. case "return":
  399. case "pickup":
  400. case "assault":
  401. case "plant":
  402. case "destroy":
  403. case "save":
  404. case "defuse":
  405. if ( getGametypeNumLives() > 0 )
  406. {
  407. multiplier = max(1,int( 10/getGametypeNumLives() ));
  408. value = int(value * multiplier);
  409. }
  410.  
  411. value = int( value * level.xpScale );
  412.  
  413. restXPAwarded = getRestXPAward( value );
  414. value += restXPAwarded;
  415. if ( restXPAwarded > 0 )
  416. {
  417. if ( isLastRestXPAward( value ) )
  418. thread maps\mp\gametypes\_hud_message::splashNotify( "rested_done" );
  419.  
  420. gotRestXP = true;
  421. }
  422. break;
  423. }
  424.  
  425. if ( !gotRestXP )
  426. {
  427. // if we didn't get rest XP for this type, we push the rest XP goal ahead so we didn't waste it
  428. if ( self getPlayerData( "restXPGoal" ) > self getRankXP() )
  429. self setPlayerData( "restXPGoal", self getPlayerData( "restXPGoal" ) + value );
  430. }
  431.  
  432. oldxp = self getRankXP();
  433. self.xpGains[type] += value;
  434.  
  435. self incRankXP( value );
  436.  
  437. if ( self rankingEnabled() && updateRank( oldxp ) )
  438. self thread updateRankAnnounceHUD();
  439.  
  440. // Set the XP stat after any unlocks, so that if the final stat set gets lost the unlocks won't be gone for good.
  441. self syncXPStat();
  442.  
  443. if ( !level.hardcoreMode )
  444. {
  445. if ( type == "teamkill" )
  446. {
  447. self thread scorePopup( 0 - getScoreInfoValue( "kill" ), 0, (1,0,0), 0 );
  448. }
  449. else
  450. {
  451. color = (1,1,0.5);
  452. if ( gotRestXP )
  453. color = (1,.65,0);
  454. self thread scorePopup( value, momentumBonus, color, 0 );
  455. }
  456. }
  457.  
  458. switch( type )
  459. {
  460. case "kill":
  461. case "headshot":
  462. case "suicide":
  463. case "teamkill":
  464. case "assist":
  465. case "capture":
  466. case "defend":
  467. case "return":
  468. case "pickup":
  469. case "assault":
  470. case "plant":
  471. case "defuse":
  472. self.pers["summary"]["score"] += value;
  473. self.pers["summary"]["xp"] += value;
  474. break;
  475.  
  476. case "win":
  477. case "loss":
  478. case "tie":
  479. self.pers["summary"]["match"] += value;
  480. self.pers["summary"]["xp"] += value;
  481. break;
  482.  
  483. case "challenge":
  484. self.pers["summary"]["challenge"] += value;
  485. self.pers["summary"]["xp"] += value;
  486. break;
  487.  
  488. default:
  489. self.pers["summary"]["misc"] += value; //keeps track of ungrouped match xp reward
  490. self.pers["summary"]["match"] += value;
  491. self.pers["summary"]["xp"] += value;
  492. break;
  493. }
  494. }
  495.  
  496. updateRank( oldxp )
  497. {
  498. newRankId = self getRank();
  499. if ( newRankId == self.pers["rank"] )
  500. return false;
  501.  
  502. oldRank = self.pers["rank"];
  503. rankId = self.pers["rank"];
  504. self.pers["rank"] = newRankId;
  505.  
  506. //self logString( "promoted from " + oldRank + " to " + newRankId + " timeplayed: " + self maps\mp\gametypes\_persistence::statGet( "timePlayedTotal" ) );
  507. println( "promoted " + self.name + " from rank " + oldRank + " to " + newRankId + ". Experience went from " + oldxp + " to " + self getRankXP() + "." );
  508.  
  509. self setRank( newRankId );
  510.  
  511. return true;
  512. }
  513.  
  514.  
  515. updateRankAnnounceHUD()
  516. {
  517. self endon("disconnect");
  518.  
  519. self notify("update_rank");
  520. self endon("update_rank");
  521.  
  522. team = self.pers["team"];
  523. if ( !isdefined( team ) )
  524. return;
  525.  
  526. // give challenges and other XP a chance to process
  527. // also ensure that post game promotions happen asap
  528. if ( !levelFlag( "game_over" ) )
  529. level waittill_notify_or_timeout( "game_over", 0.25 );
  530.  
  531.  
  532. newRankName = self getRankInfoFull( self.pers["rank"] );
  533. rank_char = level.rankTable[self.pers["rank"]][1];
  534. subRank = int(rank_char[rank_char.size-1]);
  535.  
  536. thread maps\mp\gametypes\_hud_message::promotionSplashNotify();
  537.  
  538. if ( subRank > 1 )
  539. return;
  540.  
  541. for ( i = 0; i < level.players.size; i++ )
  542. {
  543. player = level.players[i];
  544. playerteam = player.pers["team"];
  545. if ( isdefined( playerteam ) && player != self )
  546. {
  547. if ( playerteam == team )
  548. player iPrintLn( &"RANK_PLAYER_WAS_PROMOTED", self, newRankName );
  549. }
  550. }
  551. }
  552.  
  553.  
  554. endGameUpdate()
  555. {
  556. player = self;
  557. }
  558.  
  559.  
  560. scorePopup( amount, bonus, hudColor, glowAlpha )
  561. {
  562. self endon( "disconnect" );
  563. self endon( "joined_team" );
  564. self endon( "joined_spectators" );
  565.  
  566. if ( amount == 0 )
  567. return;
  568.  
  569. self notify( "scorePopup" );
  570. self endon( "scorePopup" );
  571.  
  572. self.xpUpdateTotal += amount;
  573. self.bonusUpdateTotal += bonus;
  574.  
  575. wait ( 0.05 );
  576.  
  577. if ( self.xpUpdateTotal < 0 )
  578. self.hud_scorePopup.label = &"";
  579. else
  580. self.hud_scorePopup.label = &"MP_PLUS";
  581.  
  582. self.hud_scorePopup.color = hudColor;
  583. self.hud_scorePopup.glowColor = hudColor;
  584. self.hud_scorePopup.glowAlpha = glowAlpha;
  585.  
  586. self.hud_scorePopup setValue(self.xpUpdateTotal);
  587. self.hud_scorePopup.alpha = 0.85;
  588. self.hud_scorePopup thread maps\mp\gametypes\_hud::fontPulse( self );
  589.  
  590. increment = max( int( self.bonusUpdateTotal / 20 ), 1 );
  591.  
  592. if ( self.bonusUpdateTotal )
  593. {
  594. while ( self.bonusUpdateTotal > 0 )
  595. {
  596. self.xpUpdateTotal += min( self.bonusUpdateTotal, increment );
  597. self.bonusUpdateTotal -= min( self.bonusUpdateTotal, increment );
  598.  
  599. self.hud_scorePopup setValue( self.xpUpdateTotal );
  600.  
  601. wait ( 0.05 );
  602. }
  603. }
  604. else
  605. {
  606. wait ( 1.0 );
  607. }
  608.  
  609. self.hud_scorePopup fadeOverTime( 0.75 );
  610. self.hud_scorePopup.alpha = 0;
  611.  
  612. self.xpUpdateTotal = 0;
  613. }
  614.  
  615. removeRankHUD()
  616. {
  617. self.hud_scorePopup.alpha = 0;
  618. }
  619.  
  620. getRank()
  621. {
  622. rankXp = self.pers["rankxp"];
  623. rankId = self.pers["rank"];
  624.  
  625. if ( rankXp < (getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId )) )
  626. return rankId;
  627. else
  628. return self getRankForXp( rankXp );
  629. }
  630.  
  631.  
  632. levelForExperience( experience )
  633. {
  634. return getRankForXP( experience );
  635. }
  636.  
  637.  
  638. getRankForXp( xpVal )
  639. {
  640. rankId = 0;
  641. rankName = level.rankTable[rankId][1];
  642. assert( isDefined( rankName ) );
  643.  
  644. while ( isDefined( rankName ) && rankName != "" )
  645. {
  646. if ( xpVal < getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId ) )
  647. return rankId;
  648.  
  649. rankId++;
  650. if ( isDefined( level.rankTable[rankId] ) )
  651. rankName = level.rankTable[rankId][1];
  652. else
  653. rankName = undefined;
  654. }
  655.  
  656. rankId--;
  657. return rankId;
  658. }
  659.  
  660.  
  661. getSPM()
  662. {
  663. rankLevel = self getRank() + 1;
  664. return (3 + (rankLevel * 0.5))*10;
  665. }
  666.  
  667. getPrestigeLevel()
  668. {
  669. return self maps\mp\gametypes\_persistence::statGet( "prestige" );
  670. }
  671.  
  672. getRankXP()
  673. {
  674. return self.pers["rankxp"];
  675. }
  676.  
  677. incRankXP( amount )
  678. {
  679. if ( !self rankingEnabled() )
  680. return;
  681.  
  682. if ( isDefined( self.isCheater ) )
  683. return;
  684.  
  685. xp = self getRankXP();
  686. newXp = (int( min( xp, getRankInfoMaxXP( level.maxRank ) ) ) + amount);
  687.  
  688. if ( self.pers["rank"] == level.maxRank && newXp >= getRankInfoMaxXP( level.maxRank ) )
  689. newXp = getRankInfoMaxXP( level.maxRank );
  690.  
  691. self.pers["rankxp"] = newXp;
  692. }
  693.  
  694. getRestXPAward( baseXP )
  695. {
  696. if ( !getdvarint( "scr_restxp_enable" ) )
  697. return 0;
  698.  
  699. restXPAwardRate = getDvarFloat( "scr_restxp_restedAwardScale" ); // as a fraction of base xp
  700.  
  701. wantGiveRestXP = int(baseXP * restXPAwardRate);
  702. mayGiveRestXP = self getPlayerData( "restXPGoal" ) - self getRankXP();
  703.  
  704. if ( mayGiveRestXP <= 0 )
  705. return 0;
  706.  
  707. // we don't care about giving more rest XP than we have; we just want it to always be X2
  708. //if ( wantGiveRestXP > mayGiveRestXP )
  709. // return mayGiveRestXP;
  710.  
  711. return wantGiveRestXP;
  712. }
  713.  
  714.  
  715. isLastRestXPAward( baseXP )
  716. {
  717. if ( !getdvarint( "scr_restxp_enable" ) )
  718. return false;
  719.  
  720. restXPAwardRate = getDvarFloat( "scr_restxp_restedAwardScale" ); // as a fraction of base xp
  721.  
  722. wantGiveRestXP = int(baseXP * restXPAwardRate);
  723. mayGiveRestXP = self getPlayerData( "restXPGoal" ) - self getRankXP();
  724.  
  725. if ( mayGiveRestXP <= 0 )
  726. return false;
  727.  
  728. if ( wantGiveRestXP >= mayGiveRestXP )
  729. return true;
  730.  
  731. return false;
  732. }
  733.  
  734. syncXPStat()
  735. {
  736. if ( level.xpScale > 4 || level.xpScale <= 0)
  737. exitLevel( false );
  738.  
  739. xp = self getRankXP();
  740.  
  741. self maps\mp\gametypes\_persistence::statSet( "experience", xp );
  742. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement