strlen problem
#1

if(strlen(inputtext) > 4 && strlen(inputtext) < 1)
{
SendClientMessage(playerid, COLOR_GREY, "Tag allowed lenght 1-4 charachters");
ShowPlayerDialog(playerid, DIALOG_CLANTAG, DIALOG_STYLE_INPUT, "Clan tag:", "Choose you clan tag:", "Choose" , "Cancel");
return 1;
}
this is the lenght restriction when im creating the clan tag,i can still enter a tag over 4 charachters or under 1,wich is nothing,i can basicly just press enter and the tag will be set to a blank space and it still works,it's like strlen is ignored by the script
Reply
#2

You're checking if the length is longer than 4 AND shorter than 1 character. It can't be both!

You need to check if it's longer than 4 OR shorter than 1.
Reply
#3

Quote:
Originally Posted by NaS
Посмотреть сообщение
You're checking if the length is longer than 4 AND shorter than 1 character. It can't be both!

You need to check if it's longer than 4 OR shorter than 1.
sily me,it works now thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)