Advertisement
Guest User

.gsc

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