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



Skins... - NeroX98 - 12.06.2012

Hi !

Is there any function or trick to return your previous skin...

Ex. I want to make a hospital system... When you die to teleport you to the hospital and change your skin. I have timer how much you need to stay in the hospital, so you'll wear that skin while the timer is on. Can i somehow make when the timer run out, the player skin change to the previous skin that he weared ... ?


Re: Skins... - Ray0 - 12.06.2012

Yep, you can either use a global variable or Player variables e.g. SetPVarInt(playerid, "Variable Name Here", IntegerAmount) - Set this before changing their skin.
Then after a time, you can use GetPVarInt(playerid, "Variable Name Here") to get the skin id they had beforehand


Re: Skins... - Jonny5 - 12.06.2012

yes just keep track of their skin before you change it,


pawn Код:
new gPlayerSkin[MAX_PLAYERS];

//in the OnPlayerDeath callback use


gPlayerSkin[playerid] = GetPlayerSkin(playerid);


//then restore it when they leave the hostipal with
SetPlayerSkin(playerid,gPlayerSkin[playerid]);

something like that, i wrote the code write in the browser so test it.


Re: Skins... - NeroX98 - 12.06.2012

Testing...
I will edit this post

It's working rep+