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

Hello Everybody. The problem is: when I enter the server I have $3.000 , then I spend $10-15 and exit the server. When I enter it again I have $3.000. So the saving system doesn't work. What can I do with it? Can you help me, please?

That's my OnPlayerDisconnect,OnPlayerSpawn and OnPlayerLogin : Check them.

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
        Delete3DTextLabel(PlayerLabel);
        SaveAccounts();
        OnPlayerDataSave(playerid);
        SetPVarInt(playerid, "laser", 0);
        RemovePlayerAttachedObject(playerid, 0);
        KillTimer(Checkveh[playerid]);

    new pname[MAX_PLAYER_NAME], string[560 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    switch(reason)
    {
pawn Код:
public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, Text[playerid]), TextDrawShowForPlayer(playerid, Text1[playerid]), TextDrawShowForPlayer(playerid, Health[playerid]);
    TextDrawShowForPlayer(playerid,Txt), TextDrawShowForPlayer(playerid, Clock), TextDrawShowForPlayer(playerid, Date);
    PlayerPlaySound(playerid, 1069, 0.0, 0.0, 0.0);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerScore(playerid, PlayerInfo[playerid][pKills]);
    SetPlayerSkillLevel(playerid,0,999);
    SetPlayerSkillLevel(playerid,1,999);
    SetPlayerSkillLevel(playerid,2,999);
    SetPlayerSkillLevel(playerid,3,999);
    SetPlayerSkillLevel(playerid,4,999);
    SetPlayerSkillLevel(playerid,5,999);
    SetPlayerSkillLevel(playerid,6,999);
    SetPlayerSkillLevel(playerid,7,999);
    SetPlayerSkillLevel(playerid,8,999);
    SetPlayerSkillLevel(playerid,9,999);
    SetPlayerSkillLevel(playerid,10,999);
    SetPlayerToTeamColor(playerid);
    SetPlayerSpawn(playerid);
    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
pawn Код:
public OnPlayerLogin_(playerid, password[])
{//15060
    new string2[256], keystring[256];
    format(string2, sizeof(string2), "%s.ini", PlayerName(playerid));
    keystring = dini_Get(string2, "Key");
    if(strcmp(keystring, password, true) == 0) // I assume that's the password check string1 is equal to string2
       {
        PlayerInfo[playerid][pAdmin] = dini_Int(string2,"AdminLevel");
        PlayerInfo[playerid][aDuty] = dini_Int(string2,"aDuty");
        PlayerInfo[playerid][aTog] = dini_Int(string2,"aTog");
        PlayerInfo[playerid][pMember] = dini_Int(string2,"pMember");
        PlayerInfo[playerid][pRank] = dini_Int(string2,"pRank");
        PlayerInfo[playerid][pBanned] = dini_Int(string2,"Banned");
        PlayerInfo[playerid][pDonateRank] = dini_Int(string2,"DonateRank");
        PlayerInfo[playerid][pWarns] = dini_Int(string2,"Warnings");
        PlayerInfo[playerid][pReg] = dini_Int(string2,"Registered");
        PlayerInfo[playerid][pCash] = dini_Int(string2,"Cash");
        PlayerInfo[playerid][pKills] = dini_Int(string2,"Kills");
        PlayerInfo[playerid][pDeaths] = dini_Int(string2,"Deaths");
        PlayerInfo[playerid][pMuted] = dini_Int(string2,"Muted");
        PlayerInfo[playerid][prMuted] = dini_Int(string2,"ReportMuted");
        PlayerInfo[playerid][ptrMuted] = dini_Int(string2,"ReportTimeMuted");
        PlayerInfo[playerid][ptMuted] = dini_Int(string2,"TimeMuted");
        PlayerInfo[playerid][pvMuted] = dini_Int(string2,"VipMuted");
        PlayerInfo[playerid][pvtMuted] = dini_Int(string2,"VipTimeMuted");
        PlayerInfo[playerid][pfMuted] = dini_Int(string2,"FactionMuted");
        PlayerInfo[playerid][pftMuted] = dini_Int(string2,"FactionTimeMuted");
        PlayerInfo[playerid][pSpree] = dini_Int(string2,"KillSpree");
        PlayerInfo[playerid][pCWons] = dini_Int(string2,"CWons");
        PlayerInfo[playerid][pHide] = dini_Int(string2,"Hide");
        PlayerInfo[playerid][pIgnorePM] = dini_Int(string2,"pIgnorePM");
        PlayerInfo[playerid][pJailed] = dini_Int(string2,"pJailed");
        PlayerInfo[playerid][pArrested] = dini_Int(string2,"pArrested");
        PlayerInfo[playerid][pCrimes] = dini_Int(string2,"pCrimes");
        PlayerInfo[playerid][pJail] = dini_Int(string2,"pJail");
        PlayerInfo[playerid][pJailTime] = dini_Int(string2,"pJailTime");
        PlayerInfo[playerid][Level] = dini_Int(string2,"Level");
        PlayerInfo[playerid][Exp] = dini_Int(string2,"Exp");
        PlayerInfo[playerid][pWantedDeaths] = dini_Int(string2,"pWantedDeaths");
    }
    else
    {
Thanks guys
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)