14.08.2013, 00:45
Try
pawn Код:
for(new i,d; i != MAX_SLOTS; i++)
{
for(d=1; d != 11; d++)
if(WearClothesItems[playerid][i] == ClothesItems[playerid][d])
{
SendClientMessage(playerid,COLOR_RED,"You already wearing this clothes");
return 0;
}
else
{
ClothesID[playerid] = ClothesItems[playerid][d];
GetClothesID(playerid);
SetPlayerAttachedObject(playerid, GetFreeClothesSlot[playerid], GetClothesID(playerid), GetClothesBoneID(playerid));
EditAttachedObject(playerid, GetFreeClothesSlot[playerid]);
WearClothesItems[playerid][GetFreeClothesSlot[playerid]] = ClothesItems[playerid][number];//This will store the item ids and on what attachmentslot the wearing it.
format(globalstring,sizeof(globalstring),"WearClothesItem[playerid][%d]=%d;",GetFreeClothesSlot[playerid],WearClothesItems[playerid][GetFreeClothesSlot[playerid]]);
SendClientMessage(playerid,-1,globalstring);
GetFreeClothesSlot[playerid]++;
return 0;
}
}