Transform online hours in cash shop points

Page 1 of 2 12 LastLast
Results 1 to 25 of 33
  1. #1
    Valued Member sqrobert is offline
    MemberRank
    Apr 2011 Join Date
    103Posts

    Transform online hours in cash shop points

    I simply couldn't find a good guide to help me with this so i managed to do it alone and now i want to share it with you.It's my first guide and i hope it's gonna go all right. So let's get started. I will show you how every hour played on mu will automatically be transformed in points for cash shop.

    Step 1
    First enter Start -> All programs-> Sql server -> enterprise manager ->DATABASE->MuOnline-> Tables
    Here look for MEMB_STAT , right click and chose Design Table and create a new column like the following:
    Column_name: OnlineHours
    Type: int
    Allow Nulls: unchecked
    Default value: 0

    Step 2
    Same location in MuOnline enter Stored Procedures and find WZ_DISCONNECT_MEMB. Douable click on it and replace the actual code with this one
    Code:
    CREATE PROCEDURE [dbo].[WZ_DISCONNECT_MEMB]
    @memb___id varchar(10)
     AS
    Begin    
    set nocount on
        Declare  @find_id varchar(10)    
        Declare @ConnectStat tinyint
    	declare @OnlineHours real
    	declare @cspoints int
        Set @ConnectStat = 0     
        Set @find_id = 'NOT'
        select @find_id = S.memb___id from MEMB_STAT S INNER JOIN MEMB_INFO I ON S.memb___id = I.memb___id 
               where I.memb___id = @memb___id
        if( @find_id <> 'NOT' )    
        begin        
    	SELECT @cspoints= cs_points FROM MEMB_INFO where memb___id = @memb___id
            update MEMB_STAT set ConnectStat = @ConnectStat, DisConnectTM = getdate(), OnlineHours = @cspoints/10+(DATEDIFF(hh,ConnectTM,getdate()))
             where memb___id = @memb___id
    	SELECT  @OnlineHours =OnlineHours FROM MEMB_STAT WHERE memb___id = @memb___id
    
    	UPDATE [dbo].[MEMB_INFO]
    	SET cs_points=(@OnlineHours * 10)
    	WHERE memb___id = @memb___id
    
        end
    end
    GO
    Click ok and you're done
    Things you should know:
    The code is set to give 10 points per hour . If you want to change that do the following:
    change hh(hour)
    in year-yy, yyyy
    quarter-qq, q
    monthmm- m
    day-dd, d
    week-wk, ww
    minute-mi, n
    second-ss, s
    These are the symbols if you want to change them, and to change the number of cash shop points received, change the "10" in the code with the number you want to receive.

    Hope I was of help. I only tested it on sql server 2000 windows xp, don't know for others. Sorry for my english and sorry if i did something wrong. GL

    EDIT: for values higher than 1 you must change in MEMB_STAT the OnlineHours column to REAL NOT INT
    Last edited by sqrobert; 24-11-11 at 07:10 PM.


  2. #2
    Valued Member PBPDomas is offline
    MemberRank
    Sep 2011 Join Date
    131Posts

    Re: Transform online hours in cash shop points

    Nice guide, thank you very much

  3. #3
    Member barry952 is offline
    MemberRank
    Oct 2008 Join Date
    71Posts

    Re: Transform online hours in cash shop points

    ohh.if this works...will be great to keep people online

  4. #4
    The MU Veteran DooMDesigN is offline
    MemberRank
    Dec 2008 Join Date
    OutlandLocation
    260Posts

    Re: Transform online hours in cash shop points

    and how about for Sql 2005 Standard

  5. #5
    Valued Member sqrobert is offline
    MemberRank
    Apr 2011 Join Date
    103Posts

    Re: Transform online hours in cash shop points

    i am sorry but i only knoow a few programing things, made this for my own server and posted the solution cuz i didn't find it anywhere else. If anyone else would like to test it on a different sql please post if it works for other players to see.

  6. #6
    Apprentice babinelo666 is offline
    MemberRank
    Feb 2011 Join Date
    7Posts

    Re: Transform online hours in cash shop points

    Server: Msg 2812, Level 16, State 62, Line 1
    Could not find stored procedure 'hh'.


    Help plz

  7. #7
    Apprentice Sunctru is offline
    MemberRank
    Jan 2012 Join Date
    GlasgowLocation
    14Posts

    Re: Transform online hours in cash shop points

    hehe thats a good idea to keep people online if they want something for free :d

  8. #8
    Novice MegaEdge is offline
    MemberRank
    Feb 2012 Join Date
    Rio de Janeiro,Location
    2Posts

    Re: Transform online hours in cash shop points

    @DooMDesigN - I think that works the same way for any MSSQL. I use MSSQL 2008 and was smoothly

    ---
    @sqrobert - I also need this for some time now and I'm looking for. But I have a question: if it does not work and I want to remove this procedure, as I do? Or just make a backup of the contents of WZ_DISCONNECT_MEMB ?

    Thank you for sharing.
    Last edited by MegaEdge; 12-02-12 at 02:20 PM.

  9. #9
    RaGEZONER Since 2004 I Am NoLimiT is offline
    MemberRank
    Jul 2004 Join Date
    Ha-HaciendaLocation
    1,025Posts

    Re: Transform online hours in cash shop points

    i just want to ask..how it worked if i wanted to transform hours online to PCPOINTS?.

  10. #10

    Re: Transform online hours in cash shop points

    Can you please tell me how to include auto pkclear in this script?

  11. #11
    Men In Black Shades nickypunk001 is offline
    MemberRank
    Aug 2008 Join Date
    Planet EarthLocation
    439Posts

    Re: Transform online hours in cash shop points

    Got this error.
    Error 446: Cannot resolve collation conflict for equal to operation.

  12. #12
    Men In Black Shades nickypunk001 is offline
    MemberRank
    Aug 2008 Join Date
    Planet EarthLocation
    439Posts

    Re: Transform online hours in cash shop points

    Quote Originally Posted by nickypunk001 View Post
    Got this error.
    Error 446: Cannot resolve collation conflict for equal to operation.
    *bump

  13. #13
    Apprentice EliteBattle is offline
    MemberRank
    Mar 2012 Join Date
    Wembley StadiumLocation
    21Posts

    Re: Transform online hours in cash shop points

    I got same error as well. but i rename cs_points to WCoin

  14. #14
    High'nLows 19871986 is offline
    MemberRank
    Sep 2010 Join Date
    istanbulLocation
    802Posts

    Re: Transform online hours in cash shop points

    UPDATE [dbo].[MEMB_INFO]
    SET cs_points=(@OnlineHours * 10)
    WHERE memb___id = @memb___id
    Here for save old points otherwise its remove before,

    UPDATE [dbo].[MEMB_INFO]
    SET cs_points=cs_points + (@OnlineHours * 10)
    WHERE memb___id = @memb___id

  15. #15
    Enthusiast mindfreakz1 is offline
    MemberRank
    Mar 2012 Join Date
    PhilippineSLocation
    35Posts

    Re: Transform online hours in cash shop points

    Thanks for this GUIDE keep it up!

  16. #16
    Apprentice jasontechie is offline
    MemberRank
    Nov 2011 Join Date
    22Posts

    Re: Transform online hours in cash shop points

    Is there any guide for transforming online hours to PC points?

  17. #17
    Member mRpLaYbOy is offline
    MemberRank
    Jan 2012 Join Date
    RomaniaLocation
    95Posts

    Re: Transform online hours in cash shop points

    How to transform online hours in webshop credits?
    Help Please!

  18. #18
    Isn't Komari-chan cute? nemoma is offline
    MemberRank
    Feb 2011 Join Date
    226Posts

    Re: Transform online hours in cash shop points

    For Webshop Credits and PCPoints, it's actually quite similar.
    Assuming you are using MUCore, the location of Webshop Credits should locate at MEMB_CREDITS, thus, you add these lines:

    under the declaration:
    Code:
    declare @credits int
    Under Selection:
    Code:
    SELECT @credits= credits FROM MEMB_CREDITS where memb___id = @uid
    Under Calculation of Online Hours ->CSPoints
    	UPDATE [dbo].[MEMB_CREDITS]
    	SET credits= credits + (@OnlineHours * 10)
    	WHERE memb___id = @uid
    PCPoints are similar, assuming you are using the TitanTech Packages, it should be located at SCFPCPoints under Characters table:
    declare @SCFPCPoints int
    SELECT @SCFPCPoints= SCFPCPoints FROM Character where AccountID = @uid
    UPDATE [dbo].[Character]
    SET SCFPCPoints= SCFPCPoints + (@OnlineHours * 1)
    WHERE AccountID = @uid


    These should work.

    Notice that the commands must go to their sections! If you paste them together there WILL be an error. My Completed scripts are here:

    Code:
    BEGIN TRANSACTION
    
    SET NOCOUNT ON
    	Declare  @find_id varchar(10)
    	declare @OnlineHours real
    	declare @SCFVipMoney int
    	declare @SCFPCPoints int
    	declare @credits int
    
    	SELECT @SCFVipMoney= SCFVipMoney FROM MEMB_INFO where memb___id = @uid
    	SELECT @SCFPCPoints= SCFPCPoints FROM Character where AccountID = @uid
    	SELECT @credits= credits FROM MEMB_CREDITS where memb___id = @uid
    
    IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
    WHERE memb___id = @uid )
    Begin
    UPDATE MEMB_STAT
    SET DisConnectTM = (getdate()), connectstat = 0,OnlineHours = @SCFVipMoney/10+(DATEDIFF(hh,ConnectTM,getdate())) WHERE memb___id = @uid
    	SELECT  @OnlineHours =OnlineHours FROM MEMB_STAT WHERE memb___id = @uid
    
    	UPDATE [dbo].[MEMB_INFO]
    	SET SCFVipMoney= SCFVipMoney + (@OnlineHours * 1)
    	WHERE memb___id = @uid
    
    	UPDATE [dbo].[Character]
    	SET SCFPCPoints= SCFPCPoints + (@OnlineHours * 1)
    	WHERE AccountID = @uid
    
    	UPDATE [dbo].[MEMB_CREDITS]
    	SET credits= credits + (@OnlineHours * 0)
    	WHERE memb___id = @uid
    End
    Again, don't outright copy it! No two databases are the same!

  19. #19
    Enthusiast ihyajade is offline
    MemberRank
    May 2009 Join Date
    41Posts

    Re: Transform online hours in cash shop points

    [QUOTE=nemoma;7109161]For Webshop Credits and PCPoints, it's actually quite similar.
    Assuming you are using MUCore, the location of Webshop Credits should locate at MEMB_CREDITS, thus, you add these lines:

    under the declaration:
    Code:
    declare @credits int
    Under Selection:
    Code:
    SELECT @credits= credits FROM MEMB_CREDITS where memb___id = @uid
    Under Calculation of Online Hours ->CSPoints
    	UPDATE [dbo].[MEMB_CREDITS]
    	SET credits= credits + (@OnlineHours * 10)
    	WHERE memb___id = @uid
    [/QUTE]

    where will I add this? In Table or Stored Procedure?

  20. #20
    Newbie daezugun is offline
    MemberRank
    Feb 2011 Join Date
    127.0.0.1Location
    787Posts

    Re: Transform online hours in cash shop points

    any additional and clear guidelines?

  21. #21
    I love HardStyle ! malemees is offline
    MemberRank
    Feb 2006 Join Date
    EstoniaLocation
    284Posts

    Re: Transform online hours in cash shop points



    how is possible to fix this error
    I use 4.5 files
    Last edited by malemees; 14-05-13 at 12:44 PM. Reason: wrong staff in text

  22. #22
    Valued Member FatalWorkz is offline
    MemberRank
    May 2011 Join Date
    PhilippinesLocation
    100Posts

    Re: Transform online hours in cash shop points

    Quote Originally Posted by nemoma View Post
    For Webshop Credits and PCPoints, it's actually quite similar.
    Assuming you are using MUCore, the location of Webshop Credits should locate at MEMB_CREDITS, thus, you add these lines:

    under the declaration:
    Code:
    declare @credits int
    Under Selection:
    Code:
    SELECT @credits= credits FROM MEMB_CREDITS where memb___id = @uid
    Under Calculation of Online Hours ->CSPoints
    	UPDATE [dbo].[MEMB_CREDITS]
    	SET credits= credits + (@OnlineHours * 10)
    	WHERE memb___id = @uid
    PCPoints are similar, assuming you are using the TitanTech Packages, it should be located at SCFPCPoints under Characters table:
    declare @SCFPCPoints int
    SELECT @SCFPCPoints= SCFPCPoints FROM Character where AccountID = @uid
    UPDATE [dbo].[Character]
    SET SCFPCPoints= SCFPCPoints + (@OnlineHours * 1)
    WHERE AccountID = @uid


    These should work.

    Notice that the commands must go to their sections! If you paste them together there WILL be an error. My Completed scripts are here:

    Code:
    BEGIN TRANSACTION
    
    SET NOCOUNT ON
    	Declare  @find_id varchar(10)
    	declare @OnlineHours real
    	declare @SCFVipMoney int
    	declare @SCFPCPoints int
    	declare @credits int
    
    	SELECT @SCFVipMoney= SCFVipMoney FROM MEMB_INFO where memb___id = @uid
    	SELECT @SCFPCPoints= SCFPCPoints FROM Character where AccountID = @uid
    	SELECT @credits= credits FROM MEMB_CREDITS where memb___id = @uid
    
    IF EXISTS ( SELECT memb___id FROM MEMB_STAT WITH (READUNCOMMITTED)
    WHERE memb___id = @uid )
    Begin
    UPDATE MEMB_STAT
    SET DisConnectTM = (getdate()), connectstat = 0,OnlineHours = @SCFVipMoney/10+(DATEDIFF(hh,ConnectTM,getdate())) WHERE memb___id = @uid
    	SELECT  @OnlineHours =OnlineHours FROM MEMB_STAT WHERE memb___id = @uid
    
    	UPDATE [dbo].[MEMB_INFO]
    	SET SCFVipMoney= SCFVipMoney + (@OnlineHours * 1)
    	WHERE memb___id = @uid
    
    	UPDATE [dbo].[Character]
    	SET SCFPCPoints= SCFPCPoints + (@OnlineHours * 1)
    	WHERE AccountID = @uid
    
    	UPDATE [dbo].[MEMB_CREDITS]
    	SET credits= credits + (@OnlineHours * 0)
    	WHERE memb___id = @uid
    End
    Again, don't outright copy it! No two databases are the same!
    hello mates can you help me with this: http://forum.ragezone.com/f193/php-s...points-934064/

    the server we used is TitanTech Package. no custom
    custom item has been disabled!
    yes i knew we used SCF.cfg. as the server configuration which is connected to the database!
    pls i need your help, at the moment i knew some of it.

  23. #23
    Member fameza123 is offline
    MemberRank
    Nov 2011 Join Date
    73Posts

    Re: Transform online hours in cash shop points

    support muserver season 2 ?

  24. #24
    Novice Sheva is offline
    MemberRank
    Sep 2013 Join Date
    1Posts

    Re: Transform online hours in cash shop points

    don`t work :( Did all the instructions. script adds 2,210 points for reconnet

  25. #25
    Member reletobg is offline
    MemberRank
    May 2010 Join Date
    77Posts

    Re: Transform online hours in cash shop points

    My online hours fields are empty. How to turn them to count whne player is online?



Page 1 of 2 12 LastLast

Advertisement