Items with Time

05/26/2018 22:57 Bacкa#1
I would like to know if there is a way to by time in some type items, helmet, weapons etc so that the time expires and the item disappears.
05/29/2018 07:23 Spectral#1#2
USE [PS_gameData]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

create TRIGGER [dbo].[itemdelete]
ON [dbo].[chars]
after update
as
IF (UPDATE(leavedate))
begin

SET NOCOUNT ON;

DECLARE @[Only registered and activated users can see links. Click Here To Register...]D INT = (SELECT CharID FROM inserted)


DELETE PS_GameData.dbo.CharItems WHERE CharID = @[Only registered and activated users can see links. Click Here To Register...]D AND (ItemID = 0) AND DATEDIFF(DAY, Maketime, GETDATE()) >= 1

END

------------------

deletes the item after 1 day. change 1 to watever number you want. or change the day to minute year month etc. Simple script.
05/31/2018 22:34 Bacкa#3
Quote:
Originally Posted by Spectral#1 View Post
USE [PS_gameData]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

create TRIGGER [dbo].[itemdelete]
ON [dbo].[chars]
after update
as
IF (UPDATE(leavedate))
begin

SET NOCOUNT ON;

DECLARE @[Only registered and activated users can see links. Click Here To Register...]D INT = (SELECT CharID FROM inserted)


DELETE PS_GameData.dbo.CharItems WHERE CharID = @[Only registered and activated users can see links. Click Here To Register...]D AND (ItemID = 0) AND DATEDIFF(DAY, Maketime, GETDATE()) >= 1

END

------------------

deletes the item after 1 day. change 1 to watever number you want. or change the day to minute year month etc. Simple script.
Tanks.

and if he uses the item and after that he puts in the deposit, the time of the item will count anyway?
05/31/2018 23:21 Spectral#1#4
The items time counts from its creation no matter where it goes. the script i provided will only delete it from the character though. You must add userstoreditems if you want it to delete from WH. Make it untradable. Or else youll have to add all the other spots too, GH, market, etc.
06/01/2018 05:44 Bacкa#5
has some items that the script does not remove.
(ItemID = 77001)
06/01/2018 07:00 Spectral#1#6
then you are writing its ID wrong
06/01/2018 07:12 Bacкa#7
[Only registered and activated users can see links. Click Here To Register...]
HTML Code:
149	1	77001	5096685863069351936	77	1	0	0	400	227	118	133	228	119	134	00101100040034002570	1	2017-10-29 17:03:10.000	X	False
HTML Code:
DELETE PS_GameData.dbo.CharItems WHERE CharID = ChariD AND (ItemID = 77001) AND DATEDIFF(MINUTE, Maketime, GETDATE()) >= 1
06/01/2018 18:58 SnickQ#8
The problem may it be here
Code:
WHERE CharID = ChariD
Your CharID is not declared
06/01/2018 20:16 Bacкa#9
Quote:
Originally Posted by SnickQ View Post
The problem may it be here
Code:
WHERE CharID = ChariD
Your CharID is not declared

Yes I also noticed this but since it was removing other items I didn't mind moving, (Item ID = 77001) They too are not removing item type 150/120
06/01/2018 20:47 SnickQ#10
Becouse this part (if have declare):
Code:
 WHERE CharID = ChariD AND (ItemID = 77001) AND DATEDIFF(MINUTE, Maketime, GETDATE()) >= 1
Remove every item from your bag with id 77001 and MakeTime "equal&more" - 1 minute.

I do not have access to sql now but try add "ItemUID log" when item 77001 is create and then remove from UID or add MakeType some letters like "Z" and then remove 'Z' + 1 minute?
06/02/2018 11:55 Spectral#1#11
WHERE CharID = @[Only registered and activated users can see links. Click Here To Register...]D
06/02/2018 14:23 Bacкa#12
I can, but items like fantasy and pets are not deleting