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.
Tanks.Quote:
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.
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
DELETE PS_GameData.dbo.CharItems WHERE CharID = ChariD AND (ItemID = 77001) AND DATEDIFF(MINUTE, Maketime, GETDATE()) >= 1
WHERE CharID = ChariD
WHERE CharID = ChariD AND (ItemID = 77001) AND DATEDIFF(MINUTE, Maketime, GETDATE()) >= 1