SA-MP Forums Archive
Skin saving. (y_INI) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Skin saving. (y_INI) (/showthread.php?tid=461583)



Skin saving. (y_INI) - Beckett - 02.09.2013

------


Re: Skin saving. (y_INI) - Ada32 - 02.09.2013

Show OnPlayerConnect and where SetTimerEx is being called.


Re : Skin saving. (y_INI) - Matnix - 02.09.2013

Firstly you have to save the skins when the players disconect...
pawn Код:
public OnPlayerDisconect(playerid)
{
   new sID = GetPlayerSkin(playerid); // get the players skins
   new INI:File = INI_Open(UserPath(playerid)); // the open his file in the userpatch
   INI_SetTag(File,"data");
   INI_WriteInt(File,"pSkin",sID); // we write a new line with his skins id
   INI_Close(File); // close his files
}
then add this line in your load data functions...
pawn Код:
INI_Int("pSkin",PlayerInfo[playerid][pSkin]);
then now when he spawn we set his skins...
pawn Код:
SetlayerSkin(playerid,PlayerInfo[playerid][pSkin]);



Re: Skin saving. (y_INI) - Beckett - 03.09.2013

------


Re: Skin saving. (y_INI) - Dragonsaurus - 03.09.2013

Maybe because you are saving the skin just before the player spawns.
Try to set the timer AFTER he spawns from class selection.
Edit: If you don't get my point: The system saves the current skin (ID: 0) and stores it in the variable, in which you had stored before the saved skin.


Re: Skin saving. (y_INI) - Beckett - 03.09.2013

------