How to?
#1

I Have Textdraw for a bank system , but i use like

pawn Код:
new Hi[MAX_PLAYERS];

//When I Show The Main TD

Hi[playerid] = 1;
But i want to like
Show : Put The Amount to deposit

The action is like when a player types 2390154210 or in this case a %d and that td is showing deposit that into account
Reply
#2

Didn't understand you well enough. But I guess you're gonna need Format to format a string and insert the "amount" you want into it then use TextDrawSetString to add the formatted string into your created textdraw. Ah if it's the first time you work with textdraws, then I advise you to read this tutorial.
Reply
#3

but i mean like Checking the stuff that he wrote

I mean :

Instead of doing /deposit (amount)


Appear A TD saying :

Enter The Amount To Deposit

and he enters Ex: 8428 so 8428 will deposit to his account
Reply
#4

I can't understand what you are trying to say re-edit it and try to explain it better.
Reply
#5

i tried this :

pawn Код:
if(strcmp(cmd, "2", true) == 0)
    {
        if(sbi[playerid] == 1)
        {
            new newtext[254];
            format(newtext, sizeof(newtext), "~y~%s~n~~n~~y~-~w~Welcome To The Business Bank~n~~y~1.~w~Deposit~n~~y~2.~w~Withdraw~n~~y~",dini_Get(file, "Name"));
            TextDrawSetString(bmenu, newtext);
            TextDrawShowForPlayer(playerid, bmenu);
            bbank[playerid] = 1;
        }
        return 0;
    }
    if(bbank[playerid] == 1 && IsNumeric(text))
    {
        print("Depositing Into Business Acount");
        return 0;
    }
And it does print that , but when i try this

pawn Код:
if(strcmp(cmd, "2", true) == 0)
    {
        if(sbi[playerid] == 1)
        {
            new newtext[254];
            format(newtext, sizeof(newtext), "~y~%s~n~~n~~y~-~w~Welcome To The Business Bank~n~~y~1.~w~Deposit~n~~y~2.~w~Withdraw~n~~y~",dini_Get(file, "Name"));
            TextDrawSetString(bmenu, newtext);
            TextDrawShowForPlayer(playerid, bmenu);
            bbank[playerid] = 1;
        }
        return 0;
    }
    if(bbank[playerid] == 1 && IsNumeric(text))
    {
        GivePlayerMoney(playerid, -text);
        return 0;
    }
pawn Код:
C:\Users\Usuario\Desktop\Projects\AChr1s\filterscripts\BizNonmysql.pwn(556) : error 035: argument type mismatch (argument 2)
Reply
#6

pawn Код:
GivePlayerMoney(playerid, -strval(text));
Reply
#7

Done and repped , but can you explain me why is that the strval , you know for learn more gracias
Reply
#8

Strval turns a string into an integer... Everything you input in the chat is a string which is why you can use strcmp, it compares strings. But giveplayermoney only accepts integers, this is why you convert it with strval
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)