SA-MP Forums Archive
Loop problem. - 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: Loop problem. (/showthread.php?tid=378866)



Loop problem. - fordawinzz - 19.09.2012

Ok, I'm having a little trouble with this:
pawn Код:
stock GetFurnitureID(name[])
{
    for(new i = 1; i <= CountDynamicObjects(); i++)
    {
        if(strcmp(debugFurniture[objectsVariables[i][oFurnitureIDS]][dfName], name, true) == 0)
        {
            return i;
        }
    }
    return 0;
}
This code always returns 1, when I use any string there, even if it is correct or incorrect.. Why it won't return 0?

I also tried with the break method, still nothing