- Joined
- Jun 16, 2014
- Messages
- 51
- Reaction score
- 9
today i was searching on my DB
i found a good system when you kill a player for the first time you will get silk + arena coins
and for 2nd time only arena...etc
if you killed the same player 5 times you have to wait 3 hours before killing him again
also it checks if the user is the same IP
here's the system
Tables
Procedure in Attachments
EDIT:
_AddLogChar Procedure
Dont use it in query just open procedure and put this code in the end of it
i found a good system when you kill a player for the first time you will get silk + arena coins
and for 2nd time only arena...etc
if you killed the same player 5 times you have to wait 3 hours before killing him again
also it checks if the user is the same IP
here's the system
Tables
Code:
USE [SRO_VT_SHARDLOG]GO
/****** Object: Table [dbo].[_Check] Script Date: 25/07/2014 10:14:09 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[_Check](
[ID] [int] IDENTITY(1,1) NOT NULL,
[KilledCharID] [int] NOT NULL,
[FromCharID] [int] NOT NULL,
[Times] [tinyint] NOT NULL,
[StartDate] [smalldatetime] NOT NULL,
[EndDate] [smalldatetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[_Check] ADD CONSTRAINT [DF__Check_Times] DEFAULT ((1)) FOR [Times]
GO
ALTER TABLE [dbo].[_Check] ADD CONSTRAINT [DF__Check_StartDate] DEFAULT (getdate()) FOR [StartDate]
GO
ALTER TABLE [dbo].[_Check] ADD CONSTRAINT [DF__Check_EndDate] DEFAULT (dateadd(hour,(6),getdate())) FOR [EndDate]
GO
Code:
USE [SRO_VT_SHARDLOG]GO
/****** Object: Table [dbo].[_IPLogs] Script Date: 25/07/2014 10:14:50 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[_IPLogs](
[No.] [int] IDENTITY(1,1) NOT NULL,
[CharID] [int] NULL,
[Charname] [varchar](max) NULL,
[IP] [varchar](max) NULL,
[Date] [datetime] NULL,
PRIMARY KEY CLUSTERED
(
[No.] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
Procedure in Attachments
EDIT:
_AddLogChar Procedure
Dont use it in query just open procedure and put this code in the end of it
Code:
DECLARE [USER=1333354868]Dyni[/USER]P VARCHAR(12)
DECLARE [USER=1333422870]CoS[/USER]ID int
DECLARE [USER=1333422870]CoS[/USER]level TINYINT
DECLARE @Aha INT
DECLARE [USER=791997]pet[/USER]Option tinyint
DECLARE [USER=551894]Char[/USER]Name Varchar(64)
DECLARE [USER=820632]JiD[/USER] int
DECLARE [USER=551894]Char[/USER]Level tinyint = (SELECT CurLevel from SRO_VT_SHARD.dbo._Char WHERE CharID = [USER=551894]Char[/USER]ID)
IF [USER=1333420483]event[/USER]ID = 4)
BEGIN
SELECT [USER=551894]Char[/USER]Name = CharName16 FROM SRO_VT_SHARD.dbo._Char WHERE CharID = [USER=551894]Char[/USER]ID
exec [USER=1333354868]Dyni[/USER]P = SRO_VT_ACCOUNT.dbo.split_ip [USER=1333359883]data[/USER]2
INSERT INTO _IPLogs (CharID,Charname,IP,[Date]) VALUES [USER=551894]Char[/USER]ID, [USER=551894]Char[/USER]Name, [USER=1333354868]Dyni[/USER]P, GETDATE())
END
IF [USER=1333420483]event[/USER]ID = 6)
BEGIN
DELETE FROM _IPLogs WHERE CharID = [USER=551894]Char[/USER]ID
END
IF [USER=1333420483]event[/USER]ID = 19 AND [USER=275999]des[/USER]c like '%My: Robber%' OR [USER=1333420483]event[/USER]ID = 19 AND [USER=275999]des[/USER]c like '%My: Trader%' OR [USER=1333420483]event[/USER]ID = 19 AND [USER=275999]des[/USER]c like '%My: Hunter%')
EXEC KillSystem [USER=551894]Char[/USER]Level, [USER=275999]des[/USER]c
Attachments
You must be registered for see attachments list
Last edited: