[AJUDA] Public salvardados;carregardados (FINI)
#1

pawn Код:
forward SalvarInformacoes(playerid);
public SalvarInformacoes(playerid)
{
    new pNome[MAX_PLAYER_NAME], arquivo[40];
    GetPlayerName(playerid, pNome, sizeof(pNome));
    format(arquivo, sizeof(arquivo), "%s Info.txt", pNome);
    if(!Fini_Exists(arquivo)) return Fini_Create(arquivo); SalvarInformacoes(playerid);
    Fini_OpenFile(arquivo); //abrir o arquivo!
    {
    Fini_SetVal("dinheiro",GetPlayerMoney(playerid)); //setar Dinheiro=DinheirodOPlayer no arquivo
    }
    Fini_SaveFile(); //salvar o arquivo(sу salva quando usas Set na funзгo acima)
    Fini_CloseFile(); //fechar o arquivo apуs usa-lo
    return 1;
}
forward CarregarInformacoes(playerid);
public CarregarInformacoes(playerid)
{
    new pNome[MAX_PLAYER_NAME], arquivo[40];
    GetPlayerName(playerid, pNome, sizeof(pNome));
    format(arquivo, sizeof(arquivo), "%s Info.txt", pNome);
    if(!Fini_Exists(arquivo)) return Fini_Create(arquivo);
    Fini_OpenFile(arquivo); //abrir o arquivo!
    {
    GivePlayerMoney(playerid, Fini_GetValue("dinheiro")); //setar Dinheiro=DinheirodOPlayer no arquivo
    }
    Fini_SaveFile(); //salvar o arquivo(sу salva quando usas Set na funзгo acima)
    Fini_CloseFile(); //fechar o arquivo apуs usa-lo
    return 1;
}
Код:
C:\Users\GABRIEL\Desktop\samp03csvr_R2-2_win32\gamemodes\JokerBoy.pwn(242) : warning 202: number of arguments does not match definition
C:\Users\GABRIEL\Desktop\samp03csvr_R2-2_win32\gamemodes\JokerBoy.pwn(257) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Esta compilando nomalmente agora, porйm quando abro a "**.TXT" ele fica vazio e nгo entra no server..
Esta errado esse code ??
Reply
#2

Postou os erros, agora poste a linha dos prуprios.
Reply
#3

Compilei o mesmo cуdigo aqui e nгo deu warnings.
Reply
#4

Olб JOKERBOY.

A forma que vocк estб formatando estava completamente errado. Tente agora:

pawn Код:
forward SalvarInformacoes(playerid);
public SalvarInformacoes(playerid)
{
    new pNome[MAX_PLAYER_NAME], arquivo[40];
    GetPlayerName(playerid, pNome, sizeof(pNome));
    format(arquivo, sizeof(arquivo), "%s.txt", pNome);
    if(!Fini_Exists(arquivo)) return Fini_Create(arquivo); SalvarInformacoes(playerid);
    Fini_OpenFile(arquivo); //abrir o arquivo!
    {
    Fini_SetVal("dinheiro",GetPlayerMoney(playerid)); //setar Dinheiro=DinheirodOPlayer no arquivo
    }
    Fini_SaveFile(); //salvar o arquivo(sу salva quando usas Set na funзгo acima)
    Fini_CloseFile(); //fechar o arquivo apуs usa-lo
    return 1;
}
forward CarregarInformacoes(playerid);
public CarregarInformacoes(playerid)
{
    new pNome[MAX_PLAYER_NAME], arquivo[40];
    GetPlayerName(playerid, pNome, sizeof(pNome));
    format(arquivo, sizeof(arquivo), "%s.txt", pNome);
    if(!Fini_Exists(arquivo)) return Fini_Create(arquivo);
    Fini_OpenFile(arquivo); //abrir o arquivo!
    {
    GivePlayerMoney(playerid, Fini_GetValue("dinheiro")); //setar Dinheiro=DinheirodOPlayer no arquivo
    }
    Fini_SaveFile(); //salvar o arquivo(sу salva quando usas Set na funзгo acima)
    Fini_CloseFile(); //fechar o arquivo apуs usa-lo
    return 1;
}
Atenciosamente,
Falcon.
Reply
#5

O que vocк mudou no cуdigo Falcon? sу notei que o "Info" foi retirado.
Bom, esse cуdigo pelo que ele me disse no msn tava criando o .txt sem nada dentro.
agora ele passou a usar Dini.
Reply
#6

Se nгo resultar, poste os erros e as linhas dos prуprios
Reply
#7

Deu isso =
C:\Users\GABRIEL\Desktop\samp03csvr_R2-2_win32\gamemodes\JokerBoy.pwn(243) : warning 202: number of arguments does not match definition
C:\Users\GABRIEL\Desktop\samp03csvr_R2-2_win32\gamemodes\JokerBoy.pwn(25 : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

--------------
Estб a mesma coisa ele faiz um arquivo, porйm eu abro e esta vazio...

----
LINHAS:

243 = Fini_SaveFile();
////////////////////////
258 = Fini_SaveFile();
Reply
#8

pawn Код:
Fini_SaveFile("%s.txt");
Reply
#9

Ele estб compilando agora sem warning's, mas o problema se mantйm...
Reply
#10

Tenta:
pawn Код:
Fini_SaveFile(arquivo);
ou
pawn Код:
Fini_SaveFile("dinheiro", GetPlayerMoney(playerid));
De resto, nгo sei... Nгo estou a ver como ajudб-lo :/
Espere o DraKiNs entrar no msn que eu pergunto a ele, e colocarei a resposta aqui *-*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)