- Joined
- Dec 18, 2009
- Messages
- 333
- Reaction score
- 142
AutoCashPoint by TimePlay new version
All Character in one account will get regen cash even that character have Timeplay lower than other character.
All Character in one account will get regen cash even that character have Timeplay lower than other character.
I release it because I am not use this way again, I am already put this features to my Module protection.
so I release this way to public.
This version for fix issue about some character cannot have cashpoint regeneration because have lower timeplay than other character in one account.
Following This for Installation
1. Create new column on your tbl_base
Code:
USE [RF_World]
-- ================================================
-- Pembuat : <Hanry Roslaw Saputra>
-- Dibuat Tanggal : <13 April 2014>
-- Keterangan : <Trigger AutoCash Version 1.2>
-- ================================================
ALTER TABLE [dbo].[tbl_base]
ADD LogPlay INT NOT NULL DEFAULT ((0))
2. Create new procedure on your RF_World database
Code:
USE [RF_World]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ================================================
-- Pembuat : <Hanry Roslaw Saputra>
-- Dibuat Tanggal : <13 April 2014>
-- Keterangan : <Prosedur AutoCash Version 1.2>
-- ================================================
CREATE PROCEDURE [dbo].[pUpdate_RoslawBase]
[USER=445157]serial[/USER] INT,
[USER=2000163149]log[/USER]Play INT
AS
BEGIN
SET NOCOUNT ON
UPDATE [dbo].[tbl_base]
SET LogPlay = [USER=2000163149]log[/USER]Play
WHERE Serial = [USER=445157]serial[/USER]
END
GO
3. Create new procedure on your BILLING Database
Code:
USE [Billing]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ================================================
-- Pembuat : <Hanry Roslaw Saputra>
-- Dibuat Tanggal : <13 April 2014>
-- Keterangan : <Prosedur AutoCash Version 1.2>
-- ================================================
CREATE PROCEDURE [dbo].[RF_AutocashRoslaw]
[USER=19862]id[/USER] VARCHAR(17),
[USER=315880]cas[/USER]h INT
AS
BEGIN
SET NOCOUNT ON
UPDATE [dbo].[tbl_UserStatus]
SET Cash = (Cash + [USER=315880]cas[/USER]h)
WHERE id = [USER=19862]id[/USER]
END
GO
4. Create new Triger on your tbl_general
Code:
USE [RF_World]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ================================================
-- Pembuat : <Hanry Roslaw Saputra>
-- Dibuat Tanggal : <13 April 2014>
-- Keterangan : <Trigger AutoCash Version 1.2>
-- ================================================
CREATE TRIGGER [dbo].[AutocashRoslaw]
ON [dbo].[tbl_general]
FOR UPDATE
AS
BEGIN
SET NOCOUNT ON
DECLARE @GSerial INT
DECLARE @GDCK BIT
DECLARE @GPlay INT
DECLARE @BSerial INT
DECLARE @BDCK BIT
DECLARE @BAccount VARCHAR(17)
DECLARE @BPlay INT
DECLARE [USER=807898]regenc[/USER]ash INT
IF UPDATE(TotalPlayMin)
BEGIN
SELECT @GSerial = Serial, @GDCK = DCK, @GPlay = TotalPlayMin FROM INSERTED
IF (@GSerial > 0 AND @GDCK = 0)
BEGIN
SELECT @BSerial = Serial, @BDCK = DCK, @BAccount = Account, @BPlay = LogPlay FROM [dbo].[tbl_base] WHERE Serial = @GSerial
IF (@BSerial > 0 AND @BDCK = 0)
BEGIN
SELECT [USER=807898]regenc[/USER]ash = ((@GPlay-@BPlay)*60)
IF [USER=807898]regenc[/USER]ash > 0)
BEGIN
EXEC [Billing].[dbo].[RF_AutocashRoslaw] [USER=19862]id[/USER] = @BAccount, [USER=315880]cas[/USER]h = [USER=807898]regenc[/USER]ash
EXEC [RF_World].[dbo].[pUpdate_RoslawBase] [USER=445157]serial[/USER] = @GSerial, [USER=2000163149]log[/USER]Play = @GPlay
END
END
END
END
END
GO
to set value regen per minute, just edit value "60" on triger query.
Example :
"60" is mean players will get 60 cashpoint every minute.Code:SELECT [USER=807898]regenc[/USER]ash = ((@GPlay-@BPlay)*[B]60[/B])
Author @ROSLAW
Last edited: