[DINI]How to make a Bank System?
#1

Sorry guys, but i am stuck on how to make a bank system involing dini. If anyone could help it would be greatly apperciated...
Reply
#2

Here's an example (Not tested)

pawn Код:
#include <a_samp>
#include <dini>

new PlayerBankAmount[MAX_PLAYERS];

public OnPlayerConnect(playerid) {
     PlayerBankAmount[playerid] = 0;
     new string[66];
     GetPlayerName(playerid, string, 24);
     format(string, 66, "Bank/%s.ini",  string);
     if(dini_Exists(string)) {
          PlayerBankAmount[playerid] = dini_Int(string, "Cash");
     }
     else {
          dini_Create(string);
     }
}

public OnPlayerDisconnect(playerid, reason) {
     new string[66];
     format(string, 66, "Bank/%s.ini",  string);
     dini_IntSet(string, "Cash", PlayerBankAmount[playerid]);
}

stock AddBankCash(playerid, amount) {
     PlayerBankAmount[playerid] += amount;
}
Reply
#3

Thanks il try it when i get home.
Reply
#4

Quote:
Originally Posted by Steven82
Посмотреть сообщение
Thanks il try it when i get home.
Alright. PS: Answer your visitor message, or go on MSN, I had you on my contact list since March..
Reply
#5

You should prolly go MySQL. It is a lot easier to make functions

Your choice, just a suggestion.
Reply
#6

Carlton, i toltally forgot i had you on MSN ROFL, i will ask you questions if i need anymore help :P
Reply
#7

You can always take a look at the bank systems on other GM's...
The one's that use DINI are all basically the same, with small variations.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)