[PAYLASIM] Item Rental Aktif Hale Getirme

    Flexy
    Flexy


    Favori Oyun Favori Oyun : WolfTeam
    Nick Nick : Ko-PVP
    Karakter Karakter : Asas
    Irk Irk : El Morad
    Cinsiyet Cinsiyet : Erkek
    Mesaj Sayısı Mesaj Sayısı : 73
    Rep Puanı Rep Puanı : 1
    Kayıt tarihi Kayıt tarihi : 26/12/09
    Lakap Lakap : Asker

    [PAYLASIM] Item Rental Aktif Hale Getirme Empty [PAYLASIM] Item Rental Aktif Hale Getirme

    Mesaj tarafından Flexy C.tesi Ara. 26, 2009 5:12 am

    Merhabalar ,

    Gectigimiz Günlerde Forumda Paylasildigini Gördüm Bir İhtimal Yapamayanlarimiz Olmustur Diye Düsünerek Prosedürü Direk Düzeltilmiş Halde Veriyorum . Bu Prosedür İle Her Database'de Bulunan Rental İtem NPC'sini Aktif Hale Getirebilirsiniz. Bazi Database'ler de İtem Register Ederken Hata Verir Bu Prosedürü Uyguladiktan Sonra Yapmaniz Gereken 1 Adet Rental Scroll Kiraya Vereceginiz İtem ve Rental NPC'si [Resimleri görebilmek için üye olun veya giriş yapın.]Bir Teşekkür Yeterli




    Kod:
    [b][font=Tahoma]/****** Object: Stored Procedure dbo.RENTAL_ITEM_REGISTER Script Date: 6/6/2006 6:03:34 PM ******/[/font][/b]
     
     
    [b][font=Tahoma]CREATE PROCEDURE RENTAL_ITEM_REGISTER[/font][/b]
    [b][font=Tahoma]@charID char(21), [/font][/b]
    [b][font=Tahoma]@AccountID char(21),[/font][/b]
    [b][font=Tahoma]@sRentalTime smallint,[/font][/b]
    [b][font=Tahoma]@nItemID int,[/font][/b]
    [b][font=Tahoma]@sDurability smallint,[/font][/b]
    [b][font=Tahoma]@nMoney int,[/font][/b]
    [b][font=Tahoma]@bGameBangType tinyint,[/font][/b]
    [b][font=Tahoma]@bItemType tinyint,[/font][/b]
    [b][font=Tahoma]@bItemClass tinyint,[/font][/b]
    [b][font=Tahoma]@nSerialNumber bigint,[/font][/b]
    [b][font=Tahoma]@nRet_Index int OUTPUT,[/font][/b]
    [b][font=Tahoma]@nRet smallint OUTPUT[/font][/b]
     
    [b][font=Tahoma]AS[/font][/b]
     
    [b][font=Tahoma]DECLARE @Row tinyint, @nRentalIndex int[/font][/b]
    [b][font=Tahoma]DECLARE @timeRegister smalldatetime[/font][/b]
    [b][font=Tahoma]SET @Row = 0[/font][/b]
    [b][font=Tahoma]SET @nRet_Index = -1[/font][/b]
    [b][font=Tahoma]SET @timeRegister = getdate()[/font][/b]
     
    [b][font=Tahoma]---------------------------------------[/font][/b]
    [b][font=Tahoma]--SET @nRet = -9[/font][/b]
    [b][font=Tahoma]--RETURN[/font][/b]
     
     
    [b][font=Tahoma]SELECT @Row = COUNT(*) FROM RENTAL_ITEM WHERE nItemIndex = @nItemID and strLenderAcID = @AccountID [/font][/b]
    [b][font=Tahoma]IF @Row > 0[/font][/b]
    [b][font=Tahoma]BEGIN[/font][/b]
    [b][font=Tahoma]SET @nRet = -9[/font][/b]
    [b][font=Tahoma]RETURN[/font][/b]
    [b][font=Tahoma]END[/font][/b]
     
    [b][font=Tahoma]BEGIN TRAN [/font][/b]
     
    [b][font=Tahoma]INSERT INTO [/font][/b]
    [b][font=Tahoma]RENTAL_ITEM ( nItemIndex, sDurability, nSerialNumber, byRegType, byItemType, byClass, sRentalTime, nRentalMoney, strLenderCharID, strLenderAcID ) [/font][/b]
    [b][font=Tahoma]VALUES (@nItemID, @sDurability, @nSerialNumber, @bGameBangType, @bItemType, @bItemClass, @sRentalTime, @nMoney, @charID, @AccountID )[/font][/b]
     
    [b][font=Tahoma]IF @@ERROR <> 0[/font][/b]
    [b][font=Tahoma]BEGIN [/font][/b]
    [b][font=Tahoma]ROLLBACK TRAN [/font][/b]
    [b][font=Tahoma]SET @nRet = -16[/font][/b]
    [b][font=Tahoma]RETURN[/font][/b]
    [b][font=Tahoma]END[/font][/b]
     
    [b][font=Tahoma]SELECT @nRentalIndex = nRentalIndex FROM RENTAL_ITEM WHERE nItemIndex = @nItemID and strLenderAcID = @AccountID [/font][/b]
     
    [b][font=Tahoma]-- 임대자정보에 추가(등록)[/font][/b]
    [b][font=Tahoma]INSERT INTO [/font][/b]
    [b][font=Tahoma]USER_RENTAL_ITEM ( strUserID, strAccountID, byRentalType, byRegType, nRentalIndex, nItemIndex, sDurability, nSerialNumber, nRentalMoney, sRentalTime, sDuringTime, timeRegister ) [/font][/b]
    [b][font=Tahoma]VALUES ( @charID, @AccountID, 1, @bGameBangType, @nRentalIndex, @nItemID, @sDurability, @nSerialNumber, @nMoney, @sRentalTime, @sRentalTime, @timeRegister )[/font][/b]
     
    [b][font=Tahoma]IF @@ERROR <> 0[/font][/b]
    [b][font=Tahoma]BEGIN [/font][/b]
    [b][font=Tahoma]ROLLBACK TRAN [/font][/b]
    [b][font=Tahoma]SET @nRet = -17[/font][/b]
    [b][font=Tahoma]RETURN[/font][/b]
    [b][font=Tahoma]END[/font][/b]
     
    [b][font=Tahoma]-- SELECT @nRentalIndex = nRentalIndex FROM RENTAL_ITEM WHERE nItemIndex = @nItemID and strLenderAcID = @AccountID [/font][/b]
    [b][font=Tahoma]SET @nRet_Index = @nRentalIndex[/font][/b]
     
    [b][font=Tahoma]COMMIT TRAN[/font][/b]
    [b][font=Tahoma]SET @nRet = 1[/font][/b]
    [b][font=Tahoma]GO[/font][/b]

      Forum Saati Cuma Nis. 26, 2024 10:19 pm