1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Release [Bo2/GSC] - StonedYoda's GSC Board [Scripts/Sources]

Discussion in 'Call of Duty: Black Ops 2 Scripts' started by StonedYoda, Feb 18, 2016.

  1. StonedYoda

    StonedYoda Coding-Content Moderator

    45
    72
    18
    Credits:
    54
    StonedYoda's GSC Board
    -----> Please login or register to view links or downloads!
    Functions:

    Functions you need for my Functions!
    Code:
    createRectangle(align,relative,x,y,width,height,color,shader,sort,alpha)
    {
        barElemBG = newClientHudElem( self );
        barElemBG.elemType = "bar";
        barElemBG.width = width;
        barElemBG.height = height;
        barElemBG.align = align;
        barElemBG.relative = relative;
        barElemBG.xOffset = 0;
        barElemBG.yOffset = 0;
        barElemBG.children = [];
        barElemBG.sort = sort;
        barElemBG.color = color;
        barElemBG.alpha = alpha;
        barElemBG setParent( level.uiParent );
        barElemBG setShader( shader, width , height );
        barElemBG.hidden = false;
        barElemBG setPoint(align,relative,x,y);
        return barElemBG;
    }
    
    drawValue(value, font, fontScale, align, relative, x, y, color, alpha, glowColor, glowAlpha, sort)
    {
        hud = self createFontString(font, fontScale);
        level.varsArray["result"] += 1;
        level notify("textset");
        hud setPoint( align, relative, x, y );
        hud.color = color;
        hud.alpha = alpha;
        hud.glowColor = glowColor;
        hud.glowAlpha = glowAlpha;
        hud.sort = sort;
        hud.alpha = alpha;
        hud setValue(value);
        hud.foreground = true;
        hud.hideWhenInMenu = true;
        return hud;
    }
    
    
    drawText(text, font, fontScale, align, relative, x, y, color, alpha, sort)
    {
        hud = self createFontString(font, fontScale);
        hud setPoint( align, relative, x, y );
        hud.color = color;
        hud.alpha = alpha;
        hud.hideWhenInMenu = true;
        hud.sort = sort;
    
        level.result += 1;
        hud setText(text);
        level notify("textset");
    
        return hud;
    }
    
    setSafeText(textIndex)
    {
        level.result += 1;
        level notify("textset");
        self setText(textIndex);
    }
    
    S(textIndex)
    {
        self iprintln( textIndex );
    }
    vector_scal(vec,scale)
    {
        vec =(vec[0] * scale,vec[1] * scale,vec[2] * scale);
        return vec;
    }
    getCursorPosProjectile()
    {
        return BulletTrace(self getTagOrigin("tag_eye"),vector_ScalProjectile(anglestoforward(self getPlayerAngles()),1000000),0,self)["position"];
    }
    traceBullet()
    {
        return bulletTrace(self getEye(),self getEye()+vectorScale(anglesToForward(self getPlayerAngles()),1000000),false,self)["position"];
    }
    GetCursorPos()
    {
        forward=self getTagOrigin("tag_eye");
        end=self thread vector_scal(anglestoforward(self getPlayerAngles()),1000000);
        location=BulletTrace(forward,end,0,self)[ "position" ];
        return location;
    }
    vector_ScalProjectile(vec,scale)
    {
        return(vec[0] * scale,vec[1] * scale,vec[2] * scale);
    }
    
    
    getCursorPosProjectile()
    {
        return BulletTrace(self getTagOrigin("tag_eye"),vector_ScalProjectile(anglestoforward(self getPlayerAngles()),1000000),0,self)["position"];
    }
    traceBullet()
    {
        return bulletTrace(self getEye(),self getEye()+vectorScale(anglesToForward(self getPlayerAngles()),1000000),false,self)["position"];
    }
    GetCursorPos()
    {
        forward=self getTagOrigin("tag_eye");
        end=self thread vector_scal(anglestoforward(self getPlayerAngles()),1000000);
        location=BulletTrace(forward,end,0,self)[ "position" ];
        return location;
    }
    vector_ScalProjectile(vec,scale)
    {
        return(vec[0] * scale,vec[1] * scale,vec[2] * scale);
    }
    vector_scal(vec,scale)
    {
        vec =(vec[0] * scale,vec[1] * scale,vec[2] * scale);
        return vec;
    }
    
    Godmode Pistol (made for @dorathekiller97) [Alpha Version may have bugs]
    Code:
    
    // Godmode Gun Code
    Check(player)
    {
            self.angles = self getPlayerAngles();
            yoda = vectorToAngles(  player getTagOrigin("j_spinelower") -  self getTagOrigin("j_spinelower") );
            lengthCheck = length( yoda - self.angles );
      
            if(lengthCheck < 10)
                    player.isOk = 1;
            else
                    player.isOk = 0;
    }
    
    GodmodePistol()
    {
        self endon("stop_gmodPistol");
        self iprintln("Godmode Gun ^2On");
        for(;;)
        {
            foreach(player in level.players)
            {
                Check(player);
                if(player.isOk == 1)
                {
                    self waittill("weapon_fired");
                    togglegodpl(player);
                }
              }
              wait 0.01;
          }
    }
    
    // Godmode functions you need for this
    ToggleGodMode()
    {
        if(!self.GodMode)
        {
            self.GodMode=true;
            self iprintln("Godmode [^2ON^7]");
            self thread doGod();
        }
        else
        {
            self.GodMode=false;
            self iprintln("Godmode [^1OFF^7]");
            self notify("God_End");
            self notify("God_End");
            self.maxhealth=100;
            self.health=self.maxhealth;
            wait .4;
            self DisableInvulnerability();
        }
    }
    
    togglegodpl(player)
    {
        if(!player.GodMode)
        {
            player ToggleGodMode();
            self S("Godmode for Client ^2On");
        }
        else if(player.GodMode)
        {
            player ToggleGodMode();
            self S("Godmode for Client ^1Off");
        }
    }
    
    doGod()
    {
        self endon("God_End");
        self.maxhealth=9999999;
        self.health=self.maxhealth;
        for(;;)
        {
            if(self.health<self.maxhealth)
            {
                self.health=self.maxhealth;
            }
            self enableInvulnerability();
            wait 0.05;
        }
        wait 0.05;
    }
    
    New: StonedYoda's dvar Editor (with All client FOV)
    Code:
    SY_Dvars(dvar, startValue, min, max, steps)
    {
        self endon("disconnect");
        level.slidername = dvar;
        self disableweapons();
        self allowJump(false);
        self S("Editing dvar [^3"+dvar+"^7] started..");
     
        if(isDefined(self.loadValue))
            currentValue = self.loadValue;
        else
            currentValue = startValue;
     
        maxValue = max;
        steps = steps;
        minValue = min;
        self iPrintLn("Press [{+attack}]/[{+speed_throw}] to Edit the Value!");
        self iPrintLn("Press [{+gostand}] to set the Value!");
        valueText = drawValue(currValue, "objective", 2.7, "CENTER", "CENTER", 0, 0, (1,1,1), 1, 0, 3);
        level.dvartext = drawText("currently Editing: ^3"+level.slidername, "objective", 1.2, "CENTER", "CENTER", 0, 23, (1,1,1), 1, 1, 3);
        editorBG1 = self createShader("line_horizontal", "CENTER", "CENTER", 0, 23, 210, 16, (0, .4, 1), 1, 0);
        editorBG2 = self createShader("line_horizontal", "CENTER", "CENTER", 0, 0, 210, 30, (0, 0, 0), 0.8, 0);
        for(;;)
        {
            while(self attackButtonPressed() && self adsButtonPressed())
                wait .05;
            if(self AttackButtonPressed() && currentValue < maxValue)
                currentValue = currentValue + steps;
            else if(self AdsButtonPressed() && currentValue > minValue)
                currentValue = currentValue - steps;
            else if(self AdsButtonPressed() && currentValue == minValue)
                currentValue = maxValue;
            else if(self AttackButtonPressed() && currentValue == maxValue)
                currentValue = minValue;
            else if(self JumpButtonpressed())
                break;
         
            if(dvar == "cg_fov")// to make the Fov Editing ALL CLIENT <-
                self setclientfov(currentValue);
            else { setDvar(dvar, currentValue); }
            valueText setValue(currentValue);     
            wait .05;
        }
        self.loadValue = currentValue;
        valueText destroy();
        editorBG1 destroy();
        editorBG2 destroy();
        level.dvartext destroy();
        self enableweapons();
        self allowJump(true);
        self iPrintLn("dvar [^3"+dvar+"^7] set to ^2"+self.loadValue);
    }
    // Simple Example: SY_Dvars("cg_fov", 65,  65, 160, 5);
    
    Javelin (Modded Weapon remaked of Mw3) [Yoda Edit with the Real Bullet Fly type]
    Code:
    tJav()
    {
        if(self.javy == 0)
        {
            self thread Jav();
            self iprintln("Javelin ^2Given");
            self.javy = 1;
        }
      
        else
        {
            self notify("javy");
            self takeweapon("fhj18_mp");
            self iprintln("Javelin ^1Taken");
            self.Jav delete();
            self.javy = 0;
        }
    }
    Jav()
    {
        self endon("disconnect");
        self endon("death");
        level endon("game_ended");
        self endon("javy");
    
        self giveWeapon("fhj18_mp");
        self SwitchToWeapon("fhj18_mp");
    
        level.remote_mortar_fx[ "missileExplode" ]=loadfx("weapon/remote_mortar/fx_rmt_mortar_explosion");
        for(;;)
        {
            if(self AttackButtonPressed() && self AdsButtonPressed() && self getcurrentweapon() == "fhj18_mp")
            {
                self iprintlnbold("Javelin Launched");
                pos = traceBullet();
                self.Jav=spawn("script_model",self.origin+(10, 10, 10));
                self.Jav setModel("projectile_hellfire_missile");
                self.Jav.angles=(90, 90, 90);
                self thread javd(self.jav);
                self.jav playSound("wpn_rpg_fire_plr");
                self.Jav moveto(self.origin+(10,10,2500), 3);
                self thread FME(self.Jav);
                wait 3;
                self.Jav moveto(pos + (0,0,2500), 1);
                wait 1;
                self.Jav moveto(pos, 1);
                wait 1.1;
                playFx(level.remote_mortar_fx[ "missileExplode" ], self.Jav.origin);
                RadiusDamage(pos, 350, 200, 150, self);
                self.Jav playSound("exp_barrel");
                self.Jav delete();
                self notify("Jav_done");
            }
            wait .05;
        }
    }
    FME(b)
    {
        self endon("disconnect");
        level endon("game_ended");
        self endon("death");
        self endon("Jav_done");
        self endon("Missle_done");
        self endon("javy");
        level.talon = loadfx("vehicle/treadfx/fx_treadfx_talon_dirt");
        for(;;)
        {
            playfxontag(level.talon,b,"tag_origin");
            wait 0.08;
        }
    }
    javd(b)
    {
        self endon("disconnect");
        level endon("game_ended");
        self endon("javy");
        self endon("Jav_done");
        self waittill("death");
        b delete();
    }
    

    Real working Bind Advanced Noclip to R2 (without any crashes or ****)
    Code:
    toggleofthetoggle()
    {
        if(self.stonedyodalol == false)
        {
            self thread NoclipToggleThread();
            self S("Noclip ^2Bound ^7to [{+frag}]");
            self.stonedyodalol = true;
        }
        else if(self.stonedyodalol == true)
        {
            self.stonedyodalol = false;
            self S("Noclip ^1Unbound");
            self notify("stop_toggleThread");
        }
    }
    
    NoclipToggleThread()
    {
    self endon("stop_toggleThread");
    for(;;)
    {
        if(self Fragbuttonpressed())
        {
            if(self.noclipbound == false)
            {
                self.noclipbound = true;
                self thread noclip();
            }
            else if(self.noclipbound == true)
            {
                self.noclipbound = false;
                self enableoffhandweapons();
                self unlink();
                self.originObj delete();
                self S("Advanced Noclip ^1Off");
                self notify("stopNoclip");
            }
        }
        wait 0.2;
    }
    }
    
    noclip()
    {
        self endon("stopNoclip");
        self.originObj=spawn("script_origin",self.origin,1);
        self.originObj.angles=self.angles;
        self playerlinkto(self.originObj,undefined);
    
        self S("Advanced Noclip ^2On");
        for(;;)
        {
            if(self sprintbuttonpressed())
            {
                normalized=anglesToForward(self getPlayerAngles());
                scaled=vectorScale(normalized,60);
                originpos=self.origin + scaled;
                self.originObj.origin=originpos;
            }
            wait 0.05;
        }
    }
    

    Location Selector
    Code:
    locationSelector()
    {
        self beginLocationSelection( "map_mortar_selector" );
        self disableoffhandweapons();
        self.selectingLocation = 1;
        self waittill("confirm_location", location);
        newLocation = BulletTrace(location+( 0, 0, 100000 ), location, false, self)["position"];
        self endLocationSelection();
        self enableoffhandweapons();
        self.selectingLocation = undefined;
        return newLocation;
    }
    
    Mortar Strike (Stoned Strike) Custom Killstreak by Yoda
    Code:
    MortarStrike()
    {
        if(!self.strikeisrunning)
        {
              self endon("disconnect");
            self endon("death");
            self.strikeisrunning = true;
            self iprintln("Please mark a Position for the Mortar Strike!");
            wait .3;
            Location=locationSelector();
            self iprintln("Stoned Strike ^2Inbound");
    
            level.startpoint = Location+(0,0,7000);
            projectile123 = "usrpg_mp";
            i = 0;
    
            for(i = 0; i < 50; i++)
            {
                stoner1 = RandomIntRange(1, 90);
                stoner2 = RandomIntRange(1, 100);
                magicbullet(projectile123, level.startpoint, level.startpoint+(stoner1, stoner2, -2000));
            }
            self iprintln("Stoned Strike ^2Done");
            self.strikeisrunning = false;
        }
        else { self iprintln("^1Error^7: Waittill the Current Strike is Over.."); }
    }
    
    Set Scoreboard Stats for Players
    Code:
    SetScoreBoardStats(player, statType)
    {
        if(statType == "Low")
        {
            player iprintlnbold("Your Scoreboard Stats set to: ^2"+statType);
            player addPlayerStat("kill", 0);
            player addPlayerStat("kills", 0);
            player addPlayerStat("deaths", 9999999);
            player addPlayerStat("wins", 0);
            player addPlayerStat("score", 0);
        }
        else if(statType == "High")
        {
            player iprintlnbold("Your Scoreboard Stats set to: ^2"+statType);
            player addPlayerStat("kill", 9999999);
            player addPlayerStat("kills", 9999999);
            player addPlayerStat("deaths", 0);
            player addPlayerStat("wins", 9999999);
            player addPlayerStat("score", 9999999);
        }
        else if(statType == "Legit")
        {
            player iprintlnbold("Your Scoreboard Stats set to: ^2"+statType);
            player addPlayerStat("kill", 1337);
            player addPlayerStat("kills", 1337);
            player addPlayerStat("deaths", 1337);
            player addPlayerStat("wins", 1337);
            player addPlayerStat("score", 1337);
        }
        self iprintln("You changed the Scoreboard Stats of " + player.name + "^7 to ^2" + statType );
    }
    
    Target HUD by Yoda (You need Overflowfix in your Menu to use this Function!)
    Code:
    InitTargetHUD()
    {
        if(!self.TargetHudEnabled)
        {
            self.TargetHudEnabled = true;
            self thread UpdateTarget();
            self thread TargetHUD();
            self.targettextspawned = true;
            self iprintln("Target HUD ^2Spawned");
        }
        else
        {
            self.TargetHudEnabled = false;
            self.targettextspawned = false;
            self notify("TargetHUD_destroy");
            self notify("TargetHUD_End");
            self iprintln("Target HUD ^1Destroyed");
        }
    }
    
    TargetHUD()
    {
        self.TargetBackground = self createRectangle("CENTER","CENTER",-330,-10,190,90,(0,0,0),"white",1, .71);
        self.TargetText = drawText("", "default", 1.1, "LEFT", "RIGHT", -780, -40, (1,1,1), 1, 4);
        self waittill("TargetHUD_destroy");
        self.TargetBackground destroy();
        self.TargetText destroy();
    }
    
    TargetOverflowfix(player)
    {
        if(player.targettextspawned == true)
        {
            player notify("TargetHUD_End");
            player thread UpdateTarget();
        }
    }
    
    
    
    UpdateTarget()
    {
        self endon("TargetHUD_End");
        for(;;)
        {
            self.Target1 = self maps\mp\gametypes\_battlechatter_mp::get_Closest_Player_Enemy();
            self.TargetAway = distance(self.origin, self.Target1.origin);
            self.TargetName = self.Target1.name;
            self.TargetGun = self.Target1 getCurrentWeapon();
            self.TargetAlive = isAlive(self.Target1);
            if(self.TargetAlive)
            {
                loltext = "Target Alive: Yes";
            }
            else
            {
                loltext = "Target Alive: No";
            }
            if(isDefined(self.Target1))
            {
                self.newtext = "^3Target Information:^7\n\n Name: "+self.TargetName+"\n Distance: "+self.TargetAway+"\n Weapon: "+self.TargetGun+"\n"+loltext;
                self.TargetText setSafeText(self.newtext);
            }
            else
            {
                self.newtext = "^3Target Information:^7\n\nN/A";
                self.TargetText setSafeText(self.newtext);
            }
            wait 0.1;
        }
    
    }
    getPlayerName(player)
    {
            playerName = getSubStr(player.name, 0, player.name.size);
            for(i=0; i < playerName.size; i++)
            {
                    if(playerName[i] == "]")
                            break;
            }
            if(playerName.size != i)
                    playerName = getSubStr(playerName, i + 1, playerName.size);
            return playerName;
    }
    
    In: overflowfix.gsc
    [​IMG]
    Grapple Gun by Yoda
    Code:
    StonedGrappler()
    {
        if(self.isGrapplinSY == false)
        {
            self.isGrapplinSY = true;
            self thread GrappleGun();
            self S("Grapple Gun ^2On");
        }
        else if(self.isGrapplinSY == true)
        {
            self.isGrapplinSY = false;
            self notify("stop_grapple");
            self S("Grapple Gun ^1Off");
            self takeweapon("fiveseven_mp++extbarrel");
        }
    }
    
    GrappleGun()
    {
        self endon("stop_grapple");
        self endon("death");
        self endon("disconnected");
        self giveWeapon("fiveseven_mp+extbarrel", 0, true (15,0,0,0,0) );
        self switchToWeapon("fiveseven_mp+extbarrel");
        self givemaxammo("fiveseven_mp+extbarrel");
        for(;:wink:
        {
            self waittill("weapon_fired");
            if(self getcurrentweapon()=="fiveseven_mp+extbarrel")
            {
                endLocSY = traceBullet();
                self.grappler = spawn("script_model", self.origin);
                self playerlinkto(self.grappler, undefined);
                self.grappler moveTo(endLocSY, 1);
                wait 1.02;
                self unlink();
                self.grappler delete();
            }
            wait 0.01;
        }
    }
    
    Toggleable Pet Chopper by Yoda
    Code:
    togglePetChopper()
    {
        if(self.chipper == false)
        {
            self thread SSH();
            self S("Pet Chopper ^2Spawned");
            self.chipper = true;
        }
        else if(self.chipper == true)
        {
            self notify("helicopter_done");
            self S("Pet Chopper ^1Deleted");
            self.chipper = false;
            self.lb delete();
        }
    }
    
    SSH()
    {
        self endon("disconnect");
        self endon("helicopter_done");
        owner=self;
        self.lb=spawnHelicopter(self,self.origin +(5000,5000,5000),self.angles,"heli_ai_mp","veh_t6_air_attack_heli_mp_dark");
        self.lb.owner=self;
        self.lb.team=self.team;
        wait 0.01;
        self.lb thread ASH(owner);
        self.lb thread PettingChopperxDEnd();
        for(;;)
        {
            self.lb setYawSpeed(90,80);
            self.lb SetSpeed(1000,16);
            self.lb setVehGoalPos(self.origin +(51,0,1000),1);
            wait 0.05;
        }
    }
    
    ASH(owner)
    {
        owner endon("disconnect");
        owner endon("helicopter_done");
        for(;;)
        {
            aimAt=owner maps\mp\gametypes\_battlechatter_mp::get_Closest_Player_Enemy();
            //owner iprintln("Chopper Target: ^2" + aimAt.name);
            MagicBullet("minigun_mp",self getTagOrigin("tag_origin")-(0,0,180),aimAt getTagOrigin("j_knee_le"), owner);
            wait .14;
        }
        wait 0.01;
    }
    PettingChopperxDEnd()
    {
        self endon("helicopter_done_end");
        for(;;)
        {
            self waittill("helicopter_done");
            lb delete();
            self notify("helicopter_done_end");
            wait 0.05;
        }
        wait 0.05;
    }
    
    Harrier Bullets by Yoda
    Code:
    ToggleHarrier()
    {
        if(self.hasHarrier == false)
        {
            self.hasHarrier = true;
            self thread HarrierBullets();
            self S("Harrier Bullets ^2On");
        }
        else if(self.hasHarrier == true)
        {
            self.hasHarrier = false;
            self notify("stop_harri");
            self S("Harrier Bullets ^1Off");
        }
    }
    
    
    HarrierBullets()
    {
        self endon("death");
        self endon("disconnected");
        self endon("stop_harri");
        level._effect["fly_smoke"] = loadfx("vehicle/treadfx/fx_treadfx_talon_dirt");
        level._effect["Harrier"] = loadfx("maps/mp_maps/fx_mp_exp_rc_bomb");
        for(;;)
        {
            self waittill("weapon_fired");
            get_tag = self gettagorigin("tag_eye");
            player_angs = anglestoforward(self getPlayerAngles());
            target_loc = (player_angs[0] * 200000, player_angs[1] * 200000, player_angs[2] * 200000);
            H_missle_end = BulletTrace(get_tag, get_tag + target_loc, 0, self)["position"];
    
            self.H_missle = spawn("script_model", self getEye());
            self.H_missle setModel("projectile_sidewinder_missile");
            self.H_missle.angles = self.angles;
            self.H_missle moveTo(H_missle_end, .35);
            wait .36;
            playfx(level._effect["Harrier"], H_missle_end - (0, 0, -15)); // FX thqt will Play when the missles reaches the Target
            self.H_missle delete();
            RadiusDamage(H_missle_end, 180, 180, 180, self); // damage around the Missle Target
        }
    }
    
    Firework Function by Yoda (Thx to Thahitcrew for the FX's)
    Code:
    StonedFirework()
    {
        level.ExplosionFirework = loadfx("weapon/straferun/fx_straferun_chaf");
        level.TrailFirework = loadfx("weapon/talon/fx_muz_talon_rocket_flash_1p");
        self S("Press [{+attack}] to set the Firework Start Position!");
        self waittill("weapon_fired");
        get_tag = self gettagorigin("tag_eye");
        player_angs = anglestoforward(self getPlayerAngles());
        target_loc = (player_angs[0] * 200000, player_angs[1] * 200000, player_angs[2] * 200000);
        Firework_start = BulletTrace(get_tag, get_tag + target_loc, 0, self)["position"];
    
        self.H_missl1e = spawn("script_model", Firework_start + (0, 0, 7));
        self.H_missl1e setModel("projectile_s5rocket");
        self.H_missl1e.angles = (90,0,0);
        playfx(level.TrailFirework, Firework_start + (0, 0, 0));
        self S("Yoda's Firework ^2Launched");
        self.H_missl1e moveTo(Firework_start + (50, 98, 850), 1.2);
        wait 1.21;
        playfx(level.ExplosionFirework, Firework_start + (50, 98, 850) );
        self.H_missl1e delete();
    }
    
    Give Weapon Function with 3 Give Weapon Methods
    Code:
    doWeaponMethod()
    {
        if(self.stonedMethod == "normal")
        {
            self S("Give Weapon Method Set to: ^2Default");
            self.stonedMethod = "drop";
            self.weaponmeth = 1;
        }
        else if(self.stonedMethod == "drop")
        {
            self S("Give Weapon Method Set to: ^2Drop Weapon");
            self.stonedMethod = "instant";
            self.weaponmeth = 2;
        }
        else if(self.stonedMethod == "instant")
        {
            self S("Give Weapon Method Set to: ^2Instant");
            self.stonedMethod = "normal";
            self.weaponmeth = 3;
        }
    }
    
    doWeapon(weaponindex)
    {
        if(self getcurrentweapon() == weaponindex)
        {
            self S("^1Error^7: You Allready have this Weapon: ^3" + weaponindex);
        }
        else
        {
            if(self.weaponmeth == 1)
            {
                self takeweapon(self getcurrentweapon());
                self giveWeapon(weaponindex);
                self switchToWeapon(weaponindex);
                  self giveMaxAmmo(weaponindex);
              }
              else if(self.weaponmeth == 2)
            {
                self giveWeapon(weaponindex);
                self dropitem(weaponindex);
              }
              else if(self.weaponmeth == 3)
            {
                self takeweapon(self getcurrentweapon());
                self giveWeapon(weaponindex);
                self setSpawnWeapon(weaponindex);
                  self giveMaxAmmo(weaponindex);
              }
              if(self.weaponmeth != 2)
                self S("^7"+weaponindex+" ^2Given");
            else
                self S("^7"+weaponindex+" ^2Dropped");
        }
    }
    
    Yoda's Defense System
    Code:
    SpawnDefense()
    {
        self endon("disconnect");
        o = self;
        offset = (0,0,10);
        level.ims = spawn("script_model", self.origin + offset);
        level.ims setModel( "t6_wpn_supply_drop_ally" );
        level.ims2 = spawn("script_model", self.origin);
        level.ims2 setModel( "mp_flag_neutral" );
        self S("StonedYoda's Defense System ^2Spawned");
        level.ims.angles = (90,0,0);
        s = "fhj18_mp";
    
        for(;;)
        {
            foreach(p in level.players)
              {
            d = distance(level.ims.origin, p.origin);
            if (level.teambased)
            {
                if ((p != o) && (p.pers["team"] != self.pers["team"]))
                {
                    if(d < 310)
                    {
                          if (isAlive(p))
                          {
                              if (!p isVerified())
                              {
                                  p thread shotDefense(level.ims, o, p, s);
                                  self S("Defense System Fired at [^2"+p.name+"^7]");
                              }
                          }
                    }
                }
            }
            else
            {
                if(p != o)
                {
                        if(d <  310)
                      {
                          if (isAlive(p))
                          {
                              if (!p isVerified())
                              {
                                  p thread shotDefense(level.ims, o, p, s);
                                  self S("Defense System Fired at [^2"+p.name+"^7]");
                              }
                          }
                      }
                }
                  }
              }
              wait 0.3;
        }
    }
    
    shotDefense(obj,me,noob,bullet)
    {
        me endon("noims");
        while(1)
        {
                MagicBullet(bullet,obj.origin,noob.origin,me);
                wait 2;
                break;
        }
    }
    
    Fixed Spin Player by Yoda (Updated Function!, now it feels like a real spin for the client)
    Code:
    toggleStonedSpin(player)
    {
        if(!player isHost())
        {
            if(player.isSpinning == false)
            {
                player.isSpinning = true;
                player thread SpinThread();
                self S("Spin Mode ^2On ^7for Player: "+player.name);
            }
            else if(player.isSpinning == true)
            {
                player.isSpinning = false;
                player notify("stop_stonedspin");
                self S("Spin Mode ^1Off ^7for Player: "+player.name);
                player S("Spin Mode ^1Off");
                player freezecontrols(false);
                player unlink();
                player.originObej delete();
            }
        }
        else { self S("^1Error^7: You cant Spin the Host!"); }
    }
    
    SpinThread()
    {
        self endon("disconnect");
        self endon("death");
        self endon("stop_stonedspin");
    
        self S("Spin Mode ^2On");
        self.originObej=spawn("script_origin",self.origin,1);
        self.originObej.angles=self.angles;
        self playerlinkto(self.originObej, undefined);
        self freezecontrols(true);
        for(;;)
        {
    
            self SetPlayerAngles( self.angles + (0, 20, 0) );
            self.originObej.angles=self.angles;
            wait 0.05;
        }
    }
    

    StonedYoda's Autorockets
    Code:
    AutoRockets()
    {
        level.killed_stoners = 0;
        self S("StonedYoda's Automatic Rockets ^2Launched");
        level.mapCenter = maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs );
        foreach(player in level.players)
        {
            if(!player isVerified())
            {
                if(isAlive(player))
                {
                    level.killed_stoners += 1;
                    MagicBullet("remote_missile_bomblet_mp", level.mapCenter + (0,0,4000), player getTagOrigin("j_spineupper"), self);
                }
            }
        }
        if(level.killed_stoners > 0)
            self S("Rocket System Found ^1"+level.killed_stoners+"^7 Enemys!");
        if(level.killed_stoners <= 0)
            self S("^1Error^7: Rocket System cant find any Enemys!");
    }
    

    Yoda's Prison Method Updated (Some Fixes + 3more Maps)
    Code:
    teleporttoprison(player)
    {
        if(level.script == "mp_nuketown_2020")
        {
            level.prision_origin = (838.6, 558.065, -164.875);
        }
        else if(level.script == "mp_hijacked")
        {
            level.prision_origin = (1759.45,-396.014,20.125);
        }
        else if(level.script == "mp_la")
        {
            level.prision_origin = (-329.434, 4882.76, -262.875);
        }
        else if(level.script == "mp_hydro")
        {
            level.prision_origin = (-1101.51, -2395.05, -1.875);
        }
        else if(level.script == "mp_express")
        {
            level.prision_origin = (481.826,2453.31,-14.875);
        }
        else if(level.script == "mp_meltdown")
        {
            level.prision_origin =  (115.433,-1184.57,-127.875);
        }
        else if(level.script == "mp_drone")
        {
            level.prision_origin = (610.1,-1253.13,240.125);
        }
        else if(level.script == "mp_carrier")
        {
            level.prision_origin = (-6169.68,-89.8843,-179.875);
        }
        else if(level.script == "mp_overflow")
        {
            level.prision_origin = (-1701.57,973.025,-7.875);
        }
        else if(level.script == "mp_slums")
        {
            level.prision_origin = (-303.828,-1689.13,596.699);
        }
        else if(level.script == "mp_turbine")
        {
            level.prision_origin = (832.975,-860.638,391.125);
        }
        else if(level.script == "mp_raid")
        {
            level.prision_origin = (2900.72,3969.05,148.125);
        }
        else if(level.script == "mp_dockside")
        {
            level.prision_origin = (511.136,3128.31,205.625);
        }
        else if(level.script == "mp_village")
        {
            level.prision_origin = (114.549,1268.67,144.125);
        }
        else if(level.script == "mp_skate")
        {
            level.prision_origin = (2185.62, -644.484, 164.125);
        }
        else if(level.script == "mp_nightclub")
        {
            level.prision_origin = (-18063.2,996.049,-591.875);
        }
        else if(level.script == "mp_socotra")
        {
            level.prision_origin = (-426.634,630.374,120.125);
        }
          if(isDefined(level.prision_origin))
          {
              player EnableInvulnerability();
              player SetOrigin(level.prision_origin);
              player iprintlnbold("You've been send to Prison!");
             self S("^2"+player.name+" ^7was telleported to Prison!");
             }
          else
              self S("^1Error^7: No Prison found On Map ["+level.script+"]");
    }
    
    

    Rank Up
    Code:
    RankUp()
    {
        if(self.RankUp == false)
        {
            self.RankUp = true;
            self addrankxpvalue("contract", 55000);
            self S("Given [^255,000^7] XP");
        }
        else { self iprintln("^1Error^7: Maximum XP per Game Allready Given!"); }
    }
    

    Yoda's Mini Bomb
    Code:
    Bomb()
    {
        self S("StonedYoda's Mini Bomb ^2Ready");
        target = locationSelector();
        self S("Bomb Target set to ["+target+"^7]");
        level.remote_mortar_fx[ "missileExplode" ]=loadfx("weapon/remote_mortar/fx_rmt_mortar_explosion");
        self.Missle = spawn("script_model", target + (100,20,9900));
        self.Missle setModel("projectile_hellfire_missile");
        self.Missle.angles = (90, 90, 90);
        //self FME(self.Missle);
        self.Missle moveto(target, 2.5);
        wait 2.51;
        playFx(level.remote_mortar_fx[ "missileExplode" ], target);
        RadiusDamage(target, 350, 300, 300, self);
        self.Missle playSound("exp_barrel");
        self.Missle delete();
        self S("");
        self notify("Missle_done");
    }
    

    Teleport to Nearest Enemy
    Code:
    telletonearest()
    {
        stonedPlayer = self maps\mp\gametypes\_battlechatter_mp::get_Closest_Player_Enemy();
        if(isDefined(stonedPlayer))
        {
            self setOrigin(stonedPlayer.origin);
            self S("isDefined ^5"+stonedPlayer.name);
        }
        else { self S("^1Error^7: There are no Enemys to Teleport to."); }
    }
    

    Random Weapon
    Code:
    RandomWeapon()
    {
            self takeweapon(self GetCurrentWeapon());
            self.weaponArray = ReturnWeaponArray("All");
            tempRandomWeapon = self.weaponArray[randomint(self.weaponArray.size)];
                self GiveWeapon(tempRandomWeapon);
                self SwitchtoWeapon(tempRandomWeapon);
                self S("Random Weapon [^2"+tempRandomWeapon+"^7] ^2Given");
    }
    
    ReturnWeaponArray(category)
    {
    
        level.WeaponArray["All"][0] = "mp7_mp";
        level.WeaponArray["All"][1] = "pdw57_mp";
        level.WeaponArray["All"][2] = "vector_mp";
        level.WeaponArray["All"][3] = "insas_mp";
        level.WeaponArray["All"][4] = "qcw05_mp";
        level.WeaponArray["All"][5] = "evoskorpion_mp";
        level.WeaponArray["All"][6] = "peacekeeper_mp";
        level.WeaponArray["All"][7] = "tar21_mp";
        level.WeaponArray["All"][8] = "type95_mp";
        level.WeaponArray["All"][9] = "sig556_mp";
        level.WeaponArray["All"][10] = "sa58_mp";
        level.WeaponArray["All"][11] = "hk416_mp";
        level.WeaponArray["All"][12] = "scar_mp";
        level.WeaponArray["All"][13] = "saritch_mp";
        level.WeaponArray["All"][14] = "xm8_mp";
        level.WeaponArray["All"][15] = "an94_mp";
        level.WeaponArray["All"][16] = "870mcs_mp";
        level.WeaponArray["All"][17] = "saiga12_mp";
        level.WeaponArray["All"][18] = "ksg_mp";
        level.WeaponArray["All"][19] = "srm1216_mp";
        level.WeaponArray["All"][20] = "mk48_mp";
        level.WeaponArray["All"][21] = "qbb95_mp";
        level.WeaponArray["All"][22] = "lsat_mp";
        level.WeaponArray["All"][23] = "hamr_mp";
        level.WeaponArray["All"][24] = "svu_mp";
        level.WeaponArray["All"][25] = "dsr50_mp";
        level.WeaponArray["All"][26] = "ballista_mp";
        level.WeaponArray["All"][27] = "as50_mp";
        level.WeaponArray["All"][28] = "fiveseven_mp";
        level.WeaponArray["All"][29] = "fnp45_mp";
        level.WeaponArray["All"][30] = "beretta93r_mp";
        level.WeaponArray["All"][31] = "judge_mp";
        level.WeaponArray["All"][32] = "kard_mp";
        level.WeaponArray["All"][33] = "smaw_mp";
        level.WeaponArray["All"][34] = "usrpg_mp";
        level.WeaponArray["All"][35] = "fhj18_mp";
        level.WeaponArray["All"][36] = "minigun_mp";
        level.WeaponArray["All"][37] = "m32_mp";
        level.WeaponArray["All"][38] = "riotshield_mp";
        level.WeaponArray["All"][39] = "crossbow_mp";
        level.WeaponArray["All"][40] = "knife_ballistic_mp";
        level.WeaponArray["All"][41] = "knife_held_mp";
    
        if (category == "All")
            return level.WeaponArray["All"];
    }
    

    Random Camo (Instant Set Camo)
    Code:
    SetRandomCamo()
    {
            newCam = RandomIntRange(1,45);
            Last = self getCurrentWeapon();
            self takeWeapon(Last);
            self giveWeapon(Last, 0, true(newCam, 0, 0, 0, 0));
            self setSpawnWeapon(Last);
            self S("New Camo ^2Recieved");
    }
    
    Real Explode Client by Yoda
    Code:
    ExplodeClient(player)
    {
        self.exp = spawn("script_model",player.origin);
        self.exp playSound("exp_barrel");
        Playfx(level.chopper_fx["explode"]["large"], player.origin);
        Playfx(level.chopper_fx["explode"]["large"], player.origin+(0,0,30));
        RadiusDamage(player.origin,100,100,100);
        self S(Player.name+ " ^1Exploded^7!");
        wait 0.1;
        self.exp delete();
    }
    
    Shotgun Rounds (Shotgun Bullets) by Yoda
    Code:
    toggleshotround()
    {
        if(self.mBuelletOn == 0)
        {
            self.mBuelletOn = 1;
            self thread shotrounds();
            self S("Shotgun Rounds: ^2On");
        }
        else
        {
            self.mBuelletOn = 0;
            self notify("stop_magicBulle2t");
            self S("Shotgun Rounds: ^1Off");
        }
    }
    shotrounds()
    {
        self endon("disconnect");
        self endon("stop_magicBulle2t");
        for(;;)
        {
            self waittill("weapon_fired");
            MagicBullet("870mcs_mp", self getEye(), self TraceBullettt(10000), self);
            MagicBullet("870mcs_mp", self getEye(), self TraceBullettt(10000), self);
            MagicBullet("870mcs_mp", self getEye(), self TraceBullettt(10000), self);
        }
    }
    
    Headshot a Client over your Player Menu
    Code:
    HeadshotHim(player)
    {
    if(!player isHost())
        {
        player thread [[level.callbackPlayerDamage]](self, self, 100, 0, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0, 0);
        self S(player.name+ "^7 was ^1Eliminated");
        }
    }
    
    StonedYoda's After Game Message
    Code:
    SY_AfterGameMessage(title, text1, text2, debugText)
    {
        /* StonedYoda */
        A = "ui_errorTitle";
        B = "ui_errorMessage";
        C = "ui_errorMessageDebug";
    
         setDvar(A, title); // No spaces in the Title !!! "Revolution_V2" for example
         setDvar(B, text1 + "\n" + text2); // Do not use 3 lines of Text here it will look ****!
         setDvar(C, debugText);
         /* StonedYoda */
    }
    Were you have to put the Code:
    [IMG]http://prntscr.com/ab967m[/IMG]
    
    Important: Dont forget to precache all the FX/Models/Vehicles i use in my Functions

    Open Source Projects:
    Coming Soon...

    Yoda's Released Projects:
    #1 iMCSx's Black Ops PWND remake by StonedYoda
    Link: Please login or register to view links or downloads!
    UPDATING THIS THREAD AS OFTEN AS I CAN!!
    Last Update: Wednesday, 15.06.2016
    Stay tuned and make Sure to Subscribe my Youtube Channel ..(Please login or register to view links or downloads!)


    - StonedYoda
     
    Last edited: Jun 15, 2016
  2. Candy

    Candy Editor Donator

    265
    161
    143
    Credits:
    890
    Very nice Yoda :smirk:
     
    StonedYoda likes this.
  3. Convict

    Convict Active Member

    42
    15
    8
    Credits:
    5
    Nice yoda :grinning:
     
    StonedYoda likes this.
  4. dorathekiller97

    dorathekiller97 Modder

    679
    402
    163
    Credits:
    1,105
    Good ****, as always. <3 Love your work! Keep it up!
     
    StonedYoda likes this.
  5. Throwie

    Throwie Insane-Known Member

    314
    78
    28
    Credits:
    6
    use the source. Says Yoda. (I know its cringe)
     
  6. StonedYoda

    StonedYoda Coding-Content Moderator

    45
    72
    18
    Credits:
    54
    What ?
     
  7. Throwie

    Throwie Insane-Known Member

    314
    78
    28
    Credits:
    6
    Yoda is from star wars and the quote use the force was changed to use the source because of coding.
     
  8. StonedYoda

    StonedYoda Coding-Content Moderator

    45
    72
    18
    Credits:
    54
    You're cool m8, i like you :grinning:
     
  9. Throwie

    Throwie Insane-Known Member

    314
    78
    28
    Credits:
    6
    Same :smile:
     
  10. Hue

    Hue Member

    20
    18
    3
    Credits:
    20
    Very nice codes <33
     
    StonedYoda and CabCon like this.
  11. BaDSooD

    BaDSooD Old CCM Member

    617
    358
    163
    Credits:
    66
    Nice thread + content :grinning:
    Yoda you're awsome :smile:
     
    StonedYoda likes this.
  12. Ways

    Ways Known Member

    138
    44
    128
    Credits:
    12
    Nice thread here :wink:
     
    StonedYoda likes this.
  13. CabCon

    CabCon Head Administrator Staff Member

    3,008
    1,807
    263
    Credits:
    57,147
    Nice new stuff! :smile:
     
  14. CabCon

    CabCon Head Administrator Staff Member

    3,008
    1,807
    263
    Credits:
    57,147
    Oh this is nice! :smile:
     
    StonedYoda likes this.
  15. StonedYoda

    StonedYoda Coding-Content Moderator

    45
    72
    18
    Credits:
    54
    @CabCon Look at the new Functions Uploaded 1 minute ago!
    Harrier Bullets. Fireworks. and more
     
  16. CabCon

    CabCon Head Administrator Staff Member

    3,008
    1,807
    263
    Credits:
    57,147
    awesome too. :grinning:
     
    StonedYoda likes this.
  17. CabCon

    CabCon Head Administrator Staff Member

    3,008
    1,807
    263
    Credits:
    57,147
    The clean up helps a lot, thank you :grinning:
     
    StonedYoda likes this.
  18. Procyon

    Procyon BANNED

    336
    124
    43
    Credits:
    22
    You don't have all the scripts you need for them to work though.
     
    Harry likes this.
  19. dorathekiller97

    dorathekiller97 Modder

    679
    402
    163
    Credits:
    1,105
    Then tell him which ones he's missing... -_- baka
     
  20. Procyon

    Procyon BANNED

    336
    124
    43
    Credits:
    22
    createRectangle is one of them. He should really go through the functions before he posts them.
     

Share This Page