My Money doesn't save, only money from Spawn
#8

pawn Код:
public OnPlayerDataSave(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] && gPlayerSpawned[playerid])
        {
            new string[256], playersip[64];
            format(string, sizeof(string), "%s.ini", PlayerName(playerid));
            GetPlayerIp(playerid, playersip, sizeof(playersip));
            if(dini_Exists(string))
            {
                dini_Set(string, "Key", PlayerInfo[playerid][pKey]);
                dini_Set(string, "IP", PlayerInfo[playerid][pIP]);
                dini_IntSet(string, "AdminLevel", PlayerInfo[playerid][pAdmin]);
                dini_IntSet(string, "aDuty", PlayerInfo[playerid][aDuty]);
                dini_IntSet(string, "aTog", PlayerInfo[playerid][aTog]);
                dini_IntSet(string, "pMember", PlayerInfo[playerid][pMember]);
                dini_IntSet(string, "pRank", PlayerInfo[playerid][pRank]);
                dini_IntSet(string, "Banned", PlayerInfo[playerid][pBanned]);
                dini_IntSet(string, "DonateRank", PlayerInfo[playerid][pDonateRank]);
                dini_IntSet(string, "Registered", PlayerInfo[playerid][pReg]);
                dini_IntSet(string, "Warnings", PlayerInfo[playerid][pWarns]);
                dini_IntSet(string, "Cash", PlayerInfo[playerid][pCash]);
                dini_IntSet(string, "Kills", PlayerInfo[playerid][pKills]);
                dini_IntSet(string, "Deaths", PlayerInfo[playerid][pDeaths]);
                dini_IntSet(string, "Muted", PlayerInfo[playerid][pMuted]);
                dini_IntSet(string, "ReportMuted", PlayerInfo[playerid][prMuted]);
                dini_IntSet(string, "ReportTimeMuted", PlayerInfo[playerid][ptrMuted]);
                dini_IntSet(string, "TimeMuted", PlayerInfo[playerid][ptMuted]);
                dini_IntSet(string, "VipMuted", PlayerInfo[playerid][pvMuted]);
                dini_IntSet(string, "VipTimeMuted", PlayerInfo[playerid][pvtMuted]);
                dini_IntSet(string, "FactionMuted", PlayerInfo[playerid][pfMuted]);
                dini_IntSet(string, "FactionTimeMuted", PlayerInfo[playerid][pftMuted]);
                dini_IntSet(string, "KillSpree", PlayerInfo[playerid][pSpree]);
                dini_IntSet(string, "CWons", PlayerInfo[playerid][pCWons]);
                dini_IntSet(string, "Hide", PlayerInfo[playerid][pHide]);
                dini_IntSet(string, "pIgnorePM", PlayerInfo[playerid][pIgnorePM]);
                dini_IntSet(string, "pJailed", PlayerInfo[playerid][pJailed]);
                dini_IntSet(string, "pArrested", PlayerInfo[playerid][pArrested]);
                dini_IntSet(string, "pCrimes", PlayerInfo[playerid][pCrimes]);
                dini_IntSet(string, "pJail", PlayerInfo[playerid][pJail]);
                dini_IntSet(string, "pJailTime", PlayerInfo[playerid][pJailTime]);
                dini_IntSet(string, "Level", PlayerInfo[playerid][Level]);
                dini_IntSet(string, "Exp", PlayerInfo[playerid][Exp]);
                dini_IntSet(string, "pWantedDeaths", PlayerInfo[playerid][pWantedDeaths]);
            }
        }
    }
    return 1;
}
And OnPlayerLogin
pawn Код:
}
    if(PlayerInfo[playerid][pReg] == 0)
    {
        PlayerInfo[playerid][pReg] = 1;
        GivePlayerMoney(playerid, 500);
    }
    gPlayerLogged[playerid] = 1;
    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
    SendClientMessage(playerid, 0x40FF40FF,"SERVER: Успешно влезе в акаунта си.");
    format(string2, sizeof(string2), "Добре дошъл {00B700}%s", PlayerName(playerid));
    SendClientMessage(playerid, COLOR_WHITE,string2);
    GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 21);
    strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
    {
        new string[256];
        new nxtlevel = PlayerInfo[playerid][Level]+1;
        new expamount = nxtlevel*levelexp;
        format(string, sizeof(string), "Админ Левел: %d | ВИП Левел: %d | Ниво: %d | XP: %d/%d | Организация: %s", PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pDonateRank], PlayerInfo[playerid][Level], PlayerInfo[playerid][Exp], expamount, TeamInfo[PlayerInfo[playerid][pMember]][TeamName]);
        SendClientMessage(playerid, COLOR_YELLOW,string);
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)