SA-MP Forums Archive
Skin saving :( - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Skin saving :( (/showthread.php?tid=172236)



Skin saving :( - sekol - 29.08.2010

How to make skin save on relog?


Re: Skin saving :( - iggy1 - 29.08.2010

You would need to learn to use file functions or a file reader/writer lke dini or djson (or something simalar)

And it would look something like this,

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    djSetInt("user/data","player/skin",GetPlayerSkin(Playerid));
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid,djInt("user/data","player/skin"));
    return 1;
}
Obviously you will want to add checks and even move the setplayerskin line away from onplayerspawn. But you should get the general idea.

That uses djson so it wont work in your script unless you have djson.
Link to file function wiki page
https://sampwiki.blast.hk/wiki/File_Functions


Re: Skin saving :( - sekol - 29.08.2010

Thanks, i'll try to do it