Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help (
/showthread.php?tid=586375)
Help -
Edw - 21.08.2015
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) < 3 || strval(inputtext) > 6) {
SendClientMessage(playerid, COLOR_WHITE, "Clan tag must be between 3 and 6 characters.");
return 1;
}
Re: Help -
Simeon87 - 21.08.2015
Can you provide more detail on the problem? What is going wrong?
Re: Help -
ThePhenix - 21.08.2015
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;
}
Re: Help -
Edw - 21.08.2015
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.