SA-MP Forums Archive
This loop won't work, very strange. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: This loop won't work, very strange. (/showthread.php?tid=501373)



This loop won't work, very strange. - Dokins - 17.03.2014

pawn Код:
new vehicleamount;
                    for(new v = 1; v <= MAX_VEHICLES; v++)
                    {
                        if(VehOwner[v] == PlayerSQLID[playerid])
                        {
                            vehicleamount++;
                            printf("VEH OWNER: %d", VehOwner[v]);
                            printf("PlayerSQLID %d", PlayerSQLID[playerid]);
                        }
                    }
                    if(vehicleamount >= PlayerLevel[playerid])return SendClientMessage(playerid, COLOUR_GREY, "You have the maximum amount of vehicles for your level.");

It won't display the results in the printfs either, very odd. Yes, I start vehicleids from 1, makes it tidier to see in database.


Re: This loop won't work, very strange. - Calabresi - 17.03.2014

pawn Код:
VehOwner[v] == PlayerSQLID[playerid]
Only explanation of this problem lies in this line. Are you sure that they equal each other? Try prinf'ing them before the if statement and see if they do.