Random skin problems! - 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)
+--- Thread: Random skin problems! (
/showthread.php?tid=513035)
Random skin problems! -
Metharon - 14.05.2014
The problem : for example , the skin 5 for "masculine = men ' don't are in the list , but keep giving to players..
what's the problem ? i want ONLY the skins from the list not any else...
Code:
new skinurimasculine[][11] = {
{1},
{2},
{3},
{6},
{7},
{21},
{22},
{23},
{291},
{292},
{42}
};
new skinurifeminine[][11] = {
{11},
{40},
{41},
{55},
{56},
{69},
{151},
{169},
{191},
{193},
{195}
};
OnRegister:
Code:
if(PlayerInfo[playerid][Sex] == 1)
{
new skinmasculin;
skinmasculin = random(sizeof(skinurimasculine));
SetPlayerSkin(playerid, skinmasculin);
PlayerInfo[playerid][pSkin] = skinmasculin;
}
else if(PlayerInfo[playerid][Sex] == 2)
{
new skinfeminin;
skinfeminin = random(sizeof(skinurifeminine));
SetPlayerSkin(playerid, skinfeminin);
PlayerInfo[playerid][pSkin] = skinfeminin;
}
Re: Random skin problems! -
biker122 - 14.05.2014
pawn Code:
new skinurimasculine[11] =
{
1,2,3,6,7,21,22,23,291,292,42
};
new skinurifeminine[11] =
{
11,40,41,55,56,69,151,169,191,193,195
};
pawn Code:
if(PlayerInfo[playerid][Sex] == 1)
{
new skin = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, skinmasculin[random(11)]);
PlayerInfo[playerid][pSkin] = skin;
}
else if(PlayerInfo[playerid][Sex] == 2)
{
new skin = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, skinfeminin[random(11)]);
PlayerInfo[playerid][pSkin] = skin;
}
try this
Re: Random skin problems! -
Scottas - 14.05.2014
Quote:
Originally Posted by biker122
pawn Code:
new skinurimasculine[11] = { 1,2,3,6,7,21,22,23,291,292,42 }; new skinurifeminine[11] = { 11,40,41,55,56,69,151,169,191,193,195 };
pawn Code:
if(PlayerInfo[playerid][Sex] == 1) { new skin = GetPlayerSkin(playerid); SetPlayerSkin(playerid, skinmasculin[random(11)]); PlayerInfo[playerid][pSkin] = skin; } else if(PlayerInfo[playerid][Sex] == 2) { new skin = GetPlayerSkin(playerid); SetPlayerSkin(playerid, skinfeminin[random(11)]); PlayerInfo[playerid][pSkin] = skin; }
try this
|
Why do you need to get player skin if you change it anyway? And you set pSkin to old one, not new one.