Thread Rating:
  • 3 Vote(s) - 2.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Mystery Box
#1


Code:
#include common_scripts\utility;

#include maps\mp\_airsupport;
#include maps\mp\_utility;

#include maps\mp\gametypes\_hud_util;



main()

{
}

init()
{
        thread onPlayerConnect();
        thread onPlayerConnected();
        level thread spawnBox();
}

onPlayerConnect()
{      
        for(;;)
        {
                level waittill( "connecting", player );

                player thread onPlayerSpawned();
                player thread onJoinedSpectators();
                player thread doVars();
        }
}

onPlayerConnected()
{      
        for(;;)
        {
                level waittill( "connected", player );

                player thread checkDistance();
        }
}

onPlayerSpawned()
{
        for(;;)
        {
                self waittill( "spawned_player" );
        
                self thread welcomeLoop();
        }
}

onJoinedSpectators()
{
        self endon( "disconnect" );
        
        for(;;)
        {
                self waittill( "joined_spectators" );
        }
}

welcomeLoop()
{
        self endon( "death" );
        
        while( 1 )
        {
                self iPrintlnBold( "WELCOME TO THE LOBBY" );
                wait 2;
                self iPrintlnBold( "GO TO THE MYSTERY BOX!!!!" );
                wait 2;
        }
}

spawnBox()
{
        level.mBox = spawn( "script_model", ( 695.165, 343.891, -35.8556 ) );
        level.mBox setModel( "mp_supplydrop_ally" );
        level.mBox.angles = ( 0, 285, 0 );
        level.mGun = spawn( "script_model", level.mBox.origin );
        level.mGun setModel( GetWeaponModel( "claymore_mp" ) );
        level.mGun.angles = level.mBox.angles + ( 0, 90, 0 );
        level.mGun hide();
}

doVars()
{
        setDvar( "scr_laststand_keep_weapons", 1 );
        setDvar( "scr_player_respawndelay", 5 );
        setDvar( "g_allow_teamchange", 0 );
        setDvar( "ui_allow_teamchange", 0 );
        self setClientDvar( "bg_fallDamageMinHeight", "9999" );
        self setClientDvar( "bg_fallDamageMaxHeight", "9999" );
        self setClientDvar( "ui_allow_teamchange", 0 );
        level.using = 0;
        self.usingg = 0;

        level.guns[0] = "aug_mp";
        level.guns[1] = "m16_mp";
        level.guns[2] = "spas_mp";
        level.guns[3] = "famas_mp";
        level.guns[4] = "rpk_mp";
        level.guns[5] = "rpg_mp";
        level.guns[6] = "m72_law_mp";
        level.guns[7] = "commando_mp";
        level.guns[8] = "python_mp";
        level.guns[9] = "ak74u_mp";
        level.guns[10] = "l96a1_mp";
        level.guns[11] = "fnfal_mp";
        level.guns[12] = "cz75_mp";
        level.guns[13] = "spectre_mp";
        level.guns[14] = "hk21_mp";
        level.guns[15] = "crossbow_explosive_mp";
        level.guns[16] = "knife_ballistic_mp";
        level.guns[17] = "m60_mp";
        level.guns[18] = "stoner63_mp";
}

checkDistance()
{      
        while( 1 )
        {
                wait .01;
        
                if( distance( self.origin, level.mBox.origin ) < 75 && level.using == 0 )
                {
                        self setLowerMessage( "Press [{+activate}] for Mystery Box" );
                        randWeap = randomInt( level.guns.size );
                        
                        for(;;)
                        {
                                if( self useButtonPressed() == true && level.using == 0 && distance( self.origin, level.mBox.origin ) < 75 )
                                {
                                        level.using = 1;
                                        self clearLowerMessage( 1.0 );
                                        level.mGun show();
                                        level.mGun moveTo( level.mBox.origin + ( 0, 0, 30 ), 1 );
                                        wait .2;
                                        for( i = 0; i < 14; i++ )
                                        {
                                                rander = randomInt( level.guns.size );
                                                level.mGun setModel( GetWeaponModel( level.guns[rander] ) );
                                                wait( 0.025 * i );
                                        }
                                        level.mGun setModel( GetWeaponModel( level.guns[randWeap] ) );
                                        wait .5;
                                        for( i = 0; i < 0.5; i += 0.01 )
                                        {
                                                self setLowerMessage( "Press [{+activate}] to Buy the Gun" );
        
                                                if( self useButtonPressed() == true && distance( self.origin, level.mBox.origin ) < 75 )
                                                {
                                                        self clearLowerMessage( 1.0 );
                                                        if( self GetWeaponsListPrimaries().size > 1 ) self takeWeapon( self getCurrentWeapon() );
                                                        self giveWeapon( level.guns[randWeap] );
                                                        self switchToWeapon( level.guns[randWeap] );
                                                        self giveMaxAmmo( level.guns[randWeap] );
                                                        i = 0.5;
                                                }
                                                else if( distance( self.origin, level.mBox.origin ) > 75 )
                                                {
                                                        self clearLowerMessage( 1.0 );
                                                }
                                                wait 0.01;
                                        }
                                        self clearLowerMessage( 1.0 );
                                        level.mGun moveTo( level.mBox.origin, 1 );
                                        wait 1;
                                        level.mGun hide();
                                        level.using = 0;
                                        break;
                                }
                                else if( distance( self.origin, level.mBox.origin ) > 75 )
                                {
                                        self clearLowerMessage( 1.0 );
                                        break;
                                }
                                wait 0.01;
                        }
                }
                else
                {
                        self clearLowerMessage( 1.0 );
                }
        }
        wait 0.01;
}

Credits:
TLPWNZER

//made for Wii, should work with the pc too. perhaps some little minor changes are needed
Reply

#2
cool thanks but how can we put this in any map??
Reply

#3
nice! if anybody can do a zombie mod with this ... Big Grin
Sorry for my english, i'm from Belgium
Steam ID: Faramire0007
[Image: 2s1aq0o.jpg]
Reply

#4
(04-01-2011, 12:07)xN4T1V3xPR1D3x Wrote: cool thanks but how can we put this in any map??

just change the coords...

if map = this set that origin
Reply

#5
it spawnes the box but i cant use it
Reply

#6
It had worked for me negative repped member.
Reply

#7
where do i put the codes
Reply

#8
(09-05-2011, 19:27)mike5566 Wrote: where do i put the codes

Maybe you have to learn some basic modding first: http://www.itsmods.com/forum/Thread-Gsc-...nners.html
[Image: 41295377.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  use Mystery Box bug E-losev 3 2,356 07-19-2013, 16:33
Last Post: surtek
  Mystery Boxes boe44 12 9,462 06-27-2012, 01:51
Last Post: george1589
Rainbow [Release] Mystery Box Model Nekochan 17 9,559 01-12-2012, 04:27
Last Post: Sanya
  A care package / mystery box mod. aefven 1 2,294 07-09-2011, 11:31
Last Post: iBanana

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.