Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server > SRO PServer Guides & Releases
You last visited: Today at 19:54

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

Advertisement



[Release] Restrict using scrolls inside town Procedure

Discussion on [Release] Restrict using scrolls inside town Procedure within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1

 
HECKT0R's Avatar
 
elite*gold: 96
Join Date: Nov 2012
Posts: 548
Received Thanks: 349
[Release] Restrict using scrolls inside town Procedure

Hello ,
The Procedure below will restrict the using of any scroll to be used only inside towns , otherwise the scroll will give nothing ,also it's enhanced with Notice system to let players knows that such scroll should not be used Outside towns .
Here you go

PHP Code:
use SRO_VT_HECKT0R
go 
create proc _Scroll_Name
Charid int
as
begin

    
Declare @ charname varchar(20), @ isbattle int 
    
    set 
isbattle = (select IsBattleField from SRO_VT_SHARD.dbo._RefRegion where wRegionID =
                    (
Select LatestRegion from SRO_VT_SHARD.dbo._Char where CharID =@ Charid ))

-- 
Check if char ouside town dont tp him for non job cheating and other stuff ... !
    if( @ 
isbattle ='1')
        
begin 
             Insert into Notice 
(Service,Type,Target,Message,Datevalues 
                        
(1,'Private',@ CharName,'sorry but you are not in town :) ',Getdate()) 
        
END
--  End of anti-cheating 
    
else
        
begin
            
print 'Put here the stuff you want from the scroll'
        
end
end 


Press Thanks if it Helps
HECKT0R is offline  
Thanks
3 Users
Old 01/17/2019, 09:29   #2
 
elite*gold: 0
Join Date: Sep 2014
Posts: 65
Received Thanks: 9
Good keep it
facnew is offline  
Old 01/17/2019, 10:02   #3

 
XxGhostSpiriTxX's Avatar
 
elite*gold: 53
Join Date: Jul 2012
Posts: 541
Received Thanks: 190
Thanks bro
XxGhostSpiriTxX is offline  
Old 01/17/2019, 10:17   #4
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
By the way, RegionID column at _Char table can be cheated easily, since it gets updated with the character data packet, so any normal movement will not update the database.
#HB is offline  
Old 01/17/2019, 11:51   #5
 
Crayon*'s Avatar
 
elite*gold: 1700
Join Date: Oct 2014
Posts: 432
Received Thanks: 397
This whole procedure could be done with single statement.
Code:
 (Select LatestRegion from SRO_VT_SHARD.dbo._Char where CharID in (select charid from SRO_VT_SHARD.._char where charid=@  Charid)))
2k19 "developers" btw
Crayon* is offline  
Old 01/17/2019, 11:59   #6

 
HECKT0R's Avatar
 
elite*gold: 96
Join Date: Nov 2012
Posts: 548
Received Thanks: 349
Quote:
Originally Posted by Crayon* View Post
This whole procedure could be done with single statement.
Code:
 (Select LatestRegion from SRO_VT_SHARD.dbo._Char where CharID in (select charid from SRO_VT_SHARD.._char where charid=@  Charid)))
2k19 "developers" btw

yea it was an old work and it has 3 subquery's inside
decreased it to 2x subquery only , the third subquery was just repeated .. you did not add much but Ty .

PHP Code:
 set isbattle = (select IsBattleField from SRO_VT_SHARD.dbo._RefRegion where wRegionID 
                    (
Select LatestRegion from SRO_VT_SHARD.dbo._Char where CharID =@ Charid )) 
HECKT0R is offline  
Old 01/17/2019, 12:00   #7

 
putzeimer195's Avatar
 
elite*gold: 29
Join Date: Apr 2011
Posts: 481
Received Thanks: 223
I would rather make all this in the Protection instead of Database, if you use his method, every time you use a scroll you have to call this Procedure...
putzeimer195 is offline  
Old 01/17/2019, 12:13   #8

 
HECKT0R's Avatar
 
elite*gold: 96
Join Date: Nov 2012
Posts: 548
Received Thanks: 349
Quote:
Originally Posted by putzeimer195 View Post
I would rather make all this in the Protection instead of Database, if you use his method, every time you use a scroll you have to call this Procedure...
ofc it would be better if it was filter sided , but this proc for ppl who asked for it already in other thread and i preferred to create an Release with it since other ppl maybe interested to add it to some of there scrolls procedures.
HECKT0R is offline  
Thanks
1 User
Old 01/17/2019, 21:48   #9
 
elite*gold: 0
Join Date: Jul 2014
Posts: 187
Received Thanks: 70
OP, ever heard of joins?
This does not prevent the scroll from usage, it will still vanish from inventory since you are basing it on SQL. Not to mention you didn't even include how and where this should be used (cuz its release right?).
JohnDornel^ is offline  
Old 01/17/2019, 22:32   #10

 
HECKT0R's Avatar
 
elite*gold: 96
Join Date: Nov 2012
Posts: 548
Received Thanks: 349
Quote:
Originally Posted by JohnDornel^ View Post
OP, ever heard of joins?
This does not prevent the scroll from usage, it will still vanish from inventory since you are basing it on SQL. Not to mention you didn't even include how and where this should be used (cuz its release right?).
What is the point HERE?
and do you think rewrite same query with joins gotta be hard?lol
Theres comments already inside the procedure should let you understand where and when it should be used , i do not have to give examples for that since theres is something called brain lol, already explains itself.
HECKT0R is offline  
Old 01/17/2019, 23:18   #11
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
Quote:
Originally Posted by HECKT0R View Post
What is the point HERE?
and do you think rewrite same query with joins gotta be hard?lol
There is a point. Join is way way faster & flexible than that weird code above.

Quote:
Originally Posted by HECKT0R View Post
i do not have to give examples for that since theres is something called brain lol, already explains itself.
Since there's something called a brain, and PPL already can do "join" themselves, then why don't they write the whole code themselves, then what's the usefulness of this topic?
#HB is offline  
Old 01/18/2019, 09:18   #12

 
HECKT0R's Avatar
 
elite*gold: 96
Join Date: Nov 2012
Posts: 548
Received Thanks: 349
Quote:
Originally Posted by #HB View Post
There is a point. Join is way way faster & flexible than that weird code above.



Since there's something called a brain, and PPL already can do "join" themselves, then why don't they write the whole code themselves, then what's the usefulness of this topic?
First of all , lets close some ppl mouths.

HTML Code:
set @isbattle = ( select IsBattleField from SRO_VT_SHARD.dbo._RefRegion R inner JOIN	SRO_VT_SHARD.dbo._Char c  on r.wRegionID=c.LatestRegion where CharID=@CharID )
if you already checked the procedure above you will see the usage of such procedure is already written inside the procedure , AND I DO NOT HAVE TO REWRITE IT TWICE lol!
HECKT0R is offline  
Old 01/18/2019, 12:23   #13
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
Quote:
Originally Posted by HECKT0R View Post
First of all , lets close some ppl mouses
Mouses? Sorry, I don't get you.

Quote:
Originally Posted by HECKT0R View Post
AND I DO NOT HAVE TO REWRITE IT TWICE lol!
If you're too lazy to write a single statement, then don't share.
#HB is offline  
Old 01/18/2019, 12:41   #14

 
devdash's Avatar
 
elite*gold: 14
Join Date: Feb 2016
Posts: 1,607
Received Thanks: 445
guys this topic made after i made a question of how to disable a scroll out-the safe zone
and iam pretty begginer, and guess what i completly understood the code


so the guy did well, and he helped me, so please guys do not be aggresive to someone trying to help the community, i really apprecaite he's help, and i don't know what does even everything u guys write, but i understand that, he's not kinda feeling bored cuz of this topic, and i don't want someone to feel like that when all he wanted is helping me,

and remember, i just said my opinion no aggressive to anyone, wish the best for all of you.
devdash is offline  
Thanks
1 User
Old 01/18/2019, 13:16   #15
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
Quote:
Originally Posted by alydandy View Post
so the guy did well, and he helped me, so please guys do not be aggresive to someone trying to help the community
We're not being aggressive, the guy above advised him to use "JOIN" but he replied rudely also kinda boastful.
#HB is offline  
Reply




All times are GMT +1. The time now is 19:57.


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.