Value still setting to 100.
#1

If I type 100 in the input box, it sets it to 100. When it should set it to 99.
pawn Код:
if(strlen(inputtext) > 98)// If the Input = Greater than 98, it Auto sets it to 99.
{
    DuelArmor = 99;
}
else
{
    new Float:armor = strval(inputtext);
    DuelArmor = armor;
}
Reply
#2

strlen returns the number of characters, you need to use strval
pawn Код:
if(strval(inputtext) > 98) DuelArmor = 99;
else DuelArmor = strval(inputtext);
Reply
#3

So would I use;
giveplayerid = strval(inputtext);
as-well?
Reply
#4

Quote:
Originally Posted by Lynn
Посмотреть сообщение
So would I use;
giveplayerid = strval(inputtext);
as-well?
Yes, strval converts a string to an integer
Reply
#5

Alright, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)