+ & - Confusion
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
if(ammount > 0) format(string, sizeof(string), "+%d", ammount);
else if(ammount < 0) format(string, sizeof(string), "-%d", ammount);
PS: I think it's spelled "amount".
Thanks about it tho', corrected the spellings too.

But.

pawn Код:
public OnPlayerDeath(...)
{
GivePlayerMoneyEx(playerid, -5000);
return 1;
}

//I'd rather use this
if(amount > 0) format(string, sizeof(string), "+%d", amount);
else if(amount < 0) format(string, sizeof(string), "%d", amount);
//since the function already gives a minus sign.
Reply


Messages In This Thread
+ & - Confusion - by Patrick - 18.09.2013, 21:45
Re: + & - Confusion - by Konstantinos - 18.09.2013, 21:49
Re: + & - Confusion - by Patrick - 18.09.2013, 21:55

Forum Jump:


Users browsing this thread: 1 Guest(s)