[Ajuda] Problema na posiзгo..
#3

Quote:
Originally Posted by willttoonn
Посмотреть сообщение
Bom, fiz um script que salve a posiзгo X Y Z do player no servidor e envie para o banco de dados.

Ao deslogar:
pawn Код:
new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid,  x, y, z);
    format(query, sizeof(query), "UPDATE `playerinfo` SET PosX = '%f', PosY = '%f', PosZ = '%f' ,PosA = '%f' WHERE `Name` = '%s'", x, y, z, z, GetName(playerid));
Olha bem o que vocк fez... Vou destacar:


pawn Код:
format(query, sizeof(query), "UPDATE `playerinfo` SET PosX = '%f', PosY = '%f', PosZ = '%f' ,PosA = '%f' WHERE `Name` = '%s'", x, y, z, z, GetName(playerid));
Vocк colocou PosX = %f = x; PosY = %f = y; PosZ = %f = z e PosA = %f = z
Vocк colocou que PosA = z

...

Ok... De qualquer forma, fiz um para vocк , jб testei e deu CERTINHO... Mas em DINI:

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new File:file, pasta[40],Float:Pos[4], String[50], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    format(pasta, 40, Pasta, pName);
    format(String, sizeof(String), "•••• %s ••••", pName);
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    GetPlayerFacingAngle(playerid, Pos[3]);
    file = fopen(pasta);
    fwrite(file, String);
    dini_FloatSet(pasta, "PosX", Pos[0]);
    dini_FloatSet(pasta, "PosY", Pos[1]);
    dini_FloatSet(pasta, "PosZ", Pos[2]);
    dini_FloatSet(pasta, "PosA", Pos[3]);
    fwrite(file, String);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new pasta[40], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    format(pasta, 40, Pasta, pName);
    if(!dini_Exists(pasta)) return dini_Create(pasta);
    SetPlayerPos(playerid, dini_Float(pasta, "PosX"), dini_Float(pasta, "PosY"), dini_Float(pasta, "PosZ"));
    SetPlayerFacingAngle(playerid, dini_Float(pasta, "PosA"));
    return 1;
}
Reply


Messages In This Thread
Problema na posiзгo.. - by willttoonn - 02.10.2013, 22:48
Re: Problema na posiзгo.. - by arakuta - 02.10.2013, 23:22
Re: Problema na posiзгo.. - by Zivo - 03.10.2013, 17:47

Forum Jump:


Users browsing this thread: 1 Guest(s)