Optimize my function
#1

Hi!

How can I optimize this function with a loop ?

thanks

Код HTML:
Function(playerid)
{
	if(PlayerInfo[playerid][house1] == 40)
	{
		PlayerInfo[playerid][house1] = 0;
	}
	else if(PlayerInfo[playerid][house2] == 40){
		PlayerInfo[playerid][house2] = 0;
	}
	else if(PlayerInfo[playerid][house3] == 40){
		PlayerInfo[playerid][house3] = 0;
	}
	else if(PlayerInfo[playerid][house4] == 40){
		PlayerInfo[playerid][house4] = 0;
	}
	else if(PlayerInfo[playerid][house5] == 40){
		PlayerInfo[playerid][house5] = 0;
	}
	else if(PlayerInfo[playerid][house6] == 40){
		PlayerInfo[playerid][house6] = 0;
	}
	else if(PlayerInfo[playerid][house7] == 40){
		PlayerInfo[playerid][house7] = 0;
	}
	else if(PlayerInfo[playerid][house8] == 40){
		PlayerInfo[playerid][house8] = 0;
	}
	return 1;
}
Reply


Messages In This Thread
Optimize my function - by pelican1 - 19.05.2017, 15:54
Re: Optimize my function - by rolex - 19.05.2017, 16:00
Re: Optimize my function - by Pottus - 19.05.2017, 16:00
Re: Optimize my function - by rolex - 19.05.2017, 16:05
Re: Optimize my function - by CheezIt - 19.05.2017, 17:32

Forum Jump:


Users browsing this thread: 1 Guest(s)