#include <a_samp>
new SkinID[MAX_PLAYERS];
#include <dini>
#include <dudb>
public OnPlayerConnect(playerid)
{
SkinID[playerid] = GetPlayerSkin(playerid);
new string[64], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), \"info/%s.ini\", name);
if(fexist(string))
{
SetPlayerScore(playerid, dini_Int(string, \"Pont\"));
SetPlayerMoney(playerid, dini_Int(string, \"Penz\"));
SetPlayerSkin(playerid, dini_Int(string, \"Skin\"));
}
else
{
dini_Create(string);
dini_IntSet(string, \"Pont\", 0);
dini_IntSet(string, \"Penz\", 0);
dini_IntSet(string, \"Skin\", 0);
}
}
public OnPlayerDisconnect(playerid, reason)
{
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), \"info/%s.ini\", name);
if(fexist(string))
{
dini_IntSet(string, \"Pont\", GetPlayerScore(playerid));
dini_IntSet(string, \"Penz\", GetPlayerMoney(playerid));
dini_IntSet(string, \"Skin\", GetPlayerSkin(SkinID[playerid]));
}
else
{
dini_Create(string);
dini_IntSet(string, \"Pont\", GetPlayerScore(playerid));
dini_IntSet(string, \"Penz\", GetPlayerMoney(playerid));
dini_IntSet(string, \"Skin\", GetPlayerSkin(SkinID[playerid]));
}
}
OnPlayerConnect-nél a fájlt nem az info mappán belülre hoztad létre..