как вот этот код переделать под 3 итема?
Code
// Loop through all item slots
for ( new i = ITEM_SLOT_ONE; i <= ITEM_SLOT_TWO; i++ )
{
[code]// Do we have a valid item here?
if ( g_iShopMenuItems[id][i] != ITEM_NONE )
{
// Don't want to give the user more charges for free do we?
// And we don't want to give the bonuses if this is a next round use item (i.e. if we do then mole for infinity - that doesn't seem nice)
if ( !ITEM_CheckFlag( g_iShopMenuItems[id][i], ITEM_CHARGEABLE ) && !ITEM_CheckFlag( g_iShopMenuItems[id][i], ITEM_NEXTROUNDUSE ) )
{
ITEM_GiveBonuses( id, g_iShopMenuItems[id][i] );
}
}
}
Добавлено (04.02.2012, 20:41)
---------------------------------------------
// Reset our position since we're using a new array
pos = 0;
Code
// User has one item
if ( g_iShopMenuItems[id][ITEM_SLOT_ONE] > ITEM_NONE )
{
ITEM_Format( id, g_iShopMenuItems[id][ITEM_SLOT_ONE], szItemName, 31 )
pos += formatex( szItemInfo[pos], 256-pos, "%s", szItemName );
}
// User has another item
if ( g_iShopMenuItems[id][ITEM_SLOT_TWO] > ITEM_NONE )
{
ITEM_Format( id, g_iShopMenuItems[id][ITEM_SLOT_TWO], szItemName, 31 )
// Then the string isn't empty and we have information in it (so we have a first item)
if ( szItemInfo[0] )
{
pos += formatex( szItemInfo[pos], 256-pos, " %L %s", id, "WORD_AND", szItemName );
}
// We don't need the word "and"
else
{
pos += formatex( szItemInfo[pos], 256-pos, "%s", szItemName );
}
И ВОТ ЭТОТДобавлено (04.02.2012, 21:17)
---------------------------------------------
Помоги пожалуйста)