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
OPEN BANK ONLY INSIDE THE HOUSE
Author Message
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #1
OPEN BANK ONLY INSIDE THE HOUSE
I have the script house, and I want that when the char has inside the house and talk to the bank to open bank ... but when he is out of the house the bank is not open ....

How to limit the area of spech



[SPEECH spk_player]
ON=*bank*
src.bankself
src.sysmessage You have <src.bankbalance> gold in your Bank Box
else
return 0
endif
endif
else
src.bankself
return 0
endif
04-04-2014 11:35 PM
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: #2
RE: OPEN BANK ONLY INSIDE THE HOUSE
Are you using any region event in the house? If so, it is as easy as adding the speech to the players when they @Enter in the region and remove it when they @Exit.

You can check Mordaunt's house system in the Add-on folder of the script pack, or in the Downloads section, for a working example Smile
04-04-2014 11:52 PM
Find all posts by this user Like Post Quote this message in a reply
Shidhun
Journeyman
*

Posts: 59
Likes Given: 5
Likes Received: 3 in 3 posts
Joined: Jul 2012
Reputation: 1



Post: #3
RE: OPEN BANK ONLY INSIDE THE HOUSE
You could add other Region_Flags.

For Script-purposes we added other Region-Flags years ago

Code:
[DEFNAME REGION_FLAGS]
.....
region_town         010000
region_house        020000
.....
region_no_mark
etc.

This way we can easily apply the according flags to the house-zones by adding |020000

In Scripts you can then easily check using :

Code:
if (<region.flags>&region_house)
....
endif

Or in your case
Code:
[SPEECH spk_player]
ON=*bank*
   if (<src.region.flags>&region_house)
       src.bankself
   endif
(This post was last modified: 04-05-2014 12:11 AM by Shidhun.)
04-05-2014 12:09 AM
Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #4
RE: OPEN BANK ONLY INSIDE THE HOUSE
Why not just create a new speech block [SPEECH spk_houses] and add it to your multis using TSPEECH = spk_houses?
And if your multis already have a speech block attached to them, just add the bank command in there.
You may also want to add some checks to see if you own the house before you open the bank...

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
04-05-2014 06:30 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
JohnVeritas
Apprentice
*

Posts: 49
Likes Given: 0
Likes Received: 4 in 4 posts
Joined: Feb 2014
Reputation: 2



Post: #5
RE: OPEN BANK ONLY INSIDE THE HOUSE
Well you can check players region with spk_player like;

on=bank
IF (<SRC.UID.<SRC.REGION.UID>.TYPE>==t_multi) || (<SRC.UID.<SRC.REGION.UID>.TYPE>==t_multi_custom)
//this line must be check owner/co-owner/friendship status of player who type "bank"
src.bankself
endif

Checking regions is only one part of solution, the other part is checking owner/co-owner/friendship status otherwise anyone can open his bank in a random house.
04-06-2014 11:35 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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