Imposter Posted July 18, 2012 Share Posted July 18, 2012 How can i make a player warp>? function loadResource ( ) warpthingy= createMarker ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, "arrow", 1.5, 0, 255, 0, 170 ) end addEventHandler ( "onResourceStart", resourceRoot, loadResource ) function markerHit ( thePlayer, matchingDimension ) if ( source == warpthingy) then end end addEventHandler ( "onMarkerHit", getRootElement(), markerHit ) Link to comment
Castillo Posted July 18, 2012 Share Posted July 18, 2012 By warp you mean set the player position? if so use: setElementPosition Link to comment
Imposter Posted July 18, 2012 Author Share Posted July 18, 2012 By warp you mean set the player position? if so use: setElementPosition yeah, but i need to warp it into a building interior for example the news paper interioir, this command puts me in a different place......................................IS ANYBODY GONNA HELP??? Link to comment
AMARANT Posted July 18, 2012 Share Posted July 18, 2012 Use: setElementInterior setElementDimension Link to comment
Imposter Posted July 18, 2012 Author Share Posted July 18, 2012 Use: setElementInterior setElementDimension If i understand u correctly, then this should work...but it doesnt. function loadResource ( ) theEntrance = createMarker ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, "arrow", 1.5, 0, 255, 0, 170 ) theExit = createMarker ( 389.8681640625, 173.9693145752, 1008.3828125+1, "arrow", 1.5, 0, 255, 0, 170 ) estateBlip = createBlip ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, 44, 0, 0, 0, 255 ) outputChatBox ( "The Estate has been Loaded!!" ) end addEventHandler ( "onResourceStart", resourceRoot, loadResource ) function markerHit ( thePlayer, matchingDimension ) if ( source == theEntrance ) then outputChatBox ( "You are entering the Estate!", thePlayer ) setElementDimension ( source, 10 ) setElementInterior ( source, 3 , 389.8681640625, 173.9693145752, 1008.3828125 ) elseif ( source == theExit ) then outputChatBox ( "You are leaving the Estate!", thePlayer ) setElementDimension ( source, 0 ) setElementInterior ( source, 0 , 1481.0408935547, -1771.6051513672, 18.795755386353 ) end end addEventHandler ( "onMarkerHit", getRootElement(), markerHit ) Link to comment
AMARANT Posted July 18, 2012 Share Posted July 18, 2012 If i understand u correctly, then this should work...but it doesnt. No, you didn't get me wrong. You just need to learn more about interior system in GTA. There are specific interiors with their own ID and coordinates. That function "setElementInterior" I gave to you is used to change your current noraml interior (which is 0). And you also have to know about dimensions. Link to comment
Imposter Posted July 18, 2012 Author Share Posted July 18, 2012 If i understand u correctly, then this should work...but it doesnt. No, you didn't get me wrong. You just need to learn more about interior system in GTA. There are specific interiors with their own ID and coordinates. That function "setElementInterior" I gave to you is used to change your current noraml interior (which is 0). And you also have to know about dimensions. so technically, my script is suppose to work?? Link to comment
AMARANT Posted July 18, 2012 Share Posted July 18, 2012 Technically, yes. But you have to specify correct coordinates, dimension and interior's ID. You can check out the interiors even from MTA Map Editor if you want. Link to comment
Imposter Posted July 18, 2012 Author Share Posted July 18, 2012 Technically, yes. But you have to specify correct coordinates, dimension and interior's ID. You can check out the interiors even from MTA Map Editor if you want. OK, i got the id and locations, how will i use it? "PAPER" posX="388.87132732" posY="173.80432323" posZ="1008.38323254" rot="320" world="3" /> Link to comment
AMARANT Posted July 18, 2012 Share Posted July 18, 2012 You have to use it like you did. Your mistake was that you were trying to change interior for 'source' in funciton arguments instead of 'thePlayer'. 'source' is your marker and not a player. I just didn't notice it back then, sorry. Link to comment
Imposter Posted July 19, 2012 Author Share Posted July 19, 2012 You have to use it like you did. Your mistake was that you were trying to change interior for 'source' in funciton arguments instead of 'thePlayer'. 'source' is your marker and not a player. I just didn't notice it back then, sorry. this is NOT WORKING PLEASE HELP ME server side : function loadResource ( ) theEntrance = createMarker ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, "arrow", 1.5, 0, 255, 0, 170 ) theExit = createMarker ( 389.8681640625, 173.9693145752, 1008.3828125+1, "arrow", 1.5, 0, 255, 0, 170 ) estateBlip = createBlip ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, 44, 0, 0, 0, 255 ) outputChatBox ( "The Estate has been Loaded!!" ) end addEventHandler ( "onResourceStart", resourceRoot, loadResource ) function markerHit ( thePlayer, matchingDimension ) if ( thePlayer == theEntrance ) then outputChatBox ( "You are entering the Estate!", getRootElement() ) setElementInterior ( thePlayer , 3 , 389.8681640625, 173.9693145752, 1008.3828125 ) setElementDimension ( thePlayer, 3 ) end end addEventHandler ( "onMarkerHit", getRootElement(), markerHit ) Link to comment
TwiX! Posted July 19, 2012 Share Posted July 19, 2012 function loadResource ( ) theEntrance = createMarker ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, "arrow", 1.5, 0, 255, 0, 170 ) theExit = createMarker ( 389.8681640625, 173.9693145752, 1008.3828125+1, "arrow", 1.5, 0, 255, 0, 170 ) estateBlip = createBlip ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, 44, 0, 0, 0, 255 ) outputChatBox ( "The Estate has been Loaded!!" ) end addEventHandler ( "onResourceStart", resourceRoot, loadResource ) function markerHit ( thePlayer, matchingDimension ) if ( source == theEntrance ) then outputChatBox ( "You are entering the Estate!" ) setElementInterior ( thePlayer , 3 , 389.8681640625, 173.9693145752, 1008.3828125 ) setElementDimension ( thePlayer, 3 ) end end addEventHandler ( "onMarkerHit", getRootElement(), markerHit ) thePlayer can not be a marker Link to comment
AMARANT Posted July 19, 2012 Share Posted July 19, 2012 TwiX! has a point. You just need to understand that 'source' is an element for a specific function. It can be a player in one case and a marker in other one (like yours). To get this you have to refer to function description at MTA wiki. In section "Returns" or "Source" of every described function you will find the 'source' of needed one. Link to comment
TwiX! Posted July 19, 2012 Share Posted July 19, 2012 AMARANT tell it to NooP i know that. source in "onMarketHit" it's the marker in NooP code. He compares the player with the marker, it is wrong Link to comment
Imposter Posted July 19, 2012 Author Share Posted July 19, 2012 AMARANT tell it to NooPi know that. source in "onMarketHit" it's the marker in NooP code. He compares the player with the marker, it is wrong so this is wrong?? function markerHit ( thePlayer, matchingDimension ) if ( thePlayer == theEstateEntrance ) then outputChatBox ( "You are entering the Estate!", getRootElement() ) setElementInterior ( thePlayer , 3 , 389.8681640625, 173.9693145752, 1008.3828125 ) setElementDimension ( thePlayer, 3 ) end end Link to comment
Castillo Posted July 19, 2012 Share Posted July 19, 2012 Yes, this line: if ( thePlayer == theEstateEntrance ) then Should be: if ( source == theEstateEntrance ) then And this line: outputChatBox ( "You are entering the Estate!", getRootElement() ) Should be: outputChatBox ( "You are entering the Estate!", thePlayer ) Link to comment
AMARANT Posted July 19, 2012 Share Posted July 19, 2012 I hope finally Solidsnake14 spelled everything out Link to comment
Imposter Posted July 19, 2012 Author Share Posted July 19, 2012 I hope finally Solidsnake14 spelled everything out Thanks guys, this stuff finally gets into my dumb head, and it is working Link to comment
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