SphereCommunity
Leave House Function or ContextMenu - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Leave House Function or ContextMenu (/Thread-Leave-House-Function-or-ContextMenu)

Pages: 1 2


RE: Leave House Function or ContextMenu - Reflex - 04-24-2012 11:46 AM

Ok.. Thank you very much shaklaban.. sorry about all the confusion =\ I've got one last and final question re-guarding this issue. Now I am in a situation where we have been creating special arenas and they are specified as a t_mutli_custom or t_multi_custom whatever it is called.
When trying to call the contextmenu of course the contextmenu script doesnt know how to distinguish between a player's house and a arena or a custom multi we have used for decoration around the world. What is the best way for me to add some type of distinguishing factor for the contextmenu leave house script to be able to tell it is in a player's house and not in one of my custom arenas or in some decorational house.. that doesn't have a house sign to grab the morep from ? I've already placed about 15 arenas and custom multis around the world I wouldn't mind adding tags or something to the existing ones and then adding that into part of the script but im not sure if that is the best way and or how to do that? Any help would be appreciated thanks guys.
Example:

Code:
//Part of one of my custom arena's
[DEFNAME Death_By_Dice]
MultiCreator_Saves_Death_By_Dice = i_multi_foundation_45x45
MultiCreator_Death_By_Dice_0 = 2084,-1,-3,-4
MultiCreator_Death_By_Dice_1 = 2086,0,-3,-4
MultiCreator_Death_By_Dice_2 = 1889,3,-21,1

Now also...

[FUNCTION IsOnHouse]
if ((<UID.<REGION.UID>.TYPE>==t_multi) || (<UID.<REGION.UID>.TYPE>==t_multi_custom)) && (<Z> > <SERV.MAP(<P.X>,<P.Y>,<P.M>).TERRAIN.Z>)
    return 1
endif
return 0

// Leave House Script
[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
    return 1

ELIF (<ARGN>==1001) && (<isonhouse> == 1)
REF1=<UID.<SRC.REGION.UID>.MORE2>
src.go <REF1.P>
src.move s
src.fix
return 1

else
return 0
ENDIF



RE: Leave House Function or ContextMenu - Shaklaban - 04-25-2012 06:27 AM

well if you dont have table you can add invisible part to the multis then teleport players to that part. or you can hold x and y differences between exit point and center of multi in the defname or tag, then you can calculate the exit point.


RE: Leave House Function or ContextMenu - Reflex - 04-28-2012 04:29 AM

Well I was wanting the script to only work for player created houses only. Any of the other custom multis I wouldnt want them to be able to use the leave house option.