- Joined
- Oct 19, 2012
- Messages
- 252
- Reaction score
- 3
for step 4 i found error like this :
Msg 102, Level 15, State 1, Procedure AutocashRoslaw, Line 36
Incorrect syntax near ')'.
Get the same error
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!for step 4 i found error like this :
Msg 102, Level 15, State 1, Procedure AutocashRoslaw, Line 36
Incorrect syntax near ')'.
Some query changed to another language. sorry.
May be in register.php must connected to Billing
Btw cant regent for new player or ?
sir ROSLAW
my query not show error but not working in game its still 0 cash point :$:
all ini file NATION = RU and i use BILLING RU
how to fix this???
thank's
sory for my bad english sir
USE [RF_World]
-- ================================================
-- Pembuat : [COLOR=#000088]<Hanry[/COLOR] [COLOR=#660066]Roslaw[/COLOR] [COLOR=#660066]Saputra[/COLOR][COLOR=#000088]>[/COLOR]
-- Dibuat Tanggal : <13 April 2014>
-- Keterangan : [COLOR=#000088]<Trigger[/COLOR] [COLOR=#660066]AutoCash[/COLOR] [COLOR=#660066]Version[/COLOR] 1.2[COLOR=#000088]>[/COLOR]
-- ================================================
ALTER TABLE [dbo].[tbl_base]
ADD LogPlay INT NOT NULL DEFAULT ((0))
USE [RF_World]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ================================================
-- Pembuat : [COLOR=#000088]<Hanry[/COLOR] [COLOR=#660066]Roslaw[/COLOR] [COLOR=#660066]Saputra[/COLOR][COLOR=#000088]>[/COLOR]
-- Dibuat Tanggal : <13 April 2014>
-- Keterangan : [COLOR=#000088]<Prosedur[/COLOR] [COLOR=#660066]AutoCash[/COLOR] [COLOR=#660066]Version[/COLOR] 1.2[COLOR=#000088]>[/COLOR]
-- ================================================
CREATE PROCEDURE [dbo].[pUpdate_LogPlay]
@[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I] INT,
@[I][B][URL="http://forum.ragezone.com/members/2000163149.html"]log[/URL][/B][/I]Play INT
AS
BEGIN
SET NOCOUNT ON
UPDATE [dbo].[tbl_base]
SET LogPlay = @[I][B][URL="http://forum.ragezone.com/members/2000163149.html"]log[/URL][/B][/I]Play
WHERE Serial = @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I]
END
GO
USE [Billing]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ================================================
-- Pembuat : [COLOR=#000088]<Hanry[/COLOR] [COLOR=#660066]Roslaw[/COLOR] [COLOR=#660066]Saputra[/COLOR][COLOR=#000088]>[/COLOR]
-- Dibuat Tanggal : <13 April 2014>
-- Keterangan : [COLOR=#000088]<Prosedur[/COLOR] [COLOR=#660066]AutoCash[/COLOR] [COLOR=#660066]Version[/COLOR] 1.2[COLOR=#000088]>[/COLOR]
-- ================================================
CREATE PROCEDURE [dbo].[RF_RegenCash]
@[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] VARCHAR(17),
@[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h INT,
@[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I] INT
AS
BEGIN
declare @[I][B][URL="http://forum.ragezone.com/members/1333430432.html"]Rat[/URL][/B][/I]e int
declare @status int
declare @map int
declare @currentmap int
set @[I][B][URL="http://forum.ragezone.com/members/1333430432.html"]Rat[/URL][/B][/I]e='2' -- multiply your cash coin for Premium user
set @map='11' -- map code for Sette
SET NOCOUNT ON
set @currentmap=(select map from RF_World.dbo.tbl_general where Serial @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I])
if @currentmap=@map
begin
if exists (select id from billing.dbo.tbl_UserStatus where id @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I])
begin
set @status=(select status from BILLING.dbo.tbl_UserStatus where id @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I])
if @status = 2
begin
update billing.dbo.tbl_UserStatus set cash=cash+ @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h @[I][B][URL="http://forum.ragezone.com/members/1333430432.html"]Rat[/URL][/B][/I]e) where id @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]
end else
begin
update billing.dbo.tbl_UserStatus set cash=cash @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h where id @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]
end
end else
begin
insert into billing.dbo.tbl_UserStatus(id,status,Cash)
values @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I],1 @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h)
end
end
END
GO
-- ================================================
-- Pembuat : [COLOR=#000088]<Hanry[/COLOR] [COLOR=#660066]Roslaw[/COLOR] [COLOR=#660066]Saputra[/COLOR][COLOR=#000088]>[/COLOR]
-- Dibuat Tanggal : <13 April 2014>
-- Keterangan : [COLOR=#000088]<Trigger[/COLOR] [COLOR=#660066]AutoCash[/COLOR] [COLOR=#660066]Version[/COLOR] 1.2[COLOR=#000088]>[/COLOR]
-- ================================================
USE [RF_World]
GO
/****** Object: Trigger [dbo].[RF_TimeUpdate] Script Date: 06/02/2016 19:37:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [dbo].[RegenCash]
ON [dbo].[tbl_general]
AFTER UPDATE
as
begin
SET NOCOUNT ON;
DECLARE @GSerial INT
DECLARE @GPlay INT
DECLARE @BSerial INT
DECLARE @BAccount VARCHAR(17)
DECLARE @BPlay INT
DECLARE @[I][B][URL="http://forum.ragezone.com/members/807898.html"]regenc[/URL][/B][/I]ash INT
declare @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h int
set @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h='100' -- amount for your cash coin per minute
IF UPDATE(TotalPlayMin)
BEGIN
SELECT @GSerial = Serial,@GPlay = TotalPlayMin FROM INSERTED
SELECT @BSerial = Serial,@BAccount=account, @BPlay = LogPlay FROM [dbo].[tbl_base] WHERE Serial = @GSerial
SELECT @[I][B][URL="http://forum.ragezone.com/members/807898.html"]regenc[/URL][/B][/I]ash = ((@GPlay-@BPlay) @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h)
IF @[I][B][URL="http://forum.ragezone.com/members/807898.html"]regenc[/URL][/B][/I]ash > 0
BEGIN
EXEC [Billing].[dbo].[RF_RegenCash] @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]=@BAccount @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h @[I][B][URL="http://forum.ragezone.com/members/807898.html"]regenc[/URL][/B][/I]ash @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I]=@Gserial
EXEC [RF_World].[dbo].[pUpdate_LogPlay] @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I]=@GSerial @[I][B][URL="http://forum.ragezone.com/members/2000163149.html"]log[/URL][/B][/I]Play=@GPlay
END
END
END
Hi,
I tried this in my little server that using RU nation database
These sqls will regen your cash coin for premium and non-premium user. it will multiply your cash coin if user's status is a premium user. It also checks current map to regen. You can remove it if you want to regen your cash coin in every map. You also can add level or other check.
Remove previous table, procedure and trigger before use these sql codes.
1. Create A Table for LogPlay
Code:USE [RF_World] -- ================================================ -- Pembuat : [COLOR=#000088]<Hanry[/COLOR] [COLOR=#660066]Roslaw[/COLOR] [COLOR=#660066]Saputra[/COLOR][COLOR=#000088]>[/COLOR] -- Dibuat Tanggal : <13 April 2014> -- Keterangan : [COLOR=#000088]<Trigger[/COLOR] [COLOR=#660066]AutoCash[/COLOR] [COLOR=#660066]Version[/COLOR] 1.2[COLOR=#000088]>[/COLOR] -- ================================================ ALTER TABLE [dbo].[tbl_base] ADD LogPlay INT NOT NULL DEFAULT ((0))
2. Create A Procedure to Save TotalPlayMin as LogPlay
Code:USE [RF_World] SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ================================================ -- Pembuat : [COLOR=#000088]<Hanry[/COLOR] [COLOR=#660066]Roslaw[/COLOR] [COLOR=#660066]Saputra[/COLOR][COLOR=#000088]>[/COLOR] -- Dibuat Tanggal : <13 April 2014> -- Keterangan : [COLOR=#000088]<Prosedur[/COLOR] [COLOR=#660066]AutoCash[/COLOR] [COLOR=#660066]Version[/COLOR] 1.2[COLOR=#000088]>[/COLOR] -- ================================================ CREATE PROCEDURE [dbo].[pUpdate_LogPlay] @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I] INT, @[I][B][URL="http://forum.ragezone.com/members/2000163149.html"]log[/URL][/B][/I]Play INT AS BEGIN SET NOCOUNT ON UPDATE [dbo].[tbl_base] SET LogPlay = @[I][B][URL="http://forum.ragezone.com/members/2000163149.html"]log[/URL][/B][/I]Play WHERE Serial = @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I] END GO
3. Create A Procedure to Add Cash Coin and Check Current Map.
Code:USE [Billing] SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ================================================ -- Pembuat : [COLOR=#000088]<Hanry[/COLOR] [COLOR=#660066]Roslaw[/COLOR] [COLOR=#660066]Saputra[/COLOR][COLOR=#000088]>[/COLOR] -- Dibuat Tanggal : <13 April 2014> -- Keterangan : [COLOR=#000088]<Prosedur[/COLOR] [COLOR=#660066]AutoCash[/COLOR] [COLOR=#660066]Version[/COLOR] 1.2[COLOR=#000088]>[/COLOR] -- ================================================ CREATE PROCEDURE [dbo].[RF_RegenCash] @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] VARCHAR(17), @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h INT, @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I] INT AS BEGIN declare @[I][B][URL="http://forum.ragezone.com/members/1333430432.html"]Rat[/URL][/B][/I]e int declare @status int declare @map int declare @currentmap int set @[I][B][URL="http://forum.ragezone.com/members/1333430432.html"]Rat[/URL][/B][/I]e='2' -- multiply your cash coin for Premium user set @map='11' -- map code for Sette SET NOCOUNT ON set @currentmap=(select map from RF_World.dbo.tbl_general where Serial @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I]) if @currentmap=@map begin if exists (select id from billing.dbo.tbl_UserStatus where id @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]) begin set @status=(select status from BILLING.dbo.tbl_UserStatus where id @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]) if @status = 2 begin update billing.dbo.tbl_UserStatus set cash=cash+ @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h @[I][B][URL="http://forum.ragezone.com/members/1333430432.html"]Rat[/URL][/B][/I]e) where id @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] end else begin update billing.dbo.tbl_UserStatus set cash=cash @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h where id @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] end end else begin insert into billing.dbo.tbl_UserStatus(id,status,Cash) values @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I],1 @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h) end end END GO
4. Create A Trigger to Update Cash Coin Per 5 Minutes
Code:-- ================================================ -- Pembuat : [COLOR=#000088]<Hanry[/COLOR] [COLOR=#660066]Roslaw[/COLOR] [COLOR=#660066]Saputra[/COLOR][COLOR=#000088]>[/COLOR] -- Dibuat Tanggal : <13 April 2014> -- Keterangan : [COLOR=#000088]<Trigger[/COLOR] [COLOR=#660066]AutoCash[/COLOR] [COLOR=#660066]Version[/COLOR] 1.2[COLOR=#000088]>[/COLOR] -- ================================================ USE [RF_World] GO /****** Object: Trigger [dbo].[RF_TimeUpdate] Script Date: 06/02/2016 19:37:26 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TRIGGER [dbo].[RegenCash] ON [dbo].[tbl_general] AFTER UPDATE as begin SET NOCOUNT ON; DECLARE @GSerial INT DECLARE @GPlay INT DECLARE @BSerial INT DECLARE @BAccount VARCHAR(17) DECLARE @BPlay INT DECLARE @[I][B][URL="http://forum.ragezone.com/members/807898.html"]regenc[/URL][/B][/I]ash INT declare @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h int set @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h='100' -- amount for your cash coin per minute IF UPDATE(TotalPlayMin) BEGIN SELECT @GSerial = Serial,@GPlay = TotalPlayMin FROM INSERTED SELECT @BSerial = Serial,@BAccount=account, @BPlay = LogPlay FROM [dbo].[tbl_base] WHERE Serial = @GSerial SELECT @[I][B][URL="http://forum.ragezone.com/members/807898.html"]regenc[/URL][/B][/I]ash = ((@GPlay-@BPlay) @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h) IF @[I][B][URL="http://forum.ragezone.com/members/807898.html"]regenc[/URL][/B][/I]ash > 0 BEGIN EXEC [Billing].[dbo].[RF_RegenCash] @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]=@BAccount @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h @[I][B][URL="http://forum.ragezone.com/members/807898.html"]regenc[/URL][/B][/I]ash @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I]=@Gserial EXEC [RF_World].[dbo].[pUpdate_LogPlay] @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I]=@GSerial @[I][B][URL="http://forum.ragezone.com/members/2000163149.html"]log[/URL][/B][/I]Play=@GPlay END END END
I don't know if it will works on your server. I've tried this for 1 hour and got not disconnected from server. But my server is very little.
You may edit this to improve.
USE [RF_World]
GO
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER dbo.UserStatusUpdater
ON dbo.tbl_base
AFTER INSERT AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Just INSERT everything from the [inserted] pseudotable into
--the target table
INSERT INTO [BILLING].dbo.tbl_UserStatus
(id, Status, DTStartPrem, DTEndPrem, Cash, Bonus)
SELECT Account, '1', '2019-08-01 13:04:12.400','2019-08-01 13:04:12.400', '1','0'
FROM inserted
WHERE Account NOT IN (SELECT id FROM [BILLING].dbo.tbl_UserStatus);
END
GO