Posts: 453
Threads: 173
Joined: Jun 2011
Reputation:
0
Hi,
I have variable with Float type.
I want player can change this value, but how to make format player must enter: (ex in dialog).
10.50
And set that value what player input in dialog to my Float variable.
Posts: 1,189
Threads: 51
Joined: Jan 2012
Reputation:
0
Show your Variable please.
Posts: 453
Threads: 173
Joined: Jun 2011
Reputation:
0
Thanks you, but i want to do you must add a don (.). Just like a float number, if you enter normal number then nothing happing, if player enter a float number, then that inputted float set to my float variable.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
That code that MouseBreaker posted should give a tag mismatch. Use floatstr instead. Or, if you want to enforce it: use sscanf.
Posts: 453
Threads: 173
Joined: Jun 2011
Reputation:
0
Thanks. But can i do this, you can only input in dialog only numbers and don? if you put other letters then nothing happin.
Posts: 485
Threads: 9
Joined: May 2011
Reputation:
0
You could use either sscanf to check if the input is a float, or probably better use strfind and check for a decimal.. And if no devimal is found just have it show the dialog ahain.