Hello!
Csináltam egy kisebb kódot, amivel a legközelebbi engedélyezett skinre váltja a játékos skinjét, de amikor meghívom crashel a samp. Ötlet?
Kód:
stock IsMale(skinid)
{
new const Females[] =
{
9,10,11,12,13,31,38,39,40,41,53,54,55,56,63,64,69,75,76,77,85,87,88,89,90,91,92,93,129,130,131,138,139,140,141, 145,148,150,151,
152,157,169,172,178,190,191,192,193,194,195,196,197,198,199,201,205,207,211,214,215,216,218,219,224,225,226, 231,232,233,237,238,
243,244,245,246,251,256,257,263,298
};
for(new i = 0; i < sizeof(Females); i++)
{
if(skinid == Females) return 0;
}
return 1;
}
stock IsNotIllegalSkin(skinid)
{
new const Illegals[] =
{
0,63,64,70,71,80,81,87,90,92,102,103,104,111,114,115,117,118,120,138,139,140,145,149,152,155,163,164,165,166,167,178,203,204,205,209,237,238,243,
244,245,246,256,257,264,265,266,267,275,276,277,278,279,280,281,282,283,284,285,286,287,288,294
};
for(new i = 0; i < sizeof(Illegals); i++)
{
if(skinid == Illegals) return 0;
}
return 1;
}
stock SetPlayerGoodSkin(playerid,merre)
{
new skin = GetPlayerSkin(playerid);
for(new skins; skins <300; skins++)
{
if(merre == JOBBRA)
{
if(skins < skin)
{
if(PlayerInfo[playerid][pNem] == 1)
{
new s;
s = skin - skins;
if(IsMale(s) && IsNotIllegalSkin(s)) return SetPlayerSkinEx(playerid,s);
}
else
{
new s;
s = skin - skins;
if(!IsMale(s) && IsNotIllegalSkin(s)) return SetPlayerSkinEx(playerid,skins);
}
}
}
if(merre == BALRA)
{
if(skins > skin)
{
if(PlayerInfo[playerid][pNem] == 1)
{
new s;
s = skin + skins;
if(IsMale(s) && IsNotIllegalSkin(s)) return SetPlayerSkinEx(playerid,s);
}
else
{
new s;
s = skin + skins;
if(!IsMale(s) && IsNotIllegalSkin(s)) return SetPlayerSkinEx(playerid,s);
}
}
}
}
return 1;
}