05.03.2018, 00:28
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
To
Change
PHP код:
foreach(Player, i)
if(i != sorte || pInfo[i][pIdade] == 1 || pInfo[i][pAviso] > 0)// If player isnt bandit and he isnt jailed.
{
fInfo[i][fPolice] = 1; //Then, he is a cop.
}
PHP код:
foreach(Player, i)
if(i != sorte && pInfo[i][pIdade] != 1 && pInfo[i][pAviso] > 0)// If player isnt bandit and he isnt jailed.
{
fInfo[i][fPolice] = 1; //Then, he is a cop.
}