Mir auch ..
Hier mal alles was ich verändert habe, vielleicht findest du was.
#include <a_samp>
#include <Dini>
#include <dudb>
#include <Dini>
#include <dudb>
//Spawn an gleicher Stelle nach Disconnect
new Float:positionx;
new Float:positiony;
new Float:positionz;
new Float:positionx;
new Float:positiony;
new Float:positionz;
public OnPlayerConnect(playerid)
{
SpawnPlayer(playerid);
SendClientMessage(playerid,0x00A93CFF,"Herzlich Willkommen auf Crosslines GTA SA RL Server!");
new pfad[50], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
{
SpawnPlayer(playerid);
SendClientMessage(playerid,0x00A93CFF,"Herzlich Willkommen auf Crosslines GTA SA RL Server!");
new pfad[50], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(pfad,sizeof(pfad),"/scriptfiles/Crossline.ini",name);//hier ersetzt Du "%s" mit dem Namen
SetSpawnInfo(playerid,0,dini_Int(pfad,"skin"),1765.6999511719, -1921.0999755859, 13.60000038147,212.2234,0,0,0,0,0,0);
LoadStats(playerid);
return 1;
}
LoadStats(playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pfad[50], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
{
new pfad[50], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(pfad,sizeof(pfad),"/scriptfiles/Crossline.ini",name);
dini_IntSet(pfad,"skin",GetPlayerSkin(playerid));
new Float:x;
new Float:y;
new Float:z;
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
positionx = x;
positiony = y;
positionz = z;
if (!dini_Exists(FileStats(playerid)))
{
dini_Create(FileStats(playerid));
}
positionx = x;
positiony = y;
positionz = z;
if (!dini_Exists(FileStats(playerid)))
{
dini_Create(FileStats(playerid));
}
SaveStats(playerid);
return 1;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid,positionx,positiony,positionz);
return 1;
}
{
SetPlayerPos(playerid,positionx,positiony,positionz);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
ForceClassSelection(playerid);
return 1;
}
{
ForceClassSelection(playerid);
return 1;
}
Und ganz am Ende:
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)
{
dini_IntSet(FileStats(playerid), "PositionX", floatround(positionx));
dini_IntSet(FileStats(playerid), "PositionY", floatround(positiony));
dini_IntSet(FileStats(playerid), "PositionZ", floatround(positionz));
}
LoadStats(playerid)
{
positionx = dini_Int(FileStats(playerid), "PositionX");
positiony = dini_Int(FileStats(playerid), "PositionY");
positionz = dini_Int(FileStats(playerid), "PositionZ");
}
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)
{
dini_IntSet(FileStats(playerid), "PositionX", floatround(positionx));
dini_IntSet(FileStats(playerid), "PositionY", floatround(positiony));
dini_IntSet(FileStats(playerid), "PositionZ", floatround(positionz));
}
LoadStats(playerid)
{
positionx = dini_Int(FileStats(playerid), "PositionX");
positiony = dini_Int(FileStats(playerid), "PositionY");
positionz = dini_Int(FileStats(playerid), "PositionZ");
}