View Single Post
Hemick
New Member
Join Date: Sep 2011
Old 09-13-2011 , 22:13   Re: [TF2] Destroy Engineer Buildings
Reply With Quote #8

Quote:
Originally Posted by danielmyst777 View Post
I tried destroying buildings but it says the object specified is invalid. Only one that works is "all".
I can confirm this as well.

Code:
] sm_destroy @me sentry
Invalid building specified, please use sentry, dispenser, tele, entrance, exit, last, or all
I was able to fix it in this block of code. Your if statement wasn't correct.

Code:
		if (StrEqual(TargetBuilding, "sentry", false))		//Sentry Gun
		{
			iTargetBuilding = 1;
		}
		else if (StrEqual(TargetBuilding, "dispenser", false))	//Dispenser
		{
			iTargetBuilding = 2;
		}
		else if (StrEqual(TargetBuilding, "tele", false))		//Tele entrance + exit
		{
			iTargetBuilding = 3;
		}
		else if (StrEqual(TargetBuilding, "entrance", false))	//Tele entrance only
		{
			iTargetBuilding = 4;
		}
		else if (StrEqual(TargetBuilding, "exit", false))		//Tele exit only
		{
			iTargetBuilding = 5;
		}
		else if (StrEqual(TargetBuilding, "last", false))		//Last building
		{
			iTargetBuilding = 6;
		}

Last edited by Hemick; 09-13-2011 at 22:19.
Hemick is offline