[DINI]How to make a Bank System? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [DINI]How to make a Bank System? (
/showthread.php?tid=165227)
[DINI]How to make a Bank System? -
Steven82 - 03.08.2010
Sorry guys, but i am stuck on how to make a bank system involing dini. If anyone could help it would be greatly apperciated...
Re: [DINI]How to make a Bank System? -
Carlton - 03.08.2010
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;
}
Re: [DINI]How to make a Bank System? -
Steven82 - 03.08.2010
Thanks il try it when i get home.
Re: [DINI]How to make a Bank System? -
Carlton - 03.08.2010
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..
Re: [DINI]How to make a Bank System? -
ScottCFR - 04.08.2010
You should prolly go MySQL. It is a lot easier to make functions
Your choice, just a suggestion.
Re: [DINI]How to make a Bank System? -
Steven82 - 04.08.2010
Carlton, i toltally forgot i had you on MSN ROFL, i will ask you questions if i need anymore help :P
Re: [DINI]How to make a Bank System? -
John_F - 04.08.2010
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.