InputText
#1

I'm trying to do the following:

pawn Код:
if(inputtext < 18 || inputtext > 99) { return SendClientMessage(playerid, red, "[ERROR] Invalid Age."); }
How would I go about doing that? I've currently got the code above, and it's giving me this error:

Quote:
Originally Posted by PAWNO
error 033: array must be indexed (variable "inputtext")
Reply
#2

why do u have brackets in that?
Reply
#3

pawn Код:
if(strval(inputtext) < 18 || strval(inputtext) > 99)
    return SendClientMessage(playerid, red, "[ERROR] Invalid Age.");
Reply
#4

Because you kind of need them?

pawn Код:
if(inputtext > 18 || inputtext > 99)
{
     SendClientMessage(playerid, red, "[ERROR] Invalid Age.");
     return 1;
}
Is that a bit easier to read for you?

Quote:
Originally Posted by bigcomfycouch
Посмотреть сообщение
pawn Код:
if(strval(inputtext) < 18 || strval(inputtext) > 99)
    return SendClientMessage(playerid, red, "[ERROR] Invalid Age.");
Thank you very much, I was looking for strval.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)