how to put all skins in simple way in script
#1

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
Reply
#2

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;
}
Reply
#3

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

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

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

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

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.
Reply
#7

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?
Reply
#8

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

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.
Reply
#10

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++)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)