11.03.2011, 14:33
Hey everyone.
I have made a login/register system using Dini.
I want it to save the players position when he disconnects,Ё
and spawns him at the same place when he logs in again next time.
I already did like this:
OnPlayerDisconnect:
and when the player logs in:
Hope you can help me. Thank you.
I have made a login/register system using Dini.
I want it to save the players position when he disconnects,Ё
and spawns him at the same place when he logs in again next time.
I already did like this:
OnPlayerDisconnect:
pawn Код:
if(dini_Exists(file))
{
PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
PlayerInfo[playerid][pActivity] = GetPlayerScore(playerid);
dini_IntSet(file, "Money",PlayerInfo[playerid][pMoney]);
new Float:Health;
GetPlayerHealth(playerid, Health);
dini_FloatSet(file, "Health", floatround(Health));
dini_IntSet(file, "Activity",PlayerInfo[playerid][pActivity]);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
dini_FloatSet(file, "PosX", floatround(x));
dini_FloatSet(file, "PosY", floatround(y));
dini_FloatSet(file, "PosZ", floatround(z));
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
dini_IntSet(file, "Banned",PlayerInfo[playerid][pBanned]);
}
pawn Код:
SetPlayerPos(playerid, dini_Float(file, "PosX"), dini_Float(file, "PosY"), dini_Float(file, "PosZ"));