calling CMover::IsUsing(CItemElem* pItemElem) and IsUsingItem(CItemBase* pItem)

05/21/2013 21:38 hackerfromhell#1
Hey guys, I've asked for help in some other forum cause I couldn't stop the /awake function from being used while the item is being used in trade or shops.. and some guy told me to call these two:

PHP Code:
IsUsingItem(CItemBasepItem
and

PHP Code:
CMover::IsUsing(CItemElempItemElem
and I've got no idea of how to call these two inside my /awaken command...
here is the /awaken bool:

PHP Code:




BOOL TextCmd_GenRandomOption
CScanner )
{

#ifdef __WORLDSERVER 
    
CUserpUser = (CUser*)s.dwValue;
#ifndef __TAB_INVENTORY  
    
CItemElempItemElem    pUser->m_Inventory.GetAt);
#else
    
DWORD dwObjId s.GetNumber();
    
CItemElempItemElem    pUser->m_Inventory.GetAtIddwObjId );
#endif // __TAB_INVENTORY
    
if( pItemElem ){
        
int nRandomOptionKind    g_xRandomOptionProperty->GetRandomOptionKindpItemElem );
        if( 
nRandomOptionKind >= ){
        
        
        
//    if( pUser->IsUsing( (CItemElem*)pItemElem ) )    might need pItem and not pItemElem
        //    {
    //    pUser->AddText( "Item is currently being used." );
    //        }

    
    
        
        
            
if(pUser->HasActivatedSystemPet() && pItemElem->GetProp()->dwItemKind3 == IK3_EGG || pUser->HasActivatedEatPet() && pItemElem->GetProp()->dwItemKind3 == IK3_PET  ){ // nein work
                
pUser->AddText"Item must not be used and your pet must be in your inventory." );
                return 
FALSE;
            }else{
                if( 
pUser->GetGold() >= ){
                    
g_xRandomOptionProperty->InitializeRandomOptionpItemElem->GetRandomOptItemIdPtr() );
                    
g_xRandomOptionProperty->GenRandomOptionpItemElem->GetRandomOptItemIdPtr(), nRandomOptionKindpItemElem->GetProp()->dwParts );
                    
pUser->UpdateItemEx( (BYTE)( pItemElem->m_dwObjId ), UI_RANDOMOPTITEMIDpItemElem->GetRandomOptItemId() );
                    
pUser->AddGold);
                    
//pUser->AddText( "Dir wurden 100.000 Penya für das Erwecken abgezogen." );
                
}else{
                    
pUser->AddText"You must have at least 1 Penya in order to have the abillity to awaken an item." );
                }
            }
        }else{
            
pUser->AddText "Either your pet is not level C or your item doesn't suit the requirments of the scroll." );
        }
    }
#endif    // __WORLDSERVER
    #if defined(__CLIENT) && defined ( __TAB_INVENTORY)
    
if( g_WndMng.m_pWndUpgradeBase == NULL )
    {
        
SAFE_DELETEg_WndMng.m_pWndUpgradeBase );
        
g_WndMng.m_pWndUpgradeBase = new CWndUpgradeBase;
        
g_WndMng.m_pWndUpgradeBase->Initialize( &g_WndMngAPP_TEST );
        return 
FALSE;
    }

    if( 
g_WndMng.m_pWndUpgradeBase )
    {
        if( 
g_WndMng.m_pWndUpgradeBase->m_pItemElem[0] )
        {
            
DWORD dwObjId g_WndMng.m_pWndUpgradeBase->m_pItemElem[0]->m_dwObjId;
            
char szSkillLevel[MAX_PATH];
            
sprintfszSkillLevel"/awaken %d"dwObjId);
            
s.SetProgszSkillLevel );        
        }
        else
        {
            return 
FALSE;
        }
    }
    else
    {
        return 
FALSE;
    }
#endif // __TAB_INVENTORY
    
return TRUE;

If anyone could help me out doing it I would appreciate that, thanks!