(Release) Lock item

03/23/2020 15:12 sebariio#1
Hola
This code is used to prevent the accidental sale or deletion of objects. You can use this 'system' for a quick sale system at NPC. I saw this system on another server, I recoded it myself. Mine works by performing SHIFT + Double click. I give it for free because I think it's very useful and I would like to see it more often on the servers.

result: [Only registered and activated users can see links. Click Here To Register...]
03/23/2020 20:42 ZeroTwo02#2
IsUsableItem isn't for dog, use it.
Call it before you use pItemElem.
03/24/2020 01:37 sebariio#3
Quote:
Originally Posted by ZeroTwo02 View Post
IsUsableItem isn't for dog, use it.
Call it before you use pItemElem.
Look at the body of the method before giving advice, disrespectfully in addition. Thanks. :handsdown:
03/24/2020 07:14 Seigh77#4
have problem with the

pItemElem->SetFlag(CItemElem::locked, bLock)

the error is
CItemElem::SetFlag function does not take 2 arguments :)

thank you for this release
03/24/2020 08:28 siono01#5
Thank you for posting, does this require a bank password?
03/24/2020 10:52 ZeroTwo02#6
Quote:
Originally Posted by Seigh77 View Post
have problem with the

pItemElem->SetFlag(CItemElem::locked, bLock)

the error is
CItemElem::SetFlag function does not take 2 arguments :)

thank you for this release
Because he change the SetFlag function to add a BOOL "bLock".
Hard to use SetFlag for "lock" and ResetFlag for remove "lock".

Quote:
Originally Posted by sebariio View Post
Look at the body of the method before giving advice, disrespectfully in addition. Thanks. :handsdown:
It is good to use IsUsableItem on the CUser::LockItem, but you have to use it also on CDPSrvr::OnLockItem.
03/24/2020 13:39 sebariio#7
Quote:
Originally Posted by Seigh77 View Post
have problem with the

pItemElem->SetFlag(CItemElem::locked, bLock)

the error is
CItemElem::SetFlag function does not take 2 arguments :)

thank you for this release
Code:
void	SetFlag(BYTE byFlag, BOOL bEnable = TRUE) { if (bEnable) m_byFlag |= byFlag; else m_byFlag &= ~byFlag; }
03/25/2020 10:29 Seigh77#8
Quote:
Originally Posted by sebariio View Post
Code:
void	SetFlag(BYTE byFlag, BOOL bEnable = TRUE) { if (bEnable) m_byFlag |= byFlag; else m_byFlag &= ~byFlag; }
can you share your icon please :) thank you
03/25/2020 10:56 Naltalah#9
Quote:
Originally Posted by Seigh77 View Post
can you share your icon please :) thank you
There you go
03/28/2020 14:31 sebariio#10
Quote:
Originally Posted by Seigh77 View Post
can you share your icon please :) thank you
My icon: [Only registered and activated users can see links. Click Here To Register...]
07/27/2020 20:55 Huguette#11
Quote:
Originally Posted by sebariio View Post
Code:
#ifdef __LOCK_ITEM
					if (pItemElem->IsFlag(CItemElem::locked))
					{
						CTexture* pTexture = CWndBase::m_textureMng.AddTexture(g_Neuz.m_pd3dDevice, MakePath(DIR_ICON, "icon_LockItem.dds"), 0xffff00ff);
						if (pTexture)
							pTexture->Render(p2DRender, CPoint(x * 35, (y * 35) + 4), 255);
					}
#endif // __LOCK_ITEM
Hey, first of all, thank you for the release,
Can u be more specific about the place of this part of code ?
04/09/2021 20:08 bhengot#12
I have some error please help there !

Thankyou so much !

[Only registered and activated users can see links. Click Here To Register...]
04/10/2021 12:55 Hikari Kuina#13
Quote:
Originally Posted by bhengot View Post
I have some error please help there !

Thankyou so much !

[Only registered and activated users can see links. Click Here To Register...]
for you error CItemElem::SetFlag here's the solution
It was posted up you have to read the article.

For the error AddDefinedText identifier not found

For the Lockitem is not a member of CUser
04/10/2021 18:04 flyffdev#14
Quote:
Originally Posted by Hikari Kuina View Post
for you error CItemElem::SetFlag here's the solution
It was posted up you have to read the article.

For the error AddDefinedText identifier not found

For the Lockitem is not a member of CUser
For the error AddDefinedText identifier not found

just change it to AddText
04/18/2021 16:02 bhengot#15
Already Fix it guys thankyou for your reply <3