Skin saving :(
#1

How to make skin save on relog?
Reply
#2

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
Reply
#3

Thanks, i'll try to do it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)