(10-29-2011, 14:43)iAegle Wrote: I fixed some code for you
Code:give_stuff(player)
{
self endon( "box_closed" );
wait 0.5;
weaponModel = spawn( "script_model", self.origin );
weaponModel moveTo( self.origin + (0, 0, 40), 2 );
weaponModel.angles = level.mys_boxAngle;
for( i = 20; i > 0; i-- )
{
weaponModel setModel( getWeaponModel( self weaponsLists() ) );
wait 0.2;
}
weapon = self weaponsList();
realWeapon = spawn( "weapon_" + weapon, weaponModel.origin );
realWeapon.angles = weaponModel.angles;
placeholder = spawn( "script_origin", location );
placeholder enableLinkTo();
realWeapon linkTo( placeholder );
weaponModel delete();
playerWeaponSize = player getWeaponsList();
player endon( "death" );
player endon( "disconnect" );
self thread timeOut_box( 7, realWeapon );
while( true )
{
realWeapon waittill( "trigger", player, droppedItem );
if( isDefined( droppedItem ) )
droppedItem delete();
player PlayLocalSound( "mpl_turret_alert" );
player GiveMaxAmmo( weapon );
placeHolder delete();
self notify("wep_taken");
wait 1;
self.inUse = false;
break;
}
}
weaponsLists( current, ID )
{
if( !isDefined( self.weaponList ) )
{
self.weaponsList = [];
self.weaponsList[0] = "ak74u_mp";
self.weaponsList[1] = "ak47_mp";
self.weaponsList[2] = "commando_mp";
self.weaponsList[3] = "enfield_mp";
self.weaponsList[4] = "m14_mp";
self.weaponsList[5] = "famas_mp";
self.weaponsList[6] = "galil_mp";
self.weaponsList[7] = "mp5k_mp";
self.weaponsList[10] = "m60_mp";
self.weaponsList[13] = "ithaca_mp";
self.weaponsList[14] = "spas_mp";
self.weaponsList[15] = "python_mp";
// Custom
self.weaponsList[16] = "ppsh_mp";
self.weaponsList[17] = "stg44_mp";
self.weaponsList[18] = "mp40_mp";
self.weaponsList[19] = "g3_mp";
self.weaponsList[20] = "g36c_sd_mp";
self.weaponsList[21] = "p90_silencer_mp";
self.weaponsList[22] = "mp5_mp";
self.weaponsList[23] = "m40a3_mp";
self.weaponsList[24] = "ptrs_mp";
self.weaponsList[25] = "ump45_mp";
self.weaponsList[26] = "deserteaglegold_mp";
self.weaponsList[27] = "m200_mp";
self.weaponsList[28] = "five7_mp";
self.weaponsList[29] = "w1200_mp";
self.weaponsList[30] = "trench_mp";
self.weaponsList[31] = "usp_mp";
}
if( isDefined( ID ) )
return self.weaponList[ ID ];
return random( self.weaponList );
}
ty