SA-MP Forums Archive
Multi Starting 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: Multi Starting Skin (/showthread.php?tid=551043)



Multi Starting Skin - lwilson - 16.12.2014

Код:
if(PlayerInfo[playerid][pSex] == 1) 
       PlayerInfo[playerid][pSkin] = 299;
     else 
       PlayerInfo[playerid][pSkin] = 192;
   
     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
     Refund(playerid);
     TogglePlayerControllable(playerid, true);
     return 1;
}
How to make it more Starting Skins for Male and Female not only 299 and 192


Re: Multi Starting Skin - lwilson - 17.12.2014

up for this


Re: Multi Starting Skin - Raweresh - 17.12.2014

Do arrays with skins:
Код:
new Males[] =
{
0,1,...
};
new Females[] =
{
192,...
};
And change your code to:
Код:
if(PlayerInfo[playerid][pSex] == 1)
{
	   new rand = random(sizeof(Males));
       PlayerInfo[playerid][pSkin] = Males[rand];
}
     else
     {
       new rand = random(sizeof(Females));
       PlayerInfo[playerid][pSkin] = Females[rand];
	 }

     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
     Refund(playerid);
     TogglePlayerControllable(playerid, true);
     return 1;
}