SA-MP Forums Archive
Adding all skins with one code? - 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: Adding all skins with one code? (/showthread.php?tid=124824)



Adding all skins with one code? - Torran - 31.01.2010

I had this code, I got it off wiki somewhere,
And what is does is adds all skins to your server,
Rather than loads of AddPlayerClass it just adds them all,
Does anyone know what that code is, As i cant find it on wiki


Re: Adding all skins with one code? - [HiC]TheKiller - 31.01.2010

pawn Код:
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);
  }
}

IsValidSkin(skinid)
{
  #define   MAX_BAD_SKINS 23
  new badSkins[MAX_BAD_SKINS] =
  { 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289, 165};
  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;
}



Re: Adding all skins with one code? - Torran - 31.01.2010

Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
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);
  }
}

IsValidSkin(skinid)
{
  #define   MAX_BAD_SKINS 23
  new badSkins[MAX_BAD_SKINS] =
  { 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 268, 273, 289, 165};
  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;
}
Little explanation on where it all goes?


Re: Adding all skins with one code? - Backwardsman97 - 31.01.2010

Put the first part under OnGameModeInit and the second part out somewhere not in a function.


Re: Adding all skins with one code? - Torran - 31.01.2010

Quote:
Originally Posted by Backwardsman97
Put the first part under OnGameModeInit and the second part out somewhere not in a function.
Ok ty