inputtext & floats - 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 & floats (
/showthread.php?tid=372297)
inputtext & floats -
2KY - 26.08.2012
How would I go about doing them without getting an error? Currently, I have..
pawn Код:
case DIALOG_HOUSEEDIT + 4: // Editing the house interior X position
{
if( response )
{
new
hStr [ 128 ];
houStats [ plEditingHouse [ playerid ] ] [ EnterInteriorPosition ] [ 0 ] = inputtext;
format( hStr, 128, "» House Interior X Position for House ID %d has been set to %f.", plEditingHouse [ playerid ], inputtext );
SendClientMessage( playerid, -1, hStr );
SaveHouse( plEditingHouse [ playerid ] );
plEditingHouse [ playerid ] = -1;
}
}
And I'm getting an error that inputtext needs to be assigned to an array. How would I go about doing this?
Re: inputtext & floats -
Ballu Miaa - 26.08.2012
Even i was thinking about this 2KY but was unable to set this as a Integer or Floating variable. So i used sscanf to modify these parts.
Any alternative?
Re: inputtext & floats -
2KY - 26.08.2012
If you don't mind me asking, how did you use sscanf in this situation?
Re: inputtext & floats -
Ballu Miaa - 26.08.2012
Quote:
Originally Posted by 2KY
If you don't mind me asking, how did you use sscanf in this situation?
|
I wasnt actually editing something. I was creating factions function with dialogs. So i had to input the integer number via the dialog box.
Whenever i was trying to do it, The same error appeared. So what i exactly did. Made a create faction command in which i input a new integer for the skin id using sscanf.
I think for the modification purpose. Add a CMD to see your current X,Y,Z. And make a command to set its new coordinates. Input them as floating numbers.
Re: inputtext & floats -
leonardo1434 - 26.08.2012
use format function to add the inputtext.
AW: inputtext & floats -
Nero_3D - 26.08.2012
pawn Код:
new Float: X = floatstr(inputtext);
Re: inputtext & floats -
ReneG - 26.08.2012
Adding to the post above.
pawn Код:
format( hStr, 128, "» House Interior X Position for House ID %d has been set to %f.", plEditingHouse [ playerid ], floatstr(inputtext) );
Manually inputting coordinates can be a pain though.