02.03.2015, 08:33
Show all the code.
pawn Код:
#include <a_samp>
#include <YSI\y_ini>
#include <YSI\y_dialog>
#include <YSI\y_inline>
static skin[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
if(fexist(FolderSkins(playerid)))
{
inline loadskin(string:name[], string:value[])
{
INI_Int("skin", skin[playerid]);
}
INI_ParseFile(FolderSkins(playerid), "loadskin");
}
return true;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(FolderSkins(playerid));
INI_SetTag(File, "Information");
INI_WriteInt(File, "skin", GetPlayerSkin(playerid));
INI_Close(File);
return true;
}
public OnPlayerSpawn(playerid)
{
SetPlayerSkin(playerid, skin[playerid]);
return true;
}
FolderSkins(playerid)
{
new string[65], name[24];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "/skins/%s.ini", name);
return string;
}