Help with taking strval(inputtext)
#2

Any number multiplied by "-1" will change its sign:
pawn Code:
new value = strval(inputtext);
if(value > 0) GivePlayerMoney(playerid, value * (-1));
else
{
    // The value was negative or just zero.
}
Or:
pawn Code:
new value = strval(inputtext);
if(value <= 0) value *= -1;
GivePlayerMoney(playerid, value);
Reply


Messages In This Thread
Help with taking strval(inputtext) - by slymatt - 25.07.2011, 21:19
Re: Help with taking strval(inputtext) - by Miguel - 25.07.2011, 21:27
Re: Help with taking strval(inputtext) - by slymatt - 25.07.2011, 21:32
Re: Help with taking strval(inputtext) - by iPLEOMAX - 25.07.2011, 21:35
Re: Help with taking strval(inputtext) - by Miguel - 25.07.2011, 21:36
Re: Help with taking strval(inputtext) - by slymatt - 25.07.2011, 21:37

Forum Jump:


Users browsing this thread: 2 Guest(s)