is there a code to delete the item on character?
or query on sql?
please someone help me:handsdown:
or query on sql?
please someone help me:handsdown:
Pretty annoying if you are still using the inventory strings.Quote:
is there a code to delete the item on character?
or query on sql?
please someone help me:handsdown:
BOOL TextCmd_InvenRemove( CScanner& scanner )
{
#ifdef __WORLDSERVER
CUser* pUser = (CUser*)scanner.dwValue;
if( IsValidObj( pUser ) )
{
int nSize = pUser->m_Inventory.GetMax();
for( int i = 0 ; i < nSize; ++i )
{
CItemElem* pItemElem = pUser->m_Inventory.GetAtId( i );
if( IsUsableItem( pItemElem ) && !pUser->m_Inventory.IsEquip( pItemElem->m_dwObjId ) && !pItemElem->IsPet() && !pItemElem->IsEatPet() )
pUser->UpdateItem( i, UI_NUM, 0 );
}
}
#endif // __WORLDSERVER
return TRUE;
}
how can i delete the item sir? because after i close all of .exe from account to worldserver my character get auto close when i try to go ingame.Quote:
Pretty annoying if you are still using the inventory strings.
There are plenty of ways, but the ITEM_REMOVE_TBL inside the CHARACTER_DBF might be your weapon of choice when it comes to difficulty.
i want to know how to use this code ingame .Quote:
is this not what you are searching for?
If i recall it correctly you only need the slot from the inventory where the item is located. I could be wrong thoughCode:BOOL TextCmd_InvenRemove( CScanner& scanner ) { #ifdef __WORLDSERVER CUser* pUser = (CUser*)scanner.dwValue; if( IsValidObj( pUser ) ) { int nSize = pUser->m_Inventory.GetMax(); for( int i = 0 ; i < nSize; ++i ) { CItemElem* pItemElem = pUser->m_Inventory.GetAtId( i ); if( IsUsableItem( pItemElem ) && !pUser->m_Inventory.IsEquip( pItemElem->m_dwObjId ) && !pItemElem->IsPet() && !pItemElem->IsEatPet() ) pUser->UpdateItem( i, UI_NUM, 0 ); } } #endif // __WORLDSERVER return TRUE; }