SA-MP Forums Archive
Save player skin - 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 player skin (/showthread.php?tid=424371)



Save player skin - JimmyNeonHD - 21.03.2013

This problem has been found from start the server when i create the server that when i select or change the skin and die the skin changed to Cj

How could this fix?


Re: Save player skin - NessaHD - 21.03.2013

I dont understand it properly? You have a skin, and when you die you loose it and it becomes CJ or what?


Re: Save player skin - JimmyNeonHD - 21.03.2013

Exactly


Re: Save player skin - Jstylezzz - 21.03.2013

Save the skin into a variable, and load it each time the player spawns.

pawn Код:
new pSkin[MAX_PLAYERS];

public ChangeSkin(playerid,skin)//just an example, add the code where you have your changing things
{
pSkin[playerid] = skin;
SetPlayerSkin(playerid,skin);
}

public OnPlayerSpawn(playerid)
{
SetPlayerSkin(playerid,pSkin[playerid]);
}
I highly recommend you use enums, if you don't know what these are, search. I've seen some tutorials covering this, so check those out.