[help] how to fix Account Premium Revive time (dbo.WZ_CharRevive)

Results 1 to 2 of 2
  1. #1
    Alpha Member javaz97 is offline
    MemberRank
    May 2006 Join Date
    HellLocation
    1,537Posts

    [help] how to fix Account Premium Revive time (dbo.WZ_CharRevive)

    my set up

    normal account Revive time = 15 min

    premium account Revive time = 10 min << not work

    [dbo].[WZ_CharRevive]

    -- note that revive timer is 1hrs, change in WZ_GetAccountInfo1 as well
    declare @sectorevive int
    declare @alive int = 0
    select
    [COLOR="#FF0000" @sectorevive=DATEDIFF (second, GETUTCDATE (), DATEADD (second, 900, DeathUtcTime)),[/COLOR]
    @alive=Alive
    from UsersChars
    where CharID=@in_CharID


    -- new code
    if ( @iSPRemium = 1)
    @sectorevive=DATEDIFF (second, GETUTCDATE (), DATEADD (second, 600, DeathUtcTime)),
    else
    @sectorevive=DATEDIFF (second, GETUTCDATE (), DATEADD (second, 900, DeathUtcTime)),

    how to write full code ?

    - - - Updated - - -

    plz test

    Code:
    ALTER PROCEDURE [dbo].[WZ_CharRevive]
    ...
    ...
    
        -- note that revive timer is 1hrs, change in WZ_GetAccountInfo1 as well
        declare    @sectorevive int
        declare    @alive int = 0
        declare    @iSPRemium int
    
    	SELECT    @iSPRemium=isPremium FROM UsersData WHERE CustomerID=@in_CustomerID
    
    	-- check premium account
        if    @iSPRemium = 1) begin
    		select
    		    @sectorevive=DATEDIFF (second, GETUTCDATE (), DATEADD (second, 600, DeathUtcTime)),
    		    @alive=Alive
    		from UsersChars
    		where CharID=@in_CharID
    	end
    
    	else begin
    		select
    		    @sectorevive=DATEDIFF (second, GETUTCDATE (), DATEADD (second, 900, DeathUtcTime)),
    		    @alive=Alive
    		from UsersChars
    		where CharID=@in_CharID
    	end
    - - - Updated - - -


    --- edit 2

    if ( @iSPRemium = 1 ) begin


  2. #2
    Alpha Member javaz97 is offline
    MemberRank
    May 2006 Join Date
    HellLocation
    1,537Posts

    Re: [help] how to fix Account Premium Revive time (dbo.WZ_CharRevive)

    work ??



Advertisement