Register for your free account! | Forgot your password?

Go Back   elitepvpers > Silkroad Online > SRO PServer - Discussions / Questions > SRO PServer Ask the Experts
You last visited: Today at 14:19

  • Please register to post and access all features, it's quick, easy and FREE!


[REQUEST] - how to add silks to new created chars ?

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: May 2008
Posts: 166
Received Thanks: 2
[REQUEST] - how to add silks to new created chars ?

hi
i just wonder if i canadd silks to new created chars in VSRO server ?
if anyone know how to do this please answer me and i will be so glad
thanks



multiuses is offline  
Old 03/13/2012, 10:44   #2
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,121
Received Thanks: 1,320
You will need a .php script to do that for you, one has already been released so use the search function.


Shifty* is offline  
Old 03/13/2012, 11:45   #3
 
elite*gold: 0
Join Date: Jan 2008
Posts: 17
Received Thanks: 9
what do u want man?
char or account?
silk only stored in account.

If you wanted to add silk when they created new char in game... you'ld check a look at trigger Insert in SQL Server => table _Char will be inserted new char's information so you detect it and find their JID.
if you wanted to add silk when they created new account... then you have to check a look at this query: INSERT INTO *silk_table* VALUES(*options here*).
Ex: My table is SK_Silk and I had 4 columns, my query will be liked this: Insert into SK_Silk values('" + IDUSR + "', 0, '2', 0)

Btw... you also make sure that account already had silk or not.... if had... just UPDATE *silk_table* SET *silk_column* = *slik_amount* WHERE JID = *account's JID*
pulpcorn is offline  
Old 03/13/2012, 12:15   #4
 
elite*gold: 0
Join Date: Jun 2010
Posts: 319
Received Thanks: 51
Lol i wanna to knw how to add silks to new created Chars !!

But i dont understand any Comment There >.<


SunSoon is offline  
Old 03/13/2012, 19:55   #5
 
elite*gold: 0
Join Date: Jan 2008
Posts: 17
Received Thanks: 9
Firstly, I want you to make sure this thing: Silk only stores in Account
Secondly, if you want to add silk to new created Char... it means that your Silk can multiply five times (max number of Char in Account), because silk affects in Account, not Char!
Ex: You want to add 2 silk when they created new Char in xyz's account. If they created 5 characters, xyz's account would earn 10 silk => all of char in xyz's account could use that silk!
Finally, if you're sure what do you want... so let's begin!

*note: You should know a little bit MSSQL query and Trigger (for insert) => if you don't know it, go google!

Relational databases: SRO_VT_ACCOUNT and SRO_VT_SHARD
Relational tables: SK_SILK and _CHAR AND _USER

Description: When you created new char in game, _Char's table will be inserted new record to last row! (I guess client send request to server to let it know insert new record into _Char's table)
1> Create new Trigger for Insert and get last CharID's column record.
PHP Code:
CREATE TRIGGER trgAddSilk
ON SRO_VT_SHARD
.._CHAR FOR INSERT 
AS
DECLARE @
CHARID int;
SET @CHARID = (SELECT TOP (1CHARID FROM SRO_VT_SHARD.._CHAR ORDER BY CHARID DESC); 
2> When you have Character's CharID, go to table _USER in SRO_VT_SHARD and find their UserJID.
PHP Code:
DECLARE @USERJID int;
SET @USERJID = (SELECT USERJID FROM SRO_VT_SHARD.._USER WHERE CHARID = @CHARID
3> When you have Account's UserJID, go to table SK_SILK in SRO_VT_ACCOUNT and let's insert or update silk through their JID.
PHP Code:
INSERT INTO SRO_VT_ACCOUNT..SK_SILK VALUES (@USERJID020//2 is amount of silk you want to add 
or
PHP Code:
UPDATE SRO_VT_ACCOUNT..SK_SILK SET SILK_GIFT SILK_GIFT 2 WHERE JID = @USERJID //2 is amount of silk you want to add 
***>>> Finish Trigger!

FULLY CODE
PHP Code:
CREATE TRIGGER trgAddSilk
ON SRO_VT_SHARD
.._CHAR FOR INSERT 
AS
    DECLARE @
CHARID int;
    
SET @CHARID = (SELECT TOP (1CHARID FROM SRO_VT_SHARD.._CHAR ORDER BY CHARID DESC);
    DECLARE @
USERJID int;
    
SET @USERJID = (SELECT USERJID FROM SRO_VT_SHARD.._USER WHERE CHARID = @CHARID);
    IF (
SELECT COUNT(*) FROM SRO_VT_ACCOUNT..SK_SILK WHERE JID = @USERJID) > 0
        UPDATE SRO_VT_ACCOUNT
..SK_SILK SET SILK_GIFT SILK_GIFT 2 WHERE JID = @USERJID;
    ELSE
        
INSERT INTO SRO_VT_ACCOUNT..SK_SILK VALUES (@USERJID020); 
This is a basic code to let you add silk when you created new char in game!
Ofc you have to test it if you decide to use it!

Say Thanks if you see my post is usefull!
pulpcorn is offline  
Thanks
4 Users
Old 03/13/2012, 21:46   #6
 
elite*gold: 7
Join Date: May 2010
Posts: 2,116
Received Thanks: 2,351
very simple query
Dr.Abdelfattah is offline  
Thanks
1 User
Old 03/14/2012, 03:27   #7
 
elite*gold: 0
Join Date: Jan 2008
Posts: 17
Received Thanks: 9
@Dr.Abdelfattah: He wants to add silk to each created char, not registed user
that's why I wanted him to make sure what's really things he wants...


pulpcorn is offline  
Thanks
2 Users
Closed Thread



« i have bug on DareDevil skill | Petfilter Help Please »

Similar Threads
Chars for silks
05/18/2011 - Silkroad Online Trading - 0 Replies
hello guys... trading those char for silk premium or normal here we go-----> Class:|Warrior/Cleric| Bow/Fire/Light | Wizzard/Cleric Build:|Full STR|Full STR |FUll INT Name:|_Islamic__|_SpecX_|TrueBlue Level:|88|95|84
Silkroad Online services [sBot, silks, rSro silks, farms, chars]
04/22/2010 - SRO Main - Discussions / Questions - 3 Replies
Hello everyone, there is Silkroad Online services There you can order: 1. Farms 2. Powerlever 3. Silks 4. Bots 5. Char botting 6. ISRO, RSRO and more



All times are GMT +1. The time now is 14:19.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.