Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. [Release][MP] Give Random Scorestreaks Script

[Release][MP] Give Random Scorestreaks Script

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
4 Posts 4 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MaxShadow09undefined Offline
    MaxShadow09undefined Offline
    MaxShadow09
    wrote on last edited by MaxShadow09
    #1

    This is my first script mod. It selects a random player and gives him a random scorestreak every few seconds. I created it mainly to give bots scorestreaks to make bot matches more interesting. Keep in mind bots can't use any scorestreak that requires direct control (RC-XD, Dragonfire, Lodestar, VTOL Warship), so they will never get those.

    Installation:
    Extract both files into your plutonium scripts folder
    \AppData\Local\Plutonium\storage\t6\scripts\mp

    CVARS:
    grs_main
    If true, the mod is enabled
    Default: 1

    grs_player_type
    Set what type of players can get killstreaks. Can be "players", "bots" or "all"
    Default: "bots"

    grs_player_team
    Set what team can get killstreaks. Can be "allies", "axis" or "all"
    Default: "all"

    grs_notify
    If true, displays a chat message to all players every time a killstreak is given
    Default: False

    grs_delay
    Delay between killstreak drops
    Default: 30

    grs_allowed_streaks
    Comma separated list of allowed killstreaks. All killstreaks are enabled by default. Check the list below with all the valid names you can use here.
    Default: "uav,rc_xd,hunter_killer,care_package,counter_uav,guardian,hellstorm_missile,lightning_strike,sentry_gun,death_machine,war_machine,dragonfire,agr,stealth_chopper,orbital_vsat,escort_drone,emp_systems,warthog,lodestar,vtol_warship,k9_unit,swarm"

    Scorestreak names
    uav
    rc_xd
    hunter_killer
    care_package
    counter_uav
    guardian
    hellstorm_missile
    lightning_strike
    sentry_gun
    death_machine
    war_machine
    dragonfire
    agr
    stealth_chopper
    orbital_vsat
    escort_drone
    emp_systems
    warthog
    lodestar
    vtol_warship
    k9_unit
    swarm

    Download

    1 Reply Last reply
    0
    • peyman07undefined Offline
      peyman07undefined Offline
      peyman07
      wrote on last edited by
      #2

      anyway i can make it so certain scorestreaks arent given to bots? i removed any of the lines about swarm drones and they still use it.

      1 Reply Last reply
      0
      • Diamond KKundefined Offline
        Diamond KKundefined Offline
        Diamond KK
        wrote on last edited by
        #3

        It works, very good

        1 Reply Last reply
        0
        • DeathMachineundefined Offline
          DeathMachineundefined Offline
          DeathMachine
          wrote on last edited by
          #4

          Hey guys! Can someone make this for Black Ops 1 if possible? I tried to convert it myself by modifying code to Black Ops 1 specific ones, but nothing works.

          Code I tried:

          #include maps\mp\_utility;
          #include maps\mp\gametypes\_hud_util;
          #include common_scripts\utility;
          
          init()
          {
          	setDvar( "grs_main", true );	
          	
          	setDvar( "grs_player_type", "all" );
          		
          	setDvar( "grs_player_team", "all" );
          		
          	setDvar( "grs_notify", true );
          		
          	setDvar( "grs_delay", 10 );
          
          	setDvar( "grs_allowed_streaks", "spy_plane,rc_xd,counter_spy_plane,sam_turret,care_package,napalm_strike,sentry_gun,mortar,minigun,cobra,valkyrie,blackbird,rolling_thunder,huey,dogs,hind" );
          
          	wait 20;
          	thread mainLoop();
          }
          
          getKillstreakArray()
          {
          	killstreakIds = [];
          	killstreakIds["spy_plane"] = "radar_mp";
          	killstreakIds["rc_xd"] = "rcbomb_mp";
          	killstreakIds["counter_spy_plane"] = "counteruav_mp";
          	killstreakIds["sam_turret"] = "tow_turret_drop_mp";
          	killstreakIds["care_package"] = "supply_drop_mp";
          	killstreakIds["napalm_strike"] = "napalm_mp";
          	killstreakIds["sentry_gun"] = "autoturret_mp";
          	killstreakIds["mortar"] = "mortar_mp";
          	killstreakIds["minigun"] = "minigun_mp";
          	killstreakIds["cobra"] = "helicopter_comlink_mp";
          	killstreakIds["valkyrie"] = "m220_tow_drop_mp";
          	killstreakIds["blackbird"] = "radardirection_mp";
          	killstreakIds["rolling_thunder"] = "airstrike_mp";
          	killstreakIds["huey"] = "helicopter_gunner_mp";
          	killstreakIds["dogs"] = "dogs_mp";
          	killstreakIds["hind"] = "helicopter_player_firstperson_mp";
          	
          	allowedStreaks = getDvar("grs_allowed_streaks");
          	
          	split = strtok( allowedStreaks, "," );
          	
          	result = [];
          	
          	for ( i = 0; i < split.size; i++ ) {
          		streak = split[i];
          		streakId = killstreakIds[streak];
          		
          		if (isDefined(streakId)) {
          			
          			result[result.size] = killstreakIds[streak];			
          		}
          	}
          	
          	return result;
          }
          
          GiveKillstreak(killstreak)
          {
          	self thread maps\mp\gametypes\_hardpoints::giveKillstreak(killstreak, killstreak, true, true);
          }
          
          mainLoop()
          {
          	level endon( "game_ended" );
          
          	killstreakNames = [];
          	killstreakNames["radar_mp"] = "Spy Plane";
          	killstreakNames["rc_xd"] = "RC-XD";
          	killstreakNames["counteruav_mp"] = "Counter-Spy Plane";
          	killstreakNames["tow_turret_drop_mp"] = "Sam Turret";
          	killstreakNames["supply_drop_mp" = "Care Package";
          	killstreakNames["napalm_mp"] = "Napalm Strike";
          	killstreakNames["autoturret_mp"] = "Sentry Gun";
          	killstreakNames["mortar_mp"] = "Mortar Team";
          	killstreakNames["minigun_mp"] = "Death Machine";
          	killstreakNames["helicopter_comlink_mp"] = "Attack Helicopter";
          	killstreakNames["m220_tow_drop_mp"] = "Valkyrie Rockets";
          	killstreakNames["radardirection_mp"] = "Blackbird";
          	killstreakNames["airstrike_mp"] = "Rolling Thunder";
          	killstreakNames["helicopter_gunner_mp"] = "Chopper Gunner";
          	killstreakNames["dogs_mp"] = "Attack Dogs";
          	killstreakNames["helicopter_player_firstperson_mp"] = "Hind";
          	
          	for ( ;; )
          	{
          		delay = getDVarInt( "grs_delay" );
          		notf = getDVarInt( "grs_notify" );
          		
          		wait delay;
          		
          		if (getDvarInt( "grs_main" )) {
          			tempPlayer = "";
          			
          			playerType = getDvar("grs_player_type");
          			if (playerType != "bots" && playerType != "players" && playerType != "all")
          				playerType = "all";
          				
          			team = getDvar("grs_player_team");
          			if (team != "allies" && team != "axis" && team != "all")
          				team = "all";
          			
          			tempPlayer = PickRandom(getPlayerArray(playerType, team));			
          				
          			killstreakList = getKillstreakArray();
          				
          			if (killstreakList.size > 0) {
          				tempKs = PickRandom(killstreakList);
          					
          				tempPlayer GiveKillstreak(tempKs);
          					
          				self iPrintln("Giving " + killstreakNames[tempKs] + " to " + tempPlayer.name + "");
          			}
          		}
          	}
          }
          
          PickRandom(arr)
          {
          	if ( !arr.size )
          		return undefined;
          
          	return arr[randomInt( arr.size )];
          }
          
          getPlayerArray(type, team)
          {
          	answer = [];
          
          	for ( i = 0; i < level.players.size; i++ )
          	{
          		player = level.players[i];
          		
          		if ( isDefined( player ) && isDefined( player.team )) {
          			if (
          				(type == "bots" && player isBot()) ||
          				(type == "players" && !(player isBot())) ||
          				(type == "all")
          			) {
          				if (
          					(team == "allies" && player.team == "allies") ||
          					(team == "axis" && player.team == "axis") ||
          					(team == "all" && (player.team == "allies" || player.team == "axis"))
          				) {
          					answer[answer.size] = player;
          				}
          			}
          		}
          	}
          
          	return answer;
          }
          

          Any help would be appreciated 🙂

          1 Reply Last reply
          0

          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Donate