For loop
#1

I made a for loop that will get the first key that has the value of 0 but for some reason it takes all the keys that have a value of 0.
Here it is:
PHP код:
            ForLoop(i,MAX_OWNED) if(HKey[playerid][i] == 0HKey[playerid][i] = HouseInfo[h][hKey], printf("House key: %i | House slot: %i",HKey[playerid][i],i); 
ForLoop is just for(new i=0;i<MAX_OWNED;i++)
MAX_OWNED is 3
Reply
#2

pawn Код:
ForLoop(i,MAX_OWNED) if(HKey[playerid][i] == 0) HKey[playerid][i] = HouseInfo[h][hKey], printf("House key: %i | House slot: %i",HKey[playerid][i],i), break;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)