12.05.2014, 07:13
I got a problem in my script. When the player spawn, if the player choose male, the skin that spawned is female skin. Can anyone help me?
Код:
stock IsValidSkin(skinid)
{
if (skinid < 0 || skinid > 299)
return 0;
switch (skinid)
{
case
0, 69, 123, 147, 163, 21, 24, 143, 71,
156, 176, 177, 165, 166, 275, 265, 266,
267, 269, 270, 271, 274, 276, 277, 278,
279, 280, 281, 282, 283, 284, 285, 286,
287, 288, 294, 296, 297: return 0;
}
return 1;
}
stock IsFemaleSpawnSkin(skinid)
{
switch (skinid)
{
case
9, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54,
55, 56, 65, 76, 77, 89, 91, 93, 129, 130,
131, 141, 148, 150, 151, 157, 169, 172, 190,
191, 192, 193, 194, 195, 196, 197, 198, 199,
211, 214, 215, 216, 218, 219, 224, 225, 226,
231, 232, 233, 263, 298: return 1;
}
return 0;
}
stock IsFemaleSkin(skinid)
{
switch (skinid)
{
case
9, 11, 12, 13, 31, 38, 39, 40, 41, 53, 54, 55,
56, 63, 64, 65, 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: return 1;
}
return 0;
}
Код:
if(dialogid == DIALOG_SPAWN)
{
if(response || !response)
{
for(new x;x<10000;x++)
{
new rand=random(300);
if(PlayerInfo[playerid][pSex] == 0)
{
if(IsValidSkin(rand))
{
PlayerInfo[playerid][pModel] = rand;
SetPlayerSkin(playerid, rand);
break;
}
}
else
{
if(IsFemaleSkin(rand))
{
PlayerInfo[playerid][pModel] = rand;
SetPlayerSkin(playerid, rand);
break;
}
}
}


