[Tutorial] [TUT] How to add all skin's avaibles.
#1

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

Skin ids 0, 1 and 2 are missing
Reply
#3

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

whoa awesome man using it in my GM
Reply
#5

Hmm good.
Reply
#6

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

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.
Reply
#8

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

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)