|
You last visited: Today at 03:00
Advertisement
[HELP]To insert Into to a new table
Discussion on [HELP]To insert Into to a new table within the Shaiya PServer Development forum part of the Shaiya Private Server category.
09/27/2014, 16:17
|
#1
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 360
|
[HELP]To insert Into to a new table
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
|
#2
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,455
|
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
|
#3
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 360
|
But i have a problem with insert log on this table:
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
|
#4
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,455
|
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
|
#5
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 360
|
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
|
#6
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,455
|
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
|
#7
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 360
|
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
|
#8
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,455
|
Yes, I understand this is not trolling, this is serious business. The trolling part was on my end.
|
|
|
09/27/2014, 19:04
|
#9
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 360
|
Quote:
Originally Posted by nubness
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
|
#10
|
elite*gold: 246
Join Date: Dec 2010
Posts: 33,474
Received Thanks: 6,059
|
#closed as request
|
|
|
 |
Similar Threads
|
table.insert problem LUA Code pls help
01/13/2014 - General Coding - 3 Replies
Hi guys,
I've some problems with this code:
local names_list_s = mysql_query("SELECT * FROM player.vote_member WHERE empire = 'SHINSOO'; ")
local names_list_table = {}
for i = 1,table.getn(names_list_s),1 do
table.insert(names_list_table,names_list_s .name)
end
|
How to insert ???
04/16/2011 - Metin2 Private Server - 1 Replies
How to insert diacritics in my client ??? ş ţ ă î ??? FAST PLS:(
|
Insert / Enfg
04/26/2010 - Combat Arms - 6 Replies
Hallo liebe E*PVP's,
ich habe eine Tastatur, der bedauerlicherweise die Insert / Enfg Taste fehlt. Da diese immer mal wieder benötigt wird, ich aber aufgrund von anderen besonderen Funktionen der Tastatur keine neue kaufen möchte, wollte ich fragen, wie ich diese Taste in CA Simulieren kann. Die Bildschirmtastatur von Windows geht nicht, die bleibt nicht im Vordergrund. Geht das irgendwie mit einem Prog, dass ich eine bestimmte Tasten-combi drücken muss, das der dem Computer die Insert / Enfg...
|
Insert tool
03/21/2008 - Conquer Online 2 - 1 Replies
how comes insert tool doesnt work with the new patches or if it does cud sumone tell me how?
|
All times are GMT +1. The time now is 03:00.
|
|