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!

ZEN to Account

Junior Spellweaver
Joined
Dec 23, 2011
Messages
159
Reaction score
87
MSSQL

Code:
EXEC [PassportBOI].[dbo].[pipiload_addcash] 'Account', 'ZEN-Value'


Easily used in PHP's.
 
Newbie Spellweaver
Joined
Aug 10, 2012
Messages
99
Reaction score
21
It doesn't seem to work everytime, when the sn inserted equals -1, the server does not care about the row and the zen never gets added to your account

The important part in the sp:

Code:
UPDATE point SET time=time-@point WHERE @userid=uid AND @aid=aid AND time>=@point
IF @@rowcount = 1
	INSERT INTO usecashnow (userid, zoneid, sn, aid, point, cash, status, creatime) VALUES(@userid, @zoneid, @sn, @aid, @point, @cash, @status, getdate() )
ELSE
BEGIN
	INSERT INTO usecashnow SELECT @userid, @zoneid, ISNULL(min(sn),0)-1, @aid, @point, @cash, 0, getdate() FROM usecashnow WHERE userid=@userid and zoneid=@zoneid and 0>=sn
	SELECT @error = -8
END

That doesn't happen when the user is created with the stored procedure "adduser" because the user gets inserted in the point table instead of the point_free. When you create the user and account manually, your data is stored in the point_free table when you login.

In the case the method by LeRaz0r doesn't work you can use this alternate method:

Code:
INSERT INTO usecashnow (userid,zoneid,sn,aid,point,cash,status,creatime) VALUES (32,904,0,9,9000000,100000,1,GetDate());

Where 32 is the userid in the users table

This query adds 100.000 zen , if you need more or less you have to multiply that amount by 90 and replace the 9.000.000 value also.

so if your user id is 48 and want 1000 zen the query would be like this:

INSERT INTO usecashnow (userid,zoneid,sn,aid,point,cash,status,creatime) VALUES (48,904,0,9,90000,1000,1,GetDate());
 
Newbie Spellweaver
Joined
Aug 10, 2012
Messages
99
Reaction score
21
That's the only conclusion that I could get, can't see why it sometimes doesn't work, maybe it happens when there's just one user. Well it doesn't matter anyway, now the stored procedure always work for me also.

Always worked for me, even when it says -1.
 
Newbie Spellweaver
Joined
Aug 5, 2012
Messages
98
Reaction score
5
why for me doesn't work none of these? you have to copy paste into a new query in mssql server and change id number right?correct me if is wrong.. :blush:
 
Last edited:

kev

Supreme Arcanarch
Loyal Member
Joined
May 12, 2003
Messages
904
Reaction score
52
INSERT INTO usecashnow (userid,zoneid,sn,aid,point,cash,status,creatime) VALUES (48,904,0,9,90000,1000,1,GetDate());


(userid,zoneid,sn,REALMNUMBER,point,cash,status,creatime)

(48,904,0,9,90000,1000,1,GetDate());


so where the 9 is add realm number you are logged in on
 
Newbie Spellweaver
Joined
Jun 19, 2012
Messages
45
Reaction score
23
The execution makes things easier as sometimes the insert won't always work and leave the zen in pending status.

I suggest using the exec, since its better than the simple insert query.
 
Newbie Spellweaver
Joined
Oct 15, 2012
Messages
52
Reaction score
11
MSSQL
Code:
EXEC [PassportBOI].[dbo].[pipiload_addcash] 'Account', 'ZEN-Value'

don't work for me

If this is not working for you and you have used the Stored Procedure then you are doing something wrong, check your dbo.point and dbo.pointfree tables

You should have 0 accounts in dbo.pointfree and you should see all the accounts in dbo.point

If they are in pointfree add them to point and remove from pointfree.

Then:

EXEC [PassportBOI].[dbo].[pipiload_addcash] 'Account', 'ZEN-Value'

Wait for 5-10 minutes and the zen should be loaded onto the character
 
Junior Spellweaver
Joined
Apr 2, 2012
Messages
165
Reaction score
0
After I use this EXEC [PassportBOI].[dbo].[pipiload_addcash] 'Account', 'ZEN-Value' I cannot log in to game.. I am just in the character selection and If I press enter to game.. nothing happen.. But If a change account without zen its working.. Any help what is the problem?
 
Junior Spellweaver
Joined
Jan 4, 2012
Messages
110
Reaction score
6
Are you actually entering "Account" and "ZEN Value" or are you changing them to the actual numbers?

You could also just use the Developer Commands in-game to give yourself ZEN.
 
Back
Top