Advertisement
Guest User

Untitled

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