SA-MP Forums Archive
all player classes - 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: all player classes (/showthread.php?tid=152664)



all player classes - Nonameman - 05.06.2010

Hi,

I want to put all the classes from the game to my gamemode with AddPlayerClass(), how can I make it easily?


Re: all player classes - ViruZZzZ_ChiLLL - 05.06.2010

Add this under OnGameModeInit()
pawn Код:
for(new s = 0; s < 300; s++)
  {
    if(IsInvalidSkin(s)) continue;
    else AddPlayerClass(s, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  }
then add this anywhere :
pawn Код:
stock IsInvalidSkin(skinid)
{
    #define MAX_BAD_SKINS  14
    if(skinid > 310) return true;
    new badSkins[MAX_BAD_SKINS] = {
        3, 4, 5, 6, 8, 42, 65, 74, 86,
        119, 149, 208, 273, 289
    };
    for (new i = 0; i < MAX_BAD_SKINS; i++)
    {
      if (skinid == badSkins[i]) return true;
    }
    return false;
}
then its done


Re: all player classes - Nonameman - 05.06.2010

thanks a lot


Re: all player classes - Nonameman - 05.06.2010

I'm scripting beginner, so I'm just learning these 'for' and other things, if it's not problem for you, can you imagine what does it do?