Inputtext - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Inputtext (
/showthread.php?tid=262787)
Inputtext -
Wesley221 - 19.06.2011
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
Re: Inputtext -
sleepysnowflake - 19.06.2011
Make 2 dialogs ? ^^ 1st for playerid and secound for the cash :P
Re: Inputtext -
Wesley221 - 19.06.2011
There's no other way to do this?
Re: Inputtext -
Babul - 19.06.2011
Код:
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
Re: Inputtext -
Wesley221 - 19.06.2011
Yeah well, im using dialogs for this, anyway to use sscanf with dialogs or..?
Re: Inputtext -
Vince - 19.06.2011
Read again.
Re: Inputtext -
Wesley221 - 19.06.2011
Oh duh, miss-readed
Thanks Babu & Vince
Re: Inputtext -
Wesley221 - 19.06.2011
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.
Re: Inputtext -
Mr4rtur - 19.06.2011
Change strval(Amount) to Amount, cause it's int not string.