03.07.2013, 17:36
pawn Код:
#include <a_samp>
#include <dini>
new
JogadorBloqueado[MAX_PLAYERS],
Jogador[MAX_PLAYER_NAME],
FLoat: kX[MAX_PLAYERS],
FLoat: kY[MAX_PLAYERS],
Float: kZ[MAX_PLAYERS],
Float: kA[MAX_PLAYERS],
sStringFrm[128];
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerName(playerid, Jogador, sizeof(Jogador));
GetPlayerPos(playerid, kX[playerid], kY[playerid], kZ[playerid]);
GetPlayerFacingAngle(playerid, kA[playerid]);
format(sStringFrm, sizeof(sStringFrm), "%s.spawn.ini", Jogador);
dini_FloatSet(sStringFrm, "cX", kX[playerid]);
dini_FloatSet(sStringFrm, "cY", kY[playerid]);
dini_FloatSet(sStringFrm, "cZ", kZ[playerid]);
dini_FloatSet(sStringFrm, "cA", kA[playerid]);
return true;
}
public OnPlayerConnect(playerid)
return JogadorBloqueado[playerid] = 0;
public OnPlayerSpawn(playerid)
{
GetPlayerName(playerid, Jogador, sizeof(Jogador));
format(sStringFrm, sizeof(sStringFrm), "%s.spawn.ini", Jogador);
if(fexist(sStringFrm) && JogadorBloqueadoplayerid] == 0)
{
kX[playerid] = dini_Float(sStringFrm,"cX");
kY[playerid] = dini_Float(sStringFrm,"cY");
kZ[playerid] = dini_Float(sStringFrm,"cZ");
kA[playerid] = dini_Float(sStringFrm,"cA");
SetPlayerPos(playerid, kX[playerid], kY[playerid], kZ[playerid]);
SetPlayerFacingAngle(playerid, kA[playerid]);
SetCameraBehindPlayer(playerid);
JogadorBloqueado[playerid] = 1;
}
if(!fexist(sStringFrm))
{
dini_Create(sStringFrm);
JogadorBloquado[playerid] = 1;
}
return true;
}