The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check for Region Event?
Author Message
pinku
Journeyman
*

Posts: 118
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Apr 2013
Reputation: 4



Post: #1
Check for Region Event?
Code:
[REGIONTYPE r_blocked]
ON=@ENTER
IF !(<SRC.ISNPC>)
SRC.SYSMESSAGE TEST.
ENDIF

Code:
[AREADEF a_pvp]
EVENTS=r_blocked,r_default
NAME=Test
FLAGS=my|flags|here
P=xxxx,xxxx
RECT=xxxx,xxxx,xxxx,xxxx

I got this AREA with a REGIONTYPE.
The message works and the area too.
But how can I check for this AREA EVENT when I use an item for example?
I want to search for r_blocked.

I tried:

Code:
IF (<SRC.REGION.EVENTS> == r_blocked)
SRC.SYSMESSAGE Can't use it here...
RETURN 1

Works, but this blocks everywhere, without really checking (I think) the r_blocked.

Code:
IF (<SRC.REGION.TYPE> == r_blocked)
SRC.SYSMESSAGE Can't use it here...
RETURN 1

Nope too. But doesn't make sense anyway. xD

I could use this on the item, but since it's a "virtual map", I'm going to set new AREAS with NAMES and everything, so it's not very practical to be adding every region name to the item...

Code:
IF STRMATCH( "Test", "<SRC.REGION.TYPE>" )
SRC.SYSMESSAGE Can't use it here...
RETURN 1

Can someone help me?

Thanks!
(This post was last modified: 12-04-2013 02:27 AM by pinku.)
12-04-2013 02:24 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #2
RE: Check for Region Event?
Try

IF STRMATCH(*Test*,*<SRC.REGION.TYPE>*)
SRC.SYSMESSAGE Can't use it here...
RETURN 1

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
12-04-2013 02:52 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #3
RE: Check for Region Event?
IF (<SRC.REGION.ISEVENT.r_blocked>)
SRC.SYSMESSAGE Can't use it here...
RETURN 1
ENDIF
12-04-2013 03:37 AM
Find all posts by this user Like Post Quote this message in a reply
pinku
Journeyman
*

Posts: 118
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Apr 2013
Reputation: 4



Post: #4
RE: Check for Region Event?
Thanks Extreme, but this is not exactly what I was looking for..
Like I said on the OP, that way works, but I'll have to add waaaaay too many AREA names on the checker.

If I create Test 2, Test 3, Test 4, etc etc.

I want a way to check if it's R_BLOCK and then block it, so it's all around the map, indifferent of the AREA name.

(12-04-2013 03:37 AM)XuN Wrote:  IF (<SRC.REGION.ISEVENT.r_blocked>)
SRC.SYSMESSAGE Can't use it here...
RETURN 1
ENDIF

Thanks XuN!!!
I'll give it a try!

Update:
I get an error.. Tongue

Can't Resolve (<SRC.REGION.ISEVENT.r_blocked>)
(This post was last modified: 12-04-2013 03:57 AM by pinku.)
12-04-2013 03:40 AM
Find all posts by this user Like Post Quote this message in a reply
Shamino
Noob Scripter
*

Posts: 57
Likes Given: 5
Likes Received: 15 in 11 posts
Joined: Mar 2012
Reputation: 0

Exilio UO

Post: #5
RE: Check for Region Event?
U can use a region TAG.

.REGION.TAG.BLOCKED=1

IF (<SRC.REGION.TAG0.BLOCKED>)
SRC.SYSMESSAGE Can't use it here...
RETURN 1
ENDIF

"My world is hell for the infidels. My blood pleasure of the immortals"
[Image: 2ec003662b15c61da117767a59bb99bao.jpg]
(This post was last modified: 12-04-2013 05:38 AM by Shamino.)
12-04-2013 05:37 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Shamino's post
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: Check for Region Event?
TAG idea is good too, BTW you should not get errors if you are using nightlies:

27-10-2013, Ben
- Fixed #2227: Region.ISEVENT not working.
12-04-2013 05:49 AM
Find all posts by this user Like Post Quote this message in a reply
pinku
Journeyman
*

Posts: 118
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Apr 2013
Reputation: 4



Post: #7
RE: Check for Region Event?
I'm using 56c, not sure which release. But I couldn't get it to work.. Sad
Can someone please explain me a bit further how this REGION.TAG works?

No console errors, but does not work anyway.
What I did:

Code:
ELSEIF (<SRC.REGION.TAG0.BLOCKED> == 01)
SRC.SYSMESSAGE Summons are blocked in this area.
RETURN 1

I tried both:

Code:
[AREADEF a_pvp]
EVENTS=r_blocked,r_default
NAME=Test
FLAGS=my|flags|here
P=xxxx,xxxx
RECT=xxxx,xxxx,xxxx,xxxx
REGION.TAG.BLOCKED=1

and

Code:
[REGIONTYPE r_blocked]
ON=@ENTER
IF !(<SRC.ISNPC>)
REGION.TAG.BLOCKED=1
SRC.SYSMESSAGE TEST.
ENDIF

Tips?

Thanks again!
12-04-2013 07:12 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #8
RE: Check for Region Event?
This DOES works, i have just tested it before posting to be (more) sure that it's working. (Do you know that when you add events to a region they are not loaded untill you reboot sphere? try adding them manually for testing purposes)

Code:
[REGIONTYPE r_noenter]
ON=@Enter
if (<tag0.block>==1) || (<region.isevent.r_default_tree>) //tag0 is checked on the region itself, src is the char entering. IsEvent also works for me, if not for you... update your SphereSvr.exe
    src.say Blocked access
    return 1
else
    src.say Wellcome to <name>
endif
12-04-2013 08:24 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)