strlen inputtext not working properly? - 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)
+--- Thread: strlen inputtext not working properly? (
/showthread.php?tid=388596)
strlen inputtext not working properly? -
RLGaming - 29.10.2012
pawn Код:
else if(strlen(inputtext) < BankInfo[playerid][pBankMoney][0])
{
if(BankInfo[playerid][pActiveAcc][0] == 1)
{
new withdrawd = strlen(inputtext);
GivePlayerMoney(playerid, withdrawd);
format(string, sizeof(string), "You have withdrawn $%d from Bank Account 1.", withdrawd);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
BankInfo[playerid][pBankMoney][0] -= withdrawd;
}
else SendClientMessage(playerid, COLOR_LIGHTRED, "That account is not active and valid, you cannot withdraw from it!");
}
I have this on my dialog response but say I withdraw like 5000 it will say I have withdrawn $2? and it will give me the $2 not the 5000
Any help on this? I have no idea why it isn't giving me the full amount, not good with strlen(inputtext)
Re: strlen inputtext not working properly? -
nGen.SoNNy - 29.10.2012
It's not working if you try to use just inputtext? without strlen?
Re: strlen inputtext not working properly? -
Vince - 29.10.2012
Duh, strlen returns the length of the text (hence
string
length). Use strval.
Re: strlen inputtext not working properly? -
RLGaming - 29.10.2012
Quote:
Originally Posted by Vince
Duh, strlen returns the length of the text (hence string length). Use strval.
|
Worked, thank you.
Rep'd