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



/saveskin - Blackazur - 28.10.2012

How can i script a /saveskin Command, that the Skin got automatic saved, when he use /saveskin and when the Player spawn?


Re: /saveskin - dr.lozer - 28.10.2012

use this:

frist, make a symbol on top
pawn Код:
new PlayerSkin[MAX_PLAYERS];
now put this code in OnPlayerConnect and OnPlayerDisconnect:
pawn Код:
PlayerSkin[playerid] = -1;
then make a cmd:
if you use zcmd so try this:
pawn Код:
CMD:saveskin(playerid)
{
   PlayerSkin[playerid] = GetPlayerSkin(playerid);
   SendClientMessage(playerid,-1,"Skin Saved");
   return 1;
}
if not then put this in your OnPlayerCommand:
pawn Код:
if(!strcmp("/saveskin",cmdtext,true))
{
   PlayerSkin[playerid] = GetPlayerSkin(playerid);
   SendClientMessage(playerid,-1,"Skin Saved");
   return 1;
}
now goto your OnPlayerSpawn then put this
pawn Код:
if(PlayerSkin[playerid] != -1)
{
   SetPlayerSkin(playerid, PlayerSkin[playerid]);
}
Rep if i Helped You