18.05.2015, 19:54
Код:
enum pInfo { pPass, pLevel, pSpawn, pAdmin, pSpol, pGodine, pPorijeklo, pNovac, pUbistva, pSmrti, CardOwner } Thats the enum and in that lower part CardOwner is if he have the card or not.. enum bInfo { Owner[MAX_PLAYER_NAME], CardNumber, DepositedMoney } new BankInfo[MAX_PLAYERS][bInfo]; this is bInfo I think u understand what it is... forward LoadBankInfo_BankData(playerid,name[],value[]); public LoadBankInfo_BankData(playerid,name[],value[])//you can see that the tag is BankData(like inside the file) { INI_String("Owner",BankInfo[playerid][Owner],24);//we will need to load the stored INI_Int("CardNumber",BankInfo[playerid][CardNumber]);//the card number will be stored INI_Int("DepositedMoney",BankInfo[playerid][DepositedMoney]);//the ammount of deposited ammount stored return 1; } stock BankDB(playerid) { new string[128],pName[MAX_PLAYER_NAME];//we defined the variable that will store the player's name GetPlayerName(playerid,pName,sizeof(pName));//we get the name format(string,sizeof(string),bPATH,pName);//we format the file for the player return string;//this will return his name,because we actually stored in the string the player's name }
Код:
OnPlayerConnect if(fexist(BankDB(playerid))) INI_ParseFile(BankDB(playerid), "LoadBankInfo_%s", .bExtra = true, .extra = playerid); if(PlayerInfo[playerid][CardOwner]==1) bInterest[playerid]=SetTimerEx("BankInterest",1440000,true,"i",playerid);//we set the timer IF the player has a card