Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    NiNeOner's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    My Mood
    Happy
    Hey still no luck i tried what you said to do and also if you don't want to help anymore that's fine you have already tried many times =) but if you decide to try again here is the code with the little fixes lol. Also i wanted to ask is there something i should be adding in another .gsc file other then adding level thread maps\mp\gametypes\MapEdit::init(); in the _rank.gsc

    Code:
    /* Custom RandomBox From 4.9.1 */
    CreateBox(pos, humancost, zombiecost)
    {
    	box = spawn( "script_model", pos );
    	box setModel( "com_plasticcase_enemy" );
    	box Solid();
    	box CloneBrushmodelToScriptmodel(level.airDropCrateCollision);
    	box maps\mp\_entityheadIcons::setHeadIcon( "allies", "waypoint_ammo_friendly", (0,0,24), 20, 20 );
    	box maps\mp\_entityheadIcons::setHeadIcon( "axis", "waypoint_ammo_friendly", (0,0,24), 20, 20 );
    	while(1)
    	{
    		foreach(player in level.players)
    		{
    			player.quze destroy();
    			if(distance(player.origin, box.origin) <100)
    			{
    				player.quze = player createFontString( "hudbig", 1.0 );
    				player.quze setPoint( "Center", "Center", 0, 5 );
    				player.quze setText("^1Press [{+activate}] For A Random Gun \ Upgrade.");
    				if(player maps\mp\gametypes\_rank::checkPress("F"))
    				{
    						if(player.team == "allies")
    					{	
    							if(player.bounty >= humancost)
    							{
    								player.bounty -= humancost;
    								player thread randomgun();
    							}else{
    									self iPrintlnBold("^1Not Enough ^3Cash");
    						}
    					}
    						if(player.team == "axis")	
    					{
    							if(player.bounty >= zombiecost)
    							{
    								player.bounty -= zombiecost;
    								player thread randomupgrade();
    							}else{
    									self iPrintlnBold("^1Not Enough ^3Cash");
    						}
    					}
    				}
    				wait.25;
    				player notify("retrieved");
    			}
    		}
    		wait0.05;
    	}
    }
    
    randomgun()
    {
    	self endon("disconnect");
    	self endon("death");
    	self endon("retrieved");
    	switch(RandomInt(6))
    	{
    		case 0: self thread epicgun1();
    		break;
    		case 1: self thread epicgun2();
    		break;
    		case 2: self thread epicgun3();
    		break;
    		case 3: self thread epicgun4();
    		break;
    		case 4: self thread hlife();
    		break;
    		case 5: self thread nothing();
    		break;
    	}
    }
    
    epicgun1()
    {
    	self endon("death");
    	self takeAllWeapons();
    	wait.25;
    	self giveWeapon("fal_eotech_fmj_mp", 8, false );
    	self giveWeapon("cheytac_mp", 0, false );
    	self switchToWeapon("fal_eotech_fmj_mp", 8, false );
    	self iPrintlnBold("Fal shooting Spas bullets");
    	for(;;)
    		{
    			self waittill( "weapon_fired" );
    				if ( self getCurrentWeapon() == "fal_eotech_fmj_mp"){ MagicBullet( "spas12_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );}
    		}
    }
    
    epicgun2()
    {
    	self endon("death");
    	self takeAllWeapons();
    	wait.25;
    	self giveWeapon("famas_eotech_fmj_mp", 6, false );
    	self giveWeapon("cheytac_mp", 0, false );
    	self switchToWeapon("famas_eotech_fmj_mp", 6, false );
    	self iPrintlnBold("Famas shooting Barrett bullets");
    	for(;;)
    		{
    			self waittill( "weapon_fired" );
    				if ( self getCurrentWeapon() == "famas_eotech_fmj_mp"){ MagicBullet( "barrett393_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );}
    		}
    }
    
    epicgun3()
    {
    	self endon("death");
    	self takeAllWeapons();
    	wait.25;
    	self giveWeapon("coltanaconda_fmj_tactical_mp", 0, true );
    	self giveWeapon("cheytac_mp", 0, false );
    	self switchToWeapon("coltanaconda_fmj_tactical_mp", 0, true );
    	self iPrintlnBold(".44 Magnum shooting Thumper bullets");
    	for(;;)
    		{
    			self waittill( "weapon_fired" );
    				if ( self getCurrentWeapon() == "coltanaconda_fmj_tactical_mp"){ MagicBullet( "m79_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );}
    		}
    }
    
    epicgun4()
    {
    	self endon("death");
    	self takeAllWeapons();
    	wait.25;
    	self giveWeapon("m16_acog_fmj_mp", 6, true );
    	self giveWeapon("cheytac_mp", 0, false );
    	self switchToWeapon("m16_acog_fmj_mp", 6, true );
    	self iPrintlnBold("M16 shooting AC130 25mm");
    	for(;;)
    		{
    			self waittill( "weapon_fired" );
    				if ( self getCurrentWeapon() == "m16_acog_fmj_mp"){ MagicBullet( "ac130_25mm_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );}
    		}
    }
    
    GetCursorPos()
    {
    	return BulletTrace( self getTagOrigin("tag_eye"), vector_Scal(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
    }
    vector_scal(vec, scale)
    {
    	return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
    }
    
    hlife()
    {
    	self endon( "death" );
    	if(self.maxhp == 100)
    	{
    		self.maxhp += 100;
    		self.maxhealth = self.maxhp;
    			self iPrintlnBold("200 health");
    	}else{
    			self iPrintlnBold("Max health achieved");
    		}
    }
    /* Custom RandomBox From 4.9.1 Ends Here */
    
    /* Custom UpgradeBox From 4.9.1 its also the same box for the humans /*
    randomupgrade()
    {
    	self endon("disconnect");
    	self endon("death");
    	self endon("retrieved");
    	switch(RandomInt(4))
    	{
    		case 0: self thread invisible();
    		break;
    		case 1: self thread zlife();
    		break;
    		case 2: self thread longknife();
    		break;
    		case 3: self thread nothing();
    		break;
    	}
    }
    
    zlife()
    {
    	self.maxhp += 1000;
    	self.maxhealth = self.maxhp;
    	self iPrintlnBold("+1000 health");
    }
    
    invisible()
    {
    	self endon("disconnect");
    	self iPrintlnBold("Invisible for half a second");
    	for(;;)
    		{
    			self hide();
    			wait.5;
    			self show();
    			wait.5;
    		}
    }
    
    longknife()
    {
    	self endon("disconnect");
    	self setClientDvar("player_meleeRange", 120);
    	self iPrintlnBold("Extra knife range");
    }
    
    nothing()
    {
    	self iPrintlnBold("You Got Nothing");
    }
    /* Custom UpgradeBox From 4.9.1 Ends Here */

  2. #17
    NiNeOner's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    My Mood
    Happy

    Added the random box.

    Hey i added the random box again but had a better look through it and noticed the code i added below so i looked at the _rank.gsc from QCZM v4.9.1 and added the other code below and then the mod loaded but now when i write in.

    CreateBox((-66, 264, -179), 1000, 600);

    The box loads propperly but it doesn't cost anything im going to try add.

    level.itemCost["Box"] = 1200;

    Which i also saw in the _rank.gsc from QCZM v4.9.1 but theres another bug the other blocks don't load only the CreateWeapon, CreateTurret and CreateSentrys load lol? If anyone knows anything that would be great.
    Code:
    if(player maps\mp\gametypes\_rank::checkPress("F")) // from the CreateBox() thread in the MapEdit.gsc
    Code:
    checkPress(string) // From the _rank.gsc
    {
    	for( i = 0; i < self.buttonListPress.size; i++){
    		if( self.buttonListPress[i] == string ) {
    			self.buttonListPress[i] = "";
    			return true;
    		}
    	}
    	return false;
    }

  3. #18
    NiNeOner's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    0
    My Mood
    Happy

    Solved!

    I finally figured it out the randombox works now.

    Thanks for all the help everyone.

    /solved
    /closed

Page 2 of 2 FirstFirst 12