Register for your free account! | Forgot your password?

You last visited: Today at 08:46

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

Advertisement



Auto Join Guild

Discussion on Auto Join Guild within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
[GameAdvisor]Finn's Avatar
 
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
Smile Auto Join Guild

Hi epvp. i think auto join guild when character is new create is possible but anyone know what query of that?
Ex. i create guild for UoF and AoL
then new character auto join guild base on his Faction..
if someone know this query im glad

Thanks in advance
[GameAdvisor]Finn is offline  
Old 04/10/2019, 16:21   #2
 
oldjayy's Avatar
 
elite*gold: 16
Join Date: Jun 2011
Posts: 63
Received Thanks: 159
Assuming there will be only one guild per faction following could do the job.
You will need to add it to your usp_Create_Char_R stored procedure.

Quote:
DECLARE @GuildID INT
DECLARE @faction tinyint
SET @faction = (SELECT Country FROM UserMaxGrow WHERE UserUID = @UserUID)
SET @GuildID = (SELECT GuildID FROM Guilds WHERE Country = @faction)
INSERT INTO GuildChars(GuildID, CharID, GuildLevel, Del, JoinDate, LeaveDate)
VALUES(@GuildID,@CharID,5,0,getdate(),NULL)
oldjayy is offline  
Thanks
3 Users
Old 04/10/2019, 17:29   #3
 
[GameAdvisor]Finn's Avatar
 
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
Quote:
Originally Posted by oldjayy View Post
Assuming there will be only one guild per faction following could do the job.
You will need to add it to your usp_Create_Char_R stored procedure.
Thank you sir but in my mined is like starter gears
Starting guild I put the guild id on table like when i add starting item on BaseGearDefs.

Ex. I make guild for Dark so all new create dark auto join on dark guild i put and same to Light guild.

Thanks for answer if you know sir
[GameAdvisor]Finn is offline  
Old 04/10/2019, 20:36   #4
 
oldjayy's Avatar
 
elite*gold: 16
Join Date: Jun 2011
Posts: 63
Received Thanks: 159
Quote:
USE PS_GameData
CREATE TABLE dbo.StarterGuilds
(
GuildID int,
Faction tinyint
)
Quote:
DECLARE @GuildID INT
DECLARE @faction tinyint
SET @faction = (SELECT Country FROM UserMaxGrow WHERE UserUID = @UserUID)
SET @GuildID = (SELECT GuildID FROM StarterGuilds WHERE Faction = @faction)
INSERT INTO GuildChars(GuildID, CharID, GuildLevel, Del, JoinDate, LeaveDate)
VALUES(@GuildID,@CharID,5,0,getdate(),NULL)
Faction 0 is AoL 1 is UoF
oldjayy is offline  
Thanks
2 Users
Old 04/10/2019, 21:41   #5
 
[GameAdvisor]Finn's Avatar
 
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
Quote:
Originally Posted by oldjayy View Post
Faction 0 is AoL 1 is UoF
Thank you sir.. i see its already insert in guildchars the new character i create.. but the problem is not show the guild on character i create..
[GameAdvisor]Finn is offline  
Old 04/12/2019, 12:58   #6
 
oldjayy's Avatar
 
elite*gold: 16
Join Date: Jun 2011
Posts: 63
Received Thanks: 159
Quote:
DECLARE @GuildID INT
DECLARE @faction tinyint
SET @faction = (SELECT Country FROM UserMaxGrow WHERE UserUID = @UserUID)
SET @GuildID = (SELECT GuildID FROM StarterGuilds WHERE Faction = @faction)

INSERT INTO GuildChars(GuildID, CharID, GuildLevel, JoinDate)
VALUES(@GuildID, @CharID, 5, GETDATE())

UPDATE Guilds SET TotalCount += 1 WHERE GuildID=@GuildID
Make sure the guild exists in dbo.Guilds in a correct way.
oldjayy is offline  
Thanks
1 User
Old 04/12/2019, 23:14   #7
 
[GameAdvisor]Finn's Avatar
 
elite*gold: 0
Join Date: Sep 2016
Posts: 171
Received Thanks: 107
Quote:
Originally Posted by oldjayy View Post
Make sure the guild exists in dbo.Guilds in a correct way.
yes sir its exists but when i create new character is not show .. then only show if i restart the server!
[GameAdvisor]Finn is offline  
Thanks
1 User
Old 03/12/2021, 07:40   #8
 
elite*gold: 0
Join Date: Jul 2013
Posts: 37
Received Thanks: 8
-------------------------------------------------------------------------------------------------------

DECLARE @D INT
DECLARE @ tinyint
SET @ = (SELECT Country FROM UserMaxGrow WHERE UserUID = @ID)
SET @D = (SELECT GuildID FROM StarterGuilds WHERE Faction = @)
SET @D = (SELECT @ FROM Chars)

INSERT INTO GuildChars(GuildID, CharID, GuildLevel, JoinDate)
VALUES @D, @, 5, GETDATE())

UPDATE Guilds SET TotalCount += 1 WHERE GuildID @D
-------------------------------------------------------------------------------------------------------
Realp0rta is offline  
Reply




All times are GMT +1. The time now is 08:47.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.