14.11.2011, 22:15
First SoRRy That i'm asking this old thing but, i use search! :P So I have position saver this thing work normal save to file pos... but i can't do that pos load:/ so pls help for me..
This is my code.
So what i have to add ? Pls help 
Saved File:
This is my code.
Код:
enum zinfo
{
lygis,
pinigai,
patirtis,
Float:posx,
Float:posy,
Float:posz,
Float:posangle
}
new VartotojoInformacija[MAX_PLAYERS][zinfo];
new prisijunges[MAX_PLAYERS];
Код:
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid, angle);
format(file, sizeof(file), SERVER_USER_FILE, name);
if(prisijunges[playerid] == 1)
{
dini_IntSet(file, "patirtis", VartotojoInformacija[playerid][patirtis]);
dini_IntSet(file, "pinigai", VartotojoInformacija[playerid][pinigai]);
dini_IntSet(file, "lygis",VartotojoInformacija[playerid][lygis]);
dini_FloatSet(file, "PozicijaX",VartotojoInformacija[playerid][posx] = x);
dini_FloatSet(file, "PozicijaY",VartotojoInformacija[playerid][posy] = y);
dini_FloatSet(file, "PozicijaZ",VartotojoInformacija[playerid][posz] = z);
dini_FloatSet(file, "PozicijaZiurma",VartotojoInformacija[playerid][posangle] = angle);
}
prisijunges[playerid] = 0;
return 1;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == 1)
{
new name[MAX_PLAYER_NAME], file[256], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{FFFFFF}Sveiki atvyke!", "{FF0000}", "Registruotis", "Iseiti");
dini_Create(file);
dini_IntSet(file, "slaptazodis", udb_hash(inputtext));
dini_IntSet(file, "lygis",VartotojoInformacija[playerid][lygis] = 0);
dini_IntSet(file, "pinigai",VartotojoInformacija[playerid][pinigai] = 0);
dini_IntSet(file, "patirtis",VartotojoInformacija[playerid][patirtis] = 0);
format(string, 128, "%s%s", name, inputtext); //uzsiregistravo ir paraso varda ir pass
SendClientMessage(playerid, Geltona, string);
prisijunges[playerid] = 1;
}
if (dialogid == 2)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{FFFFFF}Sveiki sugryze!", "{FF0000}", "Prisijungti", "Iseiti");
new tmp;
tmp = dini_Int(file, "slaptazodis");
if(udb_hash(inputtext) != tmp) {
ShowPlayerDialog(playerid,4,DIALOG_STYLE_INPUT, "{FFFFFF}Sveiki sugryze!", "{FF0000}", "Prisijungti", "Iseiti");
}
else
{
prisijunges[playerid] = 1;
VartotojoInformacija[playerid][lygis] = dini_Int(file, "lygis");
SetPlayerScore(playerid, VartotojoInformacija[playerid][patirtis]);
GivePlayerMoney(playerid, dini_Int(file, "pinigai")-GetPlayerMoney(playerid));
}
}
return 1;
}

Saved File:
Код:
slaptazodis=74121669 lygis=0 pinigai=0 patirtis=0 PozicijaX=1958.743164 PozicijaY=1355.332031 PozicijaZ=9.257812 PozicijaZiurma=359.142944

