Adding all skins with one code?
#1

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)