. OK, time to save the skins. Create a folder in
.
pawn Код:
//You have to include it:
#include <dini>
//You can put this line under #include <a_samp>
new bool:FirstSpawn[MAX_PLAYERS char] = false;
//---
public OnPlayerConnect(playerid)
{
FirstSpawn[playerid] = true;
new name[MAX_PLAYER_NAME], file_path[50];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(file_path,50,"/Skins/%s.ini",name);
if(!dini_exists(file_path))
{
dini_Create(file_path);
dini_IntSet(file_path,"Skin",0);
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
new name[MAX_PLAYER_NAME], file_path[50];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(file_path,50,"/Skins/%s.ini",name);
dini_IntSet(file_path,"Skin",GetPlayerSkin(playerid));
return 1;
}
public OnPlayerSpawn(playerid)
{
if(FirstSpawn[playerid] == true)
{
new name[MAX_PLAYER_NAME], file_path[50];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(file_path,50,"/Skins/%s.ini",name);
SetPlayerSkin(playerid, dini_Get(file_path,"Skin"));
SendClientMessage(playerid,-1,"Skin loaded");
FirstSpawn[playerid] = false;
}
return 1;
}
It should work, I didn't test it.