CapY Posted August 13, 2011 Share Posted August 13, 2011 How to teleport with marker to marker ? Link to comment
JR10 Posted August 13, 2011 Share Posted August 13, 2011 Are you serious?? Have you met the WIKI yet? Don't just come asking for help, put some effort in trying to achieve what you want. Then come ask for help you with your trial. use: onMarkerHit event functions: createMarker setElementPosition fadeCamera -- for fading to black before teleporting. Link to comment
Http Posted August 13, 2011 Share Posted August 13, 2011 Thanks JR10, I'm not CapY but a moderator of da server. Link to comment
CapY Posted August 13, 2011 Author Share Posted August 13, 2011 Oh Http you finally have acc on the forums . JR10 why the hell i need fadeCamera ? Link to comment
JR10 Posted August 13, 2011 Share Posted August 13, 2011 That's why I made a comment beside so you CAN read it. For fading to black before warping, and fading in again. It's used a lot with warping so though of adding it. Link to comment
CapY Posted August 13, 2011 Author Share Posted August 13, 2011 and setElementPosition is function to teleport a player ? Link to comment
JR10 Posted August 13, 2011 Share Posted August 13, 2011 Yes, it changes his position to the specified coordinates. Link to comment
will briggs Posted August 13, 2011 Share Posted August 13, 2011 Cut a long story short, GO READ THE WIKI... https://wiki.multitheftauto.com Link to comment
CapY Posted August 13, 2011 Author Share Posted August 13, 2011 local sMarker = createMarker (1618.6726074219, 1448.3284912109, 30.770175933838, 'cylinder', 7.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler local elementType = getElementType( hitElement ) -- get the hit element's type outputChatBox( elementType.." inside sMarker", getRootElement(), 255, 255, 0 ) -- attach the element's type with the text, and output it setElementPosition ( getLocalPlayer(), 1618.6726074219, 1448.3284912109, 30.770175933838 ) end addEventHandler( "onMarkerHit", sMarker, MarkerHit ) meta : type="map" version="1.0.0" /> "beachparty.map" dimension="0" /> "1618.6726074219" posY="1448.3284912109" posZ="30.770175933838" type="cylinder" /> Nil at getLocalPlayer() Link to comment
JR10 Posted August 13, 2011 Share Posted August 13, 2011 type = script ? o_O You don't know what you are doing, that script contains both server and client. local sMarker = createMarker (1618.6726074219, 1448.3284912109, 30.770175933838, 'cylinder', 7.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler local elementType = getElementType( hitElement ) -- get the hit element's type outputChatBox( elementType.." inside sMarker", getRootElement(), 255, 255, 0 ) -- attach the element's type with the text, and output it setElementPosition ( hitElement, 1618.6726074219, 1448.3284912109, 30.770175933838 ) end addEventHandler( "onMarkerHit", sMarker, MarkerHit ) WTF a marker doing in the meta.xml <meta> <info type="map" version="1.0.0" /> <map src="beachparty.map" dimension="0" /> <script src="markerS.lua" type="server" /> </meta> Link to comment
will briggs Posted August 13, 2011 Share Posted August 13, 2011 Capy instead of just bullsh*ting yourself thru this, go read the wiki i gave a link, but you obvs havent botherd to read it... Link to comment
CapY Posted August 13, 2011 Author Share Posted August 13, 2011 I dont read your posts as ussually Link to comment
will briggs Posted August 13, 2011 Share Posted August 13, 2011 Well fuck you, im giving you advice of how to learn how to script... I hope your fail server fails dick head Link to comment
CapY Posted August 13, 2011 Author Share Posted August 13, 2011 I don't want to fight , lock this thread moderators. Link to comment
CapY Posted August 14, 2011 Author Share Posted August 14, 2011 JR10 can it be only a client side ? Link to comment
JR10 Posted August 14, 2011 Share Posted August 14, 2011 You can make it client side, but, needs edit, message will only appear for hitElement, onClientMarkerHit not onMarkerHit, local sMarker = createMarker (1618.6726074219, 1448.3284912109, 30.770175933838, 'cylinder', 7.0, 255, 0, 0, 150) -- create myMarker function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler local elementType = getElementType( hitElement ) -- get the hit element's type outputChatBox( elementType.." inside sMarker", 255, 255, 0 ) -- attach the element's type with the text, and output it setElementPosition ( hitElement, 1618.6726074219, 1448.3284912109, 30.770175933838 ) end addEventHandler( "onClientMarkerHit", sMarker, MarkerHit ) Link to comment
CapY Posted August 25, 2011 Author Share Posted August 25, 2011 Why nil on getLocalPlayer() ? Here : local sMarker = createMarker (-1921.900, 536.816, 267.400, 'cylinder', 3.0, 255, 0, 0, 0) -- create myMarker function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler local elementType = getElementType( hitElement ) -- get the hit element's type setElementPosition ( getLocalPlayer(), 1618.6726074219, 1448.3284912109, 30.770175933838 ) end addEventHandler( "onMarkerHit", sMarker, MarkerHit ) Link to comment
CapY Posted August 25, 2011 Author Share Posted August 25, 2011 Why doesnt work now ? Link to comment
JR10 Posted August 25, 2011 Share Posted August 25, 2011 Because, it's SERVER sided, and you are using getLocalPlayer() use onClientMarkerHit, or use it server side, and use hitElement. Link to comment
CapY Posted August 25, 2011 Author Share Posted August 25, 2011 Okay works now , how i can add a text on that marker i tried with dxDrawText but doesnt works.... Link to comment
JR10 Posted August 25, 2011 Share Posted August 25, 2011 local x,y= getScreenFromWorldPosition ( posX,posY,posZ ) dxDrawText ( "text", x, y , ...) And onClientRender. Link to comment
CapY Posted August 25, 2011 Author Share Posted August 25, 2011 Doesnt works .. local sX, sY = guiGetScreenSize() local x,y= getScreenFromWorldPosition ( posX,posY,posZ ) addEventHandler("onClientRender", root, function() local px, py, pz = getElementPosition(getLocalPlayer()) local x, y = getScreenFromWorldPosition(-1921.900, 536.816, 32.340) if x and y then dxDrawText("LV", -1921.900, 536.816, 32.340,380.0,tocolor(255,255,255,255),2.0,"default","left","top",false,false,false) end end end ) Link to comment
Wojak Posted August 25, 2011 Share Posted August 25, 2011 All you want and no scripting! https://community.multitheftauto.com/ind ... ls&id=1960 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