21.05.2011, 19:59
(
Последний раз редактировалось Shadoww5; 21.05.2011 в 20:56.
)
PHP код:
#include <Dini> //BAIXE A INCLUDE E COLOCA NA PASTA PAWN/INCLUDE
new Pos[3];
new Spawn[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if(Spawn[playerid] == 0)
{
new save[31],name[MAX_PLAYER_NAME],Float:x,Float:y,Float:Z;
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"Conta %s",name);
if(fexist(save))
{
x = dini_Get(save,"PosicaoX");
y = dini_Get(save,"PosicaoY");
z = dini_Get(save,"PosicaoZ");
SetPlayerPos(playerid,x,y,z);
SendClientMessage(playerid, 0xFFFFFFFF,"Vocк voltou ao local que vocк estava antes de deslogar.");
Spawn[playerid] = 1;
}
else
{
dini_Create(save);
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new save[31],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(save,sizeof(save),"Conta %s",name);
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(fexist(save))
{
dini_FloatSet(save,"PosicaoX",Pos[0]);
dini_FloatSet(save,"PosicaoY",Pos[1]);
dini_FloatSet(save,"PosicaoZ",Pos[2]);
return 1;
}
return 1;
}