[DINI]How to make a Bank System?
#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


Messages In This Thread
[DINI]How to make a Bank System? - by Steven82 - 03.08.2010, 23:39
Re: [DINI]How to make a Bank System? - by Carlton - 03.08.2010, 23:50
Re: [DINI]How to make a Bank System? - by Steven82 - 03.08.2010, 23:58
Re: [DINI]How to make a Bank System? - by Carlton - 03.08.2010, 23:59
Re: [DINI]How to make a Bank System? - by ScottCFR - 04.08.2010, 00:01
Re: [DINI]How to make a Bank System? - by Steven82 - 04.08.2010, 04:36
Re: [DINI]How to make a Bank System? - by John_F - 04.08.2010, 06:16

Forum Jump:


Users browsing this thread: 1 Guest(s)