SA-MP Forums Archive
inputtext[] returns wrong number - 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: inputtext[] returns wrong number (/showthread.php?tid=322216)



inputtext[] returns wrong number - lukas567 - 01.03.2012

Код:
if(dialogid == 65)
{
   if(response)
   {
	  if(!IsNumeric(inputtext))
	  {
	  ShowPlayerDialog(playerid, 64, DIALOG_STYLE_INPUT, "Loan", "{FF0000}Write number!", "Ok", "");
	  return 1;
	  }
	  new string[50];
	  format(playerDB[playerid][Loan], 24, inputtext);
	  format(string, sizeof(string), "I took: %i", playerDB[playerid][Loan]);
	  SendClientMessage(playerid, RED, string);
   }
return 1;
}
SendClientMessage returns me 49 when i write 1000...

Thanks.


Re: inputtext[] returns wrong number - iPLEOMAX - 01.03.2012

If playerDB[playerid][Loan] is an integer, use:

pawn Код:
playerDB[playerid][Loan] = strval(inputtext);
Untested:

pawn Код:
if(dialogid == 65)
{
   if(response)
   {
      if(!IsNumeric(inputtext))
      {
      ShowPlayerDialog(playerid, 64, DIALOG_STYLE_INPUT, "Loan", "{FF0000}Write number!", "Ok", "");
      return 1;
      }
      new string[50];
      playerDB[playerid][Loan] = strval(inputtext);
      format(string, sizeof(string), "I took: %i", playerDB[playerid][Loan]);
      SendClientMessage(playerid, RED, string);
   }
return 1;
}