Welcome!

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!

Adding Cash Coin

Newbie Spellweaver
Joined
Jan 4, 2016
Messages
15
Reaction score
0
I wanted to ask about inserting coins into accountI 've tried some of the queries in this forum,
but still get an error message or coins do not come into account
:(:

I wish there was someone who could help me, thanks :):
 
Newbie Spellweaver
Joined
Jul 26, 2016
Messages
12
Reaction score
0
What errors did you get or any context about your problem? No one can help you if they don't know how they can help :D:
 
Upvote 0
Newbie Spellweaver
Joined
Jan 4, 2016
Messages
15
Reaction score
0
i am using Galaan tips, and i still got problem like this :

Msg 102, Level 15, State 1, Line 42
Incorrect syntax near '@long'.
Msg 102, Level 15, State 1, Line 51
Incorrect syntax near '@long'.

or

( 0 row added )

thanks for reply my thread :D
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Jan 4, 2016
Messages
15
Reaction score
0
no, i am still reading about making SQL Query, a little bit is hard for me to learn,

USE [BILLING]
GO


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


DECLARE cash int, name varchar(50),
@Buy int, cashBuy int


/** Account ID **/
SET name = 'UserID'


/** Price Amount **/
SET @Buy = 'CashPoin'
SELECT cash = Cash from tbl_UserStatus Where id = name




BEGIN
/** '1.5' is rate cashpoint from price amount 1.5 : 1 (exemple : Rp. 50.000 = 75.000 CashPoint) **/
update [BILLING].[dbo].[tbl_UserStatus]
SET cashBuy = (@Buy*1)
UPDATE tbl_UserStatus
SET [Cash] = cash cashBuy)
WHERE [ID] = name
END

i am trying using from roslaw, but still get ( 0 row(s) affected )



maybe, if you have a thread about making SQL Query, i hope you can share to me :D

Thank You For Reply My Thread
 
Upvote 0
Banned
Banned
Joined
Jul 27, 2016
Messages
123
Reaction score
19
Try this it should work :)

Code:
USE [BILLING] 
GO

DECLARE @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] VARCHAR(13)
DECLARE  @[I][B][URL="http://forum.ragezone.com/member.php?u=807274"]status[/URL][/B][/I] int
DECLARE  @[I][B][URL="http://forum.ragezone.com/member.php?u=1333458146"]Lama[/URL][/B][/I] int
DECLARE  @[I][B][URL="http://forum.ragezone.com/member.php?u=847664"]Cash[/URL][/B][/I] int
DECLARE @Buy int
DECLARE  @[I][B][URL="http://forum.ragezone.com/member.php?u=847664"]Cash[/URL][/B][/I]Buy int

/****** Account ID ******/
SET @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I] = 'Spike'

/****** Set Value to 2 For Active, Set Value to 1 For Deactived ******/
SET  @[I][B][URL="http://forum.ragezone.com/member.php?u=807274"]status[/URL][/B][/I] = '2'

/****** Long Player Get Premium Service Day, Example 1 = (1 Day) ******/
SET  @[I][B][URL="http://forum.ragezone.com/member.php?u=1333458146"]Lama[/URL][/B][/I] = '120'

/****** Update Cash Point, Example First Cash Point 100, if add 500 result is 600 ******/
SET @Buy = '5500'
SELECT  @[I][B][URL="http://forum.ragezone.com/member.php?u=847664"]Cash[/URL][/B][/I] = Cash from tbl_UserStatus Where id = @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]

/************************************************************************************************************************************************/

declare  @[I][B][URL="http://forum.ragezone.com/members/138004.html"]count[/URL][/B][/I] numeric(18, 0)
select  @[I][B][URL="http://forum.ragezone.com/members/138004.html"]count[/URL][/B][/I] = COUNT(*) from [BILLING].[dbo].[tbl_UserStatus] where id = @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I]

if   @[I][B][URL="http://forum.ragezone.com/members/138004.html"]count[/URL][/B][/I] = 0
begin
    INSERT INTO [BILLING].[dbo].[tbl_UserStatus] 
    (
    [id],
    [Status],
    [DTStartPrem],
    [DTEndPrem],
    [Cash]
    )
    VALUES
    (
 @[I][B][URL="http://forum.ragezone.com/members/19862.html"]id[/URL][/B][/I],
  @[I][B][URL="http://forum.ragezone.com/member.php?u=807274"]status[/URL][/B][/I],
    CONVERT(datetime,GETDATE()),
    CONVERT(datetime,GETDATE()  @[I][B][URL="http://forum.ragezone.com/member.php?u=1333458146"]Lama[/URL][/B][/I]),
  @[I][B][URL="http://forum.ragezone.com/member.php?u=847664"]Cash[/URL][/B][/I]
    )
end

Try this one post by Spikey
 
Upvote 0
Newbie Spellweaver
Joined
Jan 4, 2016
Messages
15
Reaction score
0
i am using this query and adding + on @Lama

USE [BILLING] GO


DECLARE @id VARCHAR(13)
DECLARE @status int
DECLARE @Lama int
DECLARE @Cash int
DECLARE @Buy int
DECLARE @CashBuy int


/****** Account ID ******/
SET @id = 'Spike'


/****** Set Value to 2 For Active, Set Value to 1 For Deactived ******/
SET @status = '2'


/****** Long Player Get Premium Service Day, Example 1 = (1 Day) ******/
SET @Lama = '120'


/****** Update Cash Point, Example First Cash Point 100, if add 500 result is 600 ******/
SET @Buy = '5500'
SELECT @Cash = Cash from tbl_UserStatus Where id = @id


/************************************************************************************************************************************************/


declare @count numeric(18, 0)
select @count = COUNT(*) from [BILLING].[dbo].[tbl_UserStatus] where id = @id


if @count = 0
begin
INSERT INTO [BILLING].[dbo].[tbl_UserStatus]
(
[id],
[Status],
[DTStartPrem],
[DTEndPrem],
[Cash]
)
VALUES
(
@id,
@status,
CONVERT(datetime,GETDATE()),
CONVERT(datetime,GETDATE() @Lama),
@Cash
)
end

but i got a new problem like this :


Msg 515, Level 16, State 2, Line 29
Cannot insert the value NULL into column 'Cash', table 'BILLING.dbo.tbl_UserStatus'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Any Solution ??? :D
 
Upvote 0
☆Dying Dawn☆
Joined
Jan 30, 2012
Messages
971
Reaction score
727
Code:
USE [[COLOR="#FF0000"][B]BILLING[/B][/COLOR]] -- DB Name
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

DECLARE   [USER=315880]cas[/USER]h int,   [USER=1333344765]name[/USER] varchar(50),
@Buy int,   [USER=315880]cas[/USER]hBuy int

SET   [USER=1333344765]name[/USER] = '[COLOR="#FF0000"][B]Bombillo293[/B][/COLOR]' -- USER NAME, NOT PLAYER NAME

SET @Buy = '[B][COLOR="#FF0000"]1000[/COLOR][/B]' -- AMOUNT OF CASH POINT
SELECT   [USER=315880]cas[/USER]h = Cash from tbl_UserStatus Where id =   [USER=1333344765]name[/USER] 


BEGIN
/** '1.5' is rate cashpoint from price amount 1.5 : 1 (exemple : Rp. 50.000 = 75.000 CashPoint) **/
	SET   [USER=315880]cas[/USER]hBuy = (@Buy*1.5)
	UPDATE tbl_UserStatus 
	SET [Cash] =    [USER=315880]cas[/USER]h   [USER=315880]cas[/USER]hBuy)
	WHERE [ID] =   [USER=1333344765]name[/USER] 
END
 
Upvote 0
Newbie Spellweaver
Joined
Jul 26, 2016
Messages
12
Reaction score
0
i am using this query and adding + on @Lama



but i got a new problem like this :


Msg 515, Level 16, State 2, Line 29
Cannot insert the value NULL into column 'Cash', table 'BILLING.dbo.tbl_UserStatus'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Any Solution ??? :D

I'm sorry to say but I can't see how that query will work. Im not saying Im an expert but it will not really work. If you examine these lines

SET @Buy = '5500'

SELECT @cash = Cash from tbl_UserStatus Where id = @id

@Buy is not used but i suspect it should be the cash to be added. @cash on the other hand will get the current cash of the user but what if the table is currently empty or the id cant be found in the table, then the query will error because @cash doesnt get a value or simply its NULL. Make a manual query like Galaan said. Clear your database then insert the entry:

delete from [BILLING].[dbo].[tbl_UserStatus]
INSERT INTO [BILLING].[dbo].[tbl_UserStatus]
(
[id],
[Status],
[DTStartPrem],
[DTEndPrem],
[Cash]
)
VALUES
(
'replacewithuseridanddontforgetthesinglequotes',
1,
NULL,
NULL,
1000
)

if that worked, try with premium. Replace 1, NULL, NULL to 2,
CONVERT(datetime,GETDATE()),CONVERT(datetime,GETDATE()+1)
from the query
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Jan 4, 2016
Messages
15
Reaction score
0
i trying using your query, and got massage : (0 row(s) affected)
~_~

Code:
USE [[COLOR=#FF0000][B]BILLING[/B][/COLOR]] -- DB Name
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

DECLARE   @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h int,   @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I] varchar(50),
@Buy int,   @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]hBuy int

SET   @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I] = '[COLOR=#FF0000][B]Bombillo293[/B][/COLOR]' -- USER NAME, NOT PLAYER NAME

SET @Buy = '[B][COLOR=#FF0000]1000[/COLOR][/B]' -- AMOUNT OF CASH POINT
SELECT   @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h = Cash from tbl_UserStatus Where id =   @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I] 


BEGIN
/** '1.5' is rate cashpoint from price amount 1.5 : 1 (exemple : Rp. 50.000 = 75.000 CashPoint) **/
    SET   @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]hBuy = (@Buy*1.5)
    UPDATE tbl_UserStatus 
    SET [Cash] =    @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]h   @[I][B][URL="http://forum.ragezone.com/members/315880.html"]cas[/URL][/B][/I]hBuy)
    WHERE [ID] =   @[I][B][URL="http://forum.ragezone.com/members/1333344765.html"]name[/URL][/B][/I] 
END
 
Upvote 0
☆Dying Dawn☆
Joined
Jan 30, 2012
Messages
971
Reaction score
727
0 row(s) affected is because you don't have the name (username) or anything in your Billing DB take a look in your tbl_UserStatus tablet if you don't know the next step I recommend looking a little more in the forum and use a little more of logic, all the answer and topics about Cash Points is in the forum
 
Upvote 0
Newbie Spellweaver
Joined
Jan 4, 2016
Messages
15
Reaction score
0
thank you for all reply
can you check my DB ??? maybe i got a something wrong on my DB

reiujiutsuho - Adding Cash Coin - RaGEZONE Forums


i think nothing wrong on my DB, maybe :D

but if there is something wrong, i hope you can explain it to me
thank you very much, and i will read some thread about adding cash point too
 
Upvote 0
Newbie Spellweaver
Joined
Jan 19, 2010
Messages
82
Reaction score
5
mate u need to check if ur register.php will register on your BILLING DB aswell,, we don't want to see ur table design or that query,, we want to see ur table if there is something on it or not,, I bet ur userstatus is clean -_- try searching For working BILLING (or query to register character on billing DB aswell) here at ragezone hope u find ur way seeya
 
Upvote 0
Newbie Spellweaver
Joined
Jul 26, 2016
Messages
12
Reaction score
0
thank you for all reply
can you check my DB ??? maybe i got a something wrong on my DB

reiujiutsuho - Adding Cash Coin - RaGEZONE Forums


i think nothing wrong on my DB, maybe :D

but if there is something wrong, i hope you can explain it to me
thank you very much, and i will read some thread about adding cash point too

You better study a little bit on SQL. Inserting and Updating entries are basic and easy to learn and the fact that you dont know why 0 rows are affected means you dont even know what you're even doing. No offense man.

check if you have a table entry for admin. Run this query first.
USE BILLING
SELECT * FROM tbl_UserStatus

If there is no entry for admin. Bombillo's query wont work and will show 0 row affected. If that's the case, try this query I posted a while ago.

DELETE FROM tbl_UserStatus
INSERT INTO tbl_UserStatus (id,status,DTStartPrem,DTEndPrem,Cash) VALUES ('admin',1,NULL,NULL,1000)

Then try running SELECT * FROM tbl_UserStatus again if there are no db errors. You should have 1000 Cash for your admin. Note that this is only in the database. It doesnt mean, it will show up magically in game.
 
Upvote 0
Back
Top