SA-MP Forums Archive
Inputtext errors - 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 errors (/showthread.php?tid=487065)



Inputtext errors - maxy153 - 11.01.2014

pawn Код:
AVehicleData[vid][Fuel] +inputtext;
Error:
Код:
error 033: array must be indexed (variable "inputtext")
Same error on this line:
pawn Код:
new RefuelPrice = (Amount * RefuelMaxPrice) / inputtext;



Re: Inputtext errors - InfiniTy. - 11.01.2014

Use
pawn Код:
strval(inputtext)
Strval


Re: Inputtext errors - Konstantinos - 11.01.2014

If you input in the dialog an integer:
pawn Код:
new RefuelPrice = (Amount * RefuelMaxPrice) / strval(inputtext);
else if a float:
pawn Код:
new RefuelPrice = (Amount * RefuelMaxPrice) / floatstr(inputtext);



Re: Inputtext errors - maxy153 - 11.01.2014

Thanks InfiniTy. and Konstantinos
+rep


Re: Inputtext errors - Patrick - 11.01.2014

In my understand code should look like this, you forgot a =

pawn Код:
AVehicleData[vid][Fuel] = strval(inputtext);