[HELP]To insert Into to a new table

09/27/2014 16:17 SnickQ#1
I try to witre auto ban for players who play in both fraction
First i cerate table 'bot" to wirte logs
Code:
USE [PS_GameLog]
GO

/****** Object:  Table [dbo].[Bot]    Script Date: 2014-09-27 16:13:16 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Bot](
	[row] [int] IDENTITY(1,1) NOT NULL,
	[UserUID] [int] NULL,
	[UserID] [int] NULL,
	[UserIP] [tinyint] NULL,
	[Country] [int] NULL,
	[Actiontime] [datetime] NULL
) ON [PRIMARY]

GO
And next i try to add Insert logs to new table in usp_Insert_Action_Log_E
Like that:
Code:
IF (@ActionType = '107')
BEGIN	
	IF EXISTS (SELECT * FROM PS_GameLog.dbo.Bot)
	BEGIN
        DECLARE @UserIP varchar(15)
		DECLARE @Country tinyint
		SET @UserUID= (Select UserIP from PS_UserData.dbo.Users_Master where UserUID=@UserUID)
		SET @UserID= (Select UserID from PS_UserData.dbo.Users_Master where UserUID=@UserUID)
		SET @UserIP= (Select UserIP from PS_UserData.dbo.Users_Master where UserUID=@UserUID)
		SET @Country = (SELECT Country FROM PS_GameData.dbo.UserMaxGrow WHERE UserUID=@UserUID)
		SET @ActionTime =GETDATE()
		IF (@ActionType ='107')
		BEGIN
			INSERT INTO PS_GameLog.dbo.Bot(UserUID,UserID,UserIP,Country,ActionTime) values (@UserUID,@UserID,@UserIP,@Country,@ActionTime)
		END
	END
END
But logs is not inserted to a ew table ;/
09/27/2014 17:05 nubness#2
This is confusing. You said you want to cerate table, and you're using the CREATE TABLE instruction. This could be the problem, I think.
09/27/2014 17:15 SnickQ#3
But i have a problem with insert log on this table:
[Only registered and activated users can see links. Click Here To Register...]
Code:
IF (@ActionType = '107')
BEGIN	
	IF EXISTS (SELECT * FROM PS_GameLog.dbo.Bot)
	BEGIN
        DECLARE @UserIP varchar(15)
		DECLARE @Country tinyint
		SET @UserUID= (Select UserIP from PS_UserData.dbo.Users_Master where UserUID=@UserUID)
		SET @UserID= (Select UserID from PS_UserData.dbo.Users_Master where UserUID=@UserUID)
		SET @UserIP= (Select UserIP from PS_UserData.dbo.Users_Master where UserUID=@UserUID)
		SET @Country = (SELECT Country FROM PS_GameData.dbo.UserMaxGrow WHERE UserUID=@UserUID)
		SET @ActionTime =GETDATE()
		IF (@ActionType ='107')
		BEGIN
			INSERT INTO PS_GameLog.dbo.Bot(UserUID,UserID,UserIP,Country,ActionTime) values (@UserUID,@UserID,@UserIP,@Country,@ActionTime)
		END
	END
END
I try that to insert logs but is not insertef
Sorry fom my english
09/27/2014 17:18 nubness#4
In the first post you said something about wirting logs, maybe you can try something like:
Code:
WIRTE INTO PS_GameLog.dbo.Bot(UserUID,UserID,UserIP,Country,ActionTime) values (@UserUID,@UserID,@UserIP,@Country,@ActionTime)
Please let me know if that works.
09/27/2014 17:27 SnickQ#5
Not work

EDIT: I try like that
Code:
insert into PS_GameLog.dbo.Bot
SELECT @UserUID AS UserUID, @UserID AS UserID, @UserIP AS UserIP, @Country AS Country, GETDATE() AS ActionTime
FROM PS_GameLog.dbo.Bot
Where UserUID=@userUID
and still have nothing >.<
09/27/2014 17:48 nubness#6
Trolling.Enabled = false;
  • This is a terrible way to prevent people from cheating.
  • Your UserID column in the Bot table is an INT, when it should be a VARCHAR(18).
  • Learn some english.
  • Check your posts for grammar or spelling mistakes before submitting them.
09/27/2014 18:16 SnickQ#7
Yes my English is suck
But i need logs with every log with Country
Then i can banned ppl who play in Country 0 and 1
This is not a trolling

Request for close
09/27/2014 18:34 nubness#8
Yes, I understand this is not trolling, this is serious business. The trolling part was on my end.
09/27/2014 19:04 SnickQ#9
Quote:
Originally Posted by nubness View Post
Yes, I understand this is not trolling, this is serious business
No is not
But need auto ban for ppl who play in both faction. on our server is too many ppl who play in faction who bosses have and unbalanced pvp because of that
With dbo.bot we can put in game_Log_out
Code:
Update ps_UserData.dbo.Users_Master
Set Status ='-5'
Where UserUID+@UserUID and @Country 0 and 1
But because logs dont want inserted in dbo.bot i ask for help here
09/27/2014 19:10 Autrux#10
#closed as request