10.06.2012, 02:40
Quote:
error 001: expected token: "#endif", but found "-end of file-" warning 203: symbol is never used: "DOF2_Exit" warning 203: symbol is never used: "positionx" warning 203: symbol is never used: "positiony" warning 203: symbol is never used: "positionz" warning 203: symbol is never used: "ret_memcpy" |
aqui a FilterScript
pawn Код:
#include <DOF2>
#include <dudb>
new Float:positionx;
new Float:positiony;
new Float:positionz;
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Sistema de Salvamento de Coordenadas ");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
LoadStats(playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
positionx = x;
positiony = y;
positionz = z;
if (!DOF2_Exists(FileStats(playerid)))
{
DOF2_CreateFile(FileStats(playerid));
}
SaveStats(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid,positionx,positiony,positionz);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerPos(playerid,1182.7733,-1323.6193,13.5785);
positionx = 1182.7733;
positiony = -1323.6193;
positionz = 13.5785;
return 1;
}
Player(playerid)
{
new player[MAX_PLAYER_NAME];
GetPlayerName(playerid, player, sizeof(player));
return player;
}
FileStats(playerid)
{
new a[256]; format(a, sizeof(a), "%s.ini",udb_encode(Player(playerid)));
return a;
}
SaveStats(playerid)
{
DOF2_IntSet(FileStats(playerid), "PositionX", floatround(positionx));
DOF2_IntSet(FileStats(playerid), "PositionY", floatround(positiony));
DOF2_IntSet(FileStats(playerid), "PositionZ", floatround(positionz));
}
LoadStats(playerid)
{
positionx = DOF2_Int(FileStats(playerid), "PositionX");
positiony = DOF2_Int(FileStats(playerid), "PositionY");
positionz = DOF2_Int(FileStats(playerid), "PositionZ");
}