do while loop not working
#2

I think the problem here is with your second loop logic. Replace all of the ORs to ANDs and modify the check a bit because you need for all of the checks to pass to succesfully declare a cop. Now I think pAviso (whatever that is) > 0 might be true for the bandits so they all become cops.

Change

PHP код:
foreach(Playeri
if(
!= sorte || pInfo[i][pIdade] == || pInfo[i][pAviso] > 0)// If player isnt bandit and he isnt jailed. 

    
fInfo[i][fPolice] = 1//Then, he is a cop. 

To

PHP код:
foreach(Playeri
if(
!= sorte && pInfo[i][pIdade] != && pInfo[i][pAviso] > 0)// If player isnt bandit and he isnt jailed. 

    
fInfo[i][fPolice] = 1//Then, he is a cop. 

Reply


Messages In This Thread
do while loop not working - by insus100 - 04.03.2018, 22:12
Re: do while loop not working - by AdamsLT - 05.03.2018, 00:28
Re: do while loop not working - by insus100 - 05.03.2018, 10:41
Re: do while loop not working - by insus100 - 05.03.2018, 16:53

Forum Jump:


Users browsing this thread: 2 Guest(s)