• 3 Vote(s) - 3.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Loadouts and Killstreaks Awarded at 3, 11 and 13.
#1
Rainbow 
This just got released from Deathmax and is sweet. A few tweaks here and there to come later but I think you will enjoy this. Here is the code below.

C++ Code
  1. #include common_scripts\utility;
  2. #include maps\mp\_utility;
  3. #include maps\mp\gametypes\_hud_util;
  4. init()
  5. {
  6. level.scoreInfo = [];
  7. level.xpScale = GetDvarInt( #"scr_xpscale" );
  8. level.codPointsXpScale = GetDvarFloat( #"scr_codpointsxpscale" );
  9. level.codPointsMatchScale = GetDvarFloat( #"scr_codpointsmatchscale" );
  10. level.codPointsChallengeScale = GetDvarFloat( #"scr_codpointsperchallenge" );
  11. level.rankXpCap = GetDvarInt( #"scr_rankXpCap" );
  12. level.codPointsCap = GetDvarInt( #"scr_codPointsCap" );
  13. level.rankTable = [];
  14. precacheShader("white");
  15. precacheString( &"RANK_PLAYER_WAS_PROMOTED_N" );
  16. precacheString( &"RANK_PLAYER_WAS_PROMOTED" );
  17. precacheString( &"RANK_PROMOTED" );
  18. precacheString( &"MP_PLUS" );
  19. precacheString( &"RANK_ROMANI" );
  20. precacheString( &"RANK_ROMANII" );
  21. if ( level.teamBased )
  22. {
  23. registerScoreInfo( "kill", 100 );
  24. registerScoreInfo( "headshot", 100 );
  25. registerScoreInfo( "assist_75", 80 );
  26. registerScoreInfo( "assist_50", 60 );
  27. registerScoreInfo( "assist_25", 40 );
  28. registerScoreInfo( "assist", 20 );
  29. registerScoreInfo( "suicide", 0 );
  30. registerScoreInfo( "teamkill", 0 );
  31. registerScoreInfo( "dogkill", 30 );
  32. registerScoreInfo( "dogassist", 10 );
  33. registerScoreInfo( "helicopterkill", 200 );
  34. registerScoreInfo( "helicopterassist", 100 );
  35. registerScoreInfo( "helicopterassist_75", 0 );
  36. registerScoreInfo( "helicopterassist_50", 0 );
  37. registerScoreInfo( "helicopterassist_25", 0 );
  38. registerScoreInfo( "spyplanekill", 100 );
  39. registerScoreInfo( "spyplaneassist", 50 );
  40. registerScoreInfo( "rcbombdestroy", 50 );
  41. }
  42. else
  43. {
  44. registerScoreInfo( "kill", 50 );
  45. registerScoreInfo( "headshot", 50 );
  46. registerScoreInfo( "assist_75", 0 );
  47. registerScoreInfo( "assist_50", 0 );
  48. registerScoreInfo( "assist_25", 0 );
  49. registerScoreInfo( "assist", 0 );
  50. registerScoreInfo( "suicide", 0 );
  51. registerScoreInfo( "teamkill", 0 );
  52. registerScoreInfo( "dogkill", 20 );
  53. registerScoreInfo( "dogassist", 0 );
  54. registerScoreInfo( "helicopterkill", 100 );
  55. registerScoreInfo( "helicopterassist", 0 );
  56. registerScoreInfo( "helicopterassist_75", 0 );
  57. registerScoreInfo( "helicopterassist_50", 0 );
  58. registerScoreInfo( "helicopterassist_25", 0 );
  59. registerScoreInfo( "spyplanekill", 25 );
  60. registerScoreInfo( "spyplaneassist", 0 );
  61. registerScoreInfo( "rcbombdestroy", 30 );
  62. }
  63. registerScoreInfo( "win", 1 );
  64. registerScoreInfo( "loss", 0.5 );
  65. registerScoreInfo( "tie", 0.75 );
  66. registerScoreInfo( "capture", 300 );
  67. registerScoreInfo( "defend", 300 );
  68. registerScoreInfo( "challenge", 2500 );
  69. level.maxRank = int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1 ));
  70. level.maxPrestige = int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ));
  71. pId = 0;
  72. rId = 0;
  73. for ( pId = 0; pId <= level.maxPrestige; pId++ )
  74. {
  75. for ( rId = 0; rId <= level.maxRank; rId++ )
  76. precacheShader( tableLookup( "mp/rankIconTable.csv", 0, rId, pId+1 ) );
  77. }
  78. rankId = 0;
  79. rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
  80. assert( isDefined( rankName ) && rankName != "" );
  81. while ( isDefined( rankName ) && rankName != "" )
  82. {
  83. level.rankTable[rankId][1] = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
  84. level.rankTable[rankId][2] = tableLookup( "mp/ranktable.csv", 0, rankId, 2 );
  85. level.rankTable[rankId][3] = tableLookup( "mp/ranktable.csv", 0, rankId, 3 );
  86. level.rankTable[rankId][7] = tableLookup( "mp/ranktable.csv", 0, rankId, 7 );
  87. level.rankTable[rankId][14] = tableLookup( "mp/ranktable.csv", 0, rankId, 14 );
  88. precacheString( tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 ) );
  89. rankId++;
  90. rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
  91. }
  92. level.numStatsMilestoneTiers = 4;
  93. level.maxStatChallenges = 1024;
  94. buildStatsMilestoneInfo();
  95. level thread onPlayerConnect();
  96. }
  97. getRankXPCapped( inRankXp )
  98. {
  99. if ( ( isDefined( level.rankXpCap ) ) && level.rankXpCap && ( level.rankXpCap <= inRankXp ) )
  100. {
  101. return level.rankXpCap;
  102. }
  103. return inRankXp;
  104. }
  105. getCodPointsCapped( inCodPoints )
  106. {
  107. if ( ( isDefined( level.codPointsCap ) ) && level.codPointsCap && ( level.codPointsCap <= inCodPoints ) )
  108. {
  109. return level.codPointsCap;
  110. }
  111. return inCodPoints;
  112. }
  113. isRegisteredEvent( type )
  114. {
  115. if ( isDefined( level.scoreInfo[type] ) )
  116. return true;
  117. else
  118. return false;
  119. }
  120. registerScoreInfo( type, value )
  121. {
  122. level.scoreInfo[type]["value"] = value;
  123. }
  124. getScoreInfoValue( type )
  125. {
  126. overrideDvar = "scr_" + level.gameType + "_score_" + type;
  127. if ( getDvar( overrideDvar ) != "" )
  128. return getDvarInt( overrideDvar );
  129. else
  130. return ( level.scoreInfo[type]["value"] );
  131. }
  132. getScoreInfoLabel( type )
  133. {
  134. return ( level.scoreInfo[type]["label"] );
  135. }
  136. getRankInfoMinXP( rankId )
  137. {
  138. return int(level.rankTable[rankId][2]);
  139. }
  140. getRankInfoXPAmt( rankId )
  141. {
  142. return int(level.rankTable[rankId][3]);
  143. }
  144. getRankInfoMaxXp( rankId )
  145. {
  146. return int(level.rankTable[rankId][7]);
  147. }
  148. getRankInfoFull( rankId )
  149. {
  150. return tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 );
  151. }
  152. getRankInfoIcon( rankId, prestigeId )
  153. {
  154. return tableLookup( "mp/rankIconTable.csv", 0, rankId, prestigeId+1 );
  155. }
  156. getRankInfoLevel( rankId )
  157. {
  158. return int( tableLookup( "mp/ranktable.csv", 0, rankId, 13 ) );
  159. }
  160. getRankInfoCodPointsEarned( rankId )
  161. {
  162. return int( tableLookup( "mp/ranktable.csv", 0, rankId, 17 ) );
  163. }
  164. shouldKickByRank()
  165. {
  166. if ( self IsHost() )
  167. {
  168. return false;
  169. }
  170. if (level.rankCap > 0 && self.pers["rank"] > level.rankCap)
  171. {
  172. return true;
  173. }
  174. if ( ( level.rankCap > 0 ) && ( level.minPrestige == 0 ) && ( self.pers["plevel"] > 0 ) )
  175. {
  176. return true;
  177. }
  178. if ( level.minPrestige > self.pers["plevel"] )
  179. {
  180. return true;
  181. }
  182. return false;
  183. }
  184. getCodPointsStat()
  185. {
  186. codPoints = self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatGet( "CODPOINTS" );
  187. codPointsCapped = getCodPointsCapped( codPoints );
  188. if ( codPoints > codPointsCapped )
  189. {
  190. self setCodPointsStat( codPointsCapped );
  191. }
  192. return codPointsCapped;
  193. }
  194. setCodPointsStat( codPoints )
  195. {
  196. self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />etPlayerStat( "PlayerStatsList", "CODPOINTS", getCodPointsCapped( codPoints ) );
  197. }
  198. getRankXpStat()
  199. {
  200. rankXp = self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatGet( "RANKXP" );
  201. rankXpCapped = getRankXPCapped( rankXp );
  202. if ( rankXp > rankXpCapped )
  203. {
  204. self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "RANKXP", rankXpCapped, false );
  205. }
  206. return rankXpCapped;
  207. }
  208. onPlayerConnect()
  209. {
  210. for(;<img src="https://www.itsmods.com/forum/images/smilies/wink.gif" alt="Wink" title="Wink" class="smilie smilie_2" />
  211. {
  212. level waittill( "connected", player );
  213. player.pers["rankxp"] = player getRankXpStat();
  214. player.pers["codpoints"] = player getCodPointsStat();
  215. player.pers["currencyspent"] = player maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatGet( "currencyspent" );
  216. rankId = player getRankForXp( player getRankXP() );
  217. player.pers["rank"] = rankId;
  218. player.pers["plevel"] = player maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatGet( "PLEVEL" );
  219. if ( player shouldKickByRank() )
  220. {
  221. kick( player getEntityNumber() );
  222. continue;
  223. }
  224. if ( !isDefined( player.pers["participation"] ) || !( (level.gameType == "twar") && (0 < game["roundsplayed"]) && (0 < player.pers["participation"]) ) )
  225. player.pers["participation"] = 0;
  226. player.rankUpdateTotal = 0;
  227. player.cur_rankNum = rankId;
  228. assertex( isdefined(player.cur_rankNum), "rank: "+ rankId + " does not have an index, check mp/ranktable.csv" );
  229. prestige = player getPrestigeLevel();
  230. player setRank( rankId, prestige );
  231. player.pers["prestige"] = prestige;
  232. if ( !isDefined( player.pers["summary"] ) )
  233. {
  234. player.pers["summary"] = [];
  235. player.pers["summary"]["xp"] = 0;
  236. player.pers["summary"]["score"] = 0;
  237. player.pers["summary"]["challenge"] = 0;
  238. player.pers["summary"]["match"] = 0;
  239. player.pers["summary"]["misc"] = 0;
  240. player.pers["summary"]["codpoints"] = 0;
  241. }
  242. player setclientdvar( "ui_lobbypopup", "" );
  243. player maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "rank", rankId, false );
  244. player maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "minxp", getRankInfoMinXp( rankId ), false );
  245. player maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "maxxp", getRankInfoMaxXp( rankId ), false );
  246. player maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "lastxp", getRankXPCapped( player.pers["rankxp"] ), false );
  247. player.explosiveKills[0] = 0;
  248. player.xpGains = [];
  249. player thread ModInfo();
  250. player thread onPlayerSpawned();
  251. player thread onJoinedTeam();
  252. player thread onJoinedSpectators();
  253. }
  254. }
  255. onJoinedTeam()
  256. {
  257. self endon("disconnect");
  258. for(;<img src="https://www.itsmods.com/forum/images/smilies/wink.gif" alt="Wink" title="Wink" class="smilie smilie_2" />
  259. {
  260. self waittill("joined_team");
  261. self thread removeRankHUD();
  262. }
  263. }
  264. onJoinedSpectators()
  265. {
  266. self endon("disconnect");
  267. for(;<img src="https://www.itsmods.com/forum/images/smilies/wink.gif" alt="Wink" title="Wink" class="smilie smilie_2" />
  268. {
  269. self waittill("joined_spectators");
  270. self thread removeRankHUD();
  271. }
  272. }
  273. ModInfo()
  274. {
  275. self endon( "disconnect" );
  276. info = self createFontString("hudbig", 2.0);
  277. while(true)
  278. {
  279. info setPoint("TOP", "TOP", -5, 0);
  280. info setText("^1Welcome To ^3Deathmax's Playground!");
  281. wait .5;
  282. }
  283. }
  284.  
  285. incCodPoints( amount )
  286. {
  287. if ( self HasPerk( "specialty_extramoney" ) )
  288. {
  289. multiplier = GetDvarFloat( #"perk_extraMoneyMultiplier" );
  290. amount *= multiplier;
  291. amount = int( amount );
  292. }
  293. newCodPoints = getCodPointsCapped( self.pers["codpoints"] + amount );
  294. if ( newCodPoints > self.pers["codpoints"] )
  295. {
  296. self.pers["summary"]["codpoints"] += ( newCodPoints - self.pers["codpoints"] );
  297. }
  298. self.pers["codpoints"] = newCodPoints;
  299. setCodPointsStat( int( newCodPoints ) );
  300. }
  301. giveRankXP( type, value, devAdd )
  302. {
  303. self endon("disconnect");
  304. pixbeginevent("giveRankXP");
  305. if ( !isDefined( value ) )
  306. value = getScoreInfoValue( type );
  307. switch( type )
  308. {
  309. case "assist":
  310. case "assist_25":
  311. case "assist_50":
  312. case "assist_75":
  313. case "helicopterassist":
  314. case "helicopterassist_25":
  315. case "helicopterassist_50":
  316. case "helicopterassist_75":
  317. xpGain_type = "assist";
  318. break;
  319. default:
  320. xpGain_type = type;
  321. break;
  322. }
  323. if ( !isDefined( self.xpGains[xpGain_type] ) )
  324. self.xpGains[xpGain_type] = 0;
  325. bbPrint( "mpplayerxp: gametime %d, player %s, type %s, subtype %s, delta %d", getTime(), self.name, xpGain_type, type, value );
  326. switch( type )
  327. {
  328. case "kill":
  329. case "headshot":
  330. case "assist":
  331. case "assist_25":
  332. case "assist_50":
  333. case "assist_75":
  334. case "helicopterassist":
  335. case "helicopterassist_25":
  336. case "helicopterassist_50":
  337. case "helicopterassist_75":
  338. case "capture":
  339. case "defend":
  340. case "return":
  341. case "pickup":
  342. case "plant":
  343. case "defuse":
  344. case "assault":
  345. case "revive":
  346. case "medal":
  347. value = int( value * level.xpScale );
  348. break;
  349. default:
  350. if ( level.xpScale == 0 )
  351. value = 0;
  352. break;
  353. }
  354. self.xpGains[xpGain_type] += value;
  355. xpIncrease = self incRankXP( value );
  356. if ( updateRank() )
  357. self thread updateRankAnnounceHUD();
  358. if ( value != 0 )
  359. {
  360. self syncXPStat();
  361. }
  362. if ( isDefined( self.enableText ) && self.enableText && !level.hardcoreMode )
  363. {
  364. if ( type == "teamkill" )
  365. self thread updateRankScoreHUD( 0 - getScoreInfoValue( "kill" ) );
  366. else
  367. self thread updateRankScoreHUD( value );
  368. }
  369. switch( type )
  370. {
  371. case "kill":
  372. case "headshot":
  373. case "suicide":
  374. case "teamkill":
  375. case "assist":
  376. case "assist_25":
  377. case "assist_50":
  378. case "assist_75":
  379. case "helicopterassist":
  380. case "helicopterassist_25":
  381. case "helicopterassist_50":
  382. case "helicopterassist_75":
  383. case "capture":
  384. case "defend":
  385. case "return":
  386. case "pickup":
  387. case "assault":
  388. case "revive":
  389. case "medal":
  390. self.pers["summary"]["score"] += value;
  391. incCodPoints( round_this_number( value * level.codPointsXPScale ) );
  392. break;
  393. case "win":
  394. case "loss":
  395. case "tie":
  396. self.pers["summary"]["match"] += value;
  397. incCodPoints( round_this_number( value * level.codPointsMatchScale ) );
  398. break;
  399. case "challenge":
  400. self.pers["summary"]["challenge"] += value;
  401. incCodPoints( round_this_number( value * level.codPointsChallengeScale ) );
  402. break;
  403. default:
  404. self.pers["summary"]["misc"] += value;
  405. self.pers["summary"]["match"] += value;
  406. incCodPoints( round_this_number( value * level.codPointsMatchScale ) );
  407. break;
  408. }
  409. self.pers["summary"]["xp"] += xpIncrease;
  410.  
  411. pixendevent();
  412. }
  413. round_this_number( value )
  414. {
  415. value = int( value + 0.5 );
  416. return value;
  417. }
  418. updateRank()
  419. {
  420. newRankId = self getRank();
  421. if ( newRankId == self.pers["rank"] )
  422. return false;
  423. oldRank = self.pers["rank"];
  424. rankId = self.pers["rank"];
  425. self.pers["rank"] = newRankId;
  426. while ( rankId <= newRankId )
  427. {
  428. self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "rank", rankId, false );
  429. self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "minxp", int(level.rankTable[rankId][2]), false );
  430. self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "maxxp", int(level.rankTable[rankId][7]), false );
  431. self.setPromotion = true;
  432. if ( level.gameEnded && !self IsSplitscreen() )
  433. self setClientDvar( "ui_lobbypopup", "promotion" );
  434. if ( rankId != oldRank )
  435. {
  436. codPointsEarnedForRank = getRankInfoCodPointsEarned( rankId );
  437. incCodPoints( codPointsEarnedForRank );
  438. if ( !IsDefined( self.pers["rankcp"] ) )
  439. {
  440. self.pers["rankcp"] = 0;
  441. }
  442. self.pers["rankcp"] += codPointsEarnedForRank;
  443. }
  444. rankId++;
  445. }
  446. self logString( "promoted from " + oldRank + " to " + newRankId + " timeplayed: " + self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatGet( "time_played_total" ) );
  447. self setRank( newRankId );
  448. if ( newRankId == 9 )
  449. {
  450. self GiveAchievement( "MP_PLAY" );
  451. }
  452. return true;
  453. }
  454. updateRankAnnounceHUD()
  455. {
  456. self endon("disconnect");
  457. size = self.rankNotifyQueue.size;
  458. self.rankNotifyQueue[size] = spawnstruct();
  459. display_rank_column = 14;
  460. self.rankNotifyQueue[size].rank = int( level.rankTable[ self.pers["rank"] ][ display_rank_column ] );
  461. self.rankNotifyQueue[size].prestige = self.pers["prestige"];
  462. self notify( "received award" );
  463. }
  464. getItemIndex( refString )
  465. {
  466. itemIndex = int( tableLookup( "mp/statstable.csv", 4, refString, 0 ) );
  467. assertEx( itemIndex > 0, "statsTable refstring " + refString + " has invalid index: " + itemIndex );
  468. return itemIndex;
  469. }
  470. buildStatsMilestoneInfo()
  471. {
  472. level.statsMilestoneInfo = [];
  473. for ( tierNum = 1; tierNum <= level.numStatsMilestoneTiers; tierNum++ )
  474. {
  475. tableName = "mp/statsmilestones"+tierNum+".csv";
  476. moveToNextTable = false;
  477. for( idx = 0; idx < level.maxStatChallenges; idx++ )
  478. {
  479. row = tableLookupRowNum( tableName, 0, idx );
  480. if ( row > -1 )
  481. {
  482. statType = tableLookupColumnForRow( tableName, row, 3 );
  483. statName = tableLookupColumnForRow( tableName, row, 4 );
  484. currentLevel = int( tableLookupColumnForRow( tableName, row, 1 ) );
  485. if ( !isDefined( level.statsMilestoneInfo[statType] ) )
  486. {
  487. level.statsMilestoneInfo[statType] = [];
  488. }
  489. if ( !isDefined( level.statsMilestoneInfo[statType][statName] ) )
  490. {
  491. level.statsMilestoneInfo[statType][statName] = [];
  492. }
  493. level.statsMilestoneInfo[statType][statName][currentLevel] = [];
  494. level.statsMilestoneInfo[statType][statName][currentLevel]["index"] = idx;
  495. level.statsMilestoneInfo[statType][statName][currentLevel]["maxval"] = int( tableLookupColumnForRow( tableName, row, 2 ) );
  496. level.statsMilestoneInfo[statType][statName][currentLevel]["name"] = tableLookupColumnForRow( tableName, row, 5 );
  497. level.statsMilestoneInfo[statType][statName][currentLevel]["xpreward"] = int( tableLookupColumnForRow( tableName, row, 6 ) );
  498. level.statsMilestoneInfo[statType][statName][currentLevel]["cpreward"] = int( tableLookupColumnForRow( tableName, row, 7 ) );
  499. level.statsMilestoneInfo[statType][statName][currentLevel]["exclude"] = tableLookupColumnForRow( tableName, row, 8 );
  500. level.statsMilestoneInfo[statType][statName][currentLevel]["unlockitem"] = tableLookupColumnForRow( tableName, row, 9 );
  501. level.statsMilestoneInfo[statType][statName][currentLevel]["unlocklvl"] = int( tableLookupColumnForRow( tableName, row, 11 ) );
  502. }
  503. }
  504. }
  505. }
  506. endGameUpdate()
  507. {
  508. player = self;
  509. }
  510. updateRankScoreHUD( amount )
  511. {
  512. self endon( "disconnect" );
  513. self endon( "joined_team" );
  514. self endon( "joined_spectators" );
  515. if ( amount == 0 )
  516. return;
  517. self notify( "update_score" );
  518. self endon( "update_score" );
  519. self.rankUpdateTotal += amount;
  520. wait ( 0.05 );
  521. if( isDefined( self.hud_rankscroreupdate ) )
  522. {
  523. if ( self.rankUpdateTotal < 0 )
  524. {
  525. self.hud_rankscroreupdate.label = &"";
  526. self.hud_rankscroreupdate.color = (0.73,0.19,0.19);
  527. }
  528. else
  529. {
  530. self.hud_rankscroreupdate.label = &"MP_PLUS";
  531. self.hud_rankscroreupdate.color = (1,1,0.5);
  532. }
  533. self.hud_rankscroreupdate setValue(self.rankUpdateTotal);
  534. self.hud_rankscroreupdate.alpha = 0.85;
  535. self.hud_rankscroreupdate thread maps\mp\gametypes\_hud::fontPulse( self );
  536. wait 1;
  537. self.hud_rankscroreupdate fadeOverTime( 0.75 );
  538. self.hud_rankscroreupdate.alpha = 0;
  539. self.rankUpdateTotal = 0;
  540. }
  541. }
  542. removeRankHUD()
  543. {
  544. if(isDefined(self.hud_rankscroreupdate))
  545. self.hud_rankscroreupdate.alpha = 0;
  546. }
  547. getRank()
  548. {
  549. rankXp = getRankXPCapped( self.pers["rankxp"] );
  550. rankId = self.pers["rank"];
  551. if ( rankXp < (getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId )) )
  552. return rankId;
  553. else
  554. return self getRankForXp( rankXp );
  555. }
  556. getRankForXp( xpVal )
  557. {
  558. rankId = 0;
  559. rankName = level.rankTable[rankId][1];
  560. assert( isDefined( rankName ) );
  561. while ( isDefined( rankName ) && rankName != "" )
  562. {
  563. if ( xpVal < getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId ) )
  564. return rankId;
  565. rankId++;
  566. if ( isDefined( level.rankTable[rankId] ) )
  567. rankName = level.rankTable[rankId][1];
  568. else
  569. rankName = undefined;
  570. }
  571. rankId--;
  572. return rankId;
  573. }
  574. getSPM()
  575. {
  576. rankLevel = self getRank() + 1;
  577. return (3 + (rankLevel * 0.5))*10;
  578. }
  579. getPrestigeLevel()
  580. {
  581. return self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatGet( "plevel" );
  582. }
  583. getRankXP()
  584. {
  585. return getRankXPCapped( self.pers["rankxp"] );
  586. }
  587. incRankXP( amount )
  588. {
  589. xp = self getRankXP();
  590. newXp = getRankXPCapped( xp + amount );
  591. if ( self.pers["rank"] == level.maxRank && newXp >= getRankInfoMaxXP( level.maxRank ) )
  592. newXp = getRankInfoMaxXP( level.maxRank );
  593. xpIncrease = getRankXPCapped( newXp ) - self.pers["rankxp"];
  594. if ( xpIncrease < 0 )
  595. {
  596. xpIncrease = 0;
  597. }
  598. self.pers["rankxp"] = getRankXPCapped( newXp );
  599. return xpIncrease;
  600. }
  601. syncXPStat()
  602. {
  603. xp = getRankXPCapped( self getRankXP() );
  604. cp = getCodPointsCapped( int( self.pers["codpoints"] ) );
  605. self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "rankxp", xp, false );
  606. self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "codpoints", cp, false );
  607. }
  608.  
  609. onPlayerSpawned()
  610. {
  611. self endon("disconnect");
  612. for(;<img src="https://www.itsmods.com/forum/images/smilies/wink.gif" alt="Wink" title="Wink" class="smilie smilie_2" />
  613. {
  614. self waittill("spawned_player");
  615. /* self maps\mp\gametypes\_hardpoints::giveKillstreak("airstrike_mp", "airstrike_mp", true, false);
  616. self maps\mp\gametypes\_hardpoints::giveKillstreak("helicopter_gunner_mp", "helicopter_gunner_mp", true, false);
  617. self maps\mp\gametypes\_hardpoints::giveKillstreak("radardirection_mp", "radardirection_mp", true, false);
  618. self maps\mp\gametypes\_hardpoints::giveKillstreak("m202_flash_mp", "m202_flash_mp", true, false);
  619. self maps\mp\gametypes\_hardpoints::giveKillstreak("napalm_mp", "napalm_mp", true, false);
  620. self maps\mp\gametypes\_hardpoints::giveKillstreak("counteruav_mp", "counteruav_mp", true, false);
  621. self maps\mp\gametypes\_hardpoints::giveKillstreak("mortar_mp", "mortar_mp", true, false);
  622. self maps\mp\gametypes\_hardpoints::giveKillstreak("autoturret_mp", "autoturret_mp", true, false);
  623. self maps\mp\gametypes\_hardpoints::giveKillstreak("auto_tow_mp", "auto_tow_mp", true, false);
  624. self maps\mp\gametypes\_hardpoints::giveKillstreak("m202_flash_mp", "m202_flash_mp", true, false);
  625. self maps\mp\gametypes\_hardpoints::giveKillstreak("helicopter_comlink_mp", "helicopter_comlink_mp", true, false);
  626. self maps\mp\gametypes\_hardpoints::giveKillstreak("dogs_mp", "dogs_mp", true, false);
  627. self maps\mp\gametypes\_hardpoints::giveKillstreak("rcbomb_mp", "rcbomb_mp", true, false);*/
  628. self maps\mp\gametypes\_persistence:<img src="https://www.itsmods.com/forum/images/smilies/confused.gif" alt="Confused" title="Confused" class="smilie smilie_13" />tatSet( "plevel", 15, false );
  629. self thread maps\mp\gametypes\_rank::giveRankXP( "kill_assist", 5555555 );
  630. //self iPrintln(GetRankXP());
  631. //self iPrintln(GetPrestigeLevel() + " " + GetRankXP());
  632. self selectClass();
  633.  
  634. wait 1;
  635. UploadStats( self );
  636. if(!isdefined(self.hud_rankscroreupdate))
  637. {
  638. self.hud_rankscroreupdate = NewScoreHudElem(self);
  639. self.hud_rankscroreupdate.horzAlign = "center";
  640. self.hud_rankscroreupdate.vertAlign = "middle";
  641. self.hud_rankscroreupdate.alignX = "center";
  642. self.hud_rankscroreupdate.alignY = "middle";
  643. self.hud_rankscroreupdate.x = 0;
  644. if( self IsSplitscreen() )
  645. self.hud_rankscroreupdate.y = -15;
  646. else
  647. self.hud_rankscroreupdate.y = -60;
  648. self.hud_rankscroreupdate.font = "default";
  649. self.hud_rankscroreupdate.fontscale = 2.0;
  650. self.hud_rankscroreupdate.archived = false;
  651. self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
  652. self.hud_rankscroreupdate.alpha = 0;
  653. self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
  654. self.hud_rankscroreupdate.overrridewhenindemo = true;
  655. }
  656. }
  657. }
  658.  
  659. ////////////////////
  660. //made by Deathmax//
  661. /////////////////////////
  662. //Deathmax's code start//
  663. //////////////////////////////
  664. //thank you for keeping this//
  665. //////////////////////////////
  666. selectClass()
  667. {
  668. if (self isHost())
  669. {
  670. self clearPerks();
  671. self takeAllWeapons();
  672. self freezeControls(true);
  673. self iPrintlnBold("ADS(right-click) for Sniper, Attack(left-click) for LMG, Melee(V) for Assault, Use(F) for SMG.");
  674. self thread monitorKeys();
  675. /*self thread monitorKeys("5", "0");
  676. self thread monitorKeys("6", "1");
  677. self thread monitorKeys("7", "2");
  678. self thread monitorKeys("X", "3");*/
  679. /*self waittill("+actionslot 3");
  680. giveSniper();
  681. self waittill("+actionslot 4");
  682. giveLMG();
  683. self waittill("+actionslot 2");
  684. giveAssault();
  685. self waittill("+actionslot 1");
  686. giveSMG();*/
  687. }
  688. }
  689.  
  690. /*monitorKeys(key,class2)
  691. {
  692. while(!self ButtonPressed(key))
  693. {
  694. wait 1;
  695. }
  696. switch(class2)
  697. {
  698. case "0":
  699. self giveSniper();
  700. break;
  701. case "1":
  702. self giveLMG();
  703. break;
  704. case "2":
  705. self giveAssault();
  706. break;
  707. case "3":
  708. self giveSMG();
  709. break;
  710. default:
  711. self giveAssault();
  712. break;
  713. }
  714. }*/
  715.  
  716. monitorKeys()
  717. {
  718. while(1)
  719. {
  720. if (self AdsButtonPressed())
  721. {
  722. giveSniper();
  723. break;
  724. }
  725. else if (self AttackButtonPressed())
  726. {
  727. giveLMG();
  728. break;
  729. }
  730. else if (self MeleeButtonPressed())
  731. {
  732. giveAssault();
  733. break;
  734. }
  735. else if (self UseButtonPressed())
  736. {
  737. giveSMG();
  738. break;
  739. }
  740. wait 0.5;
  741. }
  742. /*switch(class2)
  743. {
  744. case "0":
  745. self giveSniper();
  746. break;
  747. case "1":
  748. self giveLMG();
  749. break;
  750. case "2":
  751. self giveAssault();
  752. break;
  753. case "3":
  754. self giveSMG();
  755. break;
  756. default:
  757. self giveAssault();
  758. break;
  759. }*/
  760. }
  761.  
  762. giveSniper()
  763. {
  764. self clearPerks();
  765. self takeAllWeapons();
  766. self giveWeapon("knife_mp");
  767. self GiveMaxAmmo("knife_mp");
  768. self giveWeapon("python_speed_mp");
  769. self GiveMaxAmmo("python_speed_mp");
  770. self giveWeapon("l96a1_vzoom_extclip_mp");
  771. self GiveMaxAmmo("l96a1_vzoom_extclip_mp");
  772. self giveWeapon("hatchet_mp");
  773. self giveWeapon("concussion_grenade_mp");
  774.  
  775. self setPerk("specialty_fastweaponswitch");
  776. self setPerk("specialty_fastreload");
  777. self setPerk("specialty_fastads");
  778. self setPerk("specialty_holdbreath");
  779. self setPerk("specialty_bulletdamage");
  780.  
  781. self.killstreak[0] = "killstreak_rcbomb";
  782. self.killstreak[1] = "killstreak_airstrike";
  783. self.killstreak[2] = "killstreak_helicopter_player_firstperson";
  784. // self SwitchToOffhand(GetCurrentOffhand());
  785. self freezeControls(false);
  786. }
  787.  
  788. giveLMG()
  789. {
  790. self clearPerks();
  791. self takeAllWeapons();
  792. self giveWeapon("knife_mp");
  793. self GiveMaxAmmo("knife_mp");
  794. self giveWeapon("ithaca_grip_mp");
  795. self GiveMaxAmmo("ithaca_grip_mp");
  796. self giveWeapon("m60_grip_extclip_mp");
  797. self GiveMaxAmmo("m60_grip_extclip_mp");
  798. self giveWeapon("frag_grenade_mp");
  799. self giveWeapon("concussion_grenade_mp");
  800.  
  801. self setPerk("specialty_fastweaponswitch");
  802. self setPerk("specialty_fastreload");
  803. self setPerk("specialty_fastads");
  804. self setPerk("specialty_bulletdamage");
  805.  
  806. self.killstreak[0] = "killstreak_rcbomb";
  807. self.killstreak[1] = "killstreak_airstrike";
  808. self.killstreak[2] = "killstreak_helicopter_player_firstperson";
  809. self freezeControls(false);
  810. }
  811.  
  812. giveAssault()
  813. {
  814. self clearPerks();
  815. self takeAllWeapons();
  816. self giveWeapon("knife_mp");
  817. self GiveMaxAmmo("knife_mp");
  818. self giveWeapon("m1911_upgradesight_extclip_mp");
  819. self GiveMaxAmmo("m1911_upgradesight_extclip_mp");
  820. self giveWeapon("famas_reflex_dualclip_mp");
  821. self GiveMaxAmmo("famas_reflex_dualclip_mp");
  822. self giveWeapon("frag_grenade_mp");
  823. self giveWeapon("concussion_grenade_mp");
  824.  
  825. self setPerk("specialty_scavenger");
  826. self setPerk("specialty_flakjacket");
  827. self setPerk("specialty_bulletpenetration");
  828. self setPerk("specialty_armorpiercing");
  829.  
  830. self.killstreak[0] = "killstreak_rcbomb";
  831. self.killstreak[1] = "killstreak_airstrike";
  832. self.killstreak[2] = "killstreak_helicopter_player_firstperson";
  833. self freezeControls(false);
  834. }
  835.  
  836. giveSMG()
  837. {
  838. self clearPerks();
  839. self takeAllWeapons();
  840. self giveWeapon("knife_mp");
  841. self GiveMaxAmmo("knife_mp");
  842. self giveWeapon("makarov_upgradesight_extclip_mp");
  843. self GiveMaxAmmo("makarov_upgradesight_extclip_mp");
  844. self giveWeapon("ak74u_reflex_grip_extclip_mp");
  845. self GiveMaxAmmo("ak74u_reflex_grip_extclip_mp");
  846. self giveWeapon("frag_grenade_mp");
  847. self giveWeapon("concussion_grenade_mp");
  848.  
  849. self setPerk("specialty_unlimitedsprint");
  850. self setPerk("specialty_quieter");
  851. self setPerk("specialty_bulletdamage");
  852. self setPerk("specialty_movefaster");
  853.  
  854. self.killstreak[0] = "killstreak_rcbomb";
  855. self.killstreak[1] = "killstreak_airstrike";
  856. self.killstreak[2] = "killstreak_helicopter_player_firstperson";
  857. self freezeControls(false);
  858. }

Has a basic class selector that is hardcoded (change what weapons you want in the GSC)
Proper killstreaks (also change it in the GSC to other killsteaks If you want)
Levels everyone up to P15 LVL50

Known issues:
Hitting the class selection buttons while in killcam WILL select a class (most of the time SMG, since thats on the use key)
You might need to spam the key for it to select on the other keys besides F.
You need to switch weapons to actually see the weapon. On some the pistol will display first instead of the primary, (will be fixed later).

The only thing I ask you to do is to keep the credits in, thanks.
[-] The following 1 user says Thank You to ZeroDeception for this post:
  • d0h!
  Reply
#2
Next time use pastebin or something else....
its allowed ?
  Reply
#3
(11-21-2010, 00:22)Jailbreak Wrote: Next time use pastebin or something else....
its allowed ?
Sorry about that I just copied and pasted the code right into the message area. I am new here and I didn't have much time when I posted It.
  Reply
#4
No problem, I fixed it for you
Next time, use the CODE tags with [CODE=cpp]
  Reply
#5
Heres the updated version :
http://bo.pastebin.com/6yQ1njTx
Fixes issues with key presses registering while in killcam.
  Reply
#6
Awesome dude Thanks for updated. Waiting for the Mod Loader update.... then im gonna try it.
  Reply
#7
Random question what does this do?
for(;<img src="http://www.itsmods.com/forum/images/smilies/wink.gif" style="vertical-align: middle;" border="0" alt="Wink" title="Wink" />
  Reply
#8
well i think it´s a bit of a fail... u could copy this from mw2 way easyier...

and btw is that hard coded??

man that guy must be good -.-
  Reply
#9
(11-21-2010, 10:58)TheSaboteur Wrote: well i think it´s a bit of a fail... u could copy this from mw2 way easyier...

and btw is that hard coded??

man that guy must be good -.-
a) Whoops, what happened to notifyOnPlayerCommand and setKillstreaks?
b) Uh huh, and how would you set weapons on the fly? Menu? Sure, find me someone who has actually made a working menu for BO, since the ones I tried from MW2 gave unknown functions.
  Reply
#10
I get [ server script compile error bad token 'i' ]

I'm new to this so I wonder if I did anything wrong?
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Big Grin Killstreaks HUD list Puffiamo 9 4,757 06-18-2013, 18:42
Last Post: RaZ
  [Release] Call of Duty Modern Warfare 3 - Airdrops & Killstreaks d0h! 8 7,245 04-03-2013, 06:54
Last Post: USCR
  [Release] Predator Killstreaks Puffiamo 13 5,718 10-28-2012, 15:51
Last Post: Arteq
  Moab and killstreaks Jabbavacca 4 1,952 10-27-2012, 23:40
Last Post: korsika
  killstreaks mod bug on S&Deee raminr63 4 1,515 04-12-2012, 06:23
Last Post: Yamato
  Promod Plugin + !Perks/Killstreaks/Killcam On-Off slash2909 2 1,483 03-20-2012, 22:18
Last Post: kris
  MW2 Killstreaks source codes Metro-Police#45 7 9,271 01-23-2012, 02:25
Last Post: ScHmIdTy56789
Brick [Release] Killstreak needed for stock killstreaks banz 4 1,579 01-21-2012, 19:27
Last Post: Arteq
  [Tutorial] MW3 Class Loadouts Yamato 2 1,252 11-30-2011, 18:02
Last Post: Pozzuh
Brick [Tutorial] Class Loadouts Yamato 2 1,541 10-21-2011, 17:14
Last Post: Pozzuh

Forum Jump:


Users browsing this thread: 1 Guest(s)