DialogBox 'inputtext'
#1

Is there a way you can find out if 'inputtext' is bigger or smaller that a players cash (say PlayerInfo[playerid][pCash] represented players cash)
Reply
#2

pawn Код:
if(strval(inputtext) > PlayerInfo[playerid][pCash]) //The player is a poor mofo lol
That was easy wasn't it?
Reply
#3

Ah i was missing (strval) , thanks man
Reply
#4

LOL major fail in my code..

pawn Код:
if(dialogid==6)
{
if(!response)return 0;
if(strval(inputtext) > PlayerInfo[playerid][pCash]) {
SendClientMessage(playerid, COLOR_RED, "You cannot depost more money that you atcually have!");
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - (strval)inputtext;
AntiHack(playerid, -(strval)inputtext);
PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] + (strval)inputtext;
}
Reply
#5

bumpkins
Reply
#6

Quote:
Originally Posted by Antonio (eternalrp.webatu.com)
LOL major fail in my code..

pawn Код:
if(dialogid==6)
{
if(!response)return 0;
if(strval(inputtext) > PlayerInfo[playerid][pCash]) {
SendClientMessage(playerid, COLOR_RED, "You cannot depost more money that you atcually have!");
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - (strval)inputtext;
AntiHack(playerid, -(strval)inputtext);
PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] + (strval)inputtext;
}
Are you a complete retard?

pawn Код:
strval(STRING);
not

pawn Код:
(strval)string
Furthermore, you're allowed to bump every 12 hours, not every 12 minutes. Follow the forum rules.
Reply
#7

Thanks for the help.

Furthermore, I don't care for the rules. ( Kidding )
Reply
#8

Fuck, kay, I fixed it but now I have a new problem.

When I enter any number, It takes the money from me and instantly closes the dialog box. Help please?

pawn Код:
if(dialogid==6)
{
if(!response)return 0;
if(strval(inputtext) > PlayerInfo[playerid][pCash]) {
SendClientMessage(playerid, COLOR_RED, "You cannot deposit more money that you atcually have!");
}
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - strval(inputtext);
AntiHack(playerid, -strval(inputtext));
PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] + strval(inputtext);
}
Reply
#9

Then re-open the dialog after doing your stuff.
Reply
#10

It closes as I put the first number in, Ive done something wrong
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)