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-nmm6 (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-nmm6 (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-nmm6 (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
Leave House Function or ContextMenu
Author Message
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #1
Leave House Function or ContextMenu
Hello, I am trying to create a command or statement or contextmenu that allows you to leave a house so players can't get stuck in houses. I can't figure out how to have the player scan the area for the nearest house sign then grab the house sign's P. Currently I am trying to use a contextmenu to do so but I would also like them to be able to type something like on=I wish to leave this house and then it teleports them to under the house sign. Here is my current code..

Code:
[EVENTS e_all_players]
ON=@ContextMenuRequest
if (<isonhouse> == 1)
SRC.AddContextEntry 1001,6207,0
SRC.AddContextEntry 1000,5000,0
else
SRC.AddContextEntry 1000,5000,0
endif

ON=@ContextMenuSelect
IF (<ARGN>==1000)
    f_playerinfo_d_chooser
ENDIF

IF (<ARGN>==1001)
REF1=?????
src.go <REF1>
ENDIF
(This post was last modified: 04-21-2012 07:55 PM by Reflex.)
04-21-2012 07:54 PM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Leave House Function or ContextMenu
you can look to i ban thee or remove thyself commands in your house system.
04-21-2012 09:28 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #3
RE: Leave House Function or ContextMenu
Yea I tried that.. I still cant figure it out.. it's not making sense to me because those require targets and grab information from the target..? So Im confused
04-22-2012 04:23 AM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #4
RE: Leave House Function or ContextMenu
hmm if you put that part here we can help. its probably grab region from the target then find uid of table from the region. in community pack's house system, uid of table holded on houses (region) more2:
04-22-2012 05:08 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #5
RE: Leave House Function or ContextMenu
House Script

Code:
ON=Remove thyself
ON=Te expulso
if !(<DEF.scp.House_BanEngine>)
    return 0
endif
REF1=<UID.<SRC.REGION.UID>.MORE2>
if (<REF1.HousePlayerAccess <SRC>> >= 2)
    SRC.TARGETF f_house_eject <REF1>
    SRC.SYSMESSAGE @,,1 Select the individual to eject from this house.
endif

//end of remove thyself next is function it calls//

[FUNCTION f_house_eject]
REF1=<ARGS>
if (<ARGO.ISITEM>)
    SRC.SYSMESSAGE @,,1 You cannot eject that from the house!
    return 1
elif (<ARGO.REGION.UID> != <REF1.REGION.UID>)
    SRC.SYSMESSAGE @,,1 <ARGO.NAME> is not in your house.
    return 1
elif (<ARGO>==<SRC>)
    SRC.SYSMESSAGE @,,1 You can't eject yourself!
    return 1
elif (<REF1.IsOwner <ARGO>>)
    SRC.SYSMESSAGE @,,1 You can't eject the house owner!
    return 1
elif (<REF1.IsCoOwner <ARGO>>)
    SRC.SYSMESSAGE @,,1 You can't eject a house co-owner!
    return 1
elif (<REF1.IsFriend <ARGO>>)
    SRC.SYSMESSAGE @,,1 You can't eject a house friend!
    return 1
endif
ARGO.GO <REF1.P>
ARGO.FIX
SRC.SYSMESSAGE @,,1 <ARGO.NAME> has been ejected from this house.
ARGO.SYSMESSAGE @,,1 You have been ejected from this house. If you persist in entering, you may be banned from the house.
04-22-2012 05:27 AM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #6
RE: Leave House Function or ContextMenu
then you can set ref1=<UID.<SRC.REGION.UID>.MORE2> in contextmenu.
04-22-2012 06:10 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #7
RE: Leave House Function or ContextMenu
Can you please explain scripts when you respond because I dont understand what so ever.. ? If this is what you're referring to I dont understand how the ref1 works at all and Ive tried this but it doesnt work.

Code:
[EVENTS e_all_players]
ON=@ContextMenuRequest
if (<isonhouse> == 1)
SRC.AddContextEntry 1001,6207,0
SRC.AddContextEntry 1000,5000,0
else
SRC.AddContextEntry 1000,5000,0
endif

ON=@ContextMenuSelect
IF (<ARGN>==1000)
    f_playerinfo_d_chooser
ENDIF

IF (<ARGN>==1001)
REF1=<UID.<SRC.REGION.UID>.MORE2>
src.go <REF1>
src.say this is working
ENDIF
04-22-2012 06:44 AM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #8
RE: Leave House Function or ContextMenu
ref1 is just reference, you can assign it to an uid. in that case ref1 is the regions (multi of house) more2 value. more2 of the house is equals to uid of table of the house.
(This post was last modified: 04-23-2012 12:10 AM by Shaklaban.)
04-23-2012 12:10 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #9
RE: Leave House Function or ContextMenu
Doesn't work from a contextmenu or at least it isn't for me

IF (<ARGN>==1001)
REF1=<UID.<SRC.REGION.UID>.MORE2>
src.go <REF1>
src.say argn 1001 is being called.
ENDIF
04-23-2012 11:20 AM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #10
RE: Leave House Function or ContextMenu
you need to use:

src.go <ref1.p>
src.move s 1
04-23-2012 03:34 PM
Visit this user's website 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)