Help Textdraw show again.
#1

PHP код:
stock AddItem(playeriditemidamount)
{
    new 
bool:sucess false;
    
    for(new 
0MAX_INVENTORY_SLOTS++)
    {
        if(
pInventory[playerid][pInvSlot][i] == itemid && Items[pInventory[playerid][pInvSlot][i]][item_Limit] > && pInventory[playerid][pInvSlotAmount][i] != Items[pInventory[playerid][pInvSlot][i]][item_Limit])
        {
            new 
check amount pInventory[playerid][pInvSlotAmount][i];
            if(
check Items[pInventory[playerid][pInvSlot][i]][item_Limit])
            {
                
pInventory[playerid][pInvSlotAmount][i] = Items[itemid][item_Limit];
                for(new 
0MAX_INVENTORY_SLOTS++)
                {
                    if(
pInventory[playerid][pInvSlot][a] == 0)
                    {
                        
pInventory[playerid][pInvSlot][a] = itemid;
                        new 
resto Items[itemid][item_Limit] - check;
                        
pInventory[playerid][pInvSlotAmount][a] = resto*-1;
                        
                        if(
UsingInv[playerid])
                        {
                            
PlayerTextDrawSetPreviewModel(playeridInventorySlot[playerid][a], Items[itemid][item_Model]);
                         
                            
PlayerTextDrawHide(playeridInventorySlot[playerid][a]);
                            
PlayerTextDrawShow(playeridInventorySlot[playerid][a]);
                        }                        
                        break;
                    }
                }
            }
            else
            {
                
pInventory[playerid][pInvSlotAmount][i] += amount;
                
                if(
UsingInv[playerid])
                {
                    if(
pInventory[playerid][pInvSelectedSlot] == i)
                    {
                        if(
Items[pInventory[playerid][pInvSlot][i]][item_Type] == ITEM_TYPE_NORMAL)
                        {
                            if(
pInventory[playerid][pInvSlotAmount][i] >= 1)
                            {
                                new 
string[128];
                                
format(stringsizeof(string), "~>~ Amount: %d"pInventory[playerid][pInvSlotAmount][i]);
                                
PlayerTextDrawSetString(playeridDisplayInformation[playerid][3], string);
                                
PlayerTextDrawHide(playeridDisplayInformation[playerid][3]);
                                
PlayerTextDrawShow(playeridDisplayInformation[playerid][3]);
                            }
                        }
                    }
                }
            }
            
sucess true;
             break;
        }
    }
    if(
sucess)
        return 
true;
        
    for(new 
0MAX_INVENTORY_SLOTS++)
     {
        if(
pInventory[playerid][pInvSlot][i] == 0)
        {
            
pInventory[playerid][pInvSlot][i] = itemid;
            
pInventory[playerid][pInvSlotAmount][i] = amount;
                               
            break;
        }
    }
    return 
1;

Код:
if(UsingInv[playerid]) 
{ 
       PlayerTextDrawSetPreviewModel(playerid, InventorySlot[playerid][a], Items[itemid][item_Model]); 
                          
       PlayerTextDrawHide(playerid, InventorySlot[playerid][a]); 
       PlayerTextDrawShow(playerid, InventorySlot[playerid][a]); 
}
It no show the item model new, when i use AddItem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)