diff --git a/plugins/include/string.inc b/plugins/include/string.inc index feacf0df..f9955dd2 100755 --- a/plugins/include/string.inc +++ b/plugins/include/string.inc @@ -125,4 +125,17 @@ native strcat(dest[], const source[], maxlength); native strfind(const string[], const sub[], ignorecase=0, pos=0); /* Compares two strings with the C function strcmp(). Returns 0 on equal. */ -native strcmp(const string1[], const string2[], ignorecase=0); \ No newline at end of file +native strcmp(const string1[], const string2[], ignorecase=0); + +// tests if given string contains only digits +stock bool:is_str_num(sString[]) +{ + new i = 0, len = strlen(sString); + + do + { + if (!isdigit(sString[i])) + return false; + } while (i++ < len); + return true; +} \ No newline at end of file