How to convert strings to int?
#1

I'm trying to create a dialog that will get the age when the player types it in the dialog.
The problem is that I don't know if it's possible to convert strings to int in pawn.

pawn Код:
if(IsNumeric(inputtext))
{
  PlayerInfo[playerid][pAge] = inputtext;
}
I don't want to change Age to a string.

Код:
error 033: array must be indexed (variable "inputtext")
error 006: must be assigned to an array
Reply
#2

Код:
PlayerInfo[playerid][pAge] = strval(inputtext);
xD
Reply
#3

Quote:
Originally Posted by Jefff
Код:
PlayerInfo[playerid][pAge] = strval(inputtext);
xD
Thanks, lol.
Sorry for the stupid questions
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)