12.12.2016, 00:47
(
Последний раз редактировалось danielpalade; 25.09.2017 в 22:00.
)
-- DELETED --
The HUD only has 8 digits, so an extremely surreal unrealistic economy wasn't a really bright idea.
About getting the total amount of cash held by the users on the server. You can do that with a simple SQL statement that does all the work for you. You just have to display the number it gives you. About players being able to have so unrealistic amounts of money, you can create an array. Look at them as pockets, wallets or whatever. Wallet 1: 500 bucks Wallet 2: 200 bucks Total cash by adding all the wallets up: 700 bucks You just gotta think out of the box sometimes. Good luck and have fun! |
new money[MAX_PLAYERS][20]; stock AddMoney(playerid, money) { for(new i; i < 20; i++) { if(money[playerid][i] < 2147483647) { if(money[playerid][i] + money <= 2147483647) { money[playerid][i] += money; break; } } } }
printf("%i%9i", HIGH, LOW);
But let's say I'd calculate the total sum of the array, I would use a loop. And the variable that returns the total amount is still a 32 bit integer. So I could I do that?
I mean, I already kinda know how to add the money, but I don't know how to calculate it. Код:
new money[MAX_PLAYERS][20]; stock AddMoney(playerid, money) { for(new i; i < 20; i++) { if(money[playerid][i] < 2147483647) { if(money[playerid][i] + money <= 2147483647) { money[playerid][i] += money; break; } } } } |