(case when ItemCount < 0x7effffff then ItemCount+1else 1end )if(@@error <> 0)beginrollback transactionselect-1endelsebegincommit transactionselect @ItemSerialendENDGOif exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[trg_CheckSameID]') and OBJECTPROPERTY(id, N'IsTrigger') = 1)drop trigger [dbo].[trg_CheckSameID]GOif exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AllItemsLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[AllItemsLog]GOif exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CopyLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[CopyLog]GOCREATE TABLE [dbo].[AllItemsLog] ([items_id] [int] IDENTITY (1, 1) NOT NULL ,[items_type] [binary] (1) NOT NULL ,[items_serial] [binary] (4) NOT NULL ,[items_acid] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL) ON [PRIMARY]GOCREATE TABLE [dbo].[CopyLog] ([copy_id] [int] IDENTITY (1, 1) NOT NULL ,[copy_acid] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,[copy_whdata] [binary] (1200) NOT NULL ,[copy_date] [datetime] NOT NULL) ON [PRIMARY]GOALTER TABLE [dbo].[AllItemsLog] ADDCONSTRAINT [DF_CT_ITEM_item] DEFAULT (0) FOR [items_type],CONSTRAINT [DF_CT_ITEM_itemid] DEFAULT (0) FOR [items_serial],CONSTRAINT [DF_CT_ITEM_itemrole] DEFAULT ('\') FOR [items_acid]GOCREATE INDEX [IX_CT_ITEM] ON [dbo].[AllItemsLog]([items_type], [items_serial]) ON [PRIMARY]GOALTER TABLE [dbo].[CopyLog] ADDCONSTRAINT [DF_CopyLog_copy_date] DEFAULT (getdate()) FOR [copy_date]GOSET QUOTED_IDENTIFIER ONGOSET ANSI_NULLS ONGOCREATE TRIGGER [dbo].[trg_CheckSameID] ON [dbo].[character]FOR UPDATEASBEGINIF UPDATE(inventory)BEGINSET NOCOUNT ONDECLARE@wh_acid varchar(10),@wh_data binary(1200),@wh_type binary(1),@wh_serial binary(4),@cr_user varchar(10),@cr_acid varchar(10),@cr_data binary(760),@cr_type binary(1),@cr_serial binary(4),@al_acid varchar(10),@j int,@k int,@find bitSELECT @cr_acid=i.accountid,@cr_data=i.inventoryFROM inserted iSET @j=0SET @find=0WHILE @j<76 AND @cr_data IS NOT NULLBEGINSET @cr_type=SUBSTRING(@cr_data,@j*10+1,1)SET @cr_serial=SUBSTRING(@cr_data,@j*10+4,4)IF @cr_type<>0xFF AND @cr_serial<>0x00000000BEGINSELECT @al_acid=items_acid FROM allitemslog WHERE items_type=@cr_type AND items_serial=@cr_serialIF @al_acid IS NULLINSERT INTO allitemslog (items_type,items_serial,items_acid) VALUES (@cr_type,@cr_serial,@cr_acid)ELSEBEGINUPDATE allitemslog SET items_acid=@cr_acid WHERE items_type=@cr_type AND items_serial=@cr_serialSELECT @wh_data=items FROM warehouse WHERE accountid=@al_acidSET @k=0WHILE @k<120 AND @wh_data IS NOT NULLBEGINSET @wh_type=SUBSTRING(@wh_data,@k*10+1,1)SET @wh_serial=SUBSTRING(@wh_data,@k*10+4,4)IF @wh_type=@cr_type AND @wh_serial=@cr_serialSET @find=1SET @k=@k+1ENDENDENDSET @j=@j+1ENDIF @find=1BEGININSERT INTO copylog (copy_whdata,copy_acid,copy_date) VALUES (@wh_data,@al_acid,getdate())-- this is wer u can add more punishment like ban or lock charactersUPDATE Character SET CtlCode=1 WHERE accountid=@al_acidENDSET NOCOUNT OFFENDENDGOSET QUOTED_IDENTIFIER OFFGOSET ANSI_NULLS ONGODECLARE @al_acid char(50)set @al_acid = 'ASUS'UPDATE Character SET CtlCode=1 WHERE accountid=@al_acidgoselect * from AllItemsLogselect * from CopyLog <----- Copie ate aqui e siga o tutorial ( aprendizmuonline.net )4-Presione F5 e depois Ctrl N5- Ira abrir outra tela, nesta outra tela voce cola o seguinte codigo:select * from AllItemsLogselect * from CopyLog6- De F5 e Ctrl N novamente e mais uma vez ira abrir outra tela, ai voce cola o codigo abaixo:select * from CopyLog7- Pressione F5 e esta tudo pronto, em seguida feche todas as janelas abertas salvando os "logs" aonde desejar.Obs: O Sistema apenas funciona com os jogadores Online.Espero que tenham gostado,Creditos pela Query: Alexandre Gabriel