[Ajudinha] Salvar ъltima posiзгo.
#1

Bom, finalmente tomei vergonha na cara e estou aprendendo sobre Caches de salvamento.
Bom, no sistema de registro do meu servidor, que o Jonathan me passou, nгo tem um sistema para salvar as ъltimas coordenadas do player.
Entгo eu tentei fazer para salvar as coordenadas e logar nas coordenadas:
pawn Code:
SalvarPlayer(playerid)
{
    static Float:PosX, Float:PosY, Float:PosZ;
    new Float:Vida;
    new Float:Colete;
    GetPlayerHealth(playerid, Vida);
    GetPlayerArmour(playerid, Colete);
    new Nome[MAX_PLAYER_NAME];
    GetPlayerPos(playerid, PosX, PosY, PosZ);
    GetPlayerName(playerid, Nome, sizeof(Nome));
    //new String[50];
    format(String, sizeof(String), CONTAS, Nome);
    dini_IntSet(String,"Dinheiro", GetPlayerMoney(playerid));
    dini_FloatSet(String,"Vida", Vida);
    dini_FloatSet(String,"Colete", Colete);
    dini_IntSet(String,"Matou", Matou[playerid]);
    dini_IntSet(String,"Morreu", Morreu[playerid]);
    dini_IntSet(String,"Logou", Logou[playerid]);
    dini_FloatSet(String, "PosX", PosX);
    dini_FloatSet(String, "PosY", PosY);
    dini_FloatSet(String, "PosZ", PosZ);

    return 1;
}

SetarPlayer(playerid)
{
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nome, sizeof(Nome));
    //static Float:PosX, Float:PosY, Float:PosZ;
    //new String[50];
    /*new PosX[MaxPlayers];
    new PosY[MaxPlayers];
    new PlsZ[MaxPlayers];  */

    format(String, sizeof(String), CONTAS, Nome);
    GivePlayerMoney(playerid, dini_Int(String,"Dinheiro"));
    SetPlayerHealth(playerid, dini_Int(String,"Vida"));
    SetPlayerArmour(playerid, dini_Int(String,"Colete"));
    Matou[playerid] = dini_Int(String, "Matou");
    Morreu[playerid] = dini_Int(String, "Morreu");
    Logou[playerid] = dini_Int(String, "Logou");
    PosX[playerid] = dini_Int(String, "PosX");// Linha 453
    PosY[playerid] = dini_Int(String, "PosY");
    PosZ[playerid] = dini_Int(String, "PosZ");
    SetPlayerPos(playerid, PosX, PosY, PosZ);
    return 1;
}
O que estб entre /* e */ й o sistema, sу que ele estб dando muitos erros, como podem ver:
Quote:
Originally Posted by Pawno maldito
D:\SA-MP\Gunners\gamemodes\MMOv1.pwn(453) : error 017: undefined symbol "PosX"
D:\SA-MP\Gunners\gamemodes\MMOv1.pwn(453) : warning 215: expression has no effect
D:\SA-MP\Gunners\gamemodes\MMOv1.pwn(453) : error 001: expected token: ";", but found "]"
D:\SA-MP\Gunners\gamemodes\MMOv1.pwn(453) : error 029: invalid expression, assumed zero
D:\SA-MP\Gunners\gamemodes\MMOv1.pwn(453) : fatal error 107: too many error messages on one line
Alйm de ter todos estes erros, o sistema nгo estб salvando corretamente as coordenadas:
Quote:
Originally Posted by Magnus File
Senha=WoW11
Dinheiro=0
Vida=100.000000
Colete=0.000000
Matou=0
Morreu=1
Logou=3
PosX=0.000000
PosY=0.000000
PosZ=0.000000
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)