You are viewing our Forum Archives. To view or take place in current topics click here.
RELEASE MISTERY BOX
Posted:

RELEASE MISTERY BOXPosted:

_BiiLLYz_MODz_
  • Junior Member
Status: Offline
Joined: Feb 18, 201113Year Member
Posts: 74
Reputation Power: 2
Status: Offline
Joined: Feb 18, 201113Year Member
Posts: 74
Reputation Power: 2
This is a little buggy
It works fine but, I wanted to have it so people could buy it whenever they wanted like a real mystery box so there you go
If you want it so it automatically gives it to you just ask and ill post that coding as well
Video:


[ Register or Signin to view external links. ]

Im not sure if anyone has made this yet
I can also guarantee this was 100% coded by me
I know my post count and rep doesnt say so
But everyone starts somewhere so I guess this is where im starting
If someone wants to put the coding in a patch i would appreciate it, Ill include the DL then

#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;[quote]


Last edited by _BiiLLYz_MODz_ ; edited 2 times in total
#2. Posted:
iCamp
  • Summer 2018
Status: Offline
Joined: Jan 25, 201014Year Member
Posts: 10,532
Reputation Power: 618
Status: Offline
Joined: Jan 25, 201014Year Member
Posts: 10,532
Reputation Power: 618
This was copied and pasted.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.