#1

Can you say what's wrong? I put as if it has less than 3 or more 6 to tell him that message.

PHP код:
if(strval(inputtext) < || strval(inputtext) > 6) {
    
SendClientMessage(playeridCOLOR_WHITE"Clan tag must be between 3 and 6 characters.");
    return 
1;

Reply
#2

Can you provide more detail on the problem? What is going wrong?
Reply
#3

You are not checking the string length, you are transforming it into an integer. You need to use strlen, here you go:

pawn Код:
if(strlen(inputtext) < 3 || strlen(inputtext) > 6) {
    SendClientMessage(playerid, COLOR_WHITE, "Clan tag must be between 3 and 6 characters.");
    return 1;
}
Reply
#4

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
You are not checking the string length, you are transforming it into an integer. You need to use strlen, here you go:

pawn Код:
if(strlen(inputtext) < 3 || strlen(inputtext) > 6) {
    SendClientMessage(playerid, COLOR_WHITE, "Clan tag must be between 3 and 6 characters.");
    return 1;
}
Thanks!
+rep.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)