Is there a way to optimize this code?
#7

AmigaBlizzard has got a point. Instead of saving money as string, you can have 2 integer arrays. One being for money and the other for coins. Showing the money would look like this (an example):
pawn Код:
format(string, sizeof string, "My money: %d.%02d$", gPlayer[playerid][Money], gPlayer[playerid][Coins]);
The need of splitting is now unnecessary.

%02d ads zero in front in case it is 1 digit. "9" becomes "09".
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)