SA-MP Forums Archive
Code For All Skins? - 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: Code For All Skins? (/showthread.php?tid=251479)



Code For All Skins? - Sascha - 27.04.2011

Ok ehm... I'm searchin a code for all skins..
so something that adds all skins to my gamemode with only a few lines..
I know I've seen something like that before, however I can't remember where and I can't find any now...
can someone of you provide me with such a code?


Re: Code For All Skins? - Cameltoe - 27.04.2011

Quote:
Originally Posted by Sascha
Посмотреть сообщение
Ok ehm... I'm searchin a code for all skins..
so something that adds all skins to my gamemode with only a few lines..
I know I've seen something like that before, however I can't remember where and I can't find any now...
can someone of you provide me with such a code?
Put this under OnGameModeInit.
pawn Код:
for(new skins; skins < 300; skins++)
{
      if(IsValidSkin(skins)) AddPlayerClass(skins, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0)
}



Re: Code For All Skins? - Raimis_R - 27.04.2011

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Put this under OnGameModeInit.
pawn Код:
for(new skins; skins < 300; skins++)
{
      if(IsValidSkin(skins)) AddPlayerClass(skins, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0)
}
pawn Код:
if(IsValidSkin(skins))
If this default function?


Re: Code For All Skins? - Cameltoe - 27.04.2011

Quote:
Originally Posted by Raimis_R
Посмотреть сообщение
pawn Код:
if(IsValidSkin(skins))
If this default function?
Nope, IsValidSkin is an user defined function. I'm searching around to find it Atm.


Re: Code For All Skins? - Sascha - 27.04.2011

no...
however I know how to make that function on my own..
I'll send the function into this topic so other guys can use it too^^

edit:
here's the function
pawn Код:
stock IsValidSkin(skin)
{
    if(skin == 3 || skin == 4 || skin == 5 || skin == 6 || skin == 8 || skin == 42 || skin == 53 || skin == 65
    || skin == 74 || skin == 86 || skin == 91 || skin == 208 || skin == 273 || skin == 289 || skin == 300 ||
    skin == 119 || skin == 149) return 0;
    return 1;
}



Re: Code For All Skins? - Miguel - 27.04.2011

pawn Код:
stock IsValidSkin(skinid)
{
    if((skinid < 0) || (skinid > 300)) return 0;
    switch(skinid)
    {
        case 3..6, 8, 42, 65, 74, 86, 119, 149, 208, 273, 289: return 0;
    }
    return 1;
}



Re: Code For All Skins? - Cameltoe - 27.04.2011

Quote:
Originally Posted by Sascha
Посмотреть сообщение
no...
however I know how to make that function on my own..
I'll send the function into this topic so other guys can use it too^^
Found it !

pawn Код:
IsValidSkin(skinid) //Thanks Sergei
{
    if(0 < skinid < 300)
    {
        switch(skinid)
        {
            case 3, 4, 5, 6, 8, 42, 65, 74, 86,
            119, 149, 208, 273, 289: return 0;
        }
        return 1;
    }
    return 0;
}



Re: Code For All Skins? - Sascha - 27.04.2011

oh your function is much better lol..