Checking if a house is vaild from a random string
#5

Quote:
Originally Posted by MouseBreaker
Посмотреть сообщение
You can use while-loop and use HouseID variable to check is valid or not.

pawn Код:
new RandomHouseID = random(MAX_HOUSES);

while(HouseID[RandomHouseID] == -1) // House is not valid
{
    RandomHouseID = random(MAX_HOUSES);
}
Of course, there're many ways to do something but he would still need to set all of them to -1 in the beginning of the mode

pawn Код:
for(new h = 0; h < MAX_HOUSES; h++) Houses[h][houseid] = -1; // Or however you've called it!
Reply


Messages In This Thread
Checking if a house is vaild from a random string - by AccountName - 01.06.2013, 11:28
Re: Checking if a house is vaild from a random string - by Konstantinos - 01.06.2013, 11:35
Re: Checking if a house is vaild from a random string - by AccountName - 01.06.2013, 11:38
AW: Checking if a house is vaild from a random string - by Skimmer - 01.06.2013, 11:38
Re: AW: Checking if a house is vaild from a random string - by Konstantinos - 01.06.2013, 11:41

Forum Jump:


Users browsing this thread: 2 Guest(s)