Code stops working when formating text.
#2

well, the code is correct.

But this GetVehiclePrice looks rly ugly,
it might cause the code to stop (just guessin' this but it could be)

rewrite it, use switch instead of countless if statements
btw. the code will run faster too like this

Example:

Код:
forward GetVehiclePrice(vehicle);
public GetVehiclePrice(vehicle)
{
        new vehicleprice;
	switch(vehicle)
	{
		case 481: vehicleprice = 1200;
		case 531: vehicleprice = 36000;
		//and so on...
		default: vehicleprice = 0;// wwhen nothing matches
	}
    return vehicleprice;
}
also try leaving out one of the two functions in your format and try if it's working.
Like this, you might see what caused the code to stop
Reply


Messages In This Thread
Code stops working when formating text. - by seanny - 20.12.2013, 16:26
Re: Code stops working when formating text. - by CutX - 20.12.2013, 18:13
Re: Code stops working when formating text. - by Konstantinos - 20.12.2013, 18:28
Re: Code stops working when formating text. - by seanny - 21.12.2013, 10:25
Re: Code stops working when formating text. - by Konstantinos - 21.12.2013, 10:38
Re: Code stops working when formating text. - by seanny - 21.12.2013, 11:14

Forum Jump:


Users browsing this thread: 1 Guest(s)