Tessék:
#include <a_samp>
#include <dini>
#include <dutils>
new file[128];
new Float:X[MAX_PLAYERS], Float:Y[MAX_PLAYERS], Float:Z[MAX_PLAYERS];
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Pos mento by Rupert\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
print(\"Pos mento bezarva!\");
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME];
GetPlayerPos(playerid, X[playerid], Y[playerid], Z[playerid]);
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), \"/pos/%s.ini\", name);
if(!dini_Exists(file)) return dini_Create(file);
dini_IntSet(file, \"Lx\", X[playerid]);
dini_IntSet(file, \"Ly\", Y[playerid]);
dini_IntSet(file, \"Lz\", Z[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new Float:Xx, Float:Yy, Float:Zz;
format(file, sizeof(file), \"/pos/%s.ini\", name);
if(!dini_Exists(file))
{
dini_IntSet(file, \"Lx\", X[playerid]);
dini_IntSet(file, \"Ly\", Y[playerid]);
dini_IntSet(file, \"Lz\", Z[playerid]);
SetPlayerPos(playerid, 257.043304, -139.752044, 1.578125);
}
else
{
Xx = dini_Int(file, \"Lx\");
Yy = dini_Int(file, \"Ly\");
Zz = dini_Int(file, \"Lz\");
SetPlayerPos(playerid, Xx, Yy, Zz);
}
return 1;
}
Ui: \'Scriptfiles\' mappában legyen \'pos\' mappa.