inputtext & floats
#1

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?
Reply
#2

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?
Reply
#3

If you don't mind me asking, how did you use sscanf in this situation?
Reply
#4

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.
Reply
#5

use format function to add the inputtext.
Reply
#6

pawn Код:
new Float: X = floatstr(inputtext);
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)