SA-MP Forums Archive
how to put all skins in simple way in script - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how to put all skins in simple way in script (/showthread.php?tid=105255)



how to put all skins in simple way in script - Sfinx_17 - 28.10.2009

how to put all skins in my script plz help i don't wanna waste time to going on www.sa-mp.com/help and to choose one by oneto put in my script so how to put all skins in a simple way? plz help


Re: how to put all skins in simple way in script - kLx - 28.10.2009

Put this in bottom of your script:
pawn Код:
IsValidSkin(skinid)
{
  #define   MAX_BAD_SKINS 22
  new badSkins[MAX_BAD_SKINS] =
  { 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289 };
  if (skinid < 0 || skinid > 299) return false;
  for (new i = 0; i < MAX_BAD_SKINS; i++) { if (skinid == badSkins[i]) return false; }
  #undef MAX_BAD_SKINS
  return 1;
}
and use this:
pawn Код:
public OnGameModeInit()
{  
  for(new i = 0; i < 299; i++)
  {
    if(IsValidSkin(i))
    {
      AddPlayerClass(i,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
    }
  }
  return 1;
}



Re: how to put all skins in simple way in script - M1GU3L - 02.11.2009

I'm using this script but I have a question:

How can I include the skin of CJ?(it is not included).


Re: how to put all skins in simple way in script - smoker08 - 03.11.2009

CJ skin is id 0, you should see the skin list at https://sampwiki.blast.hk/wiki/Category:Skins


Re: how to put all skins in simple way in script - M1GU3L - 07.11.2009

I know it's 0, but it's not included with the "IsValidSkin" thingy (I want it included). What should I do?


Re: how to put all skins in simple way in script - Badger(new) - 07.11.2009

Skins included under IsValidSkin AREN'T included when you choose a skin.

If you want CJ's skin to not show up, you change "MAX_BAD_SKINS 22" to "MAX_BAD_SKINS 23", then change "{ 3, 4, 5," to "{ 0, 3, 4, 5,".

If you want CJ's skin to show up, and you are using what kLx posted, it WILL show up.


Re: how to put all skins in simple way in script - MenaceX^ - 07.11.2009

Quote:
Originally Posted by kLx
Put this in bottom of your script:
pawn Код:
IsValidSkin(skinid)
{
  #define   MAX_BAD_SKINS 22
  new badSkins[MAX_BAD_SKINS] =
  { 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289 };
  if (skinid < 0 || skinid > 299) return false;
  for (new i = 0; i < MAX_BAD_SKINS; i++) { if (skinid == badSkins[i]) return false; }
  #undef MAX_BAD_SKINS
  return 1;
}
and use this:
pawn Код:
public OnGameModeInit()
{  
  for(new i = 0; i < 299; i++)
  {
    if(IsValidSkin(i))
    {
      AddPlayerClass(i,0.0,0.0,0.0,0.0,-1,-1,-1,-1,-1,-1);
    }
  }
  return 1;
}
Why not using switch?


Re: how to put all skins in simple way in script - Badger(new) - 07.11.2009

Because this is the example one on SA-MP wiki. https://sampwiki.blast.hk/wiki/Skins:All


Re: how to put all skins in simple way in script - M1GU3L - 07.11.2009

It's not working, it's still not showing CJ sking, may someone test it for me?

Edit:

I tested it in another script (LVDM) and as I said it's not showing CJ's skin.


Re: how to put all skins in simple way in script - Badger(new) - 07.11.2009

I dunno about CJ's skin, but it doesn't show claude's because
pawn Код:
for(new i = 0; i < 299; i++)
should be
pawn Код:
for(new i = 0; i < 300; i++)