SA-MP Forums Archive
[Ajuda] Adaptaзгo 'Simples' - 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] Adaptaзгo 'Simples' (/showthread.php?tid=339142)



[Ajuda] Adaptaзгo 'Simples' - sanalex - 02.05.2012

Ae pessoal...alguйm poderia me ajudar a converter as linhas abaixo Dini para DOF2 .

Creio que o define nгo mudarб mais ai vai.
pawn Код:
#define savefile "Ranks/%s.ini"
pawn Код:
public OnPlayerConnect(playerid)
{
   
   
    new file[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),savefile,name);
    if(!fexist(file))
    {
        dini_Create(file);
        dini_IntSet(file,"Exp", 0);
        dini_IntSet(file,"Level", 0);
    }
    if(fexist(file))
    {
        SendClientMessage(playerid,0xF0F8FFAA,"CHECK: Files Loaded!");
        Exp[playerid] = dini_Int(file,"pExp");
        Level[playerid] = dini_Int(file,"pLevel");
    }
   
    return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid)
{
    new file[100];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),savefile,name);
    dini_IntSet(file,"pExp",Exp[playerid]);
    dini_IntSet(file,"pLevel",Level[playerid]);
    return 1;

}
+REP .


Re: [Ajuda] Adaptaзгo 'Simples' - ViniBorn - 02.05.2012

pawn Код:
public OnPlayerConnect(playerid)
{
    new file[40], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),savefile,name);
    if(!DOF2_FileExists(file))
    {
        DOF2_CreateFile(file);
        DOF2_SetInt(file,"Exp", 0);
        DOF2_SetInt(file,"Level", 0);
        DOF2_SaveFile();
    }
    else
    {
        SendClientMessage(playerid,0xF0F8FFAA,"CHECK: Files Loaded!");
        Exp[playerid] = DOF2_GetInt(file,"pExp");
        Level[playerid] = DOF2_GetInt(file,"pLevel");
    }
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    new file[40], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),savefile,name);
    DOF2_SetInt(file,"pExp",Exp[playerid]);
    DOF2_SetInt(file,"pLevel",Level[playerid]);
    DOF2_SaveFile();
    return 1;
}



Re: [Ajuda] Adaptaзгo 'Simples' - sanalex - 02.05.2012

Deu 2 erros quando fui compilar.

pawn Код:
C:\Users\Alex\Desktop\Servidor GTA SA\pawno\include\dof2.inc(1061) : warning 213: tag mismatch
C:\Users\Alex\Desktop\Servidor GTA SA\pawno\include\dof2.inc(1061) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\Servidor GTA SA\filterscripts\expbar.pwn(240) : error 035: argument type mismatch (argument 3)
C:\Users\Alex\Desktop\Servidor GTA SA\filterscripts\expbar.pwn(241) : error 035: argument type mismatch (argument 3)
C:\Users\Alex\Desktop\Servidor GTA SA\filterscripts\expbar.pwn(339) : warning 203: symbol is never used: "DOF2_Exit"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Linha 240:
pawn Код:
DOF2_GetInt(file,"Exp", 0);
Linha 241:
pawn Код:
DOF2_GetInt(file,"Level", 0);



Re: [Ajuda] Adaptaзгo 'Simples' - humildadeforever - 02.05.2012

Quote:
Originally Posted by sanalex
Посмотреть сообщение
Deu 2 erros quando fui compilar.

pawn Код:
C:\Users\Alex\Desktop\Servidor GTA SA\pawno\include\dof2.inc(1061) : warning 213: tag mismatch
C:\Users\Alex\Desktop\Servidor GTA SA\pawno\include\dof2.inc(1061) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\Servidor GTA SA\filterscripts\expbar.pwn(240) : error 035: argument type mismatch (argument 3)
C:\Users\Alex\Desktop\Servidor GTA SA\filterscripts\expbar.pwn(241) : error 035: argument type mismatch (argument 3)
C:\Users\Alex\Desktop\Servidor GTA SA\filterscripts\expbar.pwn(339) : warning 203: symbol is never used: "DOF2_Exit"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Linha 240:
pawn Код:
DOF2_GetInt(file,"Exp", 0);
Linha 241:
pawn Код:
DOF2_GetInt(file,"Level", 0);
Tira os 0
pawn Код:
DOF2_GetInt(file,"Exp");
DOF2_GetInt(file,"Level");



Re: [Ajuda] Adaptaзгo 'Simples' - sanalex - 02.05.2012

Й agora compilou legal, mas ainda mostra uns warnings:

pawn Код:
C:\Users\Alex\Desktop\Servidor GTA SA\pawno\include\dof2.inc(1061) : warning 213: tag mismatch
C:\Users\Alex\Desktop\Servidor GTA SA\pawno\include\dof2.inc(1061) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\Servidor GTA SA\filterscripts\expbar.pwn(240) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\Servidor GTA SA\filterscripts\expbar.pwn(241) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\Servidor GTA SA\filterscripts\expbar.pwn(337) : warning 203: symbol is never used: "DOF2_Exit"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Warnings.
Veja como estб:

pawn Код:
public OnPlayerConnect(playerid)
{
    new file[40], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),savefile,name);
    if(!DOF2_FileExists(file))
    {
        DOF2_CreateFile(file);
        DOF2_SetInt(file,"Exp");
        DOF2_SetInt(file,"Level");
        DOF2_SaveFile();
    }
    else
    {
        SendClientMessage(playerid,0xF0F8FFAA,"CHECK: Files Loaded!");
        Exp[playerid] = DOF2_GetInt(file,"pExp");
        Level[playerid] = DOF2_GetInt(file,"pLevel");
    }
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    new file[40], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),savefile,name);
    DOF2_SetInt(file,"pExp",Exp[playerid]);
    DOF2_SetInt(file,"pLevel",Level[playerid]);
    DOF2_SaveFile();
    return 1;
}



Re: [Ajuda] Adaptaзгo 'Simples' - ViniBorn - 02.05.2012

pawn Код:
public OnPlayerConnect(playerid)
{
    new file[40], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),savefile,name);
    if(!DOF2_FileExists(file))
    {
        DOF2_CreateFile(file);
        DOF2_SetInt(file,"Exp",0);
        DOF2_SetInt(file,"Level",1);
        DOF2_SaveFile();
    }
    else
    {
        SendClientMessage(playerid,0xF0F8FFAA,"CHECK: Files Loaded!");
        Exp[playerid] = DOF2_GetInt(file,"pExp");
        Level[playerid] = DOF2_GetInt(file,"pLevel");
    }
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    new file[40], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),savefile,name);
    DOF2_SetInt(file,"pExp",Exp[playerid]);
    DOF2_SetInt(file,"pLevel",Level[playerid]);
    DOF2_SaveFile();
    return 1;
}



Re: [Ajuda] Adaptaзгo 'Simples' - sanalex - 02.05.2012

Alguйm ? do jeito que a humildadeforever postou compilou mas continua os warnings jб postados acima, e no arquivo que й salvo os dados dos players fica assim:

pawn Код:
[ ]
Exp = 185124

[ini]
Level = 185124
Quando reloga nгo salva nada...

+REP pra quem ajudar pls...

@EDIT

Nгo tinha visto do Viniborn, compilei aqui e agora deu 3 warnings.

pawn Код:
C:\Users\Alex\Desktop\Servidor GTA SA\pawno\include\dof2.inc(1061) : warning 213: tag mismatch
C:\Users\Alex\Desktop\Servidor GTA SA\pawno\include\dof2.inc(1061) : warning 202: number of arguments does not match definition
C:\Users\Alex\Desktop\Servidor GTA SA\filterscripts\expbar.pwn(337) : warning 203: symbol is never used: "DOF2_Exit"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Warnings.



Re: [Ajuda] Adaptaзгo 'Simples' - ViniBorn - 02.05.2012

Tem erro na include. Atualize-a.


Re: [Ajuda] Adaptaзгo 'Simples' - CidadeNovaRP - 02.05.2012

Coloque DOF2_Exit(); em OnGameModeExit --'


Re: [Ajuda] Adaptaзгo 'Simples' - sanalex - 02.05.2012

Wow! coloquei em OnFilterScriptExit pois й um Filterscript, e agora sу deu 2 warnings.

pawn Код:
C:\Users\Alex\Desktop\Servidor GTA SA\pawno\include\dof2.inc(1061) : warning 213: tag mismatch
C:\Users\Alex\Desktop\Servidor GTA SA\pawno\include\dof2.inc(1061) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.
PS: Jб atualizei a include.

@EDIT

Nгo precisava ter colocado nгo pois jб tinha atualizado a include e esse warning jб tinha saido, nem raparei.