Ryder! Posted September 2, 2009 Posted September 2, 2009 function resourceStart() addEventHandler( "onPlayerInteriorWarped", getRootElement(), onInteriorEnter ) end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), resourceStart ) function onInteriorEnter( interior ) outputChatBox( tostring(getElementInterior( source ) ) ) --it output always 0 outputChatBox( getElementType ( interior ) ) --outputChatBox( tostring(getPlayerName( source ) ), source ) end the problem is that getElementInterior output always 0 when entering any interior =S I have only this script running and interiors. http://mta.pastebay.com/51409
eAi Posted September 2, 2009 Posted September 2, 2009 Well aren't you always entering from interior 0 - the normal gta world? Why are you doing getElementType on interior - it isn't an element - it's the number of the interior the player is entering...
Ryder! Posted September 2, 2009 Author Posted September 2, 2009 it's just for debugging and no im not entering the outside world, it returns always 0 when entering for example: ammu nation, caligulas casino and with every interior.
subenji99 Posted September 3, 2009 Posted September 3, 2009 We cannot see how you are triggering "onPlayerInteriorWarped", which is important seeing as it is a custom event. However, if getElementInterior(source) is returning 0, there are only 2 reasons I can think of for that: 1. You are specifying the source as the Root Element in your triggerEvent line, not the player. bool triggerEvent ( string eventName, element baseElement, [ var argument1, ... ] ) --baseElement should be your player in this case 2. You are triggering this event before you warp them into the interior. (Even if it's only 1 line above the setElementInterior line, it'll return 0, not the interior id.)
Ryder! Posted September 3, 2009 Author Posted September 3, 2009 onPlayerInteriorWarped is an event from interiors resource: https://wiki.multitheftauto.com/index.ph ... riorWarped
subenji99 Posted September 3, 2009 Posted September 3, 2009 Ah, my mistake. In that case, why are you attempting to get the player element's interior while they're warping in (e.g. before it is finished warping them, so they haven't switched interior yet) when the event already provides both the player that is warping (source) and the interior he is entering (interior)?
Ryder! Posted September 3, 2009 Author Posted September 3, 2009 onPlayerInteriorWarped This event is triggered when a player successfully warps to his destination interior. And the interior parameter is not the interior ID, it's the interior element.
darkdreamingdan Posted September 4, 2009 Posted September 4, 2009 This is actually a bug in the interiors resource. Players are set into interiors clientside, not serverside. I'll issue a fix soon.
Ryder! Posted September 4, 2009 Author Posted September 4, 2009 ok thanks i will be waiting the patch =)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now