My bank system [Help]
#1

Well, I've designed a full banking system and everything works the way it should but I thought it would be a nicer interface if I used Dialogs... So I came across a problem with that..
For my Withdraw and deposit dialog. There both input boxes but how do I retrieve the inputtext and put it to a variable that I can use later on?

In other words
Making a variable called bankwithdraw

Then once I have put the inputtext to the bankwithdraw I can do
PlayerInfo[playerid][BankAmount] - bankwithdraw
So it subtracts how ever much the player typed from the money in their bank account. Thanks
Reply
#2

bump Anyone?
Reply
#3

You have to use strval:

pawn Код:
PlayerInfo[ playerid ][ BankAmount ] -= strval( inputtext );
It will substract the ammount of money the player has entered in the dialog.
Reply
#4

And when a player types any negative number into the box, it will add it to his account (because minus-minus makes plus). Needs more checks, to say the least.
Reply
#5

Quote:
Originally Posted by Vince
Посмотреть сообщение
And when a player types any negative number into the box, it will add it to his account (because minus-minus makes plus). Needs more checks, to say the least.
It only needs to check with < >.
Reply
#6

Oh yeah Vince, your right. I would never have thought of that! How would I do checks and things to make sure they don't use a negative? I've never had to do it before so never thought of that
Reply
#7

pawn Код:
if ( strval ( inputtext ) < 0 )
{
    // Do you code
}
Reply
#8

Oh thats simple! Thanks very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)