Inputtext
#1

Hey guys,

How can i indicate the first word in an inputtext? Like i type: 0 500, then i want the 0 as playerid, and the 500 as cash amount.
What do i do? Something like inputtext[0], inputtext(0), or what? I've tried inputtext[0], but that didnt work..

Any help please?
~Wesley
Reply
#2

Make 2 dialogs ? ^^ 1st for playerid and secound for the cash :P
Reply
#3

There's no other way to do this?
Reply
#4

Код:
new TargetID,Amount,string[128];
if(!sscanf(inputtext,"uD(500)",TargetID,Amount))
{
	format(sting,sizeof(string),"TID:%d Amount:%d",TargetID,Amount);
}
else
{
	format(sting,sizeof(string),"TID:%d Amount:%d (=default)",TargetID,Amount);
}
SendClientMessageToAll(0xffffffff,string);
...using sscanf2 indeed
Reply
#5

Yeah well, im using dialogs for this, anyway to use sscanf with dialogs or..?
Reply
#6

Read again.
Reply
#7

Oh duh, miss-readed
Thanks Babu & Vince
Reply
#8

Sorry for double post, but im not gonna make a new topic for this since its about the same subject

pawn Код:
if(!sscanf(inputtext, "ud(50)", TargetID, Amount))
{
if(strval(Amount) > dini_Int(file1, "Cash amount")) return SendClientMessage(playerid, SKY_BLUE, " ** You do not have that amount of money on your bank account! ") && TransferBB
}
Код:
D:\RolePlay\filterscripts\Bank.pwn(415) : error 035: argument type mismatch (argument 1)
What can i do to solve this? I think the error is about "strval(Amount)", but not sure about this.
Reply
#9

Change strval(Amount) to Amount, cause it's int not string.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)