Welcome Notice!

02/20/2019 03:39 [PH]KEO(DEV)#1
Hi epvp. anyone can help me about Welcome Notice .sql?
because this sql not work ..

anyone can help me if have problem on that .sql? thanks in advance..
02/20/2019 04:11 perlisson#2
you need this ->> [Only registered and activated users can see links. Click Here To Register...]
02/20/2019 04:18 [PH]KEO(DEV)#3
Quote:
Originally Posted by perlisson View Post
you need this ->> [Only registered and activated users can see links. Click Here To Register...]
i already have that and Alex Scripts already work on me but i need sql for Auto Welcome Notice to new players
02/20/2019 08:22 [GM]-RazoR-*#4
What you need for the script to work correctly:

1- [RELEASE]Call PSMagent Commands via sql (won't work if you don't have it)

[Only registered and activated users can see links. Click Here To Register...]



2-

Quote:
USE [PS_GameData]
GO
/****** Object: StoredProcedure [dbo].[Welcome_Message] Script Date: 7/22/2016 12:35:25 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[Welcome_Message]
-- Add the parameters for the stored procedure here
@Char int
AS
BEGIN
WAITFOR DELAY '00:00:30';
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
DECLARE @CharName varchar(32) = (SELECT CharName FROM PS_GameData.dbo.Chars where CharID = @Char)
DECLARE @UserUID int = (SELECT UserUID FROM PS_GameData.dbo.Chars where CharID = @Char)
DECLARE @Faction bit = (SELECT Country FROM PS_GameData.dbo.UserMaxGrow WHERE UserUID = @UserUID)
DECLARE @Datet varchar(32) = CONVERT(varchar(32),GETDATE())
DECLARE @DFaction varchar(32)
if (@Faction = 1)
SET @DFaction = 'Union of Fury'
else
SET @DFaction = 'Alliance of Light'


DECLARE @welcomemsg nchar(200) = N'/nt ' + 'Welcome to ' + @CharName + ' (Faction: ' + @DFaction + ')' + ' who joined Legacy on the ' + @Datet


DECLARE @return_value int

EXEC @return_value = PS_GameDefs.[dbo].[Command]
@serviceName = N'ps_game',
@cmmd = @welcomemsg



END
3-

PS_GameLog > Programmability > Stored Procedures > dbo.usp_Insert_Action_Log_E

Quote:
IF ((SELECT IsNew FROM PS_UserData.dbo.Users_Master WHERE UserUID = @UserUID) != 0)
BEGIN
UPDATE PS_UserData.dbo.Users_Master SET IsNew = 0 WHERE UserUID = @UserUID
@Char = @CharID;
END
02/20/2019 10:40 [PH]KEO(DEV)#5
Quote:
Originally Posted by [GM]-RazoR-* View Post
What you need for the script to work correctly:

1- [RELEASE]Call PSMagent Commands via sql (won't work if you don't have it)

[Only registered and activated users can see links. Click Here To Register...]



2-



3-

PS_GameLog > Programmability > Stored Procedures > dbo.usp_Insert_Action_Log_E
thank you but i got error when i add on action log e
Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable @[Only registered and activated users can see links. Click Here To Register...]".

maybe because no Char or @[Only registered and activated users can see links. Click Here To Register...]D on PS_UserData
02/20/2019 13:40 oldjayy#6
Try this
Quote:
IF ((SELECT IsNew FROM PS_UserData.dbo.Users_Master WHERE UserUID = @UserUID) != 0)
BEGIN
UPDATE PS_UserData.dbo.Users_Master SET IsNew = 0 WHERE UserUID = @UserUID
@Char = @CharID;
END
02/20/2019 15:21 [PH]KEO(DEV)#7
Quote:
Originally Posted by oldjayy View Post
Try this
I already remove that and its complete
But when i create new character no welcome notice to new player even i make new account too still no auto welcome notice.
02/20/2019 15:52 SnickQ#8
Then create new columin in chars or where you want. Name it "new one" (Or whatever) then add to CreateChar update columin "new one" to '1' and to Action todbo.usp_Insert_Action_Log_E in actionType 108 to update "new one' to '0' and then qrite script like When "new one" = 1 set welcome_message = 'your message'