Register for your free account! | Forgot your password?

You last visited: Today at 23:10

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

Advertisement



[HELP] Check_Pet_Timer

Discussion on [HELP] Check_Pet_Timer within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2017
Posts: 33
Received Thanks: 2
[HELP] Check_Pet_Timer

Can someone explain to me how this query works.

ALTER Proc [dbo].[usp_Check_Pet_Timer]

@D int

AS

SET NOCOUNT ON

DECLARE @Time datetime
DECLARE @ID int
DECLARE @ int
DECLARE @t int
DECLARE @ smallint
DECLARE @UID bigint

SELECT @ID=UserUID FROM PS_GameData.dbo.Chars WHERE CharID @D

IF EXISTS(SELECT ItemUID FROM PS_GameData.dbo.CharItems WHERE [Type] IN (120,150) AND CharID @D)
BEGIN
SELECT * INTO #TempTable FROM PS_GameData.dbo.CharItems WHERE ([Type]=120 or [Type]=150) AND CharID @D
SET @ =(SELECT COUNT(ItemUID) FROM #TempTable)
SET @t = 1
WHILE @ @t)
BEGIN
SET @UID =(SELECT TOP 1 ItemUID FROM #TempTable)
SET @ = (SELECT [Range] FROM PS_GameDefs.dbo.Items WHERE ItemID=(SELECT ItemID FROM #TempTable WHERE ItemUID @UID))
SET @Time = (SELECT Maketime FROM #TempTable WHERE ItemUID @UID)
IF(GETDATE() > DATEADD(DD, @ @Time) AND @ > 0)
BEGIN
DELETE FROM PS_GameData.dbo.CharItems WHERE CharID @D AND ([Type]=120 or [Type]=150) AND ItemUID @UID
END
DELETE FROM #TempTable WHERE ItemUID @UID
SET @t @t+1
END
END

IF EXISTS(SELECT ItemUID FROM PS_GameData.dbo.UserStoredItems WHERE [Type] IN (120,150) AND UserUID @ID)
BEGIN
SELECT * INTO #TempTableWH FROM PS_GameData.dbo.UserStoredItems WHERE ([Type]=120 or [Type]=150) AND UserUID @ID
SET @=(SELECT COUNT(ItemUID) FROM #TempTableWH)
SET @t=1
WHILE @ @t)
BEGIN
SET @UID=(SELECT TOP 1 ItemUID FROM #TempTableWH)
SET @= (SELECT [Range] FROM PS_GameDefs.dbo.Items WHERE ItemID=(SELECT ItemID FROM #TempTableWH WHERE ItemUID @UID))
SET @Time= (SELECT Maketime FROM #TempTableWH WHERE ItemUID @UID)
IF(GETDATE() > DATEADD(DD, @ @Time) AND @ > 0)
BEGIN
DELETE FROM PS_GameData.dbo.UserStoredItems WHERE ([Type]=120 or [Type]=150) AND UserUID @ID AND ItemUID @UID
END
DELETE FROM #TempTableWH WHERE ItemUID @UID
SET @t @t+1
END
END
SET NOCOUNT OFF

I'm using. The count of days works, however the item is not deleted.
Bacкa is offline  
Old 09/10/2018, 00:47   #2
 
elite*gold: 0
Join Date: Apr 2016
Posts: 256
Received Thanks: 143
Quote:
Originally Posted by Bacкa View Post
HTML Code:
DECLARE [MENTION=429056]create[/MENTION]Time datetime
DECLARE [MENTION=2805776]UserU[/MENTION]ID int	
DECLARE [MENTION=4041608]LCN[/MENTION]t int
DECLARE [MENTION=1496863]Timer[/MENTION] smallint
DECLARE [MENTION=1134588]item[/MENTION]UID bigint
Please take some time and clear the code from the Mention part. It's kinda annoying and people won't be able to help you as much.
[ADMIN]Phreak is offline  
Old 09/10/2018, 05:14   #3
 
elite*gold: 0
Join Date: Mar 2017
Posts: 33
Received Thanks: 2
Quote:
Originally Posted by [ADMIN]Phreak View Post
Please take some time and clear the code from the Mention part. It's kinda annoying and people won't be able to help you as much.
Ready!
Bacкa is offline  
Old 09/11/2018, 02:46   #4
 
elite*gold: 0
Join Date: Mar 2018
Posts: 251
Received Thanks: 104
.

Quote:
Originally Posted by [ADMIN]Phreak View Post
Please take some time and clear the code from the Mention part. It's kinda annoying and people won't be able to help you as much.
Dude you need to respect post of people wtf
[DEV]Wan is offline  
Old 09/11/2018, 15:20   #5
 
elite*gold: 0
Join Date: Apr 2016
Posts: 256
Received Thanks: 143
Quote:
Originally Posted by [DEV]Wan View Post
Dude you need to respect post of people wtf
Get lost man..
[ADMIN]Phreak is offline  
Old 09/28/2018, 05:10   #6
 
elite*gold: 0
Join Date: Mar 2017
Posts: 33
Received Thanks: 2
anyone who can help?
Bacкa is offline  
Old 11/17/2018, 16:23   #7
 
elite*gold: 0
Join Date: Feb 2013
Posts: 22
Received Thanks: 9
No one has helped?
Fixed33 is offline  
Reply


Similar Threads Similar Threads
[HELP]HELP HELP HELP[HELP]
09/23/2013 - Facebook - 3 Replies
GUYS ^^ THIS IS A HELP THREAD NOT REQUEST THREAD BUT YOU CAN CONSIDER IT AS REQUEST THREAD DOES ANYONE OF YOU KNOW THE AUTO SUBMIT PHP CODE? THANKS!
[HELP][HELP][HELP][HELP]!!
09/11/2009 - Soldier Front - 3 Replies
Microsoft Visual C++ Run time error! :(:( **HELP ME PLEASE!!***
help help help help help help
06/28/2009 - Say Hello - 0 Replies
how i can dowmload Mangos 6385 ??????????????????????????????????? please give me the limk i can't see that i know it is in www.elitepvpers.com/.../153716-release-mangos-relea ses-blackscorpian-win32-2-4-3-a.html - but give me link sent it to my email plz



All times are GMT +1. The time now is 23:11.


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.