SA-MP Forums Archive
[ajuda] salvar - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [ajuda] salvar (/showthread.php?tid=289303)



[ajuda] salvar - Cristhian - 11.10.2011

Bom, jб coloquei para salvar o level de admin do player no final do GM, mas quando relogo continua a desaparecer o nvl de admin.. se alguйm souber como arrumo isso --'


Re: [ajuda] salvar - ceesar90 - 11.10.2011

posta aн como vocк usou para salvar.


Re: [ajuda] salvar - Cristhian - 11.10.2011

pawn Код:
new string3[256];
            new pname3[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pname3, sizeof(pname3));
            format(string3, sizeof(string3), "Players/%s.ini", pname3);
            new File: pFile = fopen(string3, io_write);
            if (pFile)
            {
                new pIp[128];
                GetPlayerIp(playerid, pIp, sizeof(pIp));
                new var[32];
                format(var, 32, "Password=%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var);
                fclose(pFile);
                new File: hFile = fopen(string3, io_append);
                PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
                format(var, 32, "IP=%s\n", pIp);fwrite(hFile, var);
                format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
                format(var, 32, "Warnings=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
                format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
                format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
                format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
                format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
                format(var, 32, "Bank=%d\n",PlayerInfo[playerid][pBank]);fwrite(hFile, var);
                format(var, 32, "Skin=%d\n",PlayerInfo[playerid][pSkin]);fwrite(hFile, var);
                format(var, 32, "TimesConnected=%d\n",PlayerInfo[playerid][pTimes]);fwrite(hFile, var);
                format(var, 32, "PlayingHours=%d\n",PlayerInfo[playerid][pHours]);fwrite(hFile, var);
                format(var, 32, "PlayingMinutes=%d\n",PlayerInfo[playerid][pMins]);fwrite(hFile, var);
                format(var, 32, "JailTime=%d\n",PlayerInfo[playerid][pJailTime]);fwrite(hFile, var);
                format(var, 32, "DayRegistered=%d\n",PlayerInfo[playerid][pDate1]);fwrite(hFile, var);
                format(var, 32, "MonthRegistered=%d\n",PlayerInfo[playerid][pDate2]);fwrite(hFile, var);
                format(var, 32, "YearRegistered=%d\n",PlayerInfo[playerid][pDate3]);fwrite(hFile, var);
                fclose(hFile);
OBS: jб tentei em dini..


Re: [ajuda] salvar - ceesar90 - 11.10.2011

Quote:
Originally Posted by Cristhian
Посмотреть сообщение
pawn Код:
new string3[256];
            new pname3[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pname3, sizeof(pname3));
            format(string3, sizeof(string3), "Players/%s.ini", pname3);
            new File: pFile = fopen(string3, io_write);
            if (pFile)
            {
                new pIp[128];
                GetPlayerIp(playerid, pIp, sizeof(pIp));
                new var[32];
                format(var, 32, "Password=%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var);
                fclose(pFile);
                new File: hFile = fopen(string3, io_append);
                PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
                format(var, 32, "IP=%s\n", pIp);fwrite(hFile, var);
                format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
                format(var, 32, "Warnings=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
                format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
                format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
                format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
                format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
                format(var, 32, "Bank=%d\n",PlayerInfo[playerid][pBank]);fwrite(hFile, var);
                format(var, 32, "Skin=%d\n",PlayerInfo[playerid][pSkin]);fwrite(hFile, var);
                format(var, 32, "TimesConnected=%d\n",PlayerInfo[playerid][pTimes]);fwrite(hFile, var);
                format(var, 32, "PlayingHours=%d\n",PlayerInfo[playerid][pHours]);fwrite(hFile, var);
                format(var, 32, "PlayingMinutes=%d\n",PlayerInfo[playerid][pMins]);fwrite(hFile, var);
                format(var, 32, "JailTime=%d\n",PlayerInfo[playerid][pJailTime]);fwrite(hFile, var);
                format(var, 32, "DayRegistered=%d\n",PlayerInfo[playerid][pDate1]);fwrite(hFile, var);
                format(var, 32, "MonthRegistered=%d\n",PlayerInfo[playerid][pDate2]);fwrite(hFile, var);
                format(var, 32, "YearRegistered=%d\n",PlayerInfo[playerid][pDate3]);fwrite(hFile, var);
                fclose(hFile);
OBS: jб tentei em dini..
tentou usar igual ao password que estб logo acima? por em pfile


Re: [ajuda] salvar - Cristhian - 11.10.2011

nem funfou


Re: [ajuda] salvar - Vai_Besta - 11.10.2011

Entao esta salvando,poste seu carregar


Re: [ajuda] salvar - Ricop522 - 11.10.2011

wtf
Vocк colocou para fechar a file dps que salvar.. lol e tб errado a var..
pawn Код:
new string3[128], pname3[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pname3, sizeof(pname3));
            format(string3, sizeof(string3), "Players/%s.ini", pname3);
            new File: pFile = fopen(string3, io_write);
            if (pFile)
            {
                new pIp[128], var[64];
                GetPlayerIp(playerid, pIp, sizeof(pIp));
                PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
                format(var, 64, "Password=%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var);
                format(var, 64, "IP=%s\n", pIp);fwrite(pFile, var);
                format(var, 64, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(pFile, var);
                format(var, 64, "Warnings=%d\n",PlayerInfo[playerid][pWarns]);fwrite(pFile, var);
                format(var, 64, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(pFile, var);
                format(var, 64, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(pFile, var);
                format(var, 64, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(pFile, var);
                format(var, 64, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(pFile, var);
                format(var, 64, "Bank=%d\n",PlayerInfo[playerid][pBank]);fwrite(pFile, var);
                format(var, 64, "Skin=%d\n",PlayerInfo[playerid][pSkin]);fwrite(pFile, var);
                format(var, 64, "TimesConnected=%d\n",PlayerInfo[playerid][pTimes]);fwrite(pFile, var);
                format(var, 64, "PlayingHours=%d\n",PlayerInfo[playerid][pHours]);fwrite(pFile, var);
                format(var, 64, "PlayingMinutes=%d\n",PlayerInfo[playerid][pMins]);fwrite(pFile, var);
                format(var, 64, "JailTime=%d\n",PlayerInfo[playerid][pJailTime]);fwrite(pFile, var);
                format(var, 64, "DayRegistered=%d\n",PlayerInfo[playerid][pDate1]);fwrite(pFile, var);
                format(var, 64, "MonthRegistered=%d\n",PlayerInfo[playerid][pDate2]);fwrite(pFile, var);
                format(var, 64, "YearRegistered=%d\n",PlayerInfo[playerid][pDate3]);fwrite(pFile, var);
                fclose(pFile);



Re: [ajuda] salvar - [BWL]DuST - 11.10.2011

Tbm precisava de colocar meu lvl de admin pra salvar!!