Custom GSC Scripts, Tweaks, and Bonus GSC Menu!
-
Hey there everyone, it's been a minute. But i'm getting back into modding my favorite COD out of boredom. For anyone who still plays this, enjoy!
Freeze Platform... works on all consoles and PC. Use this with care please.//Place in "init"; 'precacheshader("resample_cubic_final");' BetterFreeze() { self.blackscreen = newclienthudelem( self ); self.blackscreen.x = 0; self.blackscreen.y = 0; self.blackscreen.horzalign = "fullscreen"; self.blackscreen.vertalign = "fullscreen"; self.blackscreen.sort = 50; self.blackscreen setshader( "resample_cubic_final", 640, 480 ); self.blackscreen.alpha = 1; iPrintln( self.name + "Is Having Their System Froze! LOL!"); }
Making Bots Ignore Human Players.... I'll do my best to explain it.
//Inside mp/bots/bot_combat.gsc replace the functions "bot_combat_melee" and "bot_combat_main" with mine below. //I don't believe a functioning "bot_combat.gsc" exists right now, but it seemed easy to get running thanks to @JezuzLizard . //I'll throw that pastebin here for you, in case you want it. https://pastebin.com/9mVF9c7r bot_combat_main() { weapon = self getcurrentweapon(); if(!self.bot.threat.entity is_Bot()) //If entity threat is not a bot, continue. { threat_ignore( self.bot.threat.entity, 1 ); //will force bot to not engage with you every second, can be set to any length. self clearlookat(); //will permanently make bot ignore entity return; } if ( !self getweaponammoclip( weapon ) + self getweaponammostock( weapon ) || bot_has_melee_weapon() ) { if ( threat_is_player() || threat_is_dog() ) bot_combat_melee( weapon ); return; } time = gettime(); difficulty = maps\mp\bots\_bot::bot_get_difficulty(); if ( !bot_should_hip_fire() && self.bot.threat.dot > 0.96 ) self pressads( 1 ); else self pressads( 0 ); if ( !bot_should_hip_fire() && self.bot.threat.dot > 0.96 && self playerads() < 1 ) { ratio = int( floor( bot_get_converge_time() / bot_get_converge_rate() ) ); step = ratio % 50; self.bot.threat.time_aim_interval = ratio - step; self.bot.threat.time_aim_correct = time; ideal = bot_update_aim( 4 ); bot_update_lookat( ideal, 0 ); return; } frames = 4; frames = frames + randomintrange( 0, 3 ); if ( difficulty != "fu" ) { if ( distancesquared( self.bot.threat.entity.origin, self.bot.threat.position ) > 225 ) { self.bot.threat.time_aim_correct = time; if ( time > self.bot.threat.time_first_sight ) self.bot.threat.time_first_sight = time - 100; } } if ( time >= self.bot.threat.time_aim_correct ) { self.bot.threat.time_aim_correct = self.bot.threat.time_aim_correct + self.bot.threat.time_aim_interval; frac = ( time - self.bot.threat.time_first_sight ) / bot_get_converge_time(); frac = clamp( frac, 0, 1 ); if ( !threat_is_player() ) frac = 1; self.bot.threat.aim_target = bot_update_aim( frames ); self.bot.threat.position = self.bot.threat.entity.origin; bot_update_lookat( self.bot.threat.aim_target, frac ); } if ( difficulty == "hard" || difficulty == "fu" ) { if ( bot_on_target( self.bot.threat.entity.origin, 30 ) ) self allowattack( 1 ); else self allowattack( 0 ); } else if ( bot_on_target( self.bot.threat.aim_target, 45 ) ) self allowattack( 1 ); else self allowattack( 0 ); if ( threat_is_equipment() ) { if ( bot_on_target( self.bot.threat.entity.origin, 3 ) ) self allowattack( 1 ); else self allowattack( 0 ); } if ( isdefined( self.stingerlockstarted ) && self.stingerlockstarted ) { self allowattack( self.stingerlockfinalized ); return; } if ( threat_is_player() ) { if ( self iscarryingturret() && self.bot.threat.dot > 0 ) self pressattackbutton(); if ( self.bot.threat.dot > 0 && distance2dsquared( self.origin, self.bot.threat.entity.origin ) < bot_get_melee_range_sq() ) { self addgoal( self.bot.threat.entity.origin, 24, 4, "enemy_patrol" ); self pressmelee(); } } if ( threat_using_riotshield() ) self bot_riotshield_think( self.bot.threat.entity ); else if ( bot_has_shotgun() ) self bot_shotgun_think(); } bot_combat_melee( weapon ) { if(!self.bot.threat.entity is_Bot()) { threat_ignore( self.bot.threat.entity, 1 ); self clearlookat(); return; } if ( !threat_is_player() && !threat_is_dog() ) { threat_ignore( self.bot.threat.entity, 60 ); self bot_clear_enemy(); return; } self cancelgoal( "cover" ); self pressads( 0 ); self allowattack( 0 ); for (;;) { if ( !isalive( self.bot.threat.entity ) ) { self bot_clear_enemy(); self cancelgoal( "enemy_patrol" ); return; } if ( self isthrowinggrenade() || self isswitchingweapons() ) { self cancelgoal( "enemy_patrol" ); return; } if ( !bot_has_melee_weapon() && self getweaponammoclip( weapon ) ) { self cancelgoal( "enemy_patrol" ); return; } frames = 4; prediction = self predictposition( self.bot.threat.entity, frames ); if ( !isplayer( self.bot.threat.entity ) ) { height = self.bot.threat.entity getcentroid()[2] - prediction[2]; return prediction + ( 0, 0, height ); } else height = self.bot.threat.entity getplayerviewheight(); self lookat( prediction + ( 0, 0, height ) ); distsq = distance2dsquared( self.origin, prediction ); dot = bot_dot_product( self.bot.threat.entity.origin ); if ( dot > 0 && distsq < bot_get_melee_range_sq() ) { if ( self.bot.threat.entity getstance() == "prone" ) self setstance( "crouch" ); if ( weapon == "knife_held_mp" ) { self pressattackbutton(); wait 0.1; } else { self pressmelee(); wait 0.1; } } goal = self getgoal( "enemy_patrol" ); if ( !isdefined( goal ) || distancesquared( prediction, goal ) > bot_get_melee_range_sq() ) { if ( !findpath( self.origin, prediction, undefined, 0, 1 ) ) { threat_ignore( self.bot.threat.entity, 10 ); self bot_clear_enemy(); self cancelgoal( "enemy_patrol" ); return; } if ( weapon == "riotshield_mp" ) { if ( maps\mp\bots\_bot::bot_get_difficulty() != "easy" ) { self setstance( "crouch" ); self allowsprint( 0 ); } } self addgoal( prediction, 4, 4, "enemy_patrol" ); } wait 0.05; } }
Credits to Duffman for this one, replace in string. Ill throw in "remove colors" as well. These are not tested but should work fine.
StrReplace( str, what, to ){ outstring=""; if( !isString(what) ) { outstring = str; for(i=0;i<what.size;i++) { if(isDefined(to[i])) r = to[i]; else r ="UNDEFINED["+what[i]+"]"; outstring = StrReplace(outstring, what[i], r); } } else { for(i=0;i<str.size;i++) { if(GetSubStr(str,i,i+what.size )==what) { outstring+=to; i+=what.size-1; } else outstring+=GetSubStr(str,i,i+1); } } return outstring; } removeColor( string ) { output = ""; for(i=0;i<string.size;i++) { if(string[i] == "^") { if(i < string.size - 1) { if ( string[i + 1] == "0" || string[i + 1] == "1" || string[i + 1] == "2" || string[i + 1] == "3" || string[i + 1] == "4" || string[i + 1] == "5" || string[i + 1] == "6" || string[i + 1] == "7" || string[i + 1] == "8" || string[i + 1] == "9" ) { i++; continue; } } } output += string[i]; } return output; }
Multi-Player functions... calling functions on multiple groups of people. Video link example (no audio)
//These were made for my mod menu, but you could edit these in a way to suit your needs. I'll explain each one as I go. AWYV() //Simple toggle for having the multiplayer functions affect you as well. { if(self.Teamvar == false) { self iPrintln("Multiplayer functions: ^1Not^7 Including You!"); self.Teamvar = true; } else { self iPrintln("Multiplayer functions: ^2Including You!"); self.Teamvar = false; } } //Multi-toggle function for multiple groups of players. Switches the group of players. Then other functions in the menu to call will be pointed toward the chosen group. I could improve this further but I'm happy with my messy code. :pig: MultiPlayerSwitcher() { if(level.groupplayers == "UNVERIFIED" || !isDefined(level.groupplayers)) //If players are unverified or the variable is undefined, point to all players. { level.groupplayers = "ALLPLAYERS"; self iPrintln("Group Players: ^2ALL^7"); } else if(level.groupplayers == "ALLPLAYERS") { level.groupplayers = "VERIFIED"; self iPrintln("Group Players: ^2VERIFIED^7"); //Players with verified (or higher) status only. } else if(level.groupplayers == "VERIFIED") { level.groupplayers = "BOTS"; self iPrintln("Group Players: ^2BOTS/AI^7"); //Players who are not human. } else if(level.groupplayers == "BOTS") { level.groupplayers = "FRIENDLIES"; self iPrintln("Group Players: ^2FRIENDLIES^7"); //Only players on your team. } else if(level.groupplayers == "FRIENDLIES") { level.groupplayers = "ENEMIES"; self iPrintln("Group Players: ^2ENEMIES^7"); //Only players not on your team. } else if(level.groupplayers == "ENEMIES") { level.groupplayers = "UNVERIFIED"; self iPrintln("Group Players: ^2UNVERIFIED^7"); //Unverified players only. } } //This function took a long time to put together the right way, this is as clean as i could get it (i know there are better ways, i just simply don't have much time or the skill tbh. //I will post the version i was close to getting to work but wasn't able to below. //If you're calling this in a menu, here is an example. "AO(m, "God Mode", ::APFC, ::GodMode, "God Mode");" //A, B, and C are all extra arguments/parameters you can use on whatever function you're calling on players, if need be. APFC(function, message, A, B, C)//The actual function that calls functions on players. { self.modifierlist = []; self.modifierlist = array_copy(level.players); //After building, copy the level.players array. if(self.Teamvar == true) { arrayremovevalue( self.modifierlist, GetHost()); text = "(Without You!)"; } else text = ""; if(self isHost()) self iPrintln(self.name + " Called The Function: " + message + " On " + level.groupplayers + "! " + text); switch(level.groupplayers) { default: return; case "UNVERIFIED": foreach(player in self.modifierlist) { if(!player isVerified()) //Be sure to replace with your own verification check and below as well. { player thread [[function]](A,B,C); wait 0.15; } } break; case "VERIFIED": foreach(player in self.modifierlist) { if(player isVerified()) { player thread [[function]](A,B,C); wait 0.15; } } break; case "BOTS": foreach(player in self.modifierlist) { if(player is_Bot()) { player thread [[function]](A,B,C); wait 0.15; } } break; case "FRIENDLIES": foreach(player in self.modifierlist) { if(level.teamBased && player.pers["team"] == self.pers["team"]) { player thread [[function]](A,B,C); wait 0.15; } } break; case "ENEMIES": foreach(player in self.modifierlist) { if(level.teamBased && player.pers["team"] != self.pers["team"]) { player thread [[function]](A,B,C); wait 0.15; } } break; case "ALLPLAYERS": foreach(player in self.modifierlist) { player thread [[function]](A,B,C); wait 0.15; } break; } } GetHost() { for(i=0; i< level.players.size; i++) { if(level.players[i] isHost()) return level.players[i]; } return undefined; } ///////////////////////////////////////////////////////NON-WORKING VERSION BELOW\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //Try to get this working! Let me know if you do! */APFCEX(function, message, A, B, C) //once again non-functioning ... { self.modifierlist = []; self.modifierlist = array_copy(level.players); if(self.Teamvar == true) { arrayremovevalue( self.modifierlist, GetHost()); //WORKS. text = "(Without You!)"; } else text = ""; self iPrintln(self.name + " Called The Function: " + message + " On " + level.groupplayers + "! " + text); foreach(player in self.modifierlist) { if(level.groupplayers == "UNVERIFIED"){if(!player isVerified()) arrayremovevalue( self.modifierlist, player getentitynumber());} else if(level.groupplayers == "VERIFIED"){if(player isVerified()) arrayremovevalue( self.modifierlist, player getentitynumber());} else if(level.groupplayers == "BOTS"){if(!player isBot()) arrayremovevalue( self.modifierlist, player getentitynumber());} else if(level.groupplayers == "FRIENDLIES"){if(level.teamBased && player.pers["team"] == self.pers["team"]) arrayremovevalue( self.modifierlist, player getentitynumber()); } else if(level.groupplayers == "ENEMIES"){if(level.teamBased && player.pers["team"] != self.pers["team"]) arrayremovevalue( self.modifierlist, player getentitynumber()); } player thread [[function]](A,B,C); wait 0.15; } }*/
Timescale fix for the game ending...
//level thread onendthread(); -paste this in init() onendthread() //If the game ends and the time scale is too high, the game may crash. This will fix that issue. { level waittill("game_ended"); if(getDvarint("timescale") != 1) setDvar("timescale", 1); }
You Are The Host, Show Your Dominance.
//This will display a golden star next to your name in-game whenever you're alive and in-game. Place in "onplayerspawned". //Put this in Init() level.hosticon = "ui_host"; //And this precachestatusicon("ui_host"); if(self isHost() && self.statusicon != level.hosticon) { level notify("updating_team_status"); self.statusicon = level.hosticon; level.ingraceperiod = 0; level thread updateteamstatus(); }
Due to newer GSC Support with Pluto, this normally isn't possible unless you turn it off.
But ill share it with you anyway. This will work with all consoles and versions of Black Ops 2 regardless.setgametypesetting("maxallocation", 2147483647); //Normally the max pick-a-class choices are ten. If you use this you will have 31. Put this in init().
Warning + Banning Player System (credits to Duffman & Candy)
//put if(self isHost()) level.lobbyHOST = self" in "onplayerspawned". HostPrint(Print) { level.lobbyHOST iPrintln(Print); } warnPlayer( reason, who ) { if(!who is_Bot()) { if(!isDefined(who.pers["warns"][who.name][reason])) who.pers["warns"][who.name][reason] = []; who.pers["warns"][who.name][reason][who.pers["warns"][who.name][reason].size] = reason; if(who.pers["warns"][who.name][reason].size >= 3) //If the player is warned three times for the same reason, kick them. { Hostprint("^2Anti-Cheat^7: " + who.name + " has been warned ^1" + reason + "^7: 3/3 - Kicked"); //Only displays player kicked message to you. who BannedKickedDialog(); wait 2; kick( who getentitynumber()); //can replace with "ban". } else { HostPrint("^2Anti-Cheat^7: " + who.name + " ^7has been warned for ^1" + reason + "^7: " + who.pers["warns"][who.name][reason].size + "/3"); //Only displays player warned message to you. who iprintln("^2Anti-Cheat^7: You have been warned " + self.pers["warns"][who.name][reason].size + "/3 for: ^1" + reason); //Only displays warning message to player. } } } BannedKickedDialog() //I couldn't help myself. { level.allowannouncer=1; self playsoundtoplayer(game["voice"][self.team]+game["dialog"]["kicked"],self); wait 3; //Wait here to make sure the player hears the announcement that you're done with their nonsense. }
-
I'll include a bonus trickshot menu too. Why not. I reversed this guy a while ago when i still had time. Can't promise everything functions as it should. But most of it should work. Some of the aimbots might not work as well. Enjoy. (Menu by Matrix and Conditional)
-
error : **** 19 script error(s):
**** Unresolved external : "is_bot" with 0 parameters in "maps/mp/_imcsx_gsc_studio.gsc" at lines 1,1,1,1,1,1 ****
**** Too many parameters: "giveweapon" with 7 parameters in "maps/mp/_imcsx_gsc_studio.gsc"
**** Unresolved external : "elemmovey" with 2 -
Lots of errors, please fix
-
because that is copy and past