Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Shaiya > Shaiya Private Server > Shaiya PServer Development
You last visited: Today at 03:00

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

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.

Closed Thread
 
Old   #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 ;/
SnickQ is offline  
Old 09/27/2014, 17:05   #2
 
nubness's Avatar
 
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.
nubness is offline  
Thanks
2 Users
Old 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
SnickQ is offline  
Old 09/27/2014, 17:18   #4
 
nubness's Avatar
 
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.
nubness is offline  
Thanks
1 User
Old 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 >.<
SnickQ is offline  
Old 09/27/2014, 17:48   #6
 
nubness's Avatar
 
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.
nubness is offline  
Thanks
1 User
Old 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
SnickQ is offline  
Old 09/27/2014, 18:34   #8
 
nubness's Avatar
 
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.
nubness is offline  
Thanks
1 User
Old 09/27/2014, 19:04   #9
 
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 360
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
SnickQ is offline  
Old 09/27/2014, 19:10   #10




 
Autrux's Avatar
 
elite*gold: 246
Join Date: Dec 2010
Posts: 33,474
Received Thanks: 6,059
#closed as request
Autrux is offline  
Thanks
1 User
Closed Thread


Similar Threads 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.


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.