Loop death end.
#1

Hello.

And again I get stuck at something wierds...


Here is my code:
str = the player name.
pawn Код:
new bool:valid,tempchar[2];
    for(new n = 0; n < strlen(str); n++)
    {
        valid = false;
        for(new c = 0; c < sizeof(ARY_VALID_MAIN_CHARACTERS); c++)
        {
            strmid(tempchar, str, n, n+1);
            if(strcmp(tempchar,ARY_VALID_MAIN_CHARACTERS[c], true ) == 0)
            {
                valid = true;
            }
        }
        if(valid == false)
        {
            return true;
        }
    }
Problem,

When the player name is like RoelRoel it works fine.
But if it is, RoelRoelRoelRoel, it just keep looping and won't give me a return...
I can't find the reason, maybe somebody can?
Reply
#2

ARY_VALID_MAIN_CHARACTERS contains valid or invalid caracters ?
Reply
#3

Thanks for you reply, but nothing was wrong with this, my fault it was a query after it that didn't had the correct string size.
Reply
#4

pawn Код:
if(!valid) return true;
else return false;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)