Checking if a string matches, not working?
#1

pawn Код:
for(new x = 0; x < MAX_VEHICLES; x++)
                    {
                        if(strcmp(inputtext, VehPlate[x], true))
                        {
                            id = x;
                            printf("ID %d", x);
                            break;
                        }
                    }
I'm looping through all vehicles to check if the plate that I've typed in matches any, this doesn't work at all, it returns 0.

Thanks for any assistance.
Reply
#2

It will return 0 if either string is empty. Vehicle IDs start at 1. So start your loop at 1 with: new x = 1.
Reply
#3

Didn't resolve it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)