19.05.2015, 06:59
But he's checking if they 'don't' match, which is the exact opposite. The code you have now is correct, but it will be case sensitive.
So lets say a valid license plate was "ABC123". If you put in 'abc123', it will return true and it will say the license plate does not exist. However if you put 'ABC123', it will return false and the plates will match. To remove this, just change the case sensitivity or 'ignorecase' to true.
If this code doesn't work, then your VehPlate[x] or possibly the loop that you're using it in, is wrong.
Take note, strcmp also returns false if either of the strings is empty.
So lets say a valid license plate was "ABC123". If you put in 'abc123', it will return true and it will say the license plate does not exist. However if you put 'ABC123', it will return false and the plates will match. To remove this, just change the case sensitivity or 'ignorecase' to true.
If this code doesn't work, then your VehPlate[x] or possibly the loop that you're using it in, is wrong.
pawn Code:
if(strcmp(plate, VehPlate[x], true)) return SendClientMessage(playerid, COLOUR_GREY, "That license plate does not exist.");