15.03.2014, 13:17
Quote:
Bump. I made something, but the problem is, when it detects 8 characters, any of them, it says advertising. Here is the script. Can someone make it with numbers only?
pawn Код:
|
instead of using OR, you have to use AND
cuz that control structure should only result in true when the char is within the range you defined by '0' and '9'
c++ example checking for uppercase chars and replacing them with lower case ones:
Код:
void strKlein(char *c) { for (short i = 0; c[i] != '\0'; i++) c[i] = (c[i] > 64 && c[i] < 91) ? (c[i]+32) : (c[i]); }
Код:
if (str[i] >= '0' || str[i] <= '9') numbers++;
Код:
if (str[i] >= '0' && str[i] <= '9') numbers++;