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
New house tool event
Author Message
Sum
Apprentice
*

Posts: 40
Likes Given: 32
Likes Received: 5 in 4 posts
Joined: Feb 2016
Reputation: 0



Post: #1
New house tool event
I'm making a new house placement tool , in the event i created it deducts the gold from the player when the house is created just fine but if another player is in the way or the terrain is to bumpy it still takes the gold and the house is not placed. i need it to just cancel out and not take the gold but i cannot figure it out for the life of me lol.

thanks in advance!

Code:
[EVENTS e_houseplace]

ON=@itemCreate
IF (<src.tag0.placehouse> ==1) && (<argo.type> == t_multi) || (<argo.type> == t_multi_custom)
src.tag0.goldlast=<src.gold>
src.tag.placehouse=
src.gold -= <argo.value>
src.sysmessage @0481 You pay <argo.value> for your new home.
return 0
endif
(This post was last modified: 02-12-2017 01:40 PM by Sum.)
02-12-2017 01:33 PM
Find all posts by this user Like Post Quote this message in a reply
Artyk
Journeyman
*

Posts: 75
Likes Given: 43
Likes Received: 9 in 9 posts
Joined: Sep 2014
Reputation: 0



Post: #2
RE: New house tool event
Reading in the wiki it fires when it is initially created, before it is placed in the world, maybe is there another trigger after this one?

Otherwise you can add a timer and check after x seconds if the house exists then proceed with the payment
02-13-2017 08:22 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Artyk's post
Sum
Apprentice
*

Posts: 40
Likes Given: 32
Likes Received: 5 in 4 posts
Joined: Feb 2016
Reputation: 0



Post: #3
RE: New house tool event
Thanks Artyk, i figured it out with a timerf shortly after my post .

I appreciate the help!
02-13-2017 09:13 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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