pawn Код:
stock BuyItemForPlayer(playerid,itemlistid)
{
new item[32];
format(item,sizeof(item),"%s",GetItemNameFromShopList(itemlistid));
if(PlayerInfo[playerid][pBoughtBag] == 0) {
if(!strcmp(PlayerInfo[playerid][pInv1],"empty",1)) PlayerInfo[playerid][pInv1] = item;
else if(!strcmp(PlayerInfo[playerid][pInv2],"empty",1)) PlayerInfo[playerid][pInv2] = item;
else if(!strcmp(PlayerInfo[playerid][pInv3],"empty",1)) PlayerInfo[playerid][pInv3] = item;
else if(!strcmp(PlayerInfo[playerid][pInv4],"empty",1)) PlayerInfo[playerid][pInv4] = item;
else if(!strcmp(PlayerInfo[playerid][pInv5],"empty",1)) PlayerInfo[playerid][pInv5] = item;
else if(!strcmp(PlayerInfo[playerid][pInv6],"empty",1)) PlayerInfo[playerid][pInv6] = item;
else if(!strcmp(PlayerInfo[playerid][pInv7],"empty",1)) PlayerInfo[playerid][pInv7] = item;
else if(!strcmp(PlayerInfo[playerid][pInv8],"empty",1)) PlayerInfo[playerid][pInv8] = item;
}
else if(PlayerInfo[playerid][pBoughtBag] == 1) {
if(!strcmp(PlayerInfo[playerid][pInv1],"empty",1)) PlayerInfo[playerid][pInv1] = item;
else if(!strcmp(PlayerInfo[playerid][pInv2],"empty",1)) PlayerInfo[playerid][pInv2] = item;
else if(!strcmp(PlayerInfo[playerid][pInv3],"empty",1)) PlayerInfo[playerid][pInv3] = item;
else if(!strcmp(PlayerInfo[playerid][pInv4],"empty",1)) PlayerInfo[playerid][pInv4] = item;
else if(!strcmp(PlayerInfo[playerid][pInv5],"empty",1)) PlayerInfo[playerid][pInv5] = item;
else if(!strcmp(PlayerInfo[playerid][pInv6],"empty",1)) PlayerInfo[playerid][pInv6] = item;
else if(!strcmp(PlayerInfo[playerid][pInv7],"empty",1)) PlayerInfo[playerid][pInv7] = item;
else if(!strcmp(PlayerInfo[playerid][pInv8],"empty",1)) PlayerInfo[playerid][pInv8] = item;
else if(!strcmp(PlayerInfo[playerid][pInv9],"empty",1)) PlayerInfo[playerid][pInv9] = item;
else if(!strcmp(PlayerInfo[playerid][pInv10],"empty",1)) PlayerInfo[playerid][pInv10] = item;
}
else if(PlayerInfo[playerid][pBoughtBag] == 2) {
if(!strcmp(PlayerInfo[playerid][pInv1],"empty",1)) PlayerInfo[playerid][pInv1] = item;
else if(!strcmp(PlayerInfo[playerid][pInv2],"empty",1)) PlayerInfo[playerid][pInv2] = item;
else if(!strcmp(PlayerInfo[playerid][pInv3],"empty",1)) PlayerInfo[playerid][pInv3] = item;
else if(!strcmp(PlayerInfo[playerid][pInv4],"empty",1)) PlayerInfo[playerid][pInv4] = item;
else if(!strcmp(PlayerInfo[playerid][pInv5],"empty",1)) PlayerInfo[playerid][pInv5] = item;
else if(!strcmp(PlayerInfo[playerid][pInv6],"empty",1)) PlayerInfo[playerid][pInv6] = item;
else if(!strcmp(PlayerInfo[playerid][pInv7],"empty",1)) PlayerInfo[playerid][pInv7] = item;
else if(!strcmp(PlayerInfo[playerid][pInv8],"empty",1)) PlayerInfo[playerid][pInv8] = item;
else if(!strcmp(PlayerInfo[playerid][pInv9],"empty",1)) PlayerInfo[playerid][pInv9] = item;
else if(!strcmp(PlayerInfo[playerid][pInv10],"empty",1)) PlayerInfo[playerid][pInv10] = item;
else if(!strcmp(PlayerInfo[playerid][pInv11],"empty",1)) PlayerInfo[playerid][pInv11] = item;
else if(!strcmp(PlayerInfo[playerid][pInv12],"empty",1)) PlayerInfo[playerid][pInv12] = item;
}
return 1;
}