30.06.2009, 05:25
im trying to make deposit for bank, and am trying to use onplayertext for the amount part, something kind of like:
the problem is the "amount" = how many characters there are, not the actual amount you entered. like 1234 = 4 instead of 1234.
so if you wanted to deposit $500 and enter "500", it say 3 instead because its 3 char..
i searched but cant find how to get the amount.
i hope i make myself clear, please help.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(TestList[playerid] == 1)
{
new amount = strlen(text);
new String[50];
format(String, sizeof(String), "Amount = %i", amount);
SendClientMessage(playerid, 0xE60000FF, String);
TestList[playerid] = 0;
return 0;
}
return 1;
}
so if you wanted to deposit $500 and enter "500", it say 3 instead because its 3 char..
i searched but cant find how to get the amount.
i hope i make myself clear, please help.