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 🙂