Hi there.
I left gunz along time ago, But i'm coming back, working for gunz private servers.
There is a bug with deleting the character, " You cant delete your character because it contains cash items, clan. bla bla "
Well, I was watching the spDeleteChar procedure. and Phoenix you missed one thing. [ I'm not being ego, i'm just saying what he did ]
The original spdeletechar
The one that i've madeCode:set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO /* 캐릭터 삭제 */ ALTER PROC [dbo].[spDeleteChar] @AID int, @CharNum smallint, @CharName varchar(24) AS DECLARE @CID int DECLARE @CashItemCount int SELECT @CID=CID FROM Character WITH (nolock) WHERE AID=@AID and CharNum=@CharNum IF (@CID IS NULL) BEGIN return (-1) END SELECT @CashItemCount=COUNT(*) FROM CharacterItem(nolock) WHERE CID=@CID AND ItemID>=50000 IF (@CashItemCount > 0) OR (EXISTS (SELECT TOP 1 CLID FROM ClanMember WHERE CID=@CID)) BEGIN return (-1) END BEGIN TRAN UPDATE Character SET CharNum = -1, DeleteFlag = 1, Name='', DeleteName=@CharName WHERE AID=@AID AND CharNum=@CharNum AND Name=@CharName IF (0 <> @@ERROR) OR (0 = @@ROWCOUNT) BEGIN ROLLBACK TRAN RETURN (-1) END INSERT INTO CharacterMakingLog(AID, CharName, Type, Date) VALUES(@AID, @CharName, '삭제', GETDATE()) IF (0 <> @@ERROR) OR (0 = @@ROWCOUNT) BEGIN ROLLBACK TRAN RETURN (-1) END COMMIT TRAN SELECT 1 AS Ret
Example :Code:set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO /* 캐릭터 삭제 */ ALTER PROC [dbo].[spDeleteChar] @AID int, @CharNum smallint, @CharName varchar(24) AS DECLARE @CID int DECLARE @CashItemCount int SELECT @CID=CID FROM Character WITH (nolock) WHERE AID=@AID and CharNum=@CharNum IF (@CID IS NULL) BEGIN return (-1) END SELECT @CashItemCount=COUNT(*) FROM CharacterItem(nolock) WHERE CID=@CID AND ItemID>=add here all donators,events etc cashitems id search it at your zitem IF (@CashItemCount > 1) OR (EXISTS (SELECT TOP 1 CLID FROM ClanMember WHERE CID=@CID)) BEGIN return (-1) END BEGIN TRAN UPDATE Character SET CharNum = -1, DeleteFlag = 1, Name='', DeleteName=@CharName WHERE AID=@AID AND CharNum=@CharNum AND Name=@CharName IF (0 <> @@ERROR) OR (0 = @@ROWCOUNT) BEGIN ROLLBACK TRAN RETURN (-1) END INSERT INTO CharacterMakingLog(AID, CharName, Type, Date) VALUES(@AID, @CharName, '삭제', GETDATE()) IF (0 <> @@ERROR) OR (0 = @@ROWCOUNT) BEGIN ROLLBACK TRAN RETURN (-1) END COMMIT TRAN SELECT 1 AS Ret
[ you should have at the zitem -> iscashitem="true" ]Code:SELECT @CashItemCount=COUNT(*) FROM CharacterItem(nolock) WHERE CID=@CID AND ItemID>=650030 AND ItemID>=650032 AND ItemID>=Cashitem id AND ItemID>=CASHITEMid
If you cant fix the storage, i will make a tutorial latter how to fix it :)
Didn't work? tell me, i have another way to make it work :)
Good luck.
Wertex



Reply With Quote![Fixing the delete character bug [ 2008 files ]](http://ragezone.com/hyper728.png)


