|
You last visited: Today at 19:54
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.
01/17/2019, 09:17
|
#1
|
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,Date) values (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
|
|
|
01/17/2019, 09:29
|
#2
|
elite*gold: 0
Join Date: Sep 2014
Posts: 65
Received Thanks: 9
|
Good keep it
|
|
|
01/17/2019, 10:02
|
#3
|
elite*gold: 53
Join Date: Jul 2012
Posts: 541
Received Thanks: 190
|
Thanks bro
|
|
|
01/17/2019, 10:17
|
#4
|
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.
|
|
|
01/17/2019, 11:51
|
#5
|
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
|
|
|
01/17/2019, 11:59
|
#6
|
elite*gold: 96
Join Date: Nov 2012
Posts: 548
Received Thanks: 349
|
Quote:
Originally Posted by Crayon*
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 ))
|
|
|
01/17/2019, 12:00
|
#7
|
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...
|
|
|
01/17/2019, 12:13
|
#8
|
elite*gold: 96
Join Date: Nov 2012
Posts: 548
Received Thanks: 349
|
Quote:
Originally Posted by putzeimer195
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.
|
|
|
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?).
|
|
|
01/17/2019, 22:32
|
#10
|
elite*gold: 96
Join Date: Nov 2012
Posts: 548
Received Thanks: 349
|
Quote:
Originally Posted by JohnDornel^
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.
|
|
|
01/17/2019, 23:18
|
#11
|
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
|
Quote:
Originally Posted by HECKT0R
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
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?
|
|
|
01/18/2019, 09:18
|
#12
|
elite*gold: 96
Join Date: Nov 2012
Posts: 548
Received Thanks: 349
|
Quote:
Originally Posted by #HB
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!
|
|
|
01/18/2019, 12:23
|
#13
|
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
|
Quote:
Originally Posted by HECKT0R
First of all , lets close some ppl mouses
|
Mouses? Sorry, I don't get you.
Quote:
Originally Posted by HECKT0R
AND I DO NOT HAVE TO REWRITE IT TWICE lol!
|
If you're too lazy to write a single statement, then don't share.
|
|
|
01/18/2019, 12:41
|
#14
|
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.
|
|
|
01/18/2019, 13:16
|
#15
|
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
|
Quote:
Originally Posted by alydandy
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.
|
|
|
All times are GMT +1. The time now is 19:57.
|
|