SA-MP Forums Archive
Save skins? - 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: Save skins? (/showthread.php?tid=440477)



Save skins? - Mattakil - 30.05.2013

I am using YSI, how do I save the player's skin when he disconnects? I got everything set up, I just do not know how to convert GetPlayerSkin to PlayerInfo. Please help!!


Re: Save skins? - Richie© - 30.05.2013

Add skin variable to PlayerInfo, when you save PlayerInfo on disconnect, you can to PlayerInfo[playerid][Skin] = GetPlayerSkin(playerid);


Re: Save skins? - DobbysGamertag - 30.05.2013

What enum do you use?


Re: Save skins? - Mattakil - 30.05.2013

Well, I get this when I try that, and that was my first idea, it did not save your skin.

warning 215: expression has no effect


Re: Save skins? - Mattakil - 30.05.2013

I use this for enum: enum pInfo
{
pPass[129],
pCash,
pAdmin,
pKills,
pDeaths,
pSkin,
pGender
}


Re: Save skins? - Richie© - 30.05.2013

You must be doing something wrong then, im using that in my script without any problems.
pawn Код:
PVar[playerid][pSkin] = GetPlayerSkin(playerid);
Its from RequestClass callback, other places in script where i use SetPlayerSkin i also add the skinid to my player var that handles the skin.

Maybe show some code of what you have so far and it will be easier to help.


Re: Save skins? - DobbysGamertag - 30.05.2013

so it'll be:
pawn Код:
INI_WriteInt("Skin",pInfo[playerid][pSkin]);



Re: Save skins? - Mattakil - 30.05.2013

Yeah, I have that added :/


Re: Save skins? - Hoborific - 30.05.2013

Н know the problem you are experiencing, even if you store their ID, don't save it from GetPlayerSkin, save it to the enum when they change skin, it's much simpler.

set maybe a 300ms timer to set their skin after they spawn if you're having problems loading it, either way try to save it, and check in the server files or database if it saved correctly.


Re: Save skins? - Mattakil - 30.05.2013

how to save to enum? Im new at ysi and stuff