[Ajuda] Converter Salvamento MY_SQL Para DOF2.
#1

____
Reply
#2

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
Reply
#3

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'
Reply
#4

PHP код:
stock SavePlayer(playerid){
    if(
IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)){
        if(
GetPVarInt(playerid,"Eingeloggt") == 1){
            new 
fFile[64];
            
format(fFilesizeof(fFile), "accounts/%s.ini"GetName(playerid));//Altere esse caminho, caso necessбrio.
            
GetPlayerPos(playeridSpielerInfo[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(fFilesizeof(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;

Reply
#5

PHP код:
new xRL[40];
format(xRLsizeof(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
Reply
#6

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

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");
Reply
#8

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.
Reply
#9

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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)