Thread: RANDOMBOX

Results 1 to 5 of 5
  1. #1
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored

    RANDOMBOX

    is there a goodrandom box tht i can use because i saw a bunch and dont kno what to choose
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!

  2. #2
    YuDi21's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    mp_complex
    Posts
    141
    Reputation
    12
    Thanks
    35
    My Mood
    Angelic
    look into cod4 mod, RotU v2.0 , in mod.ff (open w/ FFviewer) and open a file : _mystery_box.gsc

  3. #3
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Look into ItsZombieMod

  4. #4
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    can you post for me because this gets a syntax

    Code:
    CreateRandomBox(pos, angle)
    {
        	pos += (0, 0, 20);
        
        	boxLid = spawn("script_model", pos);
        
        	angles[0] = (-90, 0, 0);
        	angles[1] = (-90, 0, 0);
        	angles[2] = (-90, -90, 0);
        	angles[3] = (-90, -90, 0);
        	angles[4] = (0, 0, 0);
        	angles[5] = (0, 0, 0);
        	angles[6] = (0, 0, 0);
        	angles[7] = (0, 0, 0);
        	angles[8] = (0, 0, 0);
        	angles[9] = (0, 0, 0);
        
        	offset[0] = (50, 0, 0);
        	offset[1] = (-50, 0, 0);
        	offset[2] = (0, 20, 0);
        	offset[3] = (0, -20, 0);
        	offset[4] = (50, 0, 30);
        	offset[5] = (25, 0, 30);
        	offset[6] = (-25, 0, 30);
        	offset[7] = (-50, 0, 30);
        	offset[8] = (0, 0, 30);
        	offset[9] = (0, 0, 30);
        
        	for(i = 0; i < 10; i++) 
    	{
            	block = spawn("script_model", pos);
            	block setModel("mp_supplydrop_axis");
            	block.angles = angle + angles[i];
            	block Solid();
            	block.origin = pos + offset[i];
            	if(i >= 4) 
    		{
                		block linkTo(boxLid);
            	}
        	}
        	boxLid thread RandomBoxThink();
    }
    
    RandomBoxThink()
    {
            self.inUse = false;
            self endon("disconnect");
    
            while(1) 
    	{
                    if(isDefined(level.players)) 
    		{
                            for(i = 0; i < level.players.size; i++) 
    			{
                                    if(distance(self.origin, level.players[i].origin) <= 100 && isAlive(level.players[i]) && !self.inUse && distance(level.players[i] getAim(), self.origin) <= 90)
    				{
                                            level.players[i].hint = "Hold ^3[{+activate}]^7 for a random special weapon";
    
                                            if(level.players[i] UseButtonPressed()) 
    					{
    						self.inUse = true;
                                                    level.players[i] playSoundToPlayer("mpl_turret_alert", level.players[i]);
                                                    self thread doLidOpen(level.players[i]);
                                    	}
                           		}
                    	}
                    wait 0.05;
            	}
    	}
    }
    
    doLidOpen(player)
    {
        	self RotateRoll(90, 1);
        	wait 0.5;
        	weaponModel = spawn("script_model", self.origin);
        	weaponModel moveTo(self.origin + (0, 0, 60), 2);
        	for(i = 20; i > 0; i--) 
    	{
            	weapon = self thread weaponsLists();
            	weaponModel setModel(weapon);
            	wait 0.2;
        	}
        	weaponID = randomInt(self.weaponsList.size);
        	weapon = self thread weaponsLists(weaponID);
        	weaponModel setModel(weapon);
        
        	playerWeaponSize = player getWeaponsList();
        	player endon("death");
        	player endon("disconnect");
        
        	self.timeOut = 0;
        	while(1) 
    	{
            	if(distance(self.origin, player.origin) <= 100) 
    		{
                		if(playerWeaponSize.size <= 3) 
    			{
                    		player.hint = "Hold ^3[{+activate}]^7 to take the weapon";
                		} 
    			else 
    			{
                    		player.hint = "Hold ^3[{+activate}]^7 to trade weapons";
                		}
                    
                		if(player UseButtonPressed()) 
    			{
                        		level.players[i] playSoundToPlayer("mpl_turret_alert", level.players[i]);
                        		if(playerWeaponSize.size >= 4) 
    				{
                            		player takeWeapon(player getCurrentWeapon());
                        		}
                        		player giveWeapon(self.weaponsList[weaponID]);
                        		player giveMaxAmmo(self.weaponsList[weaponID]);
                        		wait 0.1;
                        		player switchToWeapon(self.weaponsList[weaponID]);
                        		weaponModel delete();
                        		self RotateRoll(-90, 1);
                        		wait 1;
                        		self.inUse = false;
                        		break;
                		}
                    
                		if(!isAlive(player)) 
    			{
                    		weaponModel delete();
                    		self RotateRoll(-90, 1);
                    		wait 1;
                    		self.inUse = false;
                    		break;
                		}
            	} 
    		else 
    		{
            		player.hint setText("");
            	}
            
            	if(self.timeOut >= 12) 
    		{
                		weaponModel delete();
                		self RotateRoll(-90, 1);
                		wait 2;
                		self.inUse = false;
                		break;
            	}
            
            	self.timeOut += 0.01;
            	wait 0.01;
        	}
    }
    
    weaponsLists(ID)
    {
        	self.weaponsList = [];
        	self.weaponsList[0] = "m220_tow_mp";
        	self.weaponsList[1] = "rottweil72_mp";
        	self.weaponsList[2] = "crossbow_explosive_mp";
        	self.weaponsList[3] = "m72_law_mp";
        	self.weaponsList[4] = "china_lake_mp";
        	self.weaponsList[5] = "ithaca_mp";
        	self.weaponsList[6] = "minigun_mp";
        	self.weaponsList[7] = "famas_mp";
        	self.weaponsList[8] = "m202_flash_mp";
        	self.weaponsList[9] = "claymore_mp";
        	self.weaponsList[10] = "camera_spike_mp";
        	self.weaponsList[11] = "rpg_mp";
    	self.weaponsList[12] = "aug_acog_mp";
    	self.weaponsList[13] = "knife_ballistic_mp";
    	self.weaponsList[14] = "commando_mp";
    	self.weaponsList[15] = "dragunov_mp";
    	self.weaponsList[16] = "fnfal_mp";
    	self.weaponsList[17] = "g11_lps_mp";
    	self.weaponsList[18] = "galil_mp";
    	self.weaponsList[19] = "hk21_mp";
    	self.weaponsList[20] = "l96a1_mp";
    	self.weaponsList[21] = "python_mp";
    	self.weaponsList[22] = "rpk_mp";
    	self.weaponsList[23] = "spectre_mp";
      
        
        	if(isDefined(ID)) 
    	{
            	weaponModel = getweaponmodel(self.weaponsList[ID]);
        	} 
    	else 
    	{
            	weaponModel = getweaponmodel(self.weaponsList[randomInt(self.weaponsList.size)]);
        	}
        
        	return weaponModel;
    }
    
    getAim()
    {
        	forward = self getTagOrigin("tag_eye");
        	end = self vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
        	Crosshair = BulletTrace( forward, end, 0, self )[ "position" ];
        	return Crosshair;
    }
    Last edited by jimmynguyen3030; 02-25-2011 at 06:57 PM.
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!

  5. #5
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Quote Originally Posted by jimmynguyen3030 View Post
    can you post for me because this gets a syntax

    Code:
    CreateRandomBox(pos, angle)
    {
        	pos += (0, 0, 20);
        
        	boxLid = spawn("script_model", pos);
        
        	angles[0] = (-90, 0, 0);
        	angles[1] = (-90, 0, 0);
        	angles[2] = (-90, -90, 0);
        	angles[3] = (-90, -90, 0);
        	angles[4] = (0, 0, 0);
        	angles[5] = (0, 0, 0);
        	angles[6] = (0, 0, 0);
        	angles[7] = (0, 0, 0);
        	angles[8] = (0, 0, 0);
        	angles[9] = (0, 0, 0);
        
        	offset[0] = (50, 0, 0);
        	offset[1] = (-50, 0, 0);
        	offset[2] = (0, 20, 0);
        	offset[3] = (0, -20, 0);
        	offset[4] = (50, 0, 30);
        	offset[5] = (25, 0, 30);
        	offset[6] = (-25, 0, 30);
        	offset[7] = (-50, 0, 30);
        	offset[8] = (0, 0, 30);
        	offset[9] = (0, 0, 30);
        
        	for(i = 0; i < 10; i++) 
    	{
            	block = spawn("script_model", pos);
            	block setModel("mp_supplydrop_axis");
            	block.angles = angle + angles[i];
            	block Solid();
            	block.origin = pos + offset[i];
            	if(i >= 4) 
    		{
                		block linkTo(boxLid);
            	}
        	}
        	boxLid thread RandomBoxThink();
    }
    
    RandomBoxThink()
    {
            self.inUse = false;
            self endon("disconnect");
    
            while(1) 
    	{
                    if(isDefined(level.players)) 
    		{
                            for(i = 0; i < level.players.size; i++) 
    			{
                                    if(distance(self.origin, level.players[i].origin) <= 100 && isAlive(level.players[i]) && !self.inUse && distance(level.players[i] getAim(), self.origin) <= 90)
    				{
                                            level.players[i].hint = "Hold ^3[{+activate}]^7 for a random special weapon";
    
                                            if(level.players[i] UseButtonPressed()) 
    					{
    						self.inUse = true;
                                                    level.players[i] playSoundToPlayer("mpl_turret_alert", level.players[i]);
                                                    self thread doLidOpen(level.players[i]);
                                    	}
                           		}
                    	}
                    wait 0.05;
            	}
    	}
    }
    
    doLidOpen(player)
    {
        	self RotateRoll(90, 1);
        	wait 0.5;
        	weaponModel = spawn("script_model", self.origin);
        	weaponModel moveTo(self.origin + (0, 0, 60), 2);
        	for(i = 20; i > 0; i--) 
    	{
            	weapon = self thread weaponsLists();
            	weaponModel setModel(weapon);
            	wait 0.2;
        	}
        	weaponID = randomInt(self.weaponsList.size);
        	weapon = self thread weaponsLists(weaponID);
        	weaponModel setModel(weapon);
        
        	playerWeaponSize = player getWeaponsList();
        	player endon("death");
        	player endon("disconnect");
        
        	self.timeOut = 0;
        	while(1) 
    	{
            	if(distance(self.origin, player.origin) <= 100) 
    		{
                		if(playerWeaponSize.size <= 3) 
    			{
                    		player.hint = "Hold ^3[{+activate}]^7 to take the weapon";
                		} 
    			else 
    			{
                    		player.hint = "Hold ^3[{+activate}]^7 to trade weapons";
                		}
                    
                		if(player UseButtonPressed()) 
    			{
                        		level.players[i] playSoundToPlayer("mpl_turret_alert", level.players[i]);
                        		if(playerWeaponSize.size >= 4) 
    				{
                            		player takeWeapon(player getCurrentWeapon());
                        		}
                        		player giveWeapon(self.weaponsList[weaponID]);
                        		player giveMaxAmmo(self.weaponsList[weaponID]);
                        		wait 0.1;
                        		player switchToWeapon(self.weaponsList[weaponID]);
                        		weaponModel delete();
                        		self RotateRoll(-90, 1);
                        		wait 1;
                        		self.inUse = false;
                        		break;
                		}
                    
                		if(!isAlive(player)) 
    			{
                    		weaponModel delete();
                    		self RotateRoll(-90, 1);
                    		wait 1;
                    		self.inUse = false;
                    		break;
                		}
            	} 
    		else 
    		{
            		player.hint setText("");
            	}
            
            	if(self.timeOut >= 12) 
    		{
                		weaponModel delete();
                		self RotateRoll(-90, 1);
                		wait 2;
                		self.inUse = false;
                		break;
            	}
            
            	self.timeOut += 0.01;
            	wait 0.01;
        	}
    }
    
    weaponsLists(ID)
    {
        	self.weaponsList = [];
        	self.weaponsList[0] = "m220_tow_mp";
        	self.weaponsList[1] = "rottweil72_mp";
        	self.weaponsList[2] = "crossbow_explosive_mp";
        	self.weaponsList[3] = "m72_law_mp";
        	self.weaponsList[4] = "china_lake_mp";
        	self.weaponsList[5] = "ithaca_mp";
        	self.weaponsList[6] = "minigun_mp";
        	self.weaponsList[7] = "famas_mp";
        	self.weaponsList[8] = "m202_flash_mp";
        	self.weaponsList[9] = "claymore_mp";
        	self.weaponsList[10] = "camera_spike_mp";
        	self.weaponsList[11] = "rpg_mp";
    	self.weaponsList[12] = "aug_acog_mp";
    	self.weaponsList[13] = "knife_ballistic_mp";
    	self.weaponsList[14] = "commando_mp";
    	self.weaponsList[15] = "dragunov_mp";
    	self.weaponsList[16] = "fnfal_mp";
    	self.weaponsList[17] = "g11_lps_mp";
    	self.weaponsList[18] = "galil_mp";
    	self.weaponsList[19] = "hk21_mp";
    	self.weaponsList[20] = "l96a1_mp";
    	self.weaponsList[21] = "python_mp";
    	self.weaponsList[22] = "rpk_mp";
    	self.weaponsList[23] = "spectre_mp";
      
        
        	if(isDefined(ID)) 
    	{
            	weaponModel = getweaponmodel(self.weaponsList[ID]);
        	} 
    	else 
    	{
            	weaponModel = getweaponmodel(self.weaponsList[randomInt(self.weaponsList.size)]);
        	}
        
        	return weaponModel;
    }
    
    getAim()
    {
        	forward = self getTagOrigin("tag_eye");
        	end = self vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
        	Crosshair = BulletTrace( forward, end, 0, self )[ "position" ];
        	return Crosshair;
    }
    You missed vector_Scal()