Weird character using strlen(inputtext)?
#1

I have this under a dialog response;
pawn Код:
if(strlen(inputtext) < 64 || strlen(inputtext) > 0)
            {
                new iFac;
                iFac = 0;
                FactionData[iFac][pFacName] = strlen(inputtext);
                format(string, sizeof(string), "You have just re-named faction ID 0 to %s.", inputtext);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            }
It will say in the client message correctly what I entered but when I look at it after its a weird character like a |_ kinda shape? Idk why, also putting just 'FactionData[iFac][pFacName] = inputtext;' doesn't work so, any other ideas?
Reply
#2

Hmm, you may try this:

pawn Код:
format(FactionData[iFac][pFacName], /*some length here*/, "%s", inputtext);
instead of:

pawn Код:
FactionData[iFac][pFacName] = strlen(inputtext);
Reply
#3

Just want to mention that you probably would want to use the AND operator in your structure. If the player types something with length 120, that statement will still hold true because of the last part (> 0). Or use this, which is more straightforward:

pawn Код:
if(0 < strlen(inputtext) < 64)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)