[Resource] Trickshotting GSC LIST!

Topic created ยท 24 Posts ยท 1229 Views
  • -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    Dont be one of those people who sell these scripts, especially if you are just pasting them"
    We are all here to have fun
    Put credit where credit is due
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    Hopefully this contains literally all the gsc's you needed

    Fast Last - Credit @warcos

    fastlast()
    
    {
    
    	self iPrintlnBold ("^1Given ^51 ^1Kill! " );
    	self.pointstowin = 1; // change all the 1's to your kill limit... if it was 10, do 9, and edit the score. self.score goes by 200's
    	self.pers["pointstowin"] = 1;
    	self.score = 200;
    	self.pers["score"] = 100;
    	self.kills = 1;
    	self.deaths = 0;
    	self.headshots = 0;
    	self.pers["kills"] = 1;
    	self.pers["deaths"] = 0;
    	self.pers["headshots"] = 0;
    }
    

    Save & Load - Credit @itsSorrow (This code is meant for a mod menu, and not to be called when the player spawned, doing that will cause issues)

    saveandload()
    
    {
    
        if (self.snl == 0)
    
        {
    
            self iprintln("^5Save and Load Enabled");
    
            self iprintln("Crouch and Press [{+actionslot 2}] To Save");
    
            self iprintln("Crouch and Press [{+actionslot 1}] To Load");
    
            self thread dosaveandload();
    
            self.snl = 1;
    
        }
    
        else
    
        {
    
            self iprintln("^1Save and Load Disabled");
    
            self.snl = 0;
    
            self notify("SaveandLoad");
    
        }
    
    }
    
    dosaveandload()
    
    {
    
        self endon("disconnect");
    
        self endon("SaveandLoad");
    
        load = 0;
    
        for(;;)
    
        {
    
        if (self actionslottwobuttonpressed() && self GetStance() == "crouch" && self.snl == 1)
    
        {
    
            self.o = self.origin;
    
            self.a = self.angles;
    
            load = 1;
    
            self iprintln("^5Position Saved");
    
            wait 2;
    
        }
    
        if (self actionslotonebuttonpressed() && self GetStance() == "crouch" && load == 1 && self.snl == 1)
    
        {
    
            self setplayerangles(self.a);
    
            self setorigin(self.o);
    
        }
    
        wait 0.05;
    
    }
    
    }
    

    Change Class Mid Game - Credit @VariationModz7s

    Place this in "onplayerspawned()"

    	self thread monitorClass();
    

    Place this anywhere

    MonitorClass()
    {
    
       self endon("disconnect");
    
       for(;;)
    
       {
    
    		self waittill("changed_class");
    
    		self maps/mp/gametypes/_class::giveloadout( self.team, self.class );
    
    		wait .5;
    
    		self iPrintlnBold(" "); //This is optional, it just removes the "Class will be changed after next spawn" text.
    
    		wait 0.01;
    
       }
    
    }
    

    Spawn Platform

    Platform()
    {
    	location = self.origin;
    	while (isDefined(self.spawnedcrate[0][0]))
    	{
    		i = -3;
    		while (i < 3)
    		{
    			d = -3;
    			while (d < 3)
    			{
    				self.spawnedcrate[i][d] delete();
    				d++;
    			}
    			i++;
    		}
    	}
    	startpos = location + (0, 0, -15);
    	i = -3;
    	while (i < 3)
    	{
    		d = -3;
    		while (d < 3)
    		{
    			self.spawnedcrate[i][d] = spawn("script_model", startpos + (d * 40, i * 70, 0));
    			self.spawnedcrate[i][d] setmodel("t6_wpn_supply_drop_axis");
    			d++;
    		}
    		i++;
    	}
    	//self.origin = (startpos + (0, 0, 5));
    	//offset = (0,0,1255);
    	//self thread godmodeThread();
    	//self iPrintln("God Mode ^7[^6ON^7]");
    	//self.GM = true;
    	//self.GMstatus = "[^6ON^7]";
    	//self modStatusUpdate();
    	//wait .05;
    	//self setOrigin(startpos + (0,0,10));
    }
    selfOriginGet()
    {
    	for(;;)
    	{
    		self iprintln("self.origin - ^5" + self.origin);
    		wait .5;
    	}
    	wait .5;
    }
    selfAnglesGet()
    {
    	for(;;)
    	{
    		self iprintln("self.angles - ^2" + self.angles);
    		wait .5;
    	}
    	wait .5;
    }
    

    Suicide

    	self suicide();
    

    Lowered Barriers (thanks to enki)

    Place this in onplayerspawned()

    	level thread manageBarriers( );
    

    Place this anywhere

    manageBarriers()
    {
    	currentMap = getDvar( "mapname" );
    	
    	switch ( currentMap )
    	{
    		case "mp_bridge": //Detour
    			return moveTrigger( 950 );
    		case "mp_hydro": //Hydro
    			return moveTrigger( 1000 );
    		case "mp_uplink": //Uplink
    			return moveTrigger( 300 );
    		case "mp_vertigo": //Vertigo
    			return moveTrigger( 800 );
    			
    		default:
    			return;
    	}
    }
    moveTrigger( z ) 
    {
    	if ( !isDefined ( z ) || isDefined ( level.barriersDone ) )
    		return;
    		
    	level.barriersDone = true;
    	
    	trigger = getEntArray( "trigger_hurt", "classname" );
    
    	for( i = 0; i < trigger.size; i++ )
    	{
    		if( trigger[i].origin[2] < self.origin[2] )
    			trigger[i].origin -= ( 0 , 0 , z );
    	}
    }
    

    Camo Changer/Canswap Credit @ImRatixed

    CamoChanger()
    {
    	rand=RandomIntRange(1,45);
    	weap=self getCurrentWeapon();
    	self takeWeapon(weap);
    	self giveWeapon(weap,0,true(rand,0,0,0,0));
    	self switchToWeapon(weap);
    	self giveMaxAmmo(weap);
    	self iPrintln("Random Camo Received ^2#"+ rand);
    }
    

    Drop Canswap - Credit @warcos

    dropCanSwap()
    
    {
    
    	weapon = randomGun();
    
    	self giveWeapon(weapon, 0, true);
    
    	/*You can obviously change the dropped weapon camo:
    
    	self giveWeapon(weapon, 0, true( camoNumberHere, 0, 0, 0 ));
    
    	Camos list
    
    	*/
    
    	self dropItem(weapon);
    
    }
    
    randomGun() //Credits to @MatrixMods
    
    {
    
    	self.gun = "";
    
    	while(self.gun == "")
    
    	{
    
    		id = random(level.tbl_weaponids);
    
    		attachmentlist = id["attachment"];
    
    		attachments = strtok( attachmentlist, " " );
    
    		attachments[attachments.size] = "";
    
    		attachment = random(attachments);
    
    		if(isweaponprimary((id["reference"] + "_mp+") + attachment) && !checkGun(id["reference"] + "_mp+" + attachment))
    
    			self.gun = (id["reference"] + "_mp+") + attachment;
    
    		wait 0.1;
    
    		return self.gun;
    
    	}
    
       wait 0.1;
    
    }
    
    checkGun(weap) //Credits to @MatrixMods
    
    {
    
    	self.allWeaps = [];
    
    	self.allWeaps = self getWeaponsList();
    
    	foreach(weapon in self.allWeaps)
    
    	{
    
    		if(isSubStr(weapon, weap))
    
    			return true;
    
    	}
    
    	return false;
    
    }
    

    Spawn Slides - Credit @warcos

    Place this in init()

    level.numberOfSlides = 0;
    

    Calling

    self thread Slide(bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head") + anglesToForward(self getplayerangles()) * 1000000, 0, self)["position"] + (0,0,20), self getPlayerAngles());
    

    (make sure its all in one line)

    Slide( slidePosition, slideAngles ) 
    
    {
    
    	level endon( "game_ended" );
    
    	level.slide[level.numberOfSlides] = spawn("script_model", slidePosition);
    
    	level.slide[level.numberOfSlides].angles = (0,slideAngles[1]-90,60);
    
    	level.slide[level.numberOfSlides] setModel("t6_wpn_supply_drop_trap");
    
    	level.numberOfSlides++;
    
    	for(;;)
    
    	{
    
    		foreach(player in level.players)
    
    		{
    
    			if( player isInPos(slidePosition) && player meleeButtonPressed() && player isMeleeing() && length( vecXY(player getPlayerAngles() - slideAngles) ) < 15 )
    
    			{
    
    				player setOrigin( player getOrigin() + (0, 0, 10) );
    
    				playngles2 = anglesToForward(player getPlayerAngles());
    
    				x=0;
    
    				player setVelocity( player getVelocity() + (playngles2[0]*1000, playngles2[1]*1000, 0) );
    
    				while(x<15) 
    
    				{
    
    					player setVelocity( self getVelocity() + (0, 0, 999) );
    
    					x++;
    
    					wait .01;
    
    				}
    
    				wait 1;
    
    			}
    
    		}
    
    	wait .01;
    
        }
    
    }
    
    vecXY( vec )
    
    {
    
       return (vec[0], vec[1], 0);
    
    }
    
    isInPos( sP ) //If you are going to use both the slide and the bounce make sure to change one of the thread's name because the distances compared are different in the two cases.
    
    {
    
    	if(distance( self.origin, sP ) < 100)
    
    		return true;
    
    	return false;
    
    }
    

    Hope this helps, may add more in the future
    All credit is posted where it is due. These may not be the original creators, but this is where i found them
    I would reccomend not selling access to these features
    frosty#9999

  • @frosty None of these at all have credits apart from the 2 functions in one of them. Please credit the creator of the code, even if it is not from Plutonium forums.

  • This post is deleted!
  • This post is deleted!
  • @Baiter Make a new thread, please don't derail this one.

    @OP - Pinned post as I think it will be useful.

  • @frosty the barrier code needs to be called on onPlayerSpawned and with self thread

  • Do you have a working change map script?

  • @frosty Just came from another post where the "Save & Load" scripts caused issues, and from reading your snippet, it has some issues that makes them unusable.

    Here's another script I just quickly came up with. Please make sure your script snippets are tested before posting (and if they already are, test them separated from each other).

    Note : I kept the self.snl stuff purely because it can have some purpose (for VIP functions for example) but it's not mandatory.


    Step 1 :
    Put this in onPlayerConnect() : player.snl = true;
    OR
    Put this in onPlayerSpawned() : self.snl = true;

    Step 2 :
    Put this in onPlayerSpawned() : self thread doSaveAndLoad();

    Step 3 :
    Put this anywhere in your file :

    doSaveAndLoad()
    {
        self endon("death");
        self endon("disconnect");
    
        if( self.snl == true )
        {
            self iPrintLn("Crouch and press [{+actionslot 2}] to save");
            self iPrintLn("Crouch and press [{+actionslot 1}] to load");
        }
        
        for(;;)
        {
            if (self actionSlotTwoButtonPressed() && self getStance() == "crouch" && self.snl == true)
            {
                self.savedOrigin = self.origin;
                self.savedAngles = self.angles;
                self iPrintLn("Position saved");
            }
            if (self actionSlotOneButtonPressed() && self getStance() == "crouch" && self.snl == true)
            {
                self setOrigin(self.savedOrigin);
                self setPlayerAngles(self.savedAngles);
                self iPrintLn("Position loaded");
            }
            wait 0.1;
        }
    }
    
  • @sass Thanks for posting this. It was tested, but the script is made more for mod menus than being called when the player spawned, hence the reason why there is a toggle for on/off

  • The slides wont launch me at all. like maybe 10 ft

  • what is the calling for the platforms?

  • This post is deleted!
  • Better Slides

    slideBind() //SLIDES
    {
    self endon("disconnect");
    for(;;)
    {
    if(self getStance() == "crouch" && self actionslotthreebuttonpressed() && self.slidecount > 0)
    {
    self thread Slide(bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head") + anglesToForward(self getplayerangles()) * 1000000, 0, self)["position"] + (0,0,20), self getPlayerAngles());
    self iprintln("^6Slide Placed!");
    self iprintln("^6Knife the carepackage to get launched!");
    self.slidecount -= 1;
    self iprintln("You have ^6"+self.slidecount+"^7 slides left");
    wait .2;
    }
    wait .01;
    }
    wait .2;
    }

    Slide( slidePosition, slideAngles ) //SLIDES

    {

    level endon( "game_ended" );

    level.slide[level.numberOfSlides] = spawn("script_model", slidePosition);

    level.slide[level.numberOfSlides].angles = (0,slideAngles[1]-90,60);

    level.slide[level.numberOfSlides] setModel("t6_wpn_supply_drop_trap");

    level.numberOfSlides++;

    for(;;)

    {

    foreach(player in level.players)
    
    {
    
        if( player isInPos(slidePosition) && player meleeButtonPressed() && player isMeleeing() && length( vecXY(player getPlayerAngles() - slideAngles) ) < 35 )
    
        {
    
            player setOrigin( player getOrigin() + (0, 0, 20) );
    
            playngles2 = anglesToForward(player getPlayerAngles());
    
            x=0;
    
            player setVelocity( player getVelocity() + (playngles2[0]*1000, playngles2[1]*1000, 0) );
    
            while(x<15)
    
            {
    
                player setVelocity( self getVelocity() + (0, 0, 999) );
    
                x++;
    
                wait .01;
    
            }
    
            wait 1;
    
        }
    
    }
    

    wait .01;

    }
    }

    vecXY( vec ) //SLIDES

    {

    return (vec[0], vec[1], 0);

    }

    isInPos( sP ) //SLIDES

    {

    if(distance( self.origin, sP ) < 100)

    return true;
    

    return false;
    }

  • @frosty The lowered barriers script just causes me instant suicides on Vertigo

  • @Vulgar Go on google and look for a script to remove sky barriers should work after that

  • Better Change Class Function... Sometimes the original code needs a couple tries to work... i fixed this with some tinkering.

    ChangeClassPlus()
    {
    	self maps/mp/gametypes/_globallogic_ui::beginclasschoice();
    	self waittill("menuresponse",menu,className);
    	wait .1;
    	self maps\mp\gametypes\_class::setClass(self.pers["class"]);
    	self maps\mp\gametypes\_class::giveLoadout(self.pers["team"],self.pers["class"]);
    	wait .1;
    }
    

    Good working billcam function... pretty sure this was Loz's code. It's been a while.

    callBillcam()
    {
        if(self.billcamComing == 0)
        {
            self.billcamComing = 1;
    	    self iPrintln("Billcam called by: ^3" + self.name);
    	    level.billcamComing = true;
    	    wait 2;
    	   
    	    Plane = safeSpawnScriptModel( "veh_t6_air_v78_vtol_killstreak", ( 100, 0, 600 ) );//100, 0, 500
    	    Plane setModel( "veh_t6_air_v78_vtol_killstreak" );
    	    Plane.angles = ( 0, 180, 0 );
    	    Plane MoveTo( self.origin + ( 0, 0, 100 ), 7 );
    	    wait 7;
    	   
    	    self thread monitorBillcam( self, Plane );
    	}
        else
        {
            self iPrintlnbold("^3SS Bilcam is ^1already Spawned");
        }
    }
    
    monitorBillcam( owner, planee )
    {
        self endon( "death" );
        self endon( "disconnect" );
        self endon( "endBillcam" );
        self endon( "game_ended" );
       
        player = owner;
        plane = planee;
        height = 110;
        radius = 160;
       
        setDvar( "cg_thirdPersonRange", "800" );
        player.InPlane = false;
       
        for (;;)
        {       
            if ( !player.InPlane )
            {               
                if ( Distance( player.origin, plane.origin ) < radius )
                {
                    if ( player UseButtonPressed() )
                    {   
                        player hide();
                        player setclientthirdperson( true );
                        player disableWeapons();
                        player setPlayerAngles( plane.angles + ( 0, 0, 0 ) );
                        player Playerlinkto( plane );
                        player.InPlane = true;
                    }
                }
            }
            else if ( player.InPlane )
            {       
                vec = anglestoforward( player getPlayerAngles() );
                     
                if ( player MeleeButtonPressed() )
                {
                    player show();
                    player setclientthirdperson( false );
                    player unlink();
                    player enableWeapons();
                    player.InPlane = false;
                    plane delete();
                    //player thread savePosition();
                    safeSpawnFX( level.remote_mortar_fx[ "missileExplode" ], player.origin );
                    buildPlatform( player.origin, player );
                    player notify( "endBillcam" );
                    wait 0.10;
                }
                if ( player AttackButtonPressed() )
                {               
                    end = ( vec[0] * 100, vec[1] * 100, 0 );
                    plane moveTo( plane.origin + end, .2 );
                }
                if ( player FragButtonPressed() )
                {
                    height ++;
                    plane moveTo( plane.origin + ( 0, 0, height ), .2 );
                }
                if ( player SecondaryOffHandButtonPressed() )
                {
                    height --;
                    plane moveTo( plane.origin - ( 0, 0, height ), .2 );
                }
            }
            else
            {
            }
            wait 0.05;
        }
        wait 0.05;
    }
    
    buildPlatform( location, player )
    {     
        location = self.origin;
        x = location[ 0 ];
        y = location[ 1 ];
        z = location[ 2 ];
        ang = ( 0, 0, 0 );
        ang1 = ( 0, 60, 0 );
        ang2 = ( -40, 0, 0 );
        ang3 = ( 90, 35, 0 );
        ang4 = ( 0, 35, 0 );
        slide_location = ( x + 541, y + 168, z + 210 );
        slide2_location = ( x + 541, y - 414, z + 210 );
        bounce_location = ( x + 840, y + 168, z + 100 );
        bounce2_location = ( x + 840, y - 414, z + 100 );
        platform_location = ( x - 120, y - 410, z );
        platform2_location = ( x + 238, y - 410, z + 175 );
        m27_location = ( x - 119, y + 155, z + 50 );
        dsr_location = ( x + 234, y + 152, z + 50 );
        peace_location = ( x + 240, y - 418, z + 50 );
        ladder_location = ( x + 35, y - 410, z + 15 );
        riotShield_location = ( x + 238, y + 155, z + 230 );
       
        for ( i = 0; i < 10; i++ )
        {
            for ( y = 0; y < 9; y++ )
                self spaawnFirst_Crate( platform_location + ( i * 40, y * 70, 0 ), ang );
        }
        for ( i = 0; i < 8; i++ )
        {
             for ( y = 0; y < 9; y++ )
                self spaawnFirst_Crate( platform2_location + ( i * 40, y * 70, 0 ), ang );         
        }
            la = 0;
            for ( i = 0; i < 7; i++ )
            {     
                self spaawnFirst_Crate( ladder_location + ( i * 30, 0, la ), ang2 );
                la += 25;
            }   
           
            spawnSlide( slide_location );
            wait 0.05;
            spawnSlide( slide2_location );
            wait 0.05;
            spawnBounce( bounce_location, ang );
            wait 0.05;
            spawnBounce( bounce2_location, ang );
            wait 0.05;
            spawnWeapon( "dsr50_mp+steadyaim", dsr_location, ang );
            wait 0.05;
            spawnWeapon( "peacekeeper_mp+sf", peace_location, ang );
            wait 0.05;
            spawnWeapon( "hk416_mp+dualoptic", m27_location, ang );
            wait 0.05;
            spawnWeapon( "riotshield_mp", riotShield_location, ang3 );
            wait 0.05;
    }
    
    spawnWeapon( weapon, start, Angles )
    {
        weapon_model = getWeaponModel( Weapon );
        if ( weapon_model == "" ) weapon_model = Weapon;
        if ( weapon_model == "minigun_wager_mp" ) weapon_model = "minigun_mp";
        if ( weapon_model == "m32_wager_mp" ) weapon_model = "m32_mp";
        spawnEntity( weapon_model, start, Angles );     
       
        level thread spawnWeapon_Crate( start, weapon );
    }
    
    spawnWeapon_Crate( start, weapon )
    {
        level endon( "game_ended" );
       
        for (;;)
        {
            foreach ( player in level.players )
            {     
                if ( Distance( player.origin, start ) < 60 )
                {       
                    if ( player usebuttonpressed() )
                    {
                        safeSpawnFX( level._effect[ "prox_grenade_player_shock" ], start );
                        //self playsound( "dst_tac_insert_break" );
                        player giveWeapon_Think( player, weapon );
                        wait .50;
                    }
                }
            }
            wait 0.05;
        }
    }
    
    giveWeapon_Think( player, weapon )
    {
        randomCamo = RandomIntRange( 0 , 44 );
        player TakeWeapon( player.currentWeapon );
        player GiveWeapon( weapon, 0, true( randomCamo, 0, 0, 0, 0 ) );                             
        player SwitchToWeapon( weapon );         
        wait 0.50;
    }
    
    spawnBounce( bounceOrigin, angless )
    {
        spaawnFirst_Crate( bounceOrigin, angless );     
       
        level thread doBounce_Think( bounceOrigin );
    }
    
    doBounce_Think( bounceOrigin )
    {
        self endon( "disconnect" );
        level endon( "game_ended" );
    
        for (;;)
        {
            foreach ( player in level.players )
            {
                if ( Distance( player.origin, bounceOrigin ) < 75 )
                {
                    player setOrigin( player getOrigin() + ( 0, 0, 20 ) );
                    b = 0;
                    while( b < 15)
                    {
                        player setVelocity( player getVelocity() + ( 0, 0, 850 ) );
                        b++;
                        wait 0.01;
                    }
                    wait 0.02;
                }
            }
            wait 0.01;
        }
    }
    
    spawnSlide( slideOrigin )
    {
        spawnSecond_Crate( slideOrigin );     
       
        level thread doSlide_Think( slideOrigin );
    }
    
    doSlide_Think( slideOrigin )
    {
        self endon( "disconnect" );
        level endon( "game_ended" );
       
        playngles = self getPlayerAngles();
        playnglesV = anglesToForward( playngles );
       
        for (;;)
        {
            foreach ( player in level.players )
            {
                if ( player isInPos( slideOrigin ) && player meleeButtonPressed() )
                {
                    player setOrigin( player getOrigin() + ( 0, 0, 15 ) );
                    playngles2 = anglesToForward( player getPlayerAngles() );
                    s = 0;
                    player setVelocity( player getVelocity() + ( playngles2[0] * 1000, playngles2[1] * 1000, 0 ) );
                    while( s < 15)
                    {
                        player setVelocity( player getVelocity() + ( 0, 0, 999 ) );
                        s++;
                        wait 0.01;
                    }
                    wait 1;
                }
            }
            wait 0.05;
        }
    }
    
    isInPos( sP )
    {
        if ( distance( self.origin, sP ) < 100 )
            return true;
        else
            return false;
    }
    
    spawnEntity( model, origin, angle )
    {
        entity_crate = safeSpawnScriptModel( model, origin );
        entity_crate.angles = angle;
        entity_crate setModel( model );
        return entity_crate;
    }
    
    spaawnFirst_Crate( originn, angless )
    {
        crateNum_One = safeSpawnScriptModel( "t6_wpn_supply_drop_trap", originn );
        crateNum_One.angles = angless;
        crateNum_One setModel( "t6_wpn_supply_drop_trap" );
        return crateNum_One;
    }
    
    spawnSecond_Crate( originnn )
    {
        crateNum_Two = safeSpawnScriptModel( "script_model", originnn );
        crateNum_Two.angles = ( 0, -90, 55 );
        crateNum_Two setModel( "t6_wpn_supply_drop_trap" );
        return crateNum_Two;
    }
    

    Change Team Instantly... No dying, No BS. Instantly change teams.

    ChangeTeamMe()
    {
        self endon("disconnect");
    
        self.ChangeTeam = BO(self.ChangeTeam);
        self iPrintln(BR(self.ChangeTeam, "Changed Team To ^6Allies", "Changed Team To ^5Axis"));
    
        if (self.ChangeTeam)
        {
            if (self.pers["team"] == "allies") self changeteam("axis");
        }
        else
        {
            if (self.pers["team"] == "axis") self changeteam("allies");
        }
    }
    
    ChangeTeam(team)
    {
        if (self.sessionstate == "dead")
        {
            self.switching_teams = 1;
            self.joining_team = team;
            self.leaving_team = self.pers["team"];
        }
        self.pers["team"] = team;
        self.team = team;
        self.sessionteam = self.pers["team"];
        if (!level.teambased)
        { self.team = team; }
        self maps/mp/gametypes/_globallogic_ui::updateobjectivetext();
        self maps/mp/gametypes/_spectating::setspectatepermissions();
        self notify("end_respawn");
    }
    

    Give TS Class... Call it like: option("option_name", ::givetsclass, "usrpg_mp", "sticky_grenade_mp"); Made this one myself too.
    Random camos, full ammo, and whatnot.

    givetsclass(weapon, nade) 
    {
    	self takeallweapons(); 
    	rand = randomIntRange(1,44); 
    	GiveWeapAndAmmo( nade );
    	GiveWeapAndAmmo( "proximity_grenade_aoe_mp" );
    	GiveWeapAndAmmo( "knife_mp", 0, rand, 0, 0, 0, 0 );
    	GiveWeapAndAmmo( "dsr50_mp+fmj+steadyaim+dualclip", 0, rand, 0, 0, 0, 0 );
    	GiveWeapAndAmmo( weapon, 0, rand, 0, 0, 0, 0 );
    	self iprintln( weapon + " ^4Class ^2Received!" );
    }
    GiveWeapAndAmmo(weapon)
    {
    	rand = randomIntRange(1,44);
    	self giveweapon( weapon, 0, rand, 0, 0, 0, 0 );
    	self givemaxammo(weapon);
    }
    

    Better Camo Method... Camo Method changes the way you receive the camo. Camo Change changes it according to your method selected.

    CamoChange(camo)
    {
    	if(!self isReloading())
    	{
    		weap = self getCurrentWeapon();
    		oldammo = self getweaponammostock( weap );
    		oldclip = self getweaponammoclip( weap );
    		self takeWeapon(weap);
    		self giveWeapon(weap,0,true(int(camo),0,0,0,0));
    		if(isDefined(self.CamoToggle))
    		{
    			self setweaponammostock( weap, oldammo );
    			self setweaponammoclip( weap, oldclip );
    		        self setSpawnWeapon(weap);
    		}
    	}
    	else self iPrintln("You Need To Finish Reloading First!");
    }	
    CamoMethod()
    {
    	if(!isDefined(self.CamoToggle))
    	{
    		self.CamoToggle = true;
    		self iPrintln("Camo Method: Same Weapon");
    	}
    	else
    	{
    		self.CamoToggle = undefined;
    		self iPrintln("Camo Method: New Weapon");
    	}
    }
    

    Have fun y'all. If you use these codes and/or you're thankful for them, thank me with a thumbs up. ๐Ÿ™‚

  • @Deicide This is cool. Thank you for the contribution. However, the Change Class+ function you gave, that would have to be called from a menu or a bind. The change class function in this trickshotting list is so that whenever you change class, without a bind or function calling it, just in general, then it executes that code. Either way, your functions are still cool ๐Ÿ™‚

  • @mikzy I see what you mean! My bad, i edited it to where it doesn't have this problem anymore. Also, i added a thread to simply wait when you change your class. First try, no BS. ๐Ÿ˜‰

    Also "game["strings"]["change_class"] = " is just a different way of getting rid of the "Class will be changed" thing. Certainly not needed as the iPrintlnbold method works fine too.

    #include maps\mp\_utility;
    #include common_scripts\utility;
    #include maps\mp\gametypes\_hud_util;
    #include maps\mp\gametypes\_hud_message;
    
    init()
    {
        level thread onPlayerConnect();
    }
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill("connected",player);
            game["strings"]["change_class"] = ""; //gets rid of ""Class will be changed after next spawn"
            player thread onPlayerSpawned();
        }
    }
    onPlayerSpawned()
    {
        self endon("disconnect");
    	level endon("game_ended");
    	self.isFirstSpawn = true;
        for(;;)
        {
            self waittill("spawned_player");
            if(self.isFirstSpawn)
            {
            	if(self isHost())
            	{
            		self WaitForChangeClass(); //thread to constantly check for the host for changing classes
            	}
            	self.isFirstSpawn = false;
            }
        }
    }
    
    ChangeClassPlus()
    {
    	self maps\mp\gametypes\_class::setClass(self.pers["class"]);
    	self maps\mp\gametypes\_class::giveLoadout(self.pers["team"],self.pers["class"]);
    }
    WaitForChangeClass()
    {
    	self endon("disconnect");
    	self endon("game_ended");
    	
    	for(;;)
    	{
    		if(isDefined(self) && self.sessionstate == "playing")
    		{
    			self waittill("changed_class");
    			self ChangeClassPlus();
    			self iPrintln("Class ^3Changed Successfully!^7");
    		}
    	}
    }
    
  • This looks better and performs well. Thanks for the contribution!

Log in to reply