01.08.2013, 21:50
pawn Код:
#include <a_samp>
#include <Dini>
#pragma tabsize 0
new Float:KenX[MAX_PLAYERS];
new Float:KenY[MAX_PLAYERS];
new Float:KenZ[MAX_PLAYERS];
new Float:KenA[MAX_PLAYERS];
new SpawnBloqueado[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("//:::::::::::::::::::::::::::::::::::://");
print(" FilterScript - Voltar б Posiзгo");
print(" Crйditos: Ken_xD ou rjjj");
print("//:::::::::::::::::::::::::::::::::::://\n");
return 1;
}
public OnPlayerConnect(playerid)
{
SpawnBloqueado[playerid] = 0;
SendClientMessage(playerid, 0x33FF00FF, "[Server] Este servidor utiliza o FS Voltar б Posiзгo por Ken_xD.");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fsspawn", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0x33FF00FF, "Crйditos do FS Voltar б posiзгo: Ken_xD ou rjjj.");
return 1;
}
return 0;
}
public OnPlayerDisconnect(playerid, reason)
{
new Jogador[MAX_PLAYER_NAME];
new data[256];
GetPlayerName(playerid, Jogador, sizeof(Jogador));
GetPlayerPos(playerid,KenX[playerid],KenY[playerid],KenZ[playerid]);
GetPlayerFacingAngle(playerid,KenA[playerid]);
format(data, sizeof(data), "%s.spawn.ini", Jogador);
dini_FloatSet(data,"CoordenadaX",KenX[playerid]);
dini_FloatSet(data,"CoordenadaY",KenY[playerid]);
dini_FloatSet(data,"CoordenadaZ",KenZ[playerid]);
dini_FloatSet(data,"CoordenadaA",KenA[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
new VolteiPraCa[MAX_PLAYER_NAME];
new voltarcoordenada[256];
GetPlayerName(playerid, VolteiPraCa, sizeof(VolteiPraCa));
format(voltarcoordenada, sizeof(voltarcoordenada), "LocalJogador/%s.spawn.ini", VolteiPraCa);
if(fexist(voltarcoordenada) && SpawnBloqueado[playerid] == 0)
{
KenX[playerid] = dini_Float(voltarcoordenada,"CoordenadaX");
KenY[playerid] = dini_Float(voltarcoordenada,"CoordenadaY");
KenZ[playerid] = dini_Float(voltarcoordenada,"CoordenadaZ");
KenA[playerid] = dini_Float(voltarcoordenada,"CoordenadaA");
SetPlayerPos(playerid, KenX[playerid], KenY[playerid], KenZ[playerid]);
SetPlayerFacingAngle(playerid, KenA[playerid]);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid, 0x33FF00FF, "Vocк voltou para onde saiu pela ъltima vez ! [Crйditos: Ken_xD ou rjjj].");
SpawnBloqueado[playerid] = 1;
}
if(!fexist(voltarcoordenada))
{
dini_Create(voltarcoordenada);
SpawnBloqueado[playerid] = 1;
}
return 1;
}
public OnFilterScriptExit()
{
return 1;
}