SA-MP Forums Archive
[Tutorial] [TUT] How to add all skin's avaibles. - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] [TUT] How to add all skin's avaibles. (/showthread.php?tid=141444)



[TUT] How to add all skin's avaibles. - .(Infinite Imagination). - 13.04.2010

in "OnGameModeInit" use this code:

Code:
	for(new i=0;i<300;i++)
	{
	  if((i == 7)||(i >= 9 && i <= 41)||(i >= 43 && i <= 64)||(i >= 66 && i <= 73)
	  ||(i >= 75 && i <= 85)||(i >= 87 && i <= 118)||(i >= 120 && i <= 148)||(i >= 150 && i <= 207)
	  ||(i >= 209 && i <= 264)||(i >= 274 && i <= 288)||(i >= 290 && i <= 299))
	  {
	   AddPlayerClass(i, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	  }
	}
Explication:

Code:
for(new i=0;i<300;i++)
Loop's a variable (starts to 0, and end in 300 (avaible skins))

Code:
	  if((i == 7)||(i >= 9 && i <= 41)||(i >= 43 && i <= 64)||(i >= 66 && i <= 73)
	  ||(i >= 75 && i <= 85)||(i >= 87 && i <= 118)||(i >= 120 && i <= 148)||(i >= 150 && i <= 207)
	  ||(i >= 209 && i <= 264)||(i >= 274 && i <= 288)||(i >= 290 && i <= 299))
if looped variable is exist's skin.

Code:
AddPlayerClass(i, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
Creates the AddPlayerClass..

Thanks to: AlexPoison


Re: [TUT] How to add all skin's avaibles. - M4S7ERMIND - 13.04.2010

Skin ids 0, 1 and 2 are missing


Re: [TUT] How to add all skin's avaibles. - Torran - 13.04.2010

Better way:

[code=OnGameModeInit]for(new s = 0; s < 299; s++)
{
if(IsValidSkin(s)) AddPlayerClass(s, X, Y, Z, A, -1, -1, -1, -1, -1, -1);
}[/code]

[code=Outside Callback]IsValidSkin(skinid)
{
#define MAX_BAD_SKINS (14)
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 false;
}
#undef MAX_BAD_SKINS
return 1;
}[/code]


Re: [TUT] How to add all skin's avaibles. - johnathon956 - 14.04.2010

whoa awesome man using it in my GM


Re: [TUT] How to add all skin's avaibles. - russo666 - 14.04.2010

Hmm good.


Re: [TUT] How to add all skin's avaibles. - dice7 - 14.04.2010

The GF script is a bad place to learn and copy

pawn Code:
IsValidSkin(skinid)
{
    switch(skinid)
    {
        case 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 273, 289: {return 0;}
    }
    return 1;
}



Re: [TUT] How to add all skin's avaibles. - MisterTickle - 25.04.2010

Quote:
Originally Posted by Joe Torran C
Better way:

[code=OnGameModeInit]for(new s = 0; s < 299; s++)
{
if(IsValidSkin(s)) AddPlayerClass(s, X, Y, Z, A, -1, -1, -1, -1, -1, -1);
}[/code]

[code=Outside Callback]IsValidSkin(skinid)
{
#define MAX_BAD_SKINS (14)
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 false;
}
#undef MAX_BAD_SKINS
return 1;
}[/code]
It says X isnt defined.


Re: [TUT] How to add all skin's avaibles. - GforceNL - 29.04.2010

Quote:
Originally Posted by MisterTickle
Quote:
Originally Posted by Joe Torran C
Better way:

[code=OnGameModeInit]for(new s = 0; s < 299; s++)
{
if(IsValidSkin(s)) AddPlayerClass(s, X, Y, Z, A, -1, -1, -1, -1, -1, -1);
}[/code]

[code=Outside Callback]IsValidSkin(skinid)
{
#define MAX_BAD_SKINS (14)
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 false;
}
#undef MAX_BAD_SKINS
return 1;
}[/code]
It says X isnt defined.
Code:
	for(new s = 0; s < 299; s++)
  {
    new Float:X;
    new Float:Y;
    new Float:Z;
    new Float:A;
    if(IsValidSkin(s)) AddPlayerClass(s, X, Y, Z, A, -1, -1, -1, -1, -1, -1);
  }



Re: [TUT] How to add all skin's avaibles. - Torran - 29.04.2010

Quote:
Originally Posted by GforceNL
Code:
	for(new s = 0; s < 299; s++)
  {
    new Float:X;
    new Float:Y;
    new Float:Z;
    new Float:A;
    if(IsValidSkin(s)) AddPlayerClass(s, X, Y, Z, A, -1, -1, -1, -1, -1, -1);
  }
Lol dude

You replace the X, Y, Z, A with X Coord, Y Coord, Z Coord, And Angle


Re: [TUT] How to add all skin's avaibles. - -Rebel Son- - 29.04.2010

Nice work! ive been looking for Somthing like this. Defininantly using it!