SA-MP Forums Archive
[Ajuda] Converter Salvamento MY_SQL Para DOF2. - 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] Converter Salvamento MY_SQL Para DOF2. (/showthread.php?tid=566912)



Resolvido amiguinhos. - StarPeens - 09.03.2015

____


Re: Converter Salvamento MY_SQL Para DOF2. - xOrder - 09.03.2015

Isso me ajudou a converter meu sistema:
http://forum.sa-mp.com/showthread.ph...svendando+dof2

Ex:
mysql_GetInt equivale em DOF2 а DOF2_GetInt...

Nгo й dificil converter, sу prestar atenзгo...

Erros na conversгo postar aqui que ajudo


Re: Converter Salvamento MY_SQL Para DOF2. - StarPeens - 09.03.2015

Quote:
Originally Posted by xOrder
Посмотреть сообщение
Isso me ajudou a converter meu sistema:
http://forum.sa-mp.com/showthread.ph...svendando+dof2

Ex:
mysql_GetInt equivale em DOF2 а DOF2_GetInt...

Nгo й dificil converter, sу prestar atenзгo...

Erros na conversгo postar aqui que ajudo
warning 202: number of arguments does not match definition

pawn Код:
DOF2_SetFloat("accounts","PosX",SpielerInfo[playerid][PosX],"Name",GetName(playerid));
Deu uns 80 warning kkk'


Re: Converter Salvamento MY_SQL Para DOF2. - Lуs - 09.03.2015

PHP код:
stock SavePlayer(playerid){
    if(
IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)){
        if(
GetPVarInt(playerid,"Eingeloggt") == 1){
            new 
fFile[64];
            
format(fFile, sizeof(fFile), "accounts/%s.ini", GetName(playerid));//Altere esse caminho, caso necessбrio.
            
GetPlayerPos(playerid, SpielerInfo[playerid][PosX], SpielerInfo[playerid][PosY], SpielerInfo[playerid][PosZ]);
            
//Ints
            
DOF2_SetInt(fFile, "Level", GetPlayerScore(playerid));
            
DOF2_SetInt(fFile, "Items_MED", GiveItem[playerid][MED_KIT]);
            
DOF2_SetInt(fFile, "Items_CZ550", GiveItem[playerid][CZ550]);
            
DOF2_SetInt(fFile, "Items_M4A1", GiveItem[playerid][M4A1]);
            
DOF2_SetInt(fFile, "Items_Bandage", GiveItem[playerid][BANDAGE]);
            
DOF2_SetInt(fFile, "Items_FullBottle", GiveItem[playerid][FULL_BOTTLE]);
            
DOF2_SetInt(fFile, "Items_Map", GiveItem[playerid][MAP]);
            
DOF2_SetInt(fFile, "Items_Items_EmptyBottle", GiveItem[playerid][EMPTY_BOTTLE]);
            
DOF2_SetInt(fFile, "Backpack", SpielerInfo[playerid][Backpack]);
            
DOF2_SetInt(fFile, "AliveMinutes", SpielerInfo[playerid][pAliveMinutes]);
            
DOF2_SetInt(fFile, "AliveSeconds", SpielerInfo[playerid][pAliveSeconds]);
            
DOF2_SetInt(fFile, "Blood", SpielerInfo[playerid][pBlood]);
            
DOF2_SetInt(fFile, "Temparatur", SpielerInfo[playerid][pTemparatur1]);
            
DOF2_SetInt(fFile, "Live", SpielerInfo[playerid][pLive]);
            
DOF2_SetInt(fFile, "Durst", SpielerInfo[playerid][pDurst]);
            
DOF2_SetInt(fFile, "Banned", SpielerInfo[playerid][pBan]);
            
DOF2_SetInt(fFile, "MapUsed", SpielerInfo[playerid][isMapUsed]);
            
DOF2_SetInt(fFile, "AdminPlayer", SpielerInfo[playerid][isAdmin]);
            
//Floats
            
DOF2_SetFloat(fFile, "Backpack", SpielerInfo[playerid][Backpack]);
            
DOF2_SetFloat(fFile, "PosX", SpielerInfo[playerid][PosX]);
            
DOF2_SetFloat(fFile, "PosY", SpielerInfo[playerid][PosY]);
            
DOF2_SetFloat(fFile, "PosZ", SpielerInfo[playerid][PosZ]);
            
//Strings
            
DOF2_SetString(fFile, "BanReason", SpielerInfo[playerid][pBanGrund]);
            
DOF2_SetString(fFile, "BanTime", SpielerInfo[playerid][pBanTime]);
            
DOF2_SetString(fFile, "BanDate", SpielerInfo[playerid][pBanDate]);
            
DOF2_SetString(fFile, "BanIP", SpielerInfo[playerid][pBanIP]);
        }
    }
    return 
1;
}
stock LoadPlayer(playerid){
    if(
IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)){
        new 
fFile[64];
        
format(fFile, sizeof(fFile), "accounts/%s.ini", GetName(playerid));//Altere esse caminho, caso necessбrio.
        
GiveItem[playerid][MED_KIT]         = DOF2_GetInt(fFile, "Items_MED");
        
GiveItem[playerid][CZ550]             = DOF2_GetInt(fFile, "Items_CZ550");
        
GiveItem[playerid][M4A1]             = DOF2_GetInt(fFile, "Items_M4A1");
        
GiveItem[playerid][BANDAGE]         = DOF2_GetInt(fFile, "Items_Bandage");
        
GiveItem[playerid][FULL_BOTTLE]         = DOF2_GetInt(fFile, "Items_FullBottle");
        
GiveItem[playerid][MAP]             = DOF2_GetInt(fFile, "Items_Map");
        
GiveItem[playerid][EMPTY_BOTTLE]    = DOF2_GetInt(fFile, "Items_EmptyBottle", "Name", GetName(playerid));
        
SpielerInfo[playerid][pLevel]         = DOF2_GetInt(fFile, "Level");
        
SpielerInfo[playerid][Backpack]         = DOF2_GetInt(fFile, "Backpack");
        
SpielerInfo[playerid][pAliveMinutes]     = DOF2_GetInt(fFile, "AliveMinutes");
        
SpielerInfo[playerid][pAliveSeconds]     = DOF2_GetInt(fFile, "AliveSeconds");
        
SpielerInfo[playerid][pBlood]         = DOF2_GetInt(fFile, "Blood");
        
SpielerInfo[playerid][pTemparatur1]     = DOF2_GetInt(fFile, "Temparatur");
        
SpielerInfo[playerid][pLive]             = DOF2_GetInt(fFile, "Live");
        
SpielerInfo[playerid][pDurst]         = DOF2_GetInt(fFile, "Durst");
        
SpielerInfo[playerid][pBan]             = DOF2_GetInt(fFile, "Banned");
        
SpielerInfo[playerid][isMapUsed]         = DOF2_GetInt(fFile, "MapUsed");
        
SpielerInfo[playerid][isAdmin]         = DOF2_GetInt(fFile, "AdminPlayer");
        
SpielerInfo[playerid][PosX]             = DOF2_GetFloat(fFile, "PosX");
        
SpielerInfo[playerid][PosY]             = DOF2_GetFloat(fFile, "PosY");
        
SpielerInfo[playerid][PosZ]             = DOF2_GetFloat(fFile, "PosZ");
    }
    return 
1;
} 



Re: Converter Salvamento MY_SQL Para DOF2. - xOrder - 09.03.2015

PHP код:
new xRL[40];
format(xRL, sizeof(xRL), "Contas/%s.ini", GetName(playerid)); // Mude de acordo com sua pasta.
DOF2_SetFloat(xRL, "PosX", SpielerInfo[playerid][PosX]);
DOF2_SaveFile(); // Usada para salvar o arquivo 
@Edit

O Lуs te deu tudo pronto, depois nгo sabem porque a board ta assim...
Da CTRL + C + V e seja feliz


Re: Converter Salvamento MY_SQL Para DOF2. - StarPeens - 09.03.2015

@Los
pawn Код:
GiveItem[playerid][EMPTY_BOTTLE]    = DOF2_GetInt(fFile, "Items_EmptyBottle", "Name", GetName(playerid));
warning 202: number of arguments does not match definition


Re: Converter Salvamento MY_SQL Para DOF2. - xOrder - 09.03.2015

Quote:
Originally Posted by StarPeens
Посмотреть сообщение
@Los
pawn Код:
GiveItem[playerid][EMPTY_BOTTLE]    = DOF2_GetInt(fFile, "Items_EmptyBottle", "Name", GetName(playerid));
warning 202: number of arguments does not match definition
pawn Код:
GiveItem[playerid][EMPTY_BOTTLE]    = DOF2_GetInt(fFile, "Items_EmptyBottle");



Re: Converter Salvamento MY_SQL Para DOF2. - Lуs - 09.03.2015

Retire os 2 ъltimos argumentos. Esqueci de tira-los.

PHP код:
 GiveItem[playerid][EMPTY_BOTTLE]    = DOF2_GetInt(fFile, "Items_EmptyBottle"); 
Estou em um tйdio absoluto. Entгo, eu acho mais fбcil criar e que observem como foi feito, do que explicar funзхes e mйtodos neste caso. Includes de salvamento й questгo de prбtica.


Re: Converter Salvamento MY_SQL Para DOF2. - StarPeens - 09.03.2015

da mais uma ajuda 5 warnings so em uma linha
pawn Код:
GetName(playerid),GetName(playerid),DOF2_GetString("accounts","BanReason","Name",GetName(playerid)),DOF2_GetString("accounts","BanTime","Name",GetName(playerid)),DOF2_GetString("accounts","BanDate","Name",GetName(playerid)),DOF2_GetString("accounts","BanIP","Name",GetName(playerid)));
warning 202: number of arguments does not match definition

@Edit nessa tambem
pawn Код:
SpielerInfo[playerid][pBan] = DOF2_GetInt("accounts","Banned","Name",GetName(playerid));
warning 202: number of arguments does not match definition


Re: Converter Salvamento MY_SQL Para DOF2. - PT - 09.03.2015

Ele me pediu isso por pm eu tentei lhe explicar que isso seria como andar do sйculo XXI para o sйculo XVII acho que ele nгo entendeu.

Para resolveres o problema acima usa format